Capstone 6 · Frontend

Oware

Oware is one of the oldest games in the world, played across West Africa and the diaspora for centuries under names including Awale, Ayo and Warri. Two rows of six houses, forty-eight seeds, and rules simple enough to explain in a minute and deep enough to have been studied for decades. Build it. A board that reads clearly, sowing that animates so a move can be followed, and an opponent that searches ahead rather than picking at random. Get the rules exactly right, including the ones people forget: sowing skips the house you started from on a lap, capture happens on two or three seeds in the opponent's row and walks backwards, and a move that would starve the opponent is illegal unless nothing else is available. The interface matters as much as the engine. This should be playable entirely from the keyboard, announce the state of play to a screen reader, and be genuinely usable on a phone.

Concepts used

Game stateRules enginesMinimax and pruningCanvas or SVGAnimationKeyboard interactionAccessibilityTesting

Your dataset

No external data. The board is twelve houses and a store for each player.

Milestones

1Model the board and implement legal move generation, tested before any interface exists.
2Implement sowing, including skipping the origin house on a full lap.
3Implement capture, walking backwards while houses hold two or three seeds.
4Implement the starvation rule and end conditions, including a stalemate.
5Build the board interface, with sowing animated so a move can be followed.
6Add an opponent: start with a one-move-ahead evaluation, then minimax with alpha-beta pruning and a depth setting.
7Make it fully keyboard operable, and announce captures and turn changes to assistive technology.
8Add undo, a move history in standard notation, and a way to share a position.

The graded core

The rest of this project is yours to shape. This one function is the piece everything else depends on, so it runs against hidden tests to prove it is right before you build outward.

◈ Graded Challenge

The rule everybody implements wrongly. Write capture(board, last, opponent_houses) returning the number of seeds captured. Starting at the house `last` where the final seed landed, walk BACKWARDS while the house is one of the opponent's AND holds exactly 2 or 3 seeds, adding those seeds to the total. Stop at the first house that fails either condition. Do not modify the board; just return the count.

Name it exactly: capture(board, last, opponent_houses)

Python3 visible + 5 hidden
loading editor…

Your workspace

Build the full project here. Work through the milestones in order, in both languages.

SANKOFA SANDBOX
loading editor…
Your turn → Build it in Python first, then rebuild it in JavaScript. The logic transfers, only the syntax changes.
← All projectsNext: The Rhythm Machine →