// No simultaneous version (define "Columns" 8) (define "PiecesOwnedBy" (+ (count Cell at:(handSite #1)) (count in:(sites #1 "Home")))) (define "NoPiece" (all Sites (sites Player "Home") if:(= 0 (count at:(site))))) //------------------------------------------------------------------------------ (game "Ryakati" (players 2) (equipment { (mancalaBoard 4 "Columns" store:None { (track "Track1" "0,E,N1,W" loop:True P1) (track "Track2" "16,E,N1,W" loop:True P2) } ) (regions "Home" P1 (sites Track "Track1")) // P1 Home (regions "Home" P2 (sites Track "Track2")) // P2 home (regions "Inner" P1 (difference (sites Track "Track1") (sites Bottom))) // P1 inner Home (regions "Inner" P2 (difference (sites Track "Track2") (sites Top))) // P2 inner Home (map "RightMostOuter" {(pair P1 7) (pair P2 24)}) (map "SecondHoleRightOuter" {(pair P1 6) (pair P2 25)}) (piece "Seed" Shared) (hand Each) }) (rules (start (set Count 2 to:(sites Board)) ) phases:{ (phase "Opening1" (play (move Select (from (mapEntry "SecondHoleRightOuter" Mover) ) (then (sow "Track" owner:(mover) apply:(and (fromTo (from ("OppositePit" (to))) (to (mapEntry "RightMostOuter" Mover)) count:2 ) (fromTo (from ("OppositeOuterPit" (to))) (to (mapEntry "RightMostOuter" Mover)) count:2 ) ) ) ) ) ) (nextPhase Mover "Opening2") ) (phase "Opening2" (play (move Select (from (mapEntry "RightMostOuter" Mover) ) (then (sow count:4 "Track" owner:(mover) apply:(and (fromTo (from ("OppositePit" (to))) (to (mapEntry "RightMostOuter" Mover)) count:2 ) (fromTo (from ("OppositeOuterPit" (to))) (to (mapEntry "RightMostOuter" Mover)) count:2 ) ) origin:True ) ) ) ) (nextPhase Mover "Opening3") ) (phase "Opening3" (play (move Select (from (if ("SameTurn") (var "Replay") (mapEntry "RightMostOuter" Mover) ) ) (then (sow count:(if ("SameTurn") (count at:(last To)) 4) "Track" owner:(mover) apply:(if (< 1 (count at:(to))) (and (moveAgain) (set Var "Replay" (to)) ) ) origin:("NewTurn") ) ) ) ) (nextPhase Mover (not (is Next Mover)) "Sowing") ) (phase "Sowing" (play (move Select (from (if ("SameTurn") (sites {(var "Replay") }) (sites Mover "Home") ) if:(> (count at:(from)) 1) ) (then (sow "Track" owner:(mover) apply:(if (< 1 (count at:(to))) (if (and { (is In (to) (sites Mover "Inner")) (is Occupied ("OppositePit" (to))) (is Occupied ("OppositeOuterPit" (to))) }) (and { (fromTo (from ("OppositePit" (to))) (to (last From)) count:(count at:("OppositePit" (to))) ) (fromTo (from ("OppositeOuterPit" (to))) (to (last From)) count:(count at:("OppositeOuterPit" (to))) ) (sow (last From) count:(+ (count at:("OppositeOuterPit" (to))) (count at:("OppositePit" (to)))) "Track" owner:(mover) ) }) (and (moveAgain) (set Var "Replay" (to)) ) ) ) ) ) ) ) ) } (end (forEach NonMover if:("NoPiece") (result Player Loss) ) ) ) ) //------------------------------------------------------------------------------ (metadata (info { (description "Ryakati is a four-row mancala-style board game played by the Bari people of South Sudan. The holes are scooped out of the ground and counters are seeds or pebbles, and represent cows.") (aliases {"Soro"}) (rules "4x8 board. Two counters in each hole. Sowing proceeds in an anti-clockwise direction. The first move must begin from the second hole from the right in the player's outer row, and proceed as follows, and is played simultaneously by both players: sow the two counters from that first hole, capture the counters in the opponent's two opposite holes and sow them, starting in the rightmost hole in the outer row, capture from the opposite two holes on the opponent's side and sow them again from the same hole. When the final counter falls in an occupied hole, those counters are picked up and sowing continues. The opening move ends when the final counter falls in an empty hole. The main phase then begins. When the final counter falls into an occupied hole in the player's inner row and both of the opposite holes on the opponent's side of the board are occupied, the counters in the opposite holes are captured and sown beginning in the first hole that was sown into to begin the sowing that caused the capture. When the final counter falls into an occupied hole and a capture is not possible, the contents of the hole are picked up and sowing continues. When the final counter lands in an empty hole, the turn ends. Players cannot sow from a hole containing a single counter. The player who captures all of their opponent's counters wins.") (source "Beaton 1939: 133-141") (id "1282") (version "1.3.12") (classification "board/sow/four rows") (credit "Eric Piette") (origin "This game was played in South Sudan, around 1939.") } ) (graphics { (board Style Mancala) }) (ai "Ryakati_ai" ) )