// No Simultaneous move. (define "NextHole" ("NextSiteOnTrack" #2 from:#1 "Track")) (define "OwnedHoles" (if (is Mover P1) (sites (values Remembered "OwnedP1")) (sites (values Remembered "OwnedP2")) ) ) (define "RightMostEmpty" (trackSite FirstSite "TrackCW" from:(mapEntry "RightMost" Mover) if:(is Empty (to)) ) ) (define "RemmemberOwnedHoles" (if (is Mover P1) (remember Value "OwnedP1" #1) (remember Value "OwnedP2" #1) ) ) (define "APlayerCanNotMove" (and (not (is Next Mover)) (or (all Sites (sites (values Remembered "OwnedP1")) if:(is Empty (site))) (all Sites (sites (values Remembered "OwnedP2")) if:(is Empty (site))) ) ) ) //------------------------------------------------------------------------------ (game "Mewelad" (players 2) (equipment { (mancalaBoard 2 6 store:None { (track "TrackCCW" "0,E,N,W" loop:True) (track "TrackCW" "5,W,N,E" loop:True) } ) (piece "Seed" Shared) (hand Each) (regions P1 (sites Bottom)) // P1 home (regions P2 (sites Top)) // P2 home (map "RightMost" {(pair P1 5) (pair P2 6)}) }) (rules (start { (set Count 4 to:(sites Track)) (set RememberValue "OwnedP1" (sites Bottom)) (set RememberValue "OwnedP2" (sites Top)) }) phases:{ (phase "Sowing" (play (or { (move Select (from (if ("SameTurn") (sites {(var "Replay")}) ("OwnedHoles") ) if:(is Occupied (from)) ) (then (do (set Var "NumSowed" (count at:(last To))) next:(sow "TrackCCW" apply:(if (= 4 (count at:(to))) (fromTo (from (to)) (to (handSite Mover)) count:4 ) (if (< 1 (count at:(to))) (and (moveAgain) (set Var "Replay" (to)) ) ) ) ) (then (and (forEach Site (sites Track from:(last From) to:(trackSite Move from:(last From) "Track" steps:(- (var "NumSowed") 1))) (if (= 4 (count at:(site))) (fromTo (from (site)) (to (if (is In (to) (sites (values Remembered "OwnedP1"))) (handSite P1) (handSite P2))) count:4 ) ) ) (set Var "NumSowed" 0) ) ) ) ) ) } (then (if ("APlayerCanNotMove") (and { (if (no Moves P1) (forEach Site (sites Board) (if (is Occupied (site)) (fromTo (from (site)) (to (handSite P1)) count:(count at:(site)) ) ) ) (forEach Site (sites Board) (if (is Occupied (site)) (fromTo (from (site)) (to (handSite P2)) count:(count at:(site)) ) ) ) ) (forget Value "OwnedP1" All) (forget Value "OwnedP2" All) }) ) ) ) ) (end (if ("NoPieceOnBoard") { (if (> 3 (count Cell at:(handSite P1))) (result P2 Win)) (if (> 3 (count Cell at:(handSite P2))) (result P1 Win)) } ) ) (nextPhase ("NoPieceOnBoard") "BetweenRounds") ) (phase "BetweenRounds" (play (if (<= 3 (count Cell at:(handSite Mover))) (move (from (handSite Mover)) (to ("RightMostEmpty")) count:(if (>= (count Cell at:(handSite Mover)) 4) 4 3) (then ("RemmemberOwnedHoles" (last To)) ) ) ) ) (nextPhase (all Passed) "Sowing") ) } ) ) //------------------------------------------------------------------------------ (metadata (info { (description "Mewelad is a two-row mancala-style board game played in Eritrea. It involves a unique rule of capturing, where if a player does not capture when they are supposed to, there is a penalty assigned to that hole with alternative capturing rules.") (aliases {"Gabata"}) (rules "2x6 board. Four counters per hole. Play begins with a simultaneous racing move, where players attempt to be the first to drop the final counter of their sowing into an empty hole. Sowing occurs in an anti-clockwise direction. If the final counter falls into an occupied hole, these are picked up and sowing continues. If the final counter falls into an empty hole, the turn ends. At any time during the sowing, if a hole is made to contain four counters, the owner of the hole in which the four counters are located captures them, unless it is the final hole of the sowing, in which case the player who is sowing captures them. Play continues until a player can no longer move because there are no counters in their row, and the opponent captures the remaining counters. Players then count their pieces by placing four in each hole, and the player who has more than their original number takes ownership of one of the opponent's holes for every four counters more than the original number that have been taken. If no player took four more than the original, the player with three extra gets the hole. Play then begins again as before. The game ends when one player owns all of the counters, and thus all of the holes.") (source "Pankhurst 1971: 168.") (id "343") (version "1.3.12") (classification "board/sow/two rows") (credit "Eric Piette") (origin "This game was played in Horn of Africa., around 1971.") } ) (graphics { (board Style Mancala) }) (ai "Mewelad_ai" ) )