Logo Lanfrica

obimz/Ayo-game

Record type:

software
Creator:
obi
Host:
A Java implementation of Ayò Ọlọ́pọ́n, the traditional Yoruba mancala strategy game. # Ayo Game A Java implementation of Ayo (Yoruba mancala) for a concurrent programming course assignment. The project implements two concurrency modes — local (human vs. AI with background thread computation) and networked (two clients connected to a server holding authoritative game state via synchronized access and wait/notify) — both built on one shared, single-source-of-truth game engine. ## Build & Run Requires Java 17+. The Maven wrapper (`mvnw` / `mvnw.cmd`) auto-downloads Maven if not installed. ```bash ./mvnw compile # build ./mvnw test # run all tests ./mvnw -Dtest=AyoEngineTest test # run single test class ./mvnw -Dtest="AyoEngineTest#testName" test # run single test method ``` Run targets (once implemented): ```bash ./mvnw exec:java -Dexec.mainClass=ayo.local.LocalGameRunner # local mode (human vs AI) ./mvnw exec:java -Dexec.mainClass=ayo.net.AyoServer # networked server ./mvnw exec:java -Dexec.mainClass=ayo.net.AyoClient # networked client ``` ## Project Structure ``` src/main/java/ayo/ ├── engine/ Game engine (rules, board state, move logic) ├── local/ Local mode — human vs. AI on a background thread └── net/ Networked mode — server + client over sockets src/test/java/ayo/ └── engine/ Unit tests for the game engine ``` ## Game Rules Ayo is played on a board of 12 pits (6 per player) with 48 seeds total. - **Sowing (Rule A):** Pick up all seeds from one of your pits, drop one per pit counter-clockwise. If the pit had 12+ seeds, skip the origin pit each time you pass it (Kó-kó rule). - **Capture (Rule B):** If the last seed lands on the opponent's side in a pit with exactly 2 or 3 seeds, capture that pit. Chain backward while adjacent pits on the opponent's side also hold 2 or 3. - **Mandatory Feeding (Rule C):** If the opponent has zero seeds, you must choose a move that feeds them. If no such move exists, the game ends and the current …

Languages