(define "ThrowValue" (mapEntry "Throw" (count Pips))) (define "ThrowThreeDice" (+ (+ ("Die1") ("Die2")) ("Die3"))) (define "ThrowTwoDice" (+ ("Die1") ("Die2"))) (define "Remember" (if (is Mover P1) (remember Value "ScoreP1" #1) (if (is Mover P2) (remember Value "ScoreP2" #1) (if (is Mover P3) (remember Value "ScoreP3" #1) (remember Value "ScoreP4" #1) ) ) ) ) (define "Forget" (if (is Mover P1) (forget Value "ScoreP1" #1) (if (is Mover P2) (forget Value "ScoreP2" #1) (if (is Mover P3) (forget Value "ScoreP3" #1) (forget Value "ScoreP4" #1) ) ) ) ) (define "ForgetAll" (if (is Mover P1) (forget Value "ScoreP1" All) (if (is Mover P2) (forget Value "ScoreP2" All) (if (is Mover P3) (forget Value "ScoreP3" All) (forget Value "ScoreP4" All) ) ) ) ) (define "RememberedValues" (if (is Mover P1) (values Remembered "ScoreP1") (if (is Mover P2) (values Remembered "ScoreP2") (if (is Mover P3) (values Remembered "ScoreP3") (values Remembered "ScoreP4") ) ) ) ) (define "MoveWithScore" (forEach Value ("RememberedValues") (move (from (from) if:(or (= (value) 1) ("ActivatedPiece" (from)) ) ) (to ("NextSiteOnTrack" (value) from:(from)) if:(and (not ("IsFriendAt" (to))) (or (= 1 (value)) (= 0 (count Sites in:(intersection (sites Occupied by:Enemy) (sites Track Mover from:("NextSiteOnTrack" 1 from:(from)) to:("NextSiteOnTrack" (- (value) 1) from:(from)))) ) ) ) ) (apply (and ("Forget" (value)) (if ("IsEnemyAt" (to)) (remove (to)) ) ) ) ) (then (if (not ("ActivatedPiece" (last To))) ("ActivePiece" (last To)) ) ) ) ) ) (define "Move" (move (from (from) if:(or (= ("ThrowValue") 1) ("ActivatedPiece" (from)) ) ) (to ("NextSiteOnTrack" ("ThrowValue") from:(from)) if:(and (not ("IsFriendAt" (to))) (or (= 1 ("ThrowValue")) (= 0 (count Sites in:(intersection (sites Occupied by:Enemy) (sites Track Mover from:("NextSiteOnTrack" 1 from:(from)) to:("NextSiteOnTrack" (- ("ThrowValue") 1) from:(from)))) ) ) ) ) (apply (if ("IsEnemyAt" (to)) (remove (to)) ) ) ) (then (if (not ("ActivatedPiece" (last To))) ("ActivePiece" (last To)) ) ) ) ) (define "PlayRulesPlayingScore" (if (or (is Mover P1) (is Mover P3)) (forEach Piece ("MoveWithScore") P1) (forEach Piece ("MoveWithScore") P2) ) ) (define "ActivatedPiece" (= 1 (state at:#1)) ) (define "ActivePiece" (set State at:#1 1) ) //------------------------------------------------------------------------------ (game "Deleb" (players 4) (equipment { (board (rectangle 4 ) use:Vertex ) ("StickDice" 4) (piece "Marker" P1 ("Move")) (piece "Marker" P2 ("Move")) (map "Throw" {(pair 0 6) (pair 1 1) (pair 2 2) (pair 3 3) (pair 4 4)}) }) (rules (start { (set Team 1 {P1 P3}) (set Team 2 {P2 P4}) (place "Marker1" (sites Bottom)) (place "Marker2" (sites Top)) }) phases:{ (phase "StageOne" (play ("RollMove" (move Pass) (then (if (or (= ("ThrowValue") 6) (= ("ThrowValue") 4) ) (moveAgain) (if (= ("ThrowValue") 1) ("Remember" 1) ) ) ) ) ) (nextPhase Mover (= ("ThrowValue") 1) "StageTwo") ) (phase "StageTwo" (play ("RollMove" (move Pass) (then (if (or (= 0 ("ThrowThreeDice")) (= 1 ("ThrowThreeDice")) ) (and (moveAgain) ("Remember" 1) ) (if (= 3 ("ThrowThreeDice")) (and (moveAgain) ("Remember" 4) ) ) ) ) ) ) (nextPhase Mover (= ("ThrowThreeDice") 2) "StageThree") ) (phase "StageThree" (play ("RollMove" (move Pass) (then (if (= 0 ("ThrowTwoDice")) ("ForgetAll") (if (= 1 ("ThrowTwoDice")) (moveAgain) (and (moveAgain) ("Remember" 4) ) ) ) ) ) ) { (nextPhase Mover (= 0 ("ThrowTwoDice")) "StageOne") (nextPhase Mover (= 2 ("ThrowTwoDice")) "StageTwo") (nextPhase Mover (= 1 ("ThrowTwoDice")) "PlayingScore") } ) (phase "PlayingScore" (play (if (can Move ("PlayRulesPlayingScore")) ("PlayRulesPlayingScore") (move Pass (then ("ForgetAll"))) (then (if (!= 0 (size Array ("RememberedValues"))) (moveAgain) ) ) ) ) (nextPhase Mover (= 0 (size Array ("RememberedValues"))) "Playing") ) (phase "Playing" (play ("RollMove" (or (if (or (is Mover P1) (is Mover P3)) (forEach Piece P1) (forEach Piece P2) ) (move Pass) ) (then (if (and (!= 2 ("ThrowValue")) (!= 3 ("ThrowValue"))) (moveAgain) ) ) ) ) ) } (end ("CaptureAllTeam")) ) ) //------------------------------------------------------------------------------ (option "Board Size" args:{ } { (item "10" <10> < (define "Die1" (face 40)) (define "Die2" (face 41)) (define "Die3" (face 42)) (define "Die4" (face 43)) > < { (track "Track1" "0,E,N1,W,N1,E,N1,W,S1,E,S1,W" loop:True P1) (track "Track2" "39,W,S1,E,S1,W,S1,E,N1,W,N1,E" loop:True P2) (track "Track3" "0,E,N1,W,N1,E,N1,W,S1,E,S1,W" loop:True P3) (track "Track4" "39,W,S1,E,S1,W,S1,E,N1,W,N1,E" loop:True P3) } > "The board has 10 columns.") (item "20" <20> < (define "Die1" (face 80)) (define "Die2" (face 81)) (define "Die3" (face 82)) (define "Die4" (face 83)) > < { (track "Track1" "0,E,N1,W,N1,E,N1,W,S1,E,S1,W" loop:True P1) (track "Track2" "79,W,S1,E,S1,W,S1,E,N1,W,N1,E" loop:True P2) (track "Track3" "0,E,N1,W,N1,E,N1,W,S1,E,S1,W" loop:True P3) (track "Track4" "79,W,S1,E,S1,W,S1,E,N1,W,N1,E" loop:True P3) } > "The board has 20 columns.")* (item "30" <30> < (define "Die1" (face 120)) (define "Die2" (face 121)) (define "Die3" (face 122)) (define "Die4" (face 123)) > < { (track "Track1" "0,E,N1,W,N1,E,N1,W,S1,E,S1,W" loop:True P1) (track "Track2" "119,W,S1,E,S1,W,S1,E,N1,W,N1,E" loop:True P2) (track "Track3" "0,E,N1,W,N1,E,N1,W,S1,E,S1,W" loop:True P3) (track "Track4" "119,W,S1,E,S1,W,S1,E,N1,W,N1,E" loop:True P3) } > "The board has 30 columns.") (item "40" <40> < (define "Die1" (face 160)) (define "Die2" (face 161)) (define "Die3" (face 162)) (define "Die4" (face 163)) > < { (track "Track1" "0,E,N1,W,N1,E,N1,W,S1,E,S1,W" loop:True P1) (track "Track2" "159,W,S1,E,S1,W,S1,E,N1,W,N1,E" loop:True P2) (track "Track3" "0,E,N1,W,N1,E,N1,W,S1,E,S1,W" loop:True P3) (track "Track4" "159,W,S1,E,S1,W,S1,E,N1,W,N1,E" loop:True P3) } > "The board has 40 columns.") (item "50" <50> < (define "Die1" (face 200)) (define "Die2" (face 201)) (define "Die3" (face 202)) (define "Die4" (face 203)) > < { (track "Track1" "0,E,N1,W,N1,E,N1,W,S1,E,S1,W" loop:True P1) (track "Track2" "199,W,S1,E,S1,W,S1,E,N1,W,N1,E" loop:True P2) (track "Track3" "0,E,N1,W,N1,E,N1,W,S1,E,S1,W" loop:True P3) (track "Track4" "199,W,S1,E,S1,W,S1,E,N1,W,N1,E" loop:True P3) } > "The board has 50 columns.") (item "60" <60> < (define "Die1" (face 240)) (define "Die2" (face 241)) (define "Die3" (face 242)) (define "Die4" (face 243)) > < { (track "Track1" "0,E,N1,W,N1,E,N1,W,S1,E,S1,W" loop:True P1) (track "Track2" "239,W,S1,E,S1,W,S1,E,N1,W,N1,E" loop:True P2) (track "Track3" "0,E,N1,W,N1,E,N1,W,S1,E,S1,W" loop:True P3) (track "Track4" "239,W,S1,E,S1,W,S1,E,N1,W,N1,E" loop:True P3) } > "The board has 60 columns.") (item "70" <70> < (define "Die1" (face 280)) (define "Die2" (face 281)) (define "Die3" (face 282)) (define "Die4" (face 283)) > < { (track "Track1" "0,E,N1,W,N1,E,N1,W,S1,E,S1,W" loop:True P1) (track "Track2" "279,W,S1,E,S1,W,S1,E,N1,W,N1,E" loop:True P2) (track "Track3" "0,E,N1,W,N1,E,N1,W,S1,E,S1,W" loop:True P3) (track "Track4" "279,W,S1,E,S1,W,S1,E,N1,W,N1,E" loop:True P3) } > "The board has 70 columns.") (item "80" <80> < (define "Die1" (face 320)) (define "Die2" (face 321)) (define "Die3" (face 322)) (define "Die4" (face 323)) > < { (track "Track1" "0,E,N1,W,N1,E,N1,W,S1,E,S1,W" loop:True P1) (track "Track2" "319,W,S1,E,S1,W,S1,E,N1,W,N1,E" loop:True P2) (track "Track3" "0,E,N1,W,N1,E,N1,W,S1,E,S1,W" loop:True P3) (track "Track4" "319,W,S1,E,S1,W,S1,E,N1,W,N1,E" loop:True P3) } > "The board has 80 columns.") (item "90" <90> < (define "Die1" (face 360)) (define "Die2" (face 361)) (define "Die3" (face 362)) (define "Die4" (face 363)) > < { (track "Track1" "0,E,N1,W,N1,E,N1,W,S1,E,S1,W" loop:True P1) (track "Track2" "359,W,S1,E,S1,W,S1,E,N1,W,N1,E" loop:True P2) (track "Track3" "0,E,N1,W,N1,E,N1,W,S1,E,S1,W" loop:True P3) (track "Track4" "359,W,S1,E,S1,W,S1,E,N1,W,N1,E" loop:True P3) } > "The board has 90 columns.") (item "100" <100> < (define "Die1" (face 400)) (define "Die2" (face 401)) (define "Die3" (face 402)) (define "Die4" (face 403)) > < { (track "Track1" "0,E,N1,W,N1,E,N1,W,S1,E,S1,W" loop:True P1) (track "Track2" "399,W,S1,E,S1,W,S1,E,N1,W,N1,E" loop:True P2) (track "Track3" "0,E,N1,W,N1,E,N1,W,S1,E,S1,W" loop:True P3) (track "Track4" "399,W,S1,E,S1,W,S1,E,N1,W,N1,E" loop:True P3) } > "The board has 100 columns.") } ) //------------------------------------------------------------------------------ (rulesets { (ruleset "Ruleset/Deleb (Observed)" { "Board Size/20" } variations:{"Board Size/10" "Board Size/30" "Board Size/40" "Board Size/50" "Board Size/60" "Board Size/70" "Board Size/80" "Board Size/90" "Board Size/100" } )* }) //------------------------------------------------------------------------------ (metadata (info { (description "Dèleb is a game with captures played in Somalia. It is played with teams, and often is played on a large board. One defining feature of it is the requirement of making a series of throws in order to start playing. It is similar to games such as Tab known in North Africa and Southwest Asia. ") (aliases {"Dèleb"}) (rules "Board of intersecting lines: four horizontal and up to 100 vertical. Twenty is typical. Played on two teams with even-numbered players. One piece per vertical line, lined up on the outer rows. Four sticks, white on one side and black on the other, used as dice. The value of the throw is the number of white sides that land face up, when only black are face up, the value is 6. Each player must progress through the following three stages of throws to begin playing. In the first stage, they throw four sticks. A throw of 2 or 3 ends the turn, a throw of 4 or 6 gives another throw. A throw of 1 allows the player to progress to the next stage and to add 1 to their score. In the second stage, the player throws three sticks. If the player throws two or three black, they add 1 to their score and keep throwing, three white up allows the player to add 4 to their score and keep playing; one black face up allows the player to pass to the third stage. In the third stage, the player throws two sticks. If two black are thrown, all of the previously tabulated score is lost, the turn ends and the player must start again from the first stage in their next turn. If the player throws two white, the player scores 4 and reverts back to the second phase. When the player scores one white and one black, the player enters the game and plays the pieces according to their accumulated score. Each piece must be unlocked with a throw of 1 before being moved normally. From this point, players throw all four sticks. Throws of 2 or 3 end the turn, players continue to throw until they receive one of these values. Each throw must be assigned to move a piece and a single throw cannot be subdivided, though separate throws can be assigned to different pieces. Players may choose not to play a throw if they wish. Throws of 1 must be used to unlock a piece if there are any which are locked. Pieces move from left to right in their home row, right to left in the second row, left to right in the third row, right to left in their opponent's home row, returning to the third row and progressing from left to right, then to the second row progressing from right to left, and then back into the home row, proceeding from left to right, and so in a loop. Pieces may not pass the pieces of the opposing team. When a piece lands on the same space occupied by an opponent's piece, the opponent's piece is removed from the board. The team that captures all the pieces of the opposing team wins.") (source "Marin 1931: 508-510.") (id "767") (version "1.3.12") (classification "board/war/replacement/eliminate/all") (credit "Eric Piette") (origin "This game was played in Somalia, around 1931.") } ) (graphics { (show Edges Diagonal Hidden) (piece Colour "Die" state:0 fillColour:(colour Black)) }) (ai "Deleb_ai" ) )