(define "NextHoleFrom" ("NextSiteOnTrack" #3 from:#1 #2)) (define "PiecesOwnedBy" (count at:(mapEntry #1))) //------------------------------------------------------------------------------ (game "Kay" (players 2) (equipment { (mancalaBoard 2 6 (track "Track" "1,E,N,W" loop:True) ) (piece "Seed" Shared) (regions "Home" P1 (sites Bottom)) (regions "Home" P2 (sites Top)) (map {(pair P1 FirstSite) (pair P2 LastSite)}) // kalahs (storage pits) }) (rules (start (set Count 4 to:(sites Track))) (play (move Select (from (if ("SameTurn") "LastHoleSowed" (sites Mover) ) if:(or (< 1 (count at:(from))) (and (= 1 (count at:(from))) (is Empty ("NextHoleFrom" (from) "Track" 1)) ) ) ) (then (sow if:True apply:(if (= 4 (count at:(to))) (fromTo (from (to)) (to (mapEntry Mover)) count:(count at:(to)) ) (if (< 1 (count at:(to))) (if (is Occupied ("NextHoleFrom" (to) "Track" 1)) (moveAgain) ) ) ) includeSelf:False backtracking:(= 4 (count at:(to))) ) ) ) ) (end ("MancalaByScoreWhen" (no Moves Next))) ) ) //------------------------------------------------------------------------------ (metadata (info { (description "Kay is a two-row mancala-style board game played in Haiti. It is very similar to games from the Caribbean and West Africa.") (aliases {"Warri"}) (rules "2x6 board, one store on either end. Four counters in each hole. Sowing occurs in an anti-clockwise direction and begins in the player's row. When the final counter lands in an occupied hole which is not followed by an empty hole, the contents are picked up and sowing continues. If the final counter falls in an occupied hole followed by an empty hole, or if it falls into an empty hole, the turn ends. Sowing always skips the hole from which the sowing began if it goes all the way around the board. When the final counter falls into an occupied hole in the opponent's row containing three counters, these are captured and the turn ends. Any holes in the opponent's row containing four counters in an unbroken consecutive sequence behind this hole are also captured. Single counters can only be sowed when the next hole is empty. Play continues until one player can no longer play. The player who has captured the most counters wins.") (source "Comhaire-Sylvain 1952:361-362.") (id "288") (version "1.3.12") (classification "board/sow/two rows") (credit "Eric Piette") (origin "This game was played in Haiti, around 1952.") } ) (graphics { (board Style Mancala) }) (ai "Kay_ai" ) )