// Done without simultaneous moves (define "Columns" ) (define "CorrespondingOuterPit" (if (is Mover P1) (- #1 "Columns") (+ #1 "Columns"))) (define "NextHole" ("NextSiteOnTrack" #3 from:#1 #2)) //------------------------------------------------------------------------------ (game "Pereauni" (players 2) (equipment { (mancalaBoard 4 "Columns" store:None { (track "TrackCCW1" "0,E,N1,W" loop:True P1) (track "TrackCCW2" loop:True P2) } ) (regions "Home" P1 (sites Track "TrackCCW1")) // P1 Home (regions "Home" P2 (sites Track "TrackCCW2")) // P2 home (regions "Inner" P1 (difference (sites Track "TrackCCW1") (sites Bottom))) // P1 inner Home (regions "Inner" P2 (difference (sites Track "TrackCCW2") (sites Top))) // P2 inner Home (regions "Outer" P1 (sites Bottom)) // P1 outer Home (regions "Outer" P2 (sites Top)) // P2 outer Home (piece "Seed" Shared) }) (rules (start (set Count 2 to:(union (sites P1 "Home") (sites P2 "Home"))) ) phases:{ (phase "OuterPhase" (play (move Select (from (if ("SameTurn") (sites {(var "Replay")}) (sites Mover "Outer") ) if:(if ("SameTurn") (< 0 (count at:(from))) (< 1 (count at:(from))) ) ) (then (sow count:(if ("SameTurn") (var "Count") (count at:(last From))) "TrackCCW" owner:(mover) apply:(and (if (< 1 (count at:(to))) (and (moveAgain) (if (and (is Occupied ("OppositePit" (to))) (is In (to) (sites Mover "Inner")) ) (and { (fromTo (from ("OppositePit" (to))) (to ("CorrespondingOuterPit" (to))) count:(count at:("OppositePit" (to))) ) (if (is Occupied ("OppositeOuterPit" (to))) (fromTo (from ("OppositeOuterPit" (to))) (to ("CorrespondingOuterPit" (to))) count:(count at:("OppositeOuterPit" (to))) ) ) (set Var "Replay" ("CorrespondingOuterPit" (to))) (if (= 1 (count at:("CorrespondingOuterPit" (to)))) (set Var "Count" (+ { 1 (count at:("OppositePit" (to))) (count at:("OppositeOuterPit" (to))) })) (set Var "Count" (+ (count at:("OppositePit" (to))) (count at:("OppositeOuterPit" (to))))) ) }) (and (set Var "Replay" (to)) (set Var "Count" (count at:(to))) ) ) ) ) (if (!= 1 (value Player Mover)) (set Value Mover 1)) ) ) ) ) ) (nextPhase Mover (= 1 (count at:(last To afterConsequence:True))) "MainPhase") ) (phase "MainPhase" (play (move Select (from (if ("SameTurn") (sites {(var "Replay")}) (sites Mover) ) if:(if ("SameTurn") (< 0 (count at:(from))) (< 1 (count at:(from))) ) ) (then (sow count:(if ("SameTurn") (var "Count") (count at:(last From))) "TrackCCW" owner:(mover) apply: (if (< 1 (count at:(to))) (and (moveAgain) (if (and { (is Occupied ("OppositePit" (to))) (is In (to) (sites Mover "Inner")) }) (and { (fromTo (from ("OppositePit" (to))) (to ("CorrespondingOuterPit" (to))) count:(count at:("OppositePit" (to))) ) (if (is Occupied ("OppositeOuterPit" (to))) (fromTo (from ("OppositeOuterPit" (to))) (to ("CorrespondingOuterPit" (to))) count:(count at:("OppositeOuterPit" (to))) ) ) (set Var "Replay" ("CorrespondingOuterPit" (to))) (if (= 1 (count at:("CorrespondingOuterPit" (to)))) (set Var "Count" (+ { 1 (count at:("OppositePit" (to))) (count at:("OppositeOuterPit" (to))) })) (set Var "Count" (+ (count at:("OppositePit" (to))) (count at:("OppositeOuterPit" (to))))) ) }) (and (set Var "Replay" (to)) (set Var "Count" (count at:(to))) ) ) ) ) ) ) ) ) ) } (end ("BlockWin")) ) ) //------------------------------------------------------------------------------ (option "Board Size" args:{ } { (item "8" <8> <"16,E,N1,W"> "Each row has 8 holes.")* (item "9" <9> <"18,E,N1,W"> "Each row has 9 holes.") (item "10" <10> <"20,E,N1,W"> "Each row has 10 holes.") (item "11" <11> <"22,E,N1,W"> "Each row has 11 holes.") (item "12" <12> <"24,E,N1,W"> "Each row has 12 holes.") (item "13" <13> <"26,E,N1,W"> "Each row has 13 holes.") (item "14" <14> <"28,E,N1,W"> "Each row has 14 holes.") (item "15" <15> <"30,E,N1,W"> "Each row has 15 holes.") (item "16" <16> <"32,E,N1,W"> "Each row has 16 holes.") }) //------------------------------------------------------------------------------ (rulesets { (ruleset "Ruleset/Didinga (Observed)" { "Board Size/8" })* (ruleset "Ruleset/Longarim-Topotha (Observed)" { "Board Size/9" } variations:{"Board Size/10" "Board Size/11" "Board Size/12" "Board Size/13" "Board Size/14" "Board Size/15" "Board Size/16"}) }) //------------------------------------------------------------------------------ (metadata (info { (description "Pereaüni is a four-row mancala-style board game played by several different groups in Uganda. In some places, it can be played on a larger board, but typically when people are bored with the typical course of play.") (aliases {"Pereaüni"}) (useFor "Ruleset/Didinga (Observed)" (rules "4x8 board. Two counters in each hole. Opening play: Two players play simultaneously, lifting and sowing counters from their outer rows. Rules for sowing and capturing are the same as in the main phase of the game except that all holes in each player's outer rows are considered to be in opposition and back captures can be made from them. Once a counter has been sown into the inner row, this ceases and captures can only be made from the inner row. The opening ends when both players reach an empty hole, and the first player to do so begins play in the main phase. Main phase: Play begins from any hole on the player's side of the board with counters in it. Singletons cannot move. Sowing happens in an anti-clockwise direction. If the last counter lands in an empty hole, the turn is over. For capturing: four holes are in opposition when one player has the front row hole occupied and the opponent has both of the holes opposite it occupied. If the last hole in a sowing is in opposition, the player takes the counters in both of the opponent's holes and places them in the empty hole from which the player lifted the counters. The player then sows the captured counters from this hole. Further captures in the sowing can occur in the same way. If the last counter lands on a hole that is occupied but not in opposition, these counters are picked up and sowing continues. Play ends when one player captures all the opponent's counters or one player cannot play. The player who cannot play loses.")) (useFor "Ruleset/Didinga (Observed)" (source "Driberg 1927a: 505-508.")) (useFor "Ruleset/Didinga (Observed)" (id "259")) (useFor "Ruleset/Longarim-Topotha (Observed)" (rules "4x9-16 board.")) (useFor "Ruleset/Longarim-Topotha (Observed)" (source "Driberg 1927b: 189.")) (useFor "Ruleset/Longarim-Topotha (Observed)" (id "638")) (source "Murray 1951: 215-216.") (id "259") (version "1.3.12") (classification "board/sow/four rows") (credit "Eric Piette") } ) (graphics { (board Style Mancala) }) (ai "Pereauni_ai" ) )