diff --git "a/train.csv" "b/train.csv" --- "a/train.csv" +++ "b/train.csv" @@ -639,11 +639,6 @@ The game is played either by two teams of two players, or by two players playing ###Ludii (game ""Pachisi"" (players 4) (equipment {(board (add (hole (merge (shift 0 (/ (- 19 3) 2) (rectangle 3 19)) (shift (/ (- 19 3) 2) 0 (rectangle 19 3))) (poly {{8 8} {8 11} {11 11} {11 8}})) cells:{{8 28 48 68 69 70 71 51 31 11 10 9}}) {(track ""Track1"" ""97,68,N,11,E,N,W,53,N,W,S,42,W,S,E,8,S,55,N8"" P1 directed:True) (track ""Track2"" ""98,46,W,53,N,W,S,42,W,S,E,8,S,E,N,11,E,34,W8"" P2 directed:True) (track ""Track3"" ""99,81,S,42,W,S,E,8,S,E,N,11,E,N,W,53,N,94,S8"" P3 directed:True) (track ""Track4"" ""100,4,E,8,S,E,N,11,E,N,W,53,N,W,S,42,W,19,E8"" P4 directed:True)}) (hand Each) (dice d:2 from:0 num:6) (map ""Die"" {(pair 0 25) (pair 1 10) (pair 2 2) (pair 3 3) (pair 4 4) (pair 5 5) (pair 6 6)}) (map ""Entry"" {(pair 1 68) (pair 2 46) (pair 3 81) (pair 4 4)}) (map ""PreviousGoal"" {(pair 1 9) (pair 2 27) (pair 3 52) (pair 4 26)}) (regions ""Castle"" {61 63 65 32 47 15 80 84 86 21 38 3}) (regions ""Grace"" {0 1 6}) (piece ""Pawn"" Each (if (or (= (trackSite Move steps:(count Pips)) 96) (and (is In (count Pips) (sites ""Grace"")) (= (from) (mapEntry ""PreviousGoal"" (mover))))) (move Select (from) (to 96) (then (remove (last From)))) (if (and (not (= (trackSite Move steps:(mapEntry ""Die"" (count Pips))) 96)) (not (= (trackSite Move steps:(mapEntry ""Die"" (count Pips))) -1))) (move (from (from) level:(level)) (to (trackSite Move steps:(mapEntry ""Die"" (count Pips))) (apply if:(or (not (is In (trackSite Move steps:(mapEntry ""Die"" (count Pips))) (sites ""castle""))) (and (is In (trackSite Move steps:(mapEntry ""Die"" (count Pips))) (sites ""Castle"")) (is Friend (who at:(trackSite Move steps:(mapEntry ""Die"" (count Pips))))))) (if (is Enemy (who at:(to))) (fromTo (from (to)) (to (handSite (who at:(to))))))))))))}) (rules (start {(place Stack ""Pawn1"" (handSite P1) count:4) (place Stack ""Pawn2"" (handSite P2) count:4) (place Stack ""Pawn3"" (handSite P3) count:4) (place Stack ""Pawn4"" (handSite P4) count:4) (set Team 1 {P1 P3}) (set Team 2 {P2 P4})}) phases:{(phase ""firstTurn"" (play (do (roll) next:(move (from (handSite (mover))) (to (trackSite Move from:(handSite (mover)) steps:(mapEntry ""Die"" (count Pips))))))) (nextPhase (> (count Moves) 3) ""Movement"")) (phase ""Movement"" (play (do (roll) next:(or {(forEach Piece) (if (and (is Occupied (handSite (mover))) (is In (count Pips) (sites ""Grace""))) (move (from (handSite Mover) level:(topLevel at:(handSite (mover)))) (to (mapEntry ""Entry"" (mover))))) (move Pass)} (then (if (is In (count Pips) (sites ""Grace"")) (moveAgain)))))))} (end (if (no Pieces TeamMover) (result TeamMover Win)))))" -"Sixteen 3x8 rectangles are arranged in a circle, each rectangle touching the corner of another on its left and right. The second, fifth, and eighth squares (counting from the top) in the outer rows, and the third and sixth squares in the central row of each rectangle are marked. Can be played with sixteen, eight, or four players. It can be played individually, or on two teams. Each rectangle has one set of four pieces. They enter the board from the center, proceeding down the central row or their respective rectangles, proceeding in the outer rows of the rectangles in an anti-clockwise direction. When a complete circuit of the board has been made, the pieces must travel down the central row again and exit the board with an exact throw. The game is played with two eight-sided die, containing the following values: 1, 3, 4, 6, 8, 10, 12, 16 on one, 2, 5, 7, 9, 11, 13, 15, 16 on the other. It may also be played with four rectangular dice each with the values 1, 3, 4, 6. Pieces are entered on the throw of nine. Doubles allow a second roll.Spaces moved may be broken up between two pieces but each piece must move a number equal to that displayed on one of the dice. A player can pass, but only before the die is thrown. When two pieces of the same color occupy a space, no other pieces may pass them. These pieces may then move as a single pawn. If a piece lands on the same spot occupied by an opponent's piece, the opponent's piece is sent back to the start. Two pieces moving as a single pawn can only be sent to start by two other pieces moving as a single pawn. Pieces on a marked space cannot be sent to start. A play which sends an opponent's piece to start allows another roll. A player may bypass the central row and circuit the board another time if they wish (i.e., in order to send another player back to start to prevent them from winning). The first player to remove all their pieces from the board wins, and the other platers continue playing until all but one player have moved their pieces into the center. The game involves 16 players.","(game ""Pagade Kayi Ata (Sixteen-handed)"" (players 16) (equipment {(board (add (merge {(rectangle 3 8) (shift 0.88 -4.45 (rotate 22.5 (rectangle 3 8))) (shift 3.39 -8.21 (rotate 45 (rectangle 3 8))) (shift 7.15 -10.71 (rotate 67.5 (rectangle 3 8))) (shift 11.58 -11.59 (rotate 90 (rectangle 3 8))) (shift 16.02 -10.71 (rotate 112.5 (rectangle 3 8))) (shift 19.8 -8.21 (rotate 135 (rectangle 3 8))) (shift 22.33 -4.45 (rotate 157.5 (rectangle 3 8))) (shift 23.21 0 (rotate 180 (rectangle 3 8))) (shift 22.33 4.45 (rotate 202.5 (rectangle 3 8))) (shift 19.8 8.21 (rotate 225 (rectangle 3 8))) (shift 16.02 10.71 (rotate 247.5 (rectangle 3 8))) (shift 11.58 11.59 (rotate 270 (rectangle 3 8))) (shift 7.15 10.71 (rotate 292.5 (rectangle 3 8))) (shift 3.39 8.21 (rotate 315 (rectangle 3 8))) (shift 0.88 4.45 (rotate 337.5 (rectangle 3 8)))}) edges:{{8 71} {44 107} {80 143} {116 179} {152 215} {188 251} {224 287} {260 323} {296 359} {332 395} {368 431} {404 467} {440 503} {476 539} {512 575} {548 35}} cells:{{35 26 17 8 71 62 53 44 107 98 89 80 143 134 125 116 179 170 161 152 215 206 197 188 251 242 233 224 287 278 269 260 323 314 305 296 359 350 341 332 395 386 377 368 431 422 413 404 467 458 449 440 503 494 485 476 539 530 521 512 575 566 557 548}}) {(track ""Track1"" ""384,15,W,S,E7,47,WSW,SSE,ENE7,71,SW,SE,NE7,95,SSW,ESE,NNE7,119,S,E,N7,143,SSE,ENE,NNW7,167,SE,NE,NW7,191,ESE,NNE,WNW7,215,E,N,W7,239,ENE,NNW,WSW7,263,NE,NW,SW7,287,NNE,WNW,SSW7,311,N,W,S7,335,NNW,WSW,SSE7,359,NW,SW,SE7,383,WNW,SSW,ESE7,23,W,S1,End"" P1 directed:True) (track ""Track2"" ""384,39,WSW,SSE,ENE7,71,SW,SE,NE7,95,SSW,ESE,NNE7,119,S,E,N7,143,SSE,ENE,NNW7,167,SE,NE,NW7,191,ESE,NNE,WNW7,215,E,N,W7,239,ENE,NNW,WSW7,263,NE,NW,SW7,287,NNE,WNW,SSW7,311,N,W,S7,335,NNW,WSW,SSE7,359,NW,SW,SE7,383,WNW,SSW,ESE7,23,W,S,E7,47,WSW,SSE1,End"" P2 directed:True) (track ""Track3"" ""384,63,SW,SE,NE7,95,SSW,ESE,NNE7,119,S,E,N7,143,SSE,ENE,NNW7,167,SE,NE,NW7,191,ESE,NNE,WNW7,215,E,N,W7,239,ENE,NNW,WSW7,263,NE,NW,SW7,287,NNE,WNW,SSW7,311,N,W,S7,335,NNW,WSW,SSE7,359,NW,SW,SE7,383,WNW,SSW,ESE7,23,W,S,E7,47,WSW,SSE,ENE7,71,SW,SE1,End"" P3 directed:True) (track ""Track4"" ""384,87,SSW,ESE,NNE7,119,S,E,N7,143,SSE,ENE,NNW7,167,SE,NE,NW7,191,ESE,NNE,WNW7,215,E,N,W7,239,ENE,NNW,WSW7,263,NE,NW,SW7,287,NNE,WNW,SSW7,311,N,W,S7,335,NNW,WSW,SSE7,359,NW,SW,SE7,383,WNW,SSW,ESE7,23,W,S,E7,47,WSW,SSE,ENE7,71,SW,SE,NE7,95,SSW,ESE1,End"" P4 directed:True) (track ""Track5"" ""384,111,S,E,N7,143,SSE,ENE,NNW7,167,SE,NE,NW7,191,ESE,NNE,WNW7,215,E,N,W7,239,ENE,NNW,WSW7,263,NE,NW,SW7,287,NNE,WNW,SSW7,311,N,W,S7,335,NNW,WSW,SSE7,359,NW,SW,SE7,383,WNW,SSW,ESE7,23,W,S,E7,47,WSW,SSE,ENE7,71,SW,SE,NE7,95,SSW,ESE,NNE7,119,S,E1,End"" P5 directed:True) (track ""Track6"" ""384,135,SSE,ENE,NNW7,167,SE,NE,NW7,191,ESE,NNE,WNW7,215,E,N,W7,239,ENE,NNW,WSW7,263,NE,NW,SW7,287,NNE,WNW,SSW7,311,N,W,S7,335,NNW,WSW,SSE7,359,NW,SW,SE7,383,WNW,SSW,ESE7,23,W,S,E7,47,WSW,SSE,ENE7,71,SW,SE,NE7,95,SSW,ESE,NNE7,119,S,E,N7,143,SSE,ENE1,End"" P6 directed:True) (track ""Track7"" ""384,159,SE,NE,NW7,191,ESE,NNE,WNW7,215,E,N,W7,239,ENE,NNW,WSW7,263,NE,NW,SW7,287,NNE,WNW,SSW7,311,N,W,S7,335,NNW,WSW,SSE7,359,NW,SW,SE7,383,WNW,SSW,ESE7,23,W,S,E7,47,WSW,SSE,ENE7,71,SW,SE,NE7,95,SSW,ESE,NNE7,119,S,E,N7,143,SSE,ENE,NNW7,167,SE,NE1,End,"" P7 directed:True) (track ""Track8"" ""384,183,ESE,NNE,WNW7,215,E,N,W7,239,ENE,NNW,WSW7,263,NE,NW,SW7,287,NNE,WNW,SSW7,311,N,W,S7,335,NNW,WSW,SSE7,359,NW,SW,SE7,383,WNW,SSW,ESE7,23,W,S,E7,47,WSW,SSE,ENE7,71,SW,SE,NE7,95,SSW,ESE,NNE7,119,S,E,N7,143,SSE,ENE,NNW7,167,SE,NE,NW7,191,ESE,NNE1,End,"" P8 directed:True) (track ""Track9"" ""384,207,E,N,W7,239,ENE,NNW,WSW7,263,NE,NW,SW7,287,NNE,WNW,SSW7,311,N,W,S7,335,NNW,WSW,SSE7,359,NW,SW,SE7,383,WNW,SSW,ESE7,23,W,S,E7,47,WSW,SSE,ENE7,71,SW,SE,NE7,95,SSW,ESE,NNE7,119,S,E,N7,143,SSE,ENE,NNW7,167,SE,NE,NW7,191,ESE,NNE,WNW7,215,E,N1,End"" P9 directed:True) (track ""Track10"" ""384,231,ENE,NNW,WSW7,263,NE,NW,SW7,287,NNE,WNW,SSW7,311,N,W,S7,335,NNW,WSW,SSE7,359,NW,SW,SE7,383,WNW,SSW,ESE7,23,W,S,E7,47,WSW,SSE,ENE7,71,SW,SE,NE7,95,SSW,ESE,NNE7,119,S,E,N7,143,SSE,ENE,NNW7,167,SE,NE,NW7,191,ESE,NNE,WNW7,215,E,N,W7,239,ENE,NNW1,End"" P10 directed:True) (track ""Track11"" ""384,255,NE,NW,SW7,287,NNE,WNW,SSW7,311,N,W,S7,335,NNW,WSW,SSE7,359,NW,SW,SE7,383,WNW,SSW,ESE7,23,W,S,E7,47,WSW,SSE,ENE7,71,SW,SE,NE7,95,SSW,ESE,NNE7,119,S,E,N7,143,SSE,ENE,NNW7,167,SE,NE,NW7,191,ESE,NNE,WNW7,215,E,N,W7,239,ENE,NNW,WSW7,263,NE,NW1,End"" P11 directed:True) (track ""Track12"" ""384,279,NNE,WNW,SSW7,311,N,W,S7,335,NNW,WSW,SSE7,359,NW,SW,SE7,383,WNW,SSW,ESE7,23,W,S,E7,47,WSW,SSE,ENE7,71,SW,SE,NE7,95,SSW,ESE,NNE7,119,S,E,N7,143,SSE,ENE,NNW7,167,SE,NE,NW7,191,ESE,NNE,WNW7,215,E,N,W7,239,ENE,NNW,WSW7,263,NE,NW,SW7,287,NNE,WNW1,End"" P12 directed:True) (track ""Track13"" ""384,303,N,W,S7,335,NNW,WSW,SSE7,359,NW,SW,SE7,383,WNW,SSW,ESE7,23,W,S,E7,47,WSW,SSE,ENE7,71,SW,SE,NE7,95,SSW,ESE,NNE7,119,S,E,N7,143,SSE,ENE,NNW7,167,SE,NE,NW7,191,ESE,NNE,WNW7,215,E,N,W7,239,ENE,NNW,WSW7,263,NE,NW,SW7,287,NNE,WNW,SSW7,311,N,W1,End"" P13 directed:True) (track ""Track14"" ""384,327,NNW,WSW,SSE7,359,NW,SW,SE7,383,WNW,SSW,ESE7,23,W,S,E7,47,WSW,SSE,ENE7,71,SW,SE,NE7,95,SSW,ESE,NNE7,119,S,E,N7,143,SSE,ENE,NNW7,167,SE,NE,NW7,191,ESE,NNE,WNW7,215,E,N,W7,239,ENE,NNW,WSW7,263,NE,NW,SW7,287,NNE,WNW,SSW7,311,N,W,S7,335,NNW,WSW1,End"" P14 directed:True) (track ""Track15"" ""384,351,NW,SW,SE7,383,WNW,SSW,ESE7,23,W,S,E7,47,WSW,SSE,ENE7,71,SW,SE,NE7,95,SSW,ESE,NNE7,119,S,E,N7,143,SSE,ENE,NNW7,167,SE,NE,NW7,191,ESE,NNE,WNW7,215,E,N,W7,239,ENE,NNW,WSW7,263,NE,NW,SW7,287,NNE,WNW,SSW7,311,N,W,S7,335,NNW,WSW,SSE7,359,NW,SW1,End"" P15 directed:True) (track ""Track16"" ""384,375,WNW,SSW,ESE7,23,W,S,E7,47,WSW,SSE,ENE7,71,SW,SE,NE7,95,SSW,ESE,NNE7,119,S,E,N7,143,SSE,ENE,NNW7,167,SE,NE,NW7,191,ESE,NNE,WNW7,215,E,N,W7,239,ENE,NNW,WSW7,263,NE,NW,SW7,287,NNE,WNW,SSW7,311,N,W,S7,335,NNW,WSW,SSE7,359,NW,SW,SE7,383,WNW,SSW1,End"" P16 directed:True)}) (map ""Start"" {(pair 1 15) (pair 2 39) (pair 3 63) (pair 4 87) (pair 5 111) (pair 6 135) (pair 7 159) (pair 8 183) (pair 9 207) (pair 10 231) (pair 11 255) (pair 12 279) (pair 13 303) (pair 14 327) (pair 15 351) (pair 16 375)}) (piece ""Disc"" Each (if (and (!= (pips) 0) (!= (trackSite Move from:(from) steps:(pips)) -1)) (if (= (trackSite Move from:(from) steps:(pips)) -2) (move Remove (from)) (move (from (from) level:(level)) (to (trackSite Move from:(from) steps:(pips)) if:(and (or (not (is In (to) (sites ""Castle""))) (and (is In (to) (sites ""Castle"")) (not (is Enemy (who at:(to)))))) (not (and (is Enemy (who at:(to))) (> (count at:(to)) 1)))) (apply if:(and (is Enemy (who at:(to))) (= (count at:(to)) 1)) (and (fromTo (from (to)) (to 384)) (set Pending)))))))) (hand Each) (dice d:8 faces:{1 3 4 6 8 10 12 16} num:2) (regions ""Castle"" {22 19 16 0 3 6 13 10 46 43 40 34 37 24 27 30 70 54 61 67 51 58 64 48 94 78 118 102 142 126 85 109 133 91 75 115 99 139 123 82 106 130 112 88 72 96 136 120 166 150 190 174 214 198 238 222 157 181 205 229 163 147 187 171 211 195 235 219 154 178 202 226 160 144 232 184 168 232 216 208 192 262 246 253 286 270 277 310 294 301 334 318 325 358 342 349 366 382 373 331 315 322 312 328 363 379 370 259 243 250 256 240 376 283 267 274 280 264 307 291 298 304 288 355 339 346 352 360 336}) (regions ""DiceHand"" {401 402})}) (rules (start {(place Stack ""Disc1"" (handSite P1) count:4) (place Stack ""Disc2"" (handSite P2) count:4) (place Stack ""Disc3"" (handSite P3) count:4) (place Stack ""Disc4"" (handSite P4) count:4) (place Stack ""Disc5"" (handSite P5) count:4) (place Stack ""Disc6"" (handSite P6) count:4) (place Stack ""Disc7"" (handSite P7) count:4) (place Stack ""Disc8"" (handSite P8) count:4) (place Stack ""Disc9"" (handSite P9) count:4) (place Stack ""Disc10"" (handSite P10) count:4) (place Stack ""Disc11"" (handSite P11) count:4) (place Stack ""Disc12"" (handSite P12) count:4) (place Stack ""Disc13"" (handSite P13) count:4) (place Stack ""Disc14"" (handSite P14) count:4) (place Stack ""Disc15"" (handSite P15) count:4) (place Stack ""Disc16"" (handSite P16) count:4)}) (play (if (is Pending) (move Select (from (sites ""DiceHand"")) (then (and (roll) (moveAgain)))) (do (if (not (is Prev Mover)) (roll)) next:(forEach Die combined:True replayDouble:True (or (if (and (not (all Sites (sites Hand Mover) if:(= 0 (count Cell at:(site))))) (= (pips) 9)) (move (from (handSite Mover)) (to (mapEntry ""Start"" (mover))))) (or (forEach Piece) (forEach Piece container:(mover)))) (then (if (can Move (forEach Die combined:True (or (if (and (not (all Sites (sites Hand Mover) if:(= 0 (count Cell at:(site))))) (= (pips) 9)) (fromTo (from (handSite Mover)) (to (mapEntry ""Start"" (mover))))) (or (forEach Piece) (forEach Piece container:(mover)))))) (moveAgain))))))) (end (if (no Pieces Mover) (result Mover Win)))))","###Description -Sixteen 3x8 rectangles are arranged in a circle, each rectangle touching the corner of another on its left and right. The second, fifth, and eighth squares (counting from the top) in the outer rows, and the third and sixth squares in the central row of each rectangle are marked. Can be played with sixteen, eight, or four players. It can be played individually, or on two teams. Each rectangle has one set of four pieces. They enter the board from the center, proceeding down the central row or their respective rectangles, proceeding in the outer rows of the rectangles in an anti-clockwise direction. When a complete circuit of the board has been made, the pieces must travel down the central row again and exit the board with an exact throw. The game is played with two eight-sided die, containing the following values: 1, 3, 4, 6, 8, 10, 12, 16 on one, 2, 5, 7, 9, 11, 13, 15, 16 on the other. It may also be played with four rectangular dice each with the values 1, 3, 4, 6. Pieces are entered on the throw of nine. Doubles allow a second roll.Spaces moved may be broken up between two pieces but each piece must move a number equal to that displayed on one of the dice. A player can pass, but only before the die is thrown. When two pieces of the same color occupy a space, no other pieces may pass them. These pieces may then move as a single pawn. If a piece lands on the same spot occupied by an opponent's piece, the opponent's piece is sent back to the start. Two pieces moving as a single pawn can only be sent to start by two other pieces moving as a single pawn. Pieces on a marked space cannot be sent to start. A play which sends an opponent's piece to start allows another roll. A player may bypass the central row and circuit the board another time if they wish (i.e., in order to send another player back to start to prevent them from winning). The first player to remove all their pieces from the board wins, and the other platers continue playing until all but one player have moved their pieces into the center. The game involves 16 players. - -###Ludii -(game ""Pagade Kayi Ata (Sixteen-handed)"" (players 16) (equipment {(board (add (merge {(rectangle 3 8) (shift 0.88 -4.45 (rotate 22.5 (rectangle 3 8))) (shift 3.39 -8.21 (rotate 45 (rectangle 3 8))) (shift 7.15 -10.71 (rotate 67.5 (rectangle 3 8))) (shift 11.58 -11.59 (rotate 90 (rectangle 3 8))) (shift 16.02 -10.71 (rotate 112.5 (rectangle 3 8))) (shift 19.8 -8.21 (rotate 135 (rectangle 3 8))) (shift 22.33 -4.45 (rotate 157.5 (rectangle 3 8))) (shift 23.21 0 (rotate 180 (rectangle 3 8))) (shift 22.33 4.45 (rotate 202.5 (rectangle 3 8))) (shift 19.8 8.21 (rotate 225 (rectangle 3 8))) (shift 16.02 10.71 (rotate 247.5 (rectangle 3 8))) (shift 11.58 11.59 (rotate 270 (rectangle 3 8))) (shift 7.15 10.71 (rotate 292.5 (rectangle 3 8))) (shift 3.39 8.21 (rotate 315 (rectangle 3 8))) (shift 0.88 4.45 (rotate 337.5 (rectangle 3 8)))}) edges:{{8 71} {44 107} {80 143} {116 179} {152 215} {188 251} {224 287} {260 323} {296 359} {332 395} {368 431} {404 467} {440 503} {476 539} {512 575} {548 35}} cells:{{35 26 17 8 71 62 53 44 107 98 89 80 143 134 125 116 179 170 161 152 215 206 197 188 251 242 233 224 287 278 269 260 323 314 305 296 359 350 341 332 395 386 377 368 431 422 413 404 467 458 449 440 503 494 485 476 539 530 521 512 575 566 557 548}}) {(track ""Track1"" ""384,15,W,S,E7,47,WSW,SSE,ENE7,71,SW,SE,NE7,95,SSW,ESE,NNE7,119,S,E,N7,143,SSE,ENE,NNW7,167,SE,NE,NW7,191,ESE,NNE,WNW7,215,E,N,W7,239,ENE,NNW,WSW7,263,NE,NW,SW7,287,NNE,WNW,SSW7,311,N,W,S7,335,NNW,WSW,SSE7,359,NW,SW,SE7,383,WNW,SSW,ESE7,23,W,S1,End"" P1 directed:True) (track ""Track2"" ""384,39,WSW,SSE,ENE7,71,SW,SE,NE7,95,SSW,ESE,NNE7,119,S,E,N7,143,SSE,ENE,NNW7,167,SE,NE,NW7,191,ESE,NNE,WNW7,215,E,N,W7,239,ENE,NNW,WSW7,263,NE,NW,SW7,287,NNE,WNW,SSW7,311,N,W,S7,335,NNW,WSW,SSE7,359,NW,SW,SE7,383,WNW,SSW,ESE7,23,W,S,E7,47,WSW,SSE1,End"" P2 directed:True) (track ""Track3"" ""384,63,SW,SE,NE7,95,SSW,ESE,NNE7,119,S,E,N7,143,SSE,ENE,NNW7,167,SE,NE,NW7,191,ESE,NNE,WNW7,215,E,N,W7,239,ENE,NNW,WSW7,263,NE,NW,SW7,287,NNE,WNW,SSW7,311,N,W,S7,335,NNW,WSW,SSE7,359,NW,SW,SE7,383,WNW,SSW,ESE7,23,W,S,E7,47,WSW,SSE,ENE7,71,SW,SE1,End"" P3 directed:True) (track ""Track4"" ""384,87,SSW,ESE,NNE7,119,S,E,N7,143,SSE,ENE,NNW7,167,SE,NE,NW7,191,ESE,NNE,WNW7,215,E,N,W7,239,ENE,NNW,WSW7,263,NE,NW,SW7,287,NNE,WNW,SSW7,311,N,W,S7,335,NNW,WSW,SSE7,359,NW,SW,SE7,383,WNW,SSW,ESE7,23,W,S,E7,47,WSW,SSE,ENE7,71,SW,SE,NE7,95,SSW,ESE1,End"" P4 directed:True) (track ""Track5"" ""384,111,S,E,N7,143,SSE,ENE,NNW7,167,SE,NE,NW7,191,ESE,NNE,WNW7,215,E,N,W7,239,ENE,NNW,WSW7,263,NE,NW,SW7,287,NNE,WNW,SSW7,311,N,W,S7,335,NNW,WSW,SSE7,359,NW,SW,SE7,383,WNW,SSW,ESE7,23,W,S,E7,47,WSW,SSE,ENE7,71,SW,SE,NE7,95,SSW,ESE,NNE7,119,S,E1,End"" P5 directed:True) (track ""Track6"" ""384,135,SSE,ENE,NNW7,167,SE,NE,NW7,191,ESE,NNE,WNW7,215,E,N,W7,239,ENE,NNW,WSW7,263,NE,NW,SW7,287,NNE,WNW,SSW7,311,N,W,S7,335,NNW,WSW,SSE7,359,NW,SW,SE7,383,WNW,SSW,ESE7,23,W,S,E7,47,WSW,SSE,ENE7,71,SW,SE,NE7,95,SSW,ESE,NNE7,119,S,E,N7,143,SSE,ENE1,End"" P6 directed:True) (track ""Track7"" ""384,159,SE,NE,NW7,191,ESE,NNE,WNW7,215,E,N,W7,239,ENE,NNW,WSW7,263,NE,NW,SW7,287,NNE,WNW,SSW7,311,N,W,S7,335,NNW,WSW,SSE7,359,NW,SW,SE7,383,WNW,SSW,ESE7,23,W,S,E7,47,WSW,SSE,ENE7,71,SW,SE,NE7,95,SSW,ESE,NNE7,119,S,E,N7,143,SSE,ENE,NNW7,167,SE,NE1,End,"" P7 directed:True) (track ""Track8"" ""384,183,ESE,NNE,WNW7,215,E,N,W7,239,ENE,NNW,WSW7,263,NE,NW,SW7,287,NNE,WNW,SSW7,311,N,W,S7,335,NNW,WSW,SSE7,359,NW,SW,SE7,383,WNW,SSW,ESE7,23,W,S,E7,47,WSW,SSE,ENE7,71,SW,SE,NE7,95,SSW,ESE,NNE7,119,S,E,N7,143,SSE,ENE,NNW7,167,SE,NE,NW7,191,ESE,NNE1,End,"" P8 directed:True) (track ""Track9"" ""384,207,E,N,W7,239,ENE,NNW,WSW7,263,NE,NW,SW7,287,NNE,WNW,SSW7,311,N,W,S7,335,NNW,WSW,SSE7,359,NW,SW,SE7,383,WNW,SSW,ESE7,23,W,S,E7,47,WSW,SSE,ENE7,71,SW,SE,NE7,95,SSW,ESE,NNE7,119,S,E,N7,143,SSE,ENE,NNW7,167,SE,NE,NW7,191,ESE,NNE,WNW7,215,E,N1,End"" P9 directed:True) (track ""Track10"" ""384,231,ENE,NNW,WSW7,263,NE,NW,SW7,287,NNE,WNW,SSW7,311,N,W,S7,335,NNW,WSW,SSE7,359,NW,SW,SE7,383,WNW,SSW,ESE7,23,W,S,E7,47,WSW,SSE,ENE7,71,SW,SE,NE7,95,SSW,ESE,NNE7,119,S,E,N7,143,SSE,ENE,NNW7,167,SE,NE,NW7,191,ESE,NNE,WNW7,215,E,N,W7,239,ENE,NNW1,End"" P10 directed:True) (track ""Track11"" ""384,255,NE,NW,SW7,287,NNE,WNW,SSW7,311,N,W,S7,335,NNW,WSW,SSE7,359,NW,SW,SE7,383,WNW,SSW,ESE7,23,W,S,E7,47,WSW,SSE,ENE7,71,SW,SE,NE7,95,SSW,ESE,NNE7,119,S,E,N7,143,SSE,ENE,NNW7,167,SE,NE,NW7,191,ESE,NNE,WNW7,215,E,N,W7,239,ENE,NNW,WSW7,263,NE,NW1,End"" P11 directed:True) (track ""Track12"" ""384,279,NNE,WNW,SSW7,311,N,W,S7,335,NNW,WSW,SSE7,359,NW,SW,SE7,383,WNW,SSW,ESE7,23,W,S,E7,47,WSW,SSE,ENE7,71,SW,SE,NE7,95,SSW,ESE,NNE7,119,S,E,N7,143,SSE,ENE,NNW7,167,SE,NE,NW7,191,ESE,NNE,WNW7,215,E,N,W7,239,ENE,NNW,WSW7,263,NE,NW,SW7,287,NNE,WNW1,End"" P12 directed:True) (track ""Track13"" ""384,303,N,W,S7,335,NNW,WSW,SSE7,359,NW,SW,SE7,383,WNW,SSW,ESE7,23,W,S,E7,47,WSW,SSE,ENE7,71,SW,SE,NE7,95,SSW,ESE,NNE7,119,S,E,N7,143,SSE,ENE,NNW7,167,SE,NE,NW7,191,ESE,NNE,WNW7,215,E,N,W7,239,ENE,NNW,WSW7,263,NE,NW,SW7,287,NNE,WNW,SSW7,311,N,W1,End"" P13 directed:True) (track ""Track14"" ""384,327,NNW,WSW,SSE7,359,NW,SW,SE7,383,WNW,SSW,ESE7,23,W,S,E7,47,WSW,SSE,ENE7,71,SW,SE,NE7,95,SSW,ESE,NNE7,119,S,E,N7,143,SSE,ENE,NNW7,167,SE,NE,NW7,191,ESE,NNE,WNW7,215,E,N,W7,239,ENE,NNW,WSW7,263,NE,NW,SW7,287,NNE,WNW,SSW7,311,N,W,S7,335,NNW,WSW1,End"" P14 directed:True) (track ""Track15"" ""384,351,NW,SW,SE7,383,WNW,SSW,ESE7,23,W,S,E7,47,WSW,SSE,ENE7,71,SW,SE,NE7,95,SSW,ESE,NNE7,119,S,E,N7,143,SSE,ENE,NNW7,167,SE,NE,NW7,191,ESE,NNE,WNW7,215,E,N,W7,239,ENE,NNW,WSW7,263,NE,NW,SW7,287,NNE,WNW,SSW7,311,N,W,S7,335,NNW,WSW,SSE7,359,NW,SW1,End"" P15 directed:True) (track ""Track16"" ""384,375,WNW,SSW,ESE7,23,W,S,E7,47,WSW,SSE,ENE7,71,SW,SE,NE7,95,SSW,ESE,NNE7,119,S,E,N7,143,SSE,ENE,NNW7,167,SE,NE,NW7,191,ESE,NNE,WNW7,215,E,N,W7,239,ENE,NNW,WSW7,263,NE,NW,SW7,287,NNE,WNW,SSW7,311,N,W,S7,335,NNW,WSW,SSE7,359,NW,SW,SE7,383,WNW,SSW1,End"" P16 directed:True)}) (map ""Start"" {(pair 1 15) (pair 2 39) (pair 3 63) (pair 4 87) (pair 5 111) (pair 6 135) (pair 7 159) (pair 8 183) (pair 9 207) (pair 10 231) (pair 11 255) (pair 12 279) (pair 13 303) (pair 14 327) (pair 15 351) (pair 16 375)}) (piece ""Disc"" Each (if (and (!= (pips) 0) (!= (trackSite Move from:(from) steps:(pips)) -1)) (if (= (trackSite Move from:(from) steps:(pips)) -2) (move Remove (from)) (move (from (from) level:(level)) (to (trackSite Move from:(from) steps:(pips)) if:(and (or (not (is In (to) (sites ""Castle""))) (and (is In (to) (sites ""Castle"")) (not (is Enemy (who at:(to)))))) (not (and (is Enemy (who at:(to))) (> (count at:(to)) 1)))) (apply if:(and (is Enemy (who at:(to))) (= (count at:(to)) 1)) (and (fromTo (from (to)) (to 384)) (set Pending)))))))) (hand Each) (dice d:8 faces:{1 3 4 6 8 10 12 16} num:2) (regions ""Castle"" {22 19 16 0 3 6 13 10 46 43 40 34 37 24 27 30 70 54 61 67 51 58 64 48 94 78 118 102 142 126 85 109 133 91 75 115 99 139 123 82 106 130 112 88 72 96 136 120 166 150 190 174 214 198 238 222 157 181 205 229 163 147 187 171 211 195 235 219 154 178 202 226 160 144 232 184 168 232 216 208 192 262 246 253 286 270 277 310 294 301 334 318 325 358 342 349 366 382 373 331 315 322 312 328 363 379 370 259 243 250 256 240 376 283 267 274 280 264 307 291 298 304 288 355 339 346 352 360 336}) (regions ""DiceHand"" {401 402})}) (rules (start {(place Stack ""Disc1"" (handSite P1) count:4) (place Stack ""Disc2"" (handSite P2) count:4) (place Stack ""Disc3"" (handSite P3) count:4) (place Stack ""Disc4"" (handSite P4) count:4) (place Stack ""Disc5"" (handSite P5) count:4) (place Stack ""Disc6"" (handSite P6) count:4) (place Stack ""Disc7"" (handSite P7) count:4) (place Stack ""Disc8"" (handSite P8) count:4) (place Stack ""Disc9"" (handSite P9) count:4) (place Stack ""Disc10"" (handSite P10) count:4) (place Stack ""Disc11"" (handSite P11) count:4) (place Stack ""Disc12"" (handSite P12) count:4) (place Stack ""Disc13"" (handSite P13) count:4) (place Stack ""Disc14"" (handSite P14) count:4) (place Stack ""Disc15"" (handSite P15) count:4) (place Stack ""Disc16"" (handSite P16) count:4)}) (play (if (is Pending) (move Select (from (sites ""DiceHand"")) (then (and (roll) (moveAgain)))) (do (if (not (is Prev Mover)) (roll)) next:(forEach Die combined:True replayDouble:True (or (if (and (not (all Sites (sites Hand Mover) if:(= 0 (count Cell at:(site))))) (= (pips) 9)) (move (from (handSite Mover)) (to (mapEntry ""Start"" (mover))))) (or (forEach Piece) (forEach Piece container:(mover)))) (then (if (can Move (forEach Die combined:True (or (if (and (not (all Sites (sites Hand Mover) if:(= 0 (count Cell at:(site))))) (= (pips) 9)) (fromTo (from (handSite Mover)) (to (mapEntry ""Start"" (mover))))) (or (forEach Piece) (forEach Piece container:(mover)))))) (moveAgain))))))) (end (if (no Pieces Mover) (result Mover Win)))))" "Four 3x8 rectangles, arranged in a cross shape with a large square space in the center. The outer corners of each square are marked with a cross, as are the third and sixth space from the same corner. Four players, playing on two teams. Four pieces per player. The pieces are red, green, yellow, and black. Players start with one piece on the sixth and seventh space of the central row in their arm, and two pieces on the third space in the outer row of their arm, to the right. Two rectangular four-sided dice, with the following throws: 1, 3, 4, 6. Players use the throw of a die to move a piece; they may therefore may move two pieces each the value of one of the dice, or one piece twice, using the value of each dice. Play moves down the central track of the player's arm, around the outer perimeter of the board in an anti-clockwise direction, and back up the central row of the player's arm, proceeding into the large central square. When a player's piece moves into a space occupied by an opponent's piece, the opponent's piece is sent to the central square, from which it must begin again. A player cannot move into their central row, approaching the end of the track, unless two of their team member's pieces have moved past the player's own pieces. If two or more of the team member's pieces remain behind the player's own pieces, the player's pieces may not advance past the final three spaces in the left hand track of their home arm of the board. Neither they, nor any of the team's pieces, can proceed until two of the team member's pieces are placed, by exact throws, on the left inner corner of the arm of the player wishing to advance. These two pieces must then proceed together; i.e., only on double throws of the dice, with the exception that a double they cannot be used if it would cause them to land on a space occupied by a team member waiting to move. Once a double throw is successfully made and both pieces moved, the waiting pieces may proceed up the central row. When players cannot move the throws, they pass their turn. Players must move into the central square with an exact throw. The first team to place all of their pieces in the central square wins.","(game ""Pahada Keliya"" (players 4) (equipment {(board (add (hole (merge (shift 0 (/ (- 19 3) 2) (rectangle 3 19)) (shift (/ (- 19 3) 2) 0 (rectangle 19 3))) (poly {{8 8} {8 11} {11 11} {11 8}})) cells:{{8 28 48 68 69 70 71 51 31 11 10 9}}) {(track ""Track1"" ""96,9,S,E,N,11,E,N,W,53,N,W,S,42,W,S,E,8,S,E1,N7,End"" P1 directed:True) (track ""Track2"" ""96,26,W,S,E,8,S,E,N,11,E,N,W,53,N,W,S,42,W,S1,E7,End"" P2 directed:True) (track ""Track3"" ""96,52,N,W,S,42,W,S,E,8,S,E,N,11,E,N,W,53,N,W1,S7,End"" P3 directed:True) (track ""Track4"" ""96,27,E,N,W,53,N,W,S,42,W,S,E,8,S,E,N,11,E,N1,W7,End"" P4 directed:True)}) (dice d:4 faces:{1 3 4 6} num:2) (piece ""Pawn"" Each (forEach Die if:(!= (pips) 0) (if (= (trackSite Move from:(from) steps:(pips)) -2) (move Remove (from) level:(level)) (move (from (from) level:(level)) (to (trackSite Move from:(from) steps:(pips)) if:(if (not (is In (to) (sites Mover ""CentralRow""))) True (if (or (is In (from) (sites Mover ""CentralRow"")) (= (from) 96)) True (<= 1 (value Player Mover)))) (apply (if (is Enemy (who at:(to))) (forEach Level (to) FromTop (and {(if (= 1 (state at:(to) level:(level))) (if (is Mover P1) (set Value P3 (- (if (is Mover P1) (value Player P3) (if (is Mover P3) (value Player P1) (if (is Mover P2) (value Player P4) (value Player P2)))) 1)) (if (is Mover P3) (set Value P1 (- (if (is Mover P1) (value Player P3) (if (is Mover P3) (value Player P1) (if (is Mover P2) (value Player P4) (value Player P2)))) 1)) (if (is Mover P2) (set Value P4 (- (if (is Mover P1) (value Player P3) (if (is Mover P3) (value Player P1) (if (is Mover P2) (value Player P4) (value Player P2)))) 1)) (set Value P2 (- (if (is Mover P1) (value Player P3) (if (is Mover P3) (value Player P1) (if (is Mover P2) (value Player P4) (value Player P2)))) 1)))))) (remove (to) level:(level)) (add (piece (if (= (who at:(to) level:(level)) 1) (id ""Pawn"" P1) (if (= (who at:(to) level:(level)) 2) (id ""Pawn"" P2) (if (= (who at:(to) level:(level)) 3) (id ""Pawn"" P3) (id ""Pawn"" P4))))) (to (centrePoint)))}))))) (then (if (and (= 0 (state at:(last To) level:(last LevelTo))) (is In (last To) (if (is Mover P1) (sites P3 ""RightCentral"") (if (is Mover P3) (sites P1 ""RightCentral"") (if (is Mover P2) (sites P4 ""RightCentral"") (sites P2 ""RightCentral"")))))) (and (set State at:(last To) 1) (if (is Mover P1) (set Value P3 (+ 1 (if (is Mover P1) (value Player P3) (if (is Mover P3) (value Player P1) (if (is Mover P2) (value Player P4) (value Player P2)))))) (if (is Mover P3) (set Value P1 (+ 1 (if (is Mover P1) (value Player P3) (if (is Mover P3) (value Player P1) (if (is Mover P2) (value Player P4) (value Player P2)))))) (if (is Mover P2) (set Value P4 (+ 1 (if (is Mover P1) (value Player P3) (if (is Mover P3) (value Player P1) (if (is Mover P2) (value Player P4) (value Player P2)))))) (set Value P2 (+ 1 (if (is Mover P1) (value Player P3) (if (is Mover P3) (value Player P1) (if (is Mover P2) (value Player P4) (value Player P2)))))))))))))) (then (if (not (all DiceUsed)) (moveAgain))))) (regions ""CentralRow"" P1 (sites Direction from:55 N included:True distance:7)) (regions ""CentralRow"" P2 (sites Direction from:19 E included:True distance:7)) (regions ""CentralRow"" P3 (sites Direction from:94 S included:True distance:7)) (regions ""CentralRow"" P4 (sites Direction from:34 W included:True distance:7)) (regions ""RightCentral"" P1 (sites Direction from:56 N included:True distance:7)) (regions ""RightCentral"" P2 (sites Direction from:0 E included:True distance:7)) (regions ""RightCentral"" P3 (sites Direction from:93 S included:True distance:7)) (regions ""RightCentral"" P4 (sites Direction from:50 W included:True distance:7))}) (rules (start {(set Team 1 {P1 P3}) (set Team 2 {P2 P4}) (place Stack ""Pawn1"" 61) (place Stack ""Pawn1"" 58) (place Stack ""Pawn1"" 62 count:2) (place Stack ""Pawn2"" 21) (place Stack ""Pawn2"" 20) (place Stack ""Pawn2"" 2 count:2) (place Stack ""Pawn3"" 88) (place Stack ""Pawn3"" 91) (place Stack ""Pawn3"" 87 count:2) (place Stack ""Pawn4"" 32) (place Stack ""Pawn4"" 33) (place Stack ""Pawn4"" 48 count:2)}) (play (do (if (not (is Prev Mover)) (roll)) next:(forEach Piece))) (end (if (no Pieces TeamMover) (result TeamMover Win)))))","###Description Four 3x8 rectangles, arranged in a cross shape with a large square space in the center. The outer corners of each square are marked with a cross, as are the third and sixth space from the same corner. Four players, playing on two teams. Four pieces per player. The pieces are red, green, yellow, and black. Players start with one piece on the sixth and seventh space of the central row in their arm, and two pieces on the third space in the outer row of their arm, to the right. Two rectangular four-sided dice, with the following throws: 1, 3, 4, 6. Players use the throw of a die to move a piece; they may therefore may move two pieces each the value of one of the dice, or one piece twice, using the value of each dice. Play moves down the central track of the player's arm, around the outer perimeter of the board in an anti-clockwise direction, and back up the central row of the player's arm, proceeding into the large central square. When a player's piece moves into a space occupied by an opponent's piece, the opponent's piece is sent to the central square, from which it must begin again. A player cannot move into their central row, approaching the end of the track, unless two of their team member's pieces have moved past the player's own pieces. If two or more of the team member's pieces remain behind the player's own pieces, the player's pieces may not advance past the final three spaces in the left hand track of their home arm of the board. Neither they, nor any of the team's pieces, can proceed until two of the team member's pieces are placed, by exact throws, on the left inner corner of the arm of the player wishing to advance. These two pieces must then proceed together; i.e., only on double throws of the dice, with the exception that a double they cannot be used if it would cause them to land on a space occupied by a team member waiting to move. Once a double throw is successfully made and both pieces moved, the waiting pieces may proceed up the central row. When players cannot move the throws, they pass their turn. Players must move into the central square with an exact throw. The first team to place all of their pieces in the central square wins. @@ -714,11 +709,6 @@ Played on a board with twelve points on either side. The points form a continuou ###Ludii (game ""Schuster"" (players 2) (equipment {(board (rectangle 2 13) {(track ""Track1"" {6 12 11 10 9 8 7 5 4 3 2 1 0 13 14 15 16 17 18 20 21 22 23 24 25 -2} P1 directed:True) (track ""Track2"" {19 25 24 23 22 21 20 18 17 16 15 14 13 0 1 2 3 4 5 7 8 9 10 11 12 -2} P2 directed:True)} use:Vertex) (dice d:6 num:2) (piece ""Disc"" Each (forEach Die if:(!= (pips) 0) (if (= (trackSite Move from:(from) steps:(pips)) -2) (if (all Sites (sites Occupied by:Mover) if:(is In (site) (sites Mover ""FinalQuadrant""))) (move Remove (from))) (move (from (from)) (to (trackSite Move from:(from) steps:(pips)) if:(or (and {(is Enemy (who at:(to))) (not (is In (to) (sites Mover ""OppositeSide""))) (= (topLevel at:(to)) 0)}) (not (is Enemy (who at:(to))))) (apply if:(is Enemy (who at:(to))) (fromTo (from (to)) (to (mapEntry ""Bar"" Next))))))) (then (and (if (not (all DiceUsed)) (moveAgain)) (if (if (is Mover P1) (and {(= 15 (count Pieces Mover in:(sites {0 1 2 3 4 5}))) (is Friend (who at:3)) (is Friend (who at:4)) (is Friend (who at:5)) (= 3 (size Stack at:0)) (= 3 (size Stack at:1)) (= 3 (size Stack at:2))}) (and {(= 15 (count Pieces Mover in:(sites {13 14 15 16 17 18}))) (is Friend (who at:16)) (is Friend (who at:17)) (is Friend (who at:18)) (= 3 (size Stack at:13)) (= 3 (size Stack at:14)) (= 3 (size Stack at:15))})) (addScore Mover 2)))))) (regions ""FinalQuadrant"" P1 (sites {20 21 22 23 24 25})) (regions ""FinalQuadrant"" P2 (sites {7 8 9 10 11 12})) (regions ""OppositeSide"" P1 (sites {25 24 23 22 21 20 18 17 16 15 14 13})) (regions ""OppositeSide"" P2 (sites {0 1 2 3 4 5 7 8 9 10 11 12})) (map ""Bar"" {(pair P1 6) (pair P2 19)})}) (rules (start {(place Stack ""Disc1"" 12 count:15) (place Stack ""Disc2"" 25 count:15)}) (play (do (if (not (is Prev Mover)) (roll)) next:(forEach Piece top:True))) (end {(if (if (is Mover P1) (and {(= 15 (count Pieces Mover in:(sites {0 1 2 3 4 5}))) (is Friend (who at:3)) (is Friend (who at:4)) (is Friend (who at:5)) (= 3 (size Stack at:0)) (= 3 (size Stack at:1)) (= 3 (size Stack at:2))}) (and {(= 15 (count Pieces Mover in:(sites {13 14 15 16 17 18}))) (is Friend (who at:16)) (is Friend (who at:17)) (is Friend (who at:18)) (= 3 (size Stack at:13)) (= 3 (size Stack at:14)) (= 3 (size Stack at:15))})) (result Mover Win)) (if (no Pieces Mover) (result Mover Win))})))" -"Seven pieces per player, which begin on the board, alternating spaces from white to black along the track. Four throwing sticks, marked on one side and blank on the other, used as dice. The values of the throws are equal to the number of blank sides up, when no blank sides are up the throw = 5. Throws of 1, 4, and 5 grant the player another throw. All throws are made before moving, and a piece must move the full value of one throw at a time. Players alternate turns throwing the sticks, and the first one to throw 1 plays as white and moves the white piece in front. When a piece lands on a space occupied by the opponent's piece, the opponent's piece is sent back to the space where the piece that captured it moved from. When a player has two or more pieces in consecutive spaces, these pieces cannot be sent backward in this way. If a player cannot use a throw to move a piece forward, it must be used to move a piece backward. If a backward move makes a player's piece land on a space occupied by a piece belonging to the opponent, the opponent's piece is sent to the place where the player's move began. If a player cannot move, the turn ends. Spaces 26-30 provide special rules allowing the player to bear off. To move beyond square 26, the player must first land on it with an exact throw. From there, the player may: bear off with a throw of 5; move to square 30 with a throw of 4 and bear off on any subsequent throw; move to square 29 with a throw of 3, but it must stay there until borne off with a throw of 2; move to square 28 with a throw of 2, but it must stay there until borne off with a throw of 3. Pieces in squares 28 and 29 are never required to move backward and bearing off is not required from any space. When a player lands on squares 28-30 and an opponent's piece is already there, the opponent's piece is sent to square 27 instead of 26. When a piece is in square 27, whether by being sent there as described above or by being forced to use a throw of 1 to move into square 27, the player may either move the piece back to square 15 and lose one turn, or may leave the piece in square 27 until a 4 is thrown, bearing the piece off. A player cannot move any other piece on the board when one remains in square 27 or 15 after being sent back to it, and pieces which normally would be protected from bring sent back because they are next to each other may now be sent back. Pieces in squares 28-30 are safe as long as a piece is in square 27. The player in square 27 may decide to give up trying to throw a 4 on any turn and move this piece back to square 15 and lose their next turn. The first player to successfully bear off all their pieces wins. The track is a boustrophedon track with backward track. Four D2. The value of the throw is equal to the sum except when the sum is 0 the throw = 5. The rules of Kendall.","(game ""Senet"" (players 2) (equipment {(board (rectangle 3 10) {(track ""Track1"" ""20,E,S1,W,S1,E,End"" P1 directed:True) (track ""Track2"" ""20,E,S1,W,S1,E,End"" P2 directed:True) (track ""TrackOpposite1"" ""9,W,N1,E,N1,W"" P1 directed:True) (track ""TrackOpposite2"" ""9,W,N1,E,N1,W"" P2 directed:True)}) (dice d:2 from:0 num:4) (map {(pair 0 5) (pair 1 1) (pair 2 2) (pair 3 3) (pair 4 4)}) (regions ""Symbols"" (sites {""F2"" ""F1"" ""G1"" ""H1"" ""I1""})) (regions ""Ankh Waset"" (sites {""F2""})) (regions ""Neferu"" (sites {""F1""})) (regions ""Water"" (sites {""G1""})) (regions ""Baw"" (sites {""H1""})) (regions ""Two Men"" (sites {""I1""})) (regions ""Horus"" (sites {""J1""})) (regions ""TopRow"" (sites Top)) (regions ""MiddleRow"" (difference (expand (sites Top)) (sites Top))) (regions ""BottomRow"" (sites Bottom)) (piece ""SenetPiece"" Each) (hand Each)}) (rules (start {(place ""SenetPiece1"" (sites {""B3"" ""D3"" ""F3"" ""H3"" ""J3"" ""I2"" ""G2""})) (place ""SenetPiece2"" (sites {""A3"" ""C3"" ""E3"" ""G3"" ""I3"" ""J2"" ""H2""}))}) phases:{(phase ""Opening"" (play (do (roll) next:(move Pass (then (if (= 1 (mapEntry (count Pips))) (and {(fromTo (from (coord ""G2"")) (to (coord ""F2""))) (if (is Mover P2) (swap Players P1 P2)) (set NextPlayer (player 1))})))))) (nextPhase (= 1 (count Pips)) ""Playing"")) (phase ""Playing"" (play (do (roll) next:(if (can Move (if (and (= (state at:(coord ""F2"")) 1) (= 1 (count Sites in:(intersection (sites Occupied by:Mover) (sites ""Ankh Waset""))))) (priority {(if (is Empty (trackSite Move from:(coord ""F2"") steps:(mapEntry (count Pips)))) (move (from (coord ""F2"")) (to (trackSite Move from:(coord ""F2"") steps:(mapEntry (count Pips))))) (if (and (not (if (= (trackSite Move from:(coord ""F2"") steps:(mapEntry (count Pips))) 19) (or (is Line 2 W through:(trackSite Move from:(coord ""F2"") steps:(mapEntry (count Pips)))) (is Line 2 N through:(trackSite Move from:(coord ""F2"") steps:(mapEntry (count Pips))))) (if (= (trackSite Move from:(coord ""F2"") steps:(mapEntry (count Pips))) 29) (or (is Line 2 W through:(trackSite Move from:(coord ""F2"") steps:(mapEntry (count Pips)))) (is Line 2 S through:(trackSite Move from:(coord ""F2"") steps:(mapEntry (count Pips))))) (if (= (trackSite Move from:(coord ""F2"") steps:(mapEntry (count Pips))) 10) (or (is Line 2 E through:(trackSite Move from:(coord ""F2"") steps:(mapEntry (count Pips)))) (is Line 2 S through:(trackSite Move from:(coord ""F2"") steps:(mapEntry (count Pips))))) (if (= (trackSite Move from:(coord ""F2"") steps:(mapEntry (count Pips))) 0) (or (is Line 2 E through:(trackSite Move from:(coord ""F2"") steps:(mapEntry (count Pips)))) (is Line 2 N through:(trackSite Move from:(coord ""F2"") steps:(mapEntry (count Pips))))) (or (is Line 2 W through:(trackSite Move from:(coord ""F2"") steps:(mapEntry (count Pips)))) (is Line 2 E through:(trackSite Move from:(coord ""F2"") steps:(mapEntry (count Pips)))))))))) (is Enemy (who at:(trackSite Move from:(coord ""F2"") steps:(mapEntry (count Pips)))))) (move Swap Pieces (coord ""F2"") (trackSite Move from:(coord ""F2"") steps:(mapEntry (count Pips))))) (then (set State at:(last To) 0))) (if (is Empty (trackSite Move from:(coord ""F2"") ""TrackOpposite"" steps:(mapEntry (count Pips)))) (move (from (coord ""F2"")) (to (trackSite Move from:(coord ""F2"") ""TrackOpposite"" steps:(mapEntry (count Pips))))) (if (and (not (if (= (trackSite Move from:(coord ""F2"") ""TrackOpposite"" steps:(mapEntry (count Pips))) 19) (or (is Line 2 W through:(trackSite Move from:(coord ""F2"") ""TrackOpposite"" steps:(mapEntry (count Pips)))) (is Line 2 N through:(trackSite Move from:(coord ""F2"") ""TrackOpposite"" steps:(mapEntry (count Pips))))) (if (= (trackSite Move from:(coord ""F2"") ""TrackOpposite"" steps:(mapEntry (count Pips))) 29) (or (is Line 2 W through:(trackSite Move from:(coord ""F2"") ""TrackOpposite"" steps:(mapEntry (count Pips)))) (is Line 2 S through:(trackSite Move from:(coord ""F2"") ""TrackOpposite"" steps:(mapEntry (count Pips))))) (if (= (trackSite Move from:(coord ""F2"") ""TrackOpposite"" steps:(mapEntry (count Pips))) 10) (or (is Line 2 E through:(trackSite Move from:(coord ""F2"") ""TrackOpposite"" steps:(mapEntry (count Pips)))) (is Line 2 S through:(trackSite Move from:(coord ""F2"") ""TrackOpposite"" steps:(mapEntry (count Pips))))) (if (= (trackSite Move from:(coord ""F2"") ""TrackOpposite"" steps:(mapEntry (count Pips))) 0) (or (is Line 2 E through:(trackSite Move from:(coord ""F2"") ""TrackOpposite"" steps:(mapEntry (count Pips)))) (is Line 2 N through:(trackSite Move from:(coord ""F2"") ""TrackOpposite"" steps:(mapEntry (count Pips))))) (or (is Line 2 W through:(trackSite Move from:(coord ""F2"") ""TrackOpposite"" steps:(mapEntry (count Pips)))) (is Line 2 E through:(trackSite Move from:(coord ""F2"") ""TrackOpposite"" steps:(mapEntry (count Pips)))))))))) (is Enemy (who at:(trackSite Move from:(coord ""F2"") ""TrackOpposite"" steps:(mapEntry (count Pips)))))) (move Swap Pieces (coord ""F2"") (trackSite Move from:(coord ""F2"") ""TrackOpposite"" steps:(mapEntry (count Pips))))) (then (set State at:(last To) 0)))}) (if (= 1 (count Sites in:(intersection (sites Occupied by:Mover) (sites ""Water"")))) (if (= (mapEntry (count Pips)) 4) (move Remove (sites ""Water"")) (or (if (= 1 (count Sites in:(intersection (sites Empty) (sites ""Ankh Waset"")))) (move (from (sites ""Water"")) (to (sites ""Ankh Waset"")) (then (set State at:(last To) 1)))) (move Pass))) (if True (priority {(forEach Piece (or {(if (is In (from) (sites ""Neferu"")) (if (!= (trackSite Move steps:(mapEntry (count Pips))) -1) (if (= (trackSite Move steps:(mapEntry (count Pips))) -2) (move Remove (from)) (if (is Empty (trackSite Move steps:(mapEntry (count Pips)))) (move (from) (to (trackSite Move steps:(mapEntry (count Pips))))) (if (and (not (if (= (trackSite Move steps:(mapEntry (count Pips))) 19) (or (is Line 2 W through:(trackSite Move steps:(mapEntry (count Pips)))) (is Line 2 N through:(trackSite Move steps:(mapEntry (count Pips))))) (if (= (trackSite Move steps:(mapEntry (count Pips))) 29) (or (is Line 2 W through:(trackSite Move steps:(mapEntry (count Pips)))) (is Line 2 S through:(trackSite Move steps:(mapEntry (count Pips))))) (if (= (trackSite Move steps:(mapEntry (count Pips))) 10) (or (is Line 2 E through:(trackSite Move steps:(mapEntry (count Pips)))) (is Line 2 S through:(trackSite Move steps:(mapEntry (count Pips))))) (if (= (trackSite Move steps:(mapEntry (count Pips))) 0) (or (is Line 2 E through:(trackSite Move steps:(mapEntry (count Pips)))) (is Line 2 N through:(trackSite Move steps:(mapEntry (count Pips))))) (or (is Line 2 W through:(trackSite Move steps:(mapEntry (count Pips)))) (is Line 2 E through:(trackSite Move steps:(mapEntry (count Pips)))))))))) (is Enemy (who at:(trackSite Move steps:(mapEntry (count Pips)))))) (if (and (= 1 (count in:(intersection (sites Empty) (sites ""Water"")))) (is In (trackSite Move steps:(mapEntry (count Pips))) (union {(sites ""Baw"") (sites ""Two Men"") (sites ""Horus"")}))) (move Swap Pieces (from) (trackSite Move steps:(mapEntry (count Pips))) (then (fromTo (from (last From)) (to (trackSite Move from:(last From) steps:1))))))))))) (if (is In (from) (union {(sites ""Two Men"") (sites ""Baw"")})) (if (!= (trackSite Move steps:(mapEntry (count Pips))) -1) (if (= (trackSite Move steps:(mapEntry (count Pips))) -2) (move Remove (from))))) (if (is In (from) (sites ""Horus"")) (if (or (= (trackSite Move steps:(mapEntry (count Pips))) -2) (= (trackSite Move steps:(mapEntry (count Pips))) -1)) (move Remove (from)))) (if (not (is In (from) (union {(sites ""Neferu"") (sites ""Water"") (sites ""Baw"") (sites ""Two Men"") (sites ""Horus"")}))) (or {(if (not (or {(= (trackSite Move steps:(mapEntry (count Pips))) -2) (= (trackSite Move steps:(mapEntry (count Pips))) -1) (is In (trackSite Move steps:(mapEntry (count Pips))) (union {(sites ""Water"") (sites ""Baw"") (sites ""Two Men"") (sites ""Horus"")}))})) (if (is Empty (trackSite Move steps:(mapEntry (count Pips)))) (move (from) (to (trackSite Move steps:(mapEntry (count Pips))))) (if (and (not (if (= (trackSite Move steps:(mapEntry (count Pips))) 19) (or (is Line 2 W through:(trackSite Move steps:(mapEntry (count Pips)))) (is Line 2 N through:(trackSite Move steps:(mapEntry (count Pips))))) (if (= (trackSite Move steps:(mapEntry (count Pips))) 29) (or (is Line 2 W through:(trackSite Move steps:(mapEntry (count Pips)))) (is Line 2 S through:(trackSite Move steps:(mapEntry (count Pips))))) (if (= (trackSite Move steps:(mapEntry (count Pips))) 10) (or (is Line 2 E through:(trackSite Move steps:(mapEntry (count Pips)))) (is Line 2 S through:(trackSite Move steps:(mapEntry (count Pips))))) (if (= (trackSite Move steps:(mapEntry (count Pips))) 0) (or (is Line 2 E through:(trackSite Move steps:(mapEntry (count Pips)))) (is Line 2 N through:(trackSite Move steps:(mapEntry (count Pips))))) (or (is Line 2 W through:(trackSite Move steps:(mapEntry (count Pips)))) (is Line 2 E through:(trackSite Move steps:(mapEntry (count Pips)))))))))) (is Enemy (who at:(trackSite Move steps:(mapEntry (count Pips)))))) (move Swap Pieces (from) (trackSite Move steps:(mapEntry (count Pips)))))))}))})) (forEach Piece (or {(if (is In (from) (sites ""Neferu"")) (if (!= (trackSite Move ""TrackOpposite"" steps:(mapEntry (count Pips))) -1) (if (is Empty (trackSite Move ""TrackOpposite"" steps:(mapEntry (count Pips)))) (move (from) (to (trackSite Move ""TrackOpposite"" steps:(mapEntry (count Pips))))) (if (and (not (if (= (trackSite Move ""TrackOpposite"" steps:(mapEntry (count Pips))) 19) (or (is Line 2 W through:(trackSite Move ""TrackOpposite"" steps:(mapEntry (count Pips)))) (is Line 2 N through:(trackSite Move ""TrackOpposite"" steps:(mapEntry (count Pips))))) (if (= (trackSite Move ""TrackOpposite"" steps:(mapEntry (count Pips))) 29) (or (is Line 2 W through:(trackSite Move ""TrackOpposite"" steps:(mapEntry (count Pips)))) (is Line 2 S through:(trackSite Move ""TrackOpposite"" steps:(mapEntry (count Pips))))) (if (= (trackSite Move ""TrackOpposite"" steps:(mapEntry (count Pips))) 10) (or (is Line 2 E through:(trackSite Move ""TrackOpposite"" steps:(mapEntry (count Pips)))) (is Line 2 S through:(trackSite Move ""TrackOpposite"" steps:(mapEntry (count Pips))))) (if (= (trackSite Move ""TrackOpposite"" steps:(mapEntry (count Pips))) 0) (or (is Line 2 E through:(trackSite Move ""TrackOpposite"" steps:(mapEntry (count Pips)))) (is Line 2 N through:(trackSite Move ""TrackOpposite"" steps:(mapEntry (count Pips))))) (or (is Line 2 W through:(trackSite Move ""TrackOpposite"" steps:(mapEntry (count Pips)))) (is Line 2 E through:(trackSite Move ""TrackOpposite"" steps:(mapEntry (count Pips)))))))))) (is Enemy (who at:(trackSite Move ""TrackOpposite"" steps:(mapEntry (count Pips)))))) (move Swap Pieces (from) (trackSite Move ""TrackOpposite"" steps:(mapEntry (count Pips)))))))) (if (not (is In (from) (union {(sites ""Neferu"") (sites ""Water"") (sites ""Baw"") (sites ""Two Men"") (sites ""Horus"")}))) (if (!= (trackSite Move ""TrackOpposite"" steps:(mapEntry (count Pips))) -1) (if (is Empty (trackSite Move ""TrackOpposite"" steps:(mapEntry (count Pips)))) (move (from) (to (trackSite Move ""TrackOpposite"" steps:(mapEntry (count Pips))))) (if (and (not (if (= (trackSite Move ""TrackOpposite"" steps:(mapEntry (count Pips))) 19) (or (is Line 2 W through:(trackSite Move ""TrackOpposite"" steps:(mapEntry (count Pips)))) (is Line 2 N through:(trackSite Move ""TrackOpposite"" steps:(mapEntry (count Pips))))) (if (= (trackSite Move ""TrackOpposite"" steps:(mapEntry (count Pips))) 29) (or (is Line 2 W through:(trackSite Move ""TrackOpposite"" steps:(mapEntry (count Pips)))) (is Line 2 S through:(trackSite Move ""TrackOpposite"" steps:(mapEntry (count Pips))))) (if (= (trackSite Move ""TrackOpposite"" steps:(mapEntry (count Pips))) 10) (or (is Line 2 E through:(trackSite Move ""TrackOpposite"" steps:(mapEntry (count Pips)))) (is Line 2 S through:(trackSite Move ""TrackOpposite"" steps:(mapEntry (count Pips))))) (if (= (trackSite Move ""TrackOpposite"" steps:(mapEntry (count Pips))) 0) (or (is Line 2 E through:(trackSite Move ""TrackOpposite"" steps:(mapEntry (count Pips)))) (is Line 2 N through:(trackSite Move ""TrackOpposite"" steps:(mapEntry (count Pips))))) (or (is Line 2 W through:(trackSite Move ""TrackOpposite"" steps:(mapEntry (count Pips)))) (is Line 2 E through:(trackSite Move ""TrackOpposite"" steps:(mapEntry (count Pips)))))))))) (is Enemy (who at:(trackSite Move ""TrackOpposite"" steps:(mapEntry (count Pips)))))) (move Swap Pieces (from) (trackSite Move ""TrackOpposite"" steps:(mapEntry (count Pips))))))))}))} (then (if (is In (mapEntry (count Pips)) (sites {1 4 5})) (moveAgain)))))))) (if (and (= (state at:(coord ""F2"")) 1) (= 1 (count Sites in:(intersection (sites Occupied by:Mover) (sites ""Ankh Waset""))))) (priority {(if (is Empty (trackSite Move from:(coord ""F2"") steps:(mapEntry (count Pips)))) (move (from (coord ""F2"")) (to (trackSite Move from:(coord ""F2"") steps:(mapEntry (count Pips))))) (if (and (not (if (= (trackSite Move from:(coord ""F2"") steps:(mapEntry (count Pips))) 19) (or (is Line 2 W through:(trackSite Move from:(coord ""F2"") steps:(mapEntry (count Pips)))) (is Line 2 N through:(trackSite Move from:(coord ""F2"") steps:(mapEntry (count Pips))))) (if (= (trackSite Move from:(coord ""F2"") steps:(mapEntry (count Pips))) 29) (or (is Line 2 W through:(trackSite Move from:(coord ""F2"") steps:(mapEntry (count Pips)))) (is Line 2 S through:(trackSite Move from:(coord ""F2"") steps:(mapEntry (count Pips))))) (if (= (trackSite Move from:(coord ""F2"") steps:(mapEntry (count Pips))) 10) (or (is Line 2 E through:(trackSite Move from:(coord ""F2"") steps:(mapEntry (count Pips)))) (is Line 2 S through:(trackSite Move from:(coord ""F2"") steps:(mapEntry (count Pips))))) (if (= (trackSite Move from:(coord ""F2"") steps:(mapEntry (count Pips))) 0) (or (is Line 2 E through:(trackSite Move from:(coord ""F2"") steps:(mapEntry (count Pips)))) (is Line 2 N through:(trackSite Move from:(coord ""F2"") steps:(mapEntry (count Pips))))) (or (is Line 2 W through:(trackSite Move from:(coord ""F2"") steps:(mapEntry (count Pips)))) (is Line 2 E through:(trackSite Move from:(coord ""F2"") steps:(mapEntry (count Pips)))))))))) (is Enemy (who at:(trackSite Move from:(coord ""F2"") steps:(mapEntry (count Pips)))))) (move Swap Pieces (coord ""F2"") (trackSite Move from:(coord ""F2"") steps:(mapEntry (count Pips))))) (then (set State at:(last To) 0))) (if (is Empty (trackSite Move from:(coord ""F2"") ""TrackOpposite"" steps:(mapEntry (count Pips)))) (move (from (coord ""F2"")) (to (trackSite Move from:(coord ""F2"") ""TrackOpposite"" steps:(mapEntry (count Pips))))) (if (and (not (if (= (trackSite Move from:(coord ""F2"") ""TrackOpposite"" steps:(mapEntry (count Pips))) 19) (or (is Line 2 W through:(trackSite Move from:(coord ""F2"") ""TrackOpposite"" steps:(mapEntry (count Pips)))) (is Line 2 N through:(trackSite Move from:(coord ""F2"") ""TrackOpposite"" steps:(mapEntry (count Pips))))) (if (= (trackSite Move from:(coord ""F2"") ""TrackOpposite"" steps:(mapEntry (count Pips))) 29) (or (is Line 2 W through:(trackSite Move from:(coord ""F2"") ""TrackOpposite"" steps:(mapEntry (count Pips)))) (is Line 2 S through:(trackSite Move from:(coord ""F2"") ""TrackOpposite"" steps:(mapEntry (count Pips))))) (if (= (trackSite Move from:(coord ""F2"") ""TrackOpposite"" steps:(mapEntry (count Pips))) 10) (or (is Line 2 E through:(trackSite Move from:(coord ""F2"") ""TrackOpposite"" steps:(mapEntry (count Pips)))) (is Line 2 S through:(trackSite Move from:(coord ""F2"") ""TrackOpposite"" steps:(mapEntry (count Pips))))) (if (= (trackSite Move from:(coord ""F2"") ""TrackOpposite"" steps:(mapEntry (count Pips))) 0) (or (is Line 2 E through:(trackSite Move from:(coord ""F2"") ""TrackOpposite"" steps:(mapEntry (count Pips)))) (is Line 2 N through:(trackSite Move from:(coord ""F2"") ""TrackOpposite"" steps:(mapEntry (count Pips))))) (or (is Line 2 W through:(trackSite Move from:(coord ""F2"") ""TrackOpposite"" steps:(mapEntry (count Pips)))) (is Line 2 E through:(trackSite Move from:(coord ""F2"") ""TrackOpposite"" steps:(mapEntry (count Pips)))))))))) (is Enemy (who at:(trackSite Move from:(coord ""F2"") ""TrackOpposite"" steps:(mapEntry (count Pips)))))) (move Swap Pieces (coord ""F2"") (trackSite Move from:(coord ""F2"") ""TrackOpposite"" steps:(mapEntry (count Pips))))) (then (set State at:(last To) 0)))}) (if (= 1 (count Sites in:(intersection (sites Occupied by:Mover) (sites ""Water"")))) (if (= (mapEntry (count Pips)) 4) (move Remove (sites ""Water"")) (or (if (= 1 (count Sites in:(intersection (sites Empty) (sites ""Ankh Waset"")))) (move (from (sites ""Water"")) (to (sites ""Ankh Waset"")) (then (set State at:(last To) 1)))) (move Pass))) (if True (priority {(forEach Piece (or {(if (is In (from) (sites ""Neferu"")) (if (!= (trackSite Move steps:(mapEntry (count Pips))) -1) (if (= (trackSite Move steps:(mapEntry (count Pips))) -2) (move Remove (from)) (if (is Empty (trackSite Move steps:(mapEntry (count Pips)))) (move (from) (to (trackSite Move steps:(mapEntry (count Pips))))) (if (and (not (if (= (trackSite Move steps:(mapEntry (count Pips))) 19) (or (is Line 2 W through:(trackSite Move steps:(mapEntry (count Pips)))) (is Line 2 N through:(trackSite Move steps:(mapEntry (count Pips))))) (if (= (trackSite Move steps:(mapEntry (count Pips))) 29) (or (is Line 2 W through:(trackSite Move steps:(mapEntry (count Pips)))) (is Line 2 S through:(trackSite Move steps:(mapEntry (count Pips))))) (if (= (trackSite Move steps:(mapEntry (count Pips))) 10) (or (is Line 2 E through:(trackSite Move steps:(mapEntry (count Pips)))) (is Line 2 S through:(trackSite Move steps:(mapEntry (count Pips))))) (if (= (trackSite Move steps:(mapEntry (count Pips))) 0) (or (is Line 2 E through:(trackSite Move steps:(mapEntry (count Pips)))) (is Line 2 N through:(trackSite Move steps:(mapEntry (count Pips))))) (or (is Line 2 W through:(trackSite Move steps:(mapEntry (count Pips)))) (is Line 2 E through:(trackSite Move steps:(mapEntry (count Pips)))))))))) (is Enemy (who at:(trackSite Move steps:(mapEntry (count Pips)))))) (if (and (= 1 (count in:(intersection (sites Empty) (sites ""Water"")))) (is In (trackSite Move steps:(mapEntry (count Pips))) (union {(sites ""Baw"") (sites ""Two Men"") (sites ""Horus"")}))) (move Swap Pieces (from) (trackSite Move steps:(mapEntry (count Pips))) (then (fromTo (from (last From)) (to (trackSite Move from:(last From) steps:1))))))))))) (if (is In (from) (union {(sites ""Two Men"") (sites ""Baw"")})) (if (!= (trackSite Move steps:(mapEntry (count Pips))) -1) (if (= (trackSite Move steps:(mapEntry (count Pips))) -2) (move Remove (from))))) (if (is In (from) (sites ""Horus"")) (if (or (= (trackSite Move steps:(mapEntry (count Pips))) -2) (= (trackSite Move steps:(mapEntry (count Pips))) -1)) (move Remove (from)))) (if (not (is In (from) (union {(sites ""Neferu"") (sites ""Water"") (sites ""Baw"") (sites ""Two Men"") (sites ""Horus"")}))) (or {(if (not (or {(= (trackSite Move steps:(mapEntry (count Pips))) -2) (= (trackSite Move steps:(mapEntry (count Pips))) -1) (is In (trackSite Move steps:(mapEntry (count Pips))) (union {(sites ""Water"") (sites ""Baw"") (sites ""Two Men"") (sites ""Horus"")}))})) (if (is Empty (trackSite Move steps:(mapEntry (count Pips)))) (move (from) (to (trackSite Move steps:(mapEntry (count Pips))))) (if (and (not (if (= (trackSite Move steps:(mapEntry (count Pips))) 19) (or (is Line 2 W through:(trackSite Move steps:(mapEntry (count Pips)))) (is Line 2 N through:(trackSite Move steps:(mapEntry (count Pips))))) (if (= (trackSite Move steps:(mapEntry (count Pips))) 29) (or (is Line 2 W through:(trackSite Move steps:(mapEntry (count Pips)))) (is Line 2 S through:(trackSite Move steps:(mapEntry (count Pips))))) (if (= (trackSite Move steps:(mapEntry (count Pips))) 10) (or (is Line 2 E through:(trackSite Move steps:(mapEntry (count Pips)))) (is Line 2 S through:(trackSite Move steps:(mapEntry (count Pips))))) (if (= (trackSite Move steps:(mapEntry (count Pips))) 0) (or (is Line 2 E through:(trackSite Move steps:(mapEntry (count Pips)))) (is Line 2 N through:(trackSite Move steps:(mapEntry (count Pips))))) (or (is Line 2 W through:(trackSite Move steps:(mapEntry (count Pips)))) (is Line 2 E through:(trackSite Move steps:(mapEntry (count Pips)))))))))) (is Enemy (who at:(trackSite Move steps:(mapEntry (count Pips)))))) (move Swap Pieces (from) (trackSite Move steps:(mapEntry (count Pips)))))))}))})) (forEach Piece (or {(if (is In (from) (sites ""Neferu"")) (if (!= (trackSite Move ""TrackOpposite"" steps:(mapEntry (count Pips))) -1) (if (is Empty (trackSite Move ""TrackOpposite"" steps:(mapEntry (count Pips)))) (move (from) (to (trackSite Move ""TrackOpposite"" steps:(mapEntry (count Pips))))) (if (and (not (if (= (trackSite Move ""TrackOpposite"" steps:(mapEntry (count Pips))) 19) (or (is Line 2 W through:(trackSite Move ""TrackOpposite"" steps:(mapEntry (count Pips)))) (is Line 2 N through:(trackSite Move ""TrackOpposite"" steps:(mapEntry (count Pips))))) (if (= (trackSite Move ""TrackOpposite"" steps:(mapEntry (count Pips))) 29) (or (is Line 2 W through:(trackSite Move ""TrackOpposite"" steps:(mapEntry (count Pips)))) (is Line 2 S through:(trackSite Move ""TrackOpposite"" steps:(mapEntry (count Pips))))) (if (= (trackSite Move ""TrackOpposite"" steps:(mapEntry (count Pips))) 10) (or (is Line 2 E through:(trackSite Move ""TrackOpposite"" steps:(mapEntry (count Pips)))) (is Line 2 S through:(trackSite Move ""TrackOpposite"" steps:(mapEntry (count Pips))))) (if (= (trackSite Move ""TrackOpposite"" steps:(mapEntry (count Pips))) 0) (or (is Line 2 E through:(trackSite Move ""TrackOpposite"" steps:(mapEntry (count Pips)))) (is Line 2 N through:(trackSite Move ""TrackOpposite"" steps:(mapEntry (count Pips))))) (or (is Line 2 W through:(trackSite Move ""TrackOpposite"" steps:(mapEntry (count Pips)))) (is Line 2 E through:(trackSite Move ""TrackOpposite"" steps:(mapEntry (count Pips)))))))))) (is Enemy (who at:(trackSite Move ""TrackOpposite"" steps:(mapEntry (count Pips)))))) (move Swap Pieces (from) (trackSite Move ""TrackOpposite"" steps:(mapEntry (count Pips)))))))) (if (not (is In (from) (union {(sites ""Neferu"") (sites ""Water"") (sites ""Baw"") (sites ""Two Men"") (sites ""Horus"")}))) (if (!= (trackSite Move ""TrackOpposite"" steps:(mapEntry (count Pips))) -1) (if (is Empty (trackSite Move ""TrackOpposite"" steps:(mapEntry (count Pips)))) (move (from) (to (trackSite Move ""TrackOpposite"" steps:(mapEntry (count Pips))))) (if (and (not (if (= (trackSite Move ""TrackOpposite"" steps:(mapEntry (count Pips))) 19) (or (is Line 2 W through:(trackSite Move ""TrackOpposite"" steps:(mapEntry (count Pips)))) (is Line 2 N through:(trackSite Move ""TrackOpposite"" steps:(mapEntry (count Pips))))) (if (= (trackSite Move ""TrackOpposite"" steps:(mapEntry (count Pips))) 29) (or (is Line 2 W through:(trackSite Move ""TrackOpposite"" steps:(mapEntry (count Pips)))) (is Line 2 S through:(trackSite Move ""TrackOpposite"" steps:(mapEntry (count Pips))))) (if (= (trackSite Move ""TrackOpposite"" steps:(mapEntry (count Pips))) 10) (or (is Line 2 E through:(trackSite Move ""TrackOpposite"" steps:(mapEntry (count Pips)))) (is Line 2 S through:(trackSite Move ""TrackOpposite"" steps:(mapEntry (count Pips))))) (if (= (trackSite Move ""TrackOpposite"" steps:(mapEntry (count Pips))) 0) (or (is Line 2 E through:(trackSite Move ""TrackOpposite"" steps:(mapEntry (count Pips)))) (is Line 2 N through:(trackSite Move ""TrackOpposite"" steps:(mapEntry (count Pips))))) (or (is Line 2 W through:(trackSite Move ""TrackOpposite"" steps:(mapEntry (count Pips)))) (is Line 2 E through:(trackSite Move ""TrackOpposite"" steps:(mapEntry (count Pips)))))))))) (is Enemy (who at:(trackSite Move ""TrackOpposite"" steps:(mapEntry (count Pips)))))) (move Swap Pieces (from) (trackSite Move ""TrackOpposite"" steps:(mapEntry (count Pips))))))))}))} (then (if (is In (mapEntry (count Pips)) (sites {1 4 5})) (moveAgain))))))) (move Pass (then (if (is In (mapEntry (count Pips)) (sites {1 4 5})) (moveAgain))))))))} (end (if (no Pieces Mover) (result Mover Win)))))","###Description -Seven pieces per player, which begin on the board, alternating spaces from white to black along the track. Four throwing sticks, marked on one side and blank on the other, used as dice. The values of the throws are equal to the number of blank sides up, when no blank sides are up the throw = 5. Throws of 1, 4, and 5 grant the player another throw. All throws are made before moving, and a piece must move the full value of one throw at a time. Players alternate turns throwing the sticks, and the first one to throw 1 plays as white and moves the white piece in front. When a piece lands on a space occupied by the opponent's piece, the opponent's piece is sent back to the space where the piece that captured it moved from. When a player has two or more pieces in consecutive spaces, these pieces cannot be sent backward in this way. If a player cannot use a throw to move a piece forward, it must be used to move a piece backward. If a backward move makes a player's piece land on a space occupied by a piece belonging to the opponent, the opponent's piece is sent to the place where the player's move began. If a player cannot move, the turn ends. Spaces 26-30 provide special rules allowing the player to bear off. To move beyond square 26, the player must first land on it with an exact throw. From there, the player may: bear off with a throw of 5; move to square 30 with a throw of 4 and bear off on any subsequent throw; move to square 29 with a throw of 3, but it must stay there until borne off with a throw of 2; move to square 28 with a throw of 2, but it must stay there until borne off with a throw of 3. Pieces in squares 28 and 29 are never required to move backward and bearing off is not required from any space. When a player lands on squares 28-30 and an opponent's piece is already there, the opponent's piece is sent to square 27 instead of 26. When a piece is in square 27, whether by being sent there as described above or by being forced to use a throw of 1 to move into square 27, the player may either move the piece back to square 15 and lose one turn, or may leave the piece in square 27 until a 4 is thrown, bearing the piece off. A player cannot move any other piece on the board when one remains in square 27 or 15 after being sent back to it, and pieces which normally would be protected from bring sent back because they are next to each other may now be sent back. Pieces in squares 28-30 are safe as long as a piece is in square 27. The player in square 27 may decide to give up trying to throw a 4 on any turn and move this piece back to square 15 and lose their next turn. The first player to successfully bear off all their pieces wins. The track is a boustrophedon track with backward track. Four D2. The value of the throw is equal to the sum except when the sum is 0 the throw = 5. The rules of Kendall. - -###Ludii -(game ""Senet"" (players 2) (equipment {(board (rectangle 3 10) {(track ""Track1"" ""20,E,S1,W,S1,E,End"" P1 directed:True) (track ""Track2"" ""20,E,S1,W,S1,E,End"" P2 directed:True) (track ""TrackOpposite1"" ""9,W,N1,E,N1,W"" P1 directed:True) (track ""TrackOpposite2"" ""9,W,N1,E,N1,W"" P2 directed:True)}) (dice d:2 from:0 num:4) (map {(pair 0 5) (pair 1 1) (pair 2 2) (pair 3 3) (pair 4 4)}) (regions ""Symbols"" (sites {""F2"" ""F1"" ""G1"" ""H1"" ""I1""})) (regions ""Ankh Waset"" (sites {""F2""})) (regions ""Neferu"" (sites {""F1""})) (regions ""Water"" (sites {""G1""})) (regions ""Baw"" (sites {""H1""})) (regions ""Two Men"" (sites {""I1""})) (regions ""Horus"" (sites {""J1""})) (regions ""TopRow"" (sites Top)) (regions ""MiddleRow"" (difference (expand (sites Top)) (sites Top))) (regions ""BottomRow"" (sites Bottom)) (piece ""SenetPiece"" Each) (hand Each)}) (rules (start {(place ""SenetPiece1"" (sites {""B3"" ""D3"" ""F3"" ""H3"" ""J3"" ""I2"" ""G2""})) (place ""SenetPiece2"" (sites {""A3"" ""C3"" ""E3"" ""G3"" ""I3"" ""J2"" ""H2""}))}) phases:{(phase ""Opening"" (play (do (roll) next:(move Pass (then (if (= 1 (mapEntry (count Pips))) (and {(fromTo (from (coord ""G2"")) (to (coord ""F2""))) (if (is Mover P2) (swap Players P1 P2)) (set NextPlayer (player 1))})))))) (nextPhase (= 1 (count Pips)) ""Playing"")) (phase ""Playing"" (play (do (roll) next:(if (can Move (if (and (= (state at:(coord ""F2"")) 1) (= 1 (count Sites in:(intersection (sites Occupied by:Mover) (sites ""Ankh Waset""))))) (priority {(if (is Empty (trackSite Move from:(coord ""F2"") steps:(mapEntry (count Pips)))) (move (from (coord ""F2"")) (to (trackSite Move from:(coord ""F2"") steps:(mapEntry (count Pips))))) (if (and (not (if (= (trackSite Move from:(coord ""F2"") steps:(mapEntry (count Pips))) 19) (or (is Line 2 W through:(trackSite Move from:(coord ""F2"") steps:(mapEntry (count Pips)))) (is Line 2 N through:(trackSite Move from:(coord ""F2"") steps:(mapEntry (count Pips))))) (if (= (trackSite Move from:(coord ""F2"") steps:(mapEntry (count Pips))) 29) (or (is Line 2 W through:(trackSite Move from:(coord ""F2"") steps:(mapEntry (count Pips)))) (is Line 2 S through:(trackSite Move from:(coord ""F2"") steps:(mapEntry (count Pips))))) (if (= (trackSite Move from:(coord ""F2"") steps:(mapEntry (count Pips))) 10) (or (is Line 2 E through:(trackSite Move from:(coord ""F2"") steps:(mapEntry (count Pips)))) (is Line 2 S through:(trackSite Move from:(coord ""F2"") steps:(mapEntry (count Pips))))) (if (= (trackSite Move from:(coord ""F2"") steps:(mapEntry (count Pips))) 0) (or (is Line 2 E through:(trackSite Move from:(coord ""F2"") steps:(mapEntry (count Pips)))) (is Line 2 N through:(trackSite Move from:(coord ""F2"") steps:(mapEntry (count Pips))))) (or (is Line 2 W through:(trackSite Move from:(coord ""F2"") steps:(mapEntry (count Pips)))) (is Line 2 E through:(trackSite Move from:(coord ""F2"") steps:(mapEntry (count Pips)))))))))) (is Enemy (who at:(trackSite Move from:(coord ""F2"") steps:(mapEntry (count Pips)))))) (move Swap Pieces (coord ""F2"") (trackSite Move from:(coord ""F2"") steps:(mapEntry (count Pips))))) (then (set State at:(last To) 0))) (if (is Empty (trackSite Move from:(coord ""F2"") ""TrackOpposite"" steps:(mapEntry (count Pips)))) (move (from (coord ""F2"")) (to (trackSite Move from:(coord ""F2"") ""TrackOpposite"" steps:(mapEntry (count Pips))))) (if (and (not (if (= (trackSite Move from:(coord ""F2"") ""TrackOpposite"" steps:(mapEntry (count Pips))) 19) (or (is Line 2 W through:(trackSite Move from:(coord ""F2"") ""TrackOpposite"" steps:(mapEntry (count Pips)))) (is Line 2 N through:(trackSite Move from:(coord ""F2"") ""TrackOpposite"" steps:(mapEntry (count Pips))))) (if (= (trackSite Move from:(coord ""F2"") ""TrackOpposite"" steps:(mapEntry (count Pips))) 29) (or (is Line 2 W through:(trackSite Move from:(coord ""F2"") ""TrackOpposite"" steps:(mapEntry (count Pips)))) (is Line 2 S through:(trackSite Move from:(coord ""F2"") ""TrackOpposite"" steps:(mapEntry (count Pips))))) (if (= (trackSite Move from:(coord ""F2"") ""TrackOpposite"" steps:(mapEntry (count Pips))) 10) (or (is Line 2 E through:(trackSite Move from:(coord ""F2"") ""TrackOpposite"" steps:(mapEntry (count Pips)))) (is Line 2 S through:(trackSite Move from:(coord ""F2"") ""TrackOpposite"" steps:(mapEntry (count Pips))))) (if (= (trackSite Move from:(coord ""F2"") ""TrackOpposite"" steps:(mapEntry (count Pips))) 0) (or (is Line 2 E through:(trackSite Move from:(coord ""F2"") ""TrackOpposite"" steps:(mapEntry (count Pips)))) (is Line 2 N through:(trackSite Move from:(coord ""F2"") ""TrackOpposite"" steps:(mapEntry (count Pips))))) (or (is Line 2 W through:(trackSite Move from:(coord ""F2"") ""TrackOpposite"" steps:(mapEntry (count Pips)))) (is Line 2 E through:(trackSite Move from:(coord ""F2"") ""TrackOpposite"" steps:(mapEntry (count Pips)))))))))) (is Enemy (who at:(trackSite Move from:(coord ""F2"") ""TrackOpposite"" steps:(mapEntry (count Pips)))))) (move Swap Pieces (coord ""F2"") (trackSite Move from:(coord ""F2"") ""TrackOpposite"" steps:(mapEntry (count Pips))))) (then (set State at:(last To) 0)))}) (if (= 1 (count Sites in:(intersection (sites Occupied by:Mover) (sites ""Water"")))) (if (= (mapEntry (count Pips)) 4) (move Remove (sites ""Water"")) (or (if (= 1 (count Sites in:(intersection (sites Empty) (sites ""Ankh Waset"")))) (move (from (sites ""Water"")) (to (sites ""Ankh Waset"")) (then (set State at:(last To) 1)))) (move Pass))) (if True (priority {(forEach Piece (or {(if (is In (from) (sites ""Neferu"")) (if (!= (trackSite Move steps:(mapEntry (count Pips))) -1) (if (= (trackSite Move steps:(mapEntry (count Pips))) -2) (move Remove (from)) (if (is Empty (trackSite Move steps:(mapEntry (count Pips)))) (move (from) (to (trackSite Move steps:(mapEntry (count Pips))))) (if (and (not (if (= (trackSite Move steps:(mapEntry (count Pips))) 19) (or (is Line 2 W through:(trackSite Move steps:(mapEntry (count Pips)))) (is Line 2 N through:(trackSite Move steps:(mapEntry (count Pips))))) (if (= (trackSite Move steps:(mapEntry (count Pips))) 29) (or (is Line 2 W through:(trackSite Move steps:(mapEntry (count Pips)))) (is Line 2 S through:(trackSite Move steps:(mapEntry (count Pips))))) (if (= (trackSite Move steps:(mapEntry (count Pips))) 10) (or (is Line 2 E through:(trackSite Move steps:(mapEntry (count Pips)))) (is Line 2 S through:(trackSite Move steps:(mapEntry (count Pips))))) (if (= (trackSite Move steps:(mapEntry (count Pips))) 0) (or (is Line 2 E through:(trackSite Move steps:(mapEntry (count Pips)))) (is Line 2 N through:(trackSite Move steps:(mapEntry (count Pips))))) (or (is Line 2 W through:(trackSite Move steps:(mapEntry (count Pips)))) (is Line 2 E through:(trackSite Move steps:(mapEntry (count Pips)))))))))) (is Enemy (who at:(trackSite Move steps:(mapEntry (count Pips)))))) (if (and (= 1 (count in:(intersection (sites Empty) (sites ""Water"")))) (is In (trackSite Move steps:(mapEntry (count Pips))) (union {(sites ""Baw"") (sites ""Two Men"") (sites ""Horus"")}))) (move Swap Pieces (from) (trackSite Move steps:(mapEntry (count Pips))) (then (fromTo (from (last From)) (to (trackSite Move from:(last From) steps:1))))))))))) (if (is In (from) (union {(sites ""Two Men"") (sites ""Baw"")})) (if (!= (trackSite Move steps:(mapEntry (count Pips))) -1) (if (= (trackSite Move steps:(mapEntry (count Pips))) -2) (move Remove (from))))) (if (is In (from) (sites ""Horus"")) (if (or (= (trackSite Move steps:(mapEntry (count Pips))) -2) (= (trackSite Move steps:(mapEntry (count Pips))) -1)) (move Remove (from)))) (if (not (is In (from) (union {(sites ""Neferu"") (sites ""Water"") (sites ""Baw"") (sites ""Two Men"") (sites ""Horus"")}))) (or {(if (not (or {(= (trackSite Move steps:(mapEntry (count Pips))) -2) (= (trackSite Move steps:(mapEntry (count Pips))) -1) (is In (trackSite Move steps:(mapEntry (count Pips))) (union {(sites ""Water"") (sites ""Baw"") (sites ""Two Men"") (sites ""Horus"")}))})) (if (is Empty (trackSite Move steps:(mapEntry (count Pips)))) (move (from) (to (trackSite Move steps:(mapEntry (count Pips))))) (if (and (not (if (= (trackSite Move steps:(mapEntry (count Pips))) 19) (or (is Line 2 W through:(trackSite Move steps:(mapEntry (count Pips)))) (is Line 2 N through:(trackSite Move steps:(mapEntry (count Pips))))) (if (= (trackSite Move steps:(mapEntry (count Pips))) 29) (or (is Line 2 W through:(trackSite Move steps:(mapEntry (count Pips)))) (is Line 2 S through:(trackSite Move steps:(mapEntry (count Pips))))) (if (= (trackSite Move steps:(mapEntry (count Pips))) 10) (or (is Line 2 E through:(trackSite Move steps:(mapEntry (count Pips)))) (is Line 2 S through:(trackSite Move steps:(mapEntry (count Pips))))) (if (= (trackSite Move steps:(mapEntry (count Pips))) 0) (or (is Line 2 E through:(trackSite Move steps:(mapEntry (count Pips)))) (is Line 2 N through:(trackSite Move steps:(mapEntry (count Pips))))) (or (is Line 2 W through:(trackSite Move steps:(mapEntry (count Pips)))) (is Line 2 E through:(trackSite Move steps:(mapEntry (count Pips)))))))))) (is Enemy (who at:(trackSite Move steps:(mapEntry (count Pips)))))) (move Swap Pieces (from) (trackSite Move steps:(mapEntry (count Pips)))))))}))})) (forEach Piece (or {(if (is In (from) (sites ""Neferu"")) (if (!= (trackSite Move ""TrackOpposite"" steps:(mapEntry (count Pips))) -1) (if (is Empty (trackSite Move ""TrackOpposite"" steps:(mapEntry (count Pips)))) (move (from) (to (trackSite Move ""TrackOpposite"" steps:(mapEntry (count Pips))))) (if (and (not (if (= (trackSite Move ""TrackOpposite"" steps:(mapEntry (count Pips))) 19) (or (is Line 2 W through:(trackSite Move ""TrackOpposite"" steps:(mapEntry (count Pips)))) (is Line 2 N through:(trackSite Move ""TrackOpposite"" steps:(mapEntry (count Pips))))) (if (= (trackSite Move ""TrackOpposite"" steps:(mapEntry (count Pips))) 29) (or (is Line 2 W through:(trackSite Move ""TrackOpposite"" steps:(mapEntry (count Pips)))) (is Line 2 S through:(trackSite Move ""TrackOpposite"" steps:(mapEntry (count Pips))))) (if (= (trackSite Move ""TrackOpposite"" steps:(mapEntry (count Pips))) 10) (or (is Line 2 E through:(trackSite Move ""TrackOpposite"" steps:(mapEntry (count Pips)))) (is Line 2 S through:(trackSite Move ""TrackOpposite"" steps:(mapEntry (count Pips))))) (if (= (trackSite Move ""TrackOpposite"" steps:(mapEntry (count Pips))) 0) (or (is Line 2 E through:(trackSite Move ""TrackOpposite"" steps:(mapEntry (count Pips)))) (is Line 2 N through:(trackSite Move ""TrackOpposite"" steps:(mapEntry (count Pips))))) (or (is Line 2 W through:(trackSite Move ""TrackOpposite"" steps:(mapEntry (count Pips)))) (is Line 2 E through:(trackSite Move ""TrackOpposite"" steps:(mapEntry (count Pips)))))))))) (is Enemy (who at:(trackSite Move ""TrackOpposite"" steps:(mapEntry (count Pips)))))) (move Swap Pieces (from) (trackSite Move ""TrackOpposite"" steps:(mapEntry (count Pips)))))))) (if (not (is In (from) (union {(sites ""Neferu"") (sites ""Water"") (sites ""Baw"") (sites ""Two Men"") (sites ""Horus"")}))) (if (!= (trackSite Move ""TrackOpposite"" steps:(mapEntry (count Pips))) -1) (if (is Empty (trackSite Move ""TrackOpposite"" steps:(mapEntry (count Pips)))) (move (from) (to (trackSite Move ""TrackOpposite"" steps:(mapEntry (count Pips))))) (if (and (not (if (= (trackSite Move ""TrackOpposite"" steps:(mapEntry (count Pips))) 19) (or (is Line 2 W through:(trackSite Move ""TrackOpposite"" steps:(mapEntry (count Pips)))) (is Line 2 N through:(trackSite Move ""TrackOpposite"" steps:(mapEntry (count Pips))))) (if (= (trackSite Move ""TrackOpposite"" steps:(mapEntry (count Pips))) 29) (or (is Line 2 W through:(trackSite Move ""TrackOpposite"" steps:(mapEntry (count Pips)))) (is Line 2 S through:(trackSite Move ""TrackOpposite"" steps:(mapEntry (count Pips))))) (if (= (trackSite Move ""TrackOpposite"" steps:(mapEntry (count Pips))) 10) (or (is Line 2 E through:(trackSite Move ""TrackOpposite"" steps:(mapEntry (count Pips)))) (is Line 2 S through:(trackSite Move ""TrackOpposite"" steps:(mapEntry (count Pips))))) (if (= (trackSite Move ""TrackOpposite"" steps:(mapEntry (count Pips))) 0) (or (is Line 2 E through:(trackSite Move ""TrackOpposite"" steps:(mapEntry (count Pips)))) (is Line 2 N through:(trackSite Move ""TrackOpposite"" steps:(mapEntry (count Pips))))) (or (is Line 2 W through:(trackSite Move ""TrackOpposite"" steps:(mapEntry (count Pips)))) (is Line 2 E through:(trackSite Move ""TrackOpposite"" steps:(mapEntry (count Pips)))))))))) (is Enemy (who at:(trackSite Move ""TrackOpposite"" steps:(mapEntry (count Pips)))))) (move Swap Pieces (from) (trackSite Move ""TrackOpposite"" steps:(mapEntry (count Pips))))))))}))} (then (if (is In (mapEntry (count Pips)) (sites {1 4 5})) (moveAgain)))))))) (if (and (= (state at:(coord ""F2"")) 1) (= 1 (count Sites in:(intersection (sites Occupied by:Mover) (sites ""Ankh Waset""))))) (priority {(if (is Empty (trackSite Move from:(coord ""F2"") steps:(mapEntry (count Pips)))) (move (from (coord ""F2"")) (to (trackSite Move from:(coord ""F2"") steps:(mapEntry (count Pips))))) (if (and (not (if (= (trackSite Move from:(coord ""F2"") steps:(mapEntry (count Pips))) 19) (or (is Line 2 W through:(trackSite Move from:(coord ""F2"") steps:(mapEntry (count Pips)))) (is Line 2 N through:(trackSite Move from:(coord ""F2"") steps:(mapEntry (count Pips))))) (if (= (trackSite Move from:(coord ""F2"") steps:(mapEntry (count Pips))) 29) (or (is Line 2 W through:(trackSite Move from:(coord ""F2"") steps:(mapEntry (count Pips)))) (is Line 2 S through:(trackSite Move from:(coord ""F2"") steps:(mapEntry (count Pips))))) (if (= (trackSite Move from:(coord ""F2"") steps:(mapEntry (count Pips))) 10) (or (is Line 2 E through:(trackSite Move from:(coord ""F2"") steps:(mapEntry (count Pips)))) (is Line 2 S through:(trackSite Move from:(coord ""F2"") steps:(mapEntry (count Pips))))) (if (= (trackSite Move from:(coord ""F2"") steps:(mapEntry (count Pips))) 0) (or (is Line 2 E through:(trackSite Move from:(coord ""F2"") steps:(mapEntry (count Pips)))) (is Line 2 N through:(trackSite Move from:(coord ""F2"") steps:(mapEntry (count Pips))))) (or (is Line 2 W through:(trackSite Move from:(coord ""F2"") steps:(mapEntry (count Pips)))) (is Line 2 E through:(trackSite Move from:(coord ""F2"") steps:(mapEntry (count Pips)))))))))) (is Enemy (who at:(trackSite Move from:(coord ""F2"") steps:(mapEntry (count Pips)))))) (move Swap Pieces (coord ""F2"") (trackSite Move from:(coord ""F2"") steps:(mapEntry (count Pips))))) (then (set State at:(last To) 0))) (if (is Empty (trackSite Move from:(coord ""F2"") ""TrackOpposite"" steps:(mapEntry (count Pips)))) (move (from (coord ""F2"")) (to (trackSite Move from:(coord ""F2"") ""TrackOpposite"" steps:(mapEntry (count Pips))))) (if (and (not (if (= (trackSite Move from:(coord ""F2"") ""TrackOpposite"" steps:(mapEntry (count Pips))) 19) (or (is Line 2 W through:(trackSite Move from:(coord ""F2"") ""TrackOpposite"" steps:(mapEntry (count Pips)))) (is Line 2 N through:(trackSite Move from:(coord ""F2"") ""TrackOpposite"" steps:(mapEntry (count Pips))))) (if (= (trackSite Move from:(coord ""F2"") ""TrackOpposite"" steps:(mapEntry (count Pips))) 29) (or (is Line 2 W through:(trackSite Move from:(coord ""F2"") ""TrackOpposite"" steps:(mapEntry (count Pips)))) (is Line 2 S through:(trackSite Move from:(coord ""F2"") ""TrackOpposite"" steps:(mapEntry (count Pips))))) (if (= (trackSite Move from:(coord ""F2"") ""TrackOpposite"" steps:(mapEntry (count Pips))) 10) (or (is Line 2 E through:(trackSite Move from:(coord ""F2"") ""TrackOpposite"" steps:(mapEntry (count Pips)))) (is Line 2 S through:(trackSite Move from:(coord ""F2"") ""TrackOpposite"" steps:(mapEntry (count Pips))))) (if (= (trackSite Move from:(coord ""F2"") ""TrackOpposite"" steps:(mapEntry (count Pips))) 0) (or (is Line 2 E through:(trackSite Move from:(coord ""F2"") ""TrackOpposite"" steps:(mapEntry (count Pips)))) (is Line 2 N through:(trackSite Move from:(coord ""F2"") ""TrackOpposite"" steps:(mapEntry (count Pips))))) (or (is Line 2 W through:(trackSite Move from:(coord ""F2"") ""TrackOpposite"" steps:(mapEntry (count Pips)))) (is Line 2 E through:(trackSite Move from:(coord ""F2"") ""TrackOpposite"" steps:(mapEntry (count Pips)))))))))) (is Enemy (who at:(trackSite Move from:(coord ""F2"") ""TrackOpposite"" steps:(mapEntry (count Pips)))))) (move Swap Pieces (coord ""F2"") (trackSite Move from:(coord ""F2"") ""TrackOpposite"" steps:(mapEntry (count Pips))))) (then (set State at:(last To) 0)))}) (if (= 1 (count Sites in:(intersection (sites Occupied by:Mover) (sites ""Water"")))) (if (= (mapEntry (count Pips)) 4) (move Remove (sites ""Water"")) (or (if (= 1 (count Sites in:(intersection (sites Empty) (sites ""Ankh Waset"")))) (move (from (sites ""Water"")) (to (sites ""Ankh Waset"")) (then (set State at:(last To) 1)))) (move Pass))) (if True (priority {(forEach Piece (or {(if (is In (from) (sites ""Neferu"")) (if (!= (trackSite Move steps:(mapEntry (count Pips))) -1) (if (= (trackSite Move steps:(mapEntry (count Pips))) -2) (move Remove (from)) (if (is Empty (trackSite Move steps:(mapEntry (count Pips)))) (move (from) (to (trackSite Move steps:(mapEntry (count Pips))))) (if (and (not (if (= (trackSite Move steps:(mapEntry (count Pips))) 19) (or (is Line 2 W through:(trackSite Move steps:(mapEntry (count Pips)))) (is Line 2 N through:(trackSite Move steps:(mapEntry (count Pips))))) (if (= (trackSite Move steps:(mapEntry (count Pips))) 29) (or (is Line 2 W through:(trackSite Move steps:(mapEntry (count Pips)))) (is Line 2 S through:(trackSite Move steps:(mapEntry (count Pips))))) (if (= (trackSite Move steps:(mapEntry (count Pips))) 10) (or (is Line 2 E through:(trackSite Move steps:(mapEntry (count Pips)))) (is Line 2 S through:(trackSite Move steps:(mapEntry (count Pips))))) (if (= (trackSite Move steps:(mapEntry (count Pips))) 0) (or (is Line 2 E through:(trackSite Move steps:(mapEntry (count Pips)))) (is Line 2 N through:(trackSite Move steps:(mapEntry (count Pips))))) (or (is Line 2 W through:(trackSite Move steps:(mapEntry (count Pips)))) (is Line 2 E through:(trackSite Move steps:(mapEntry (count Pips)))))))))) (is Enemy (who at:(trackSite Move steps:(mapEntry (count Pips)))))) (if (and (= 1 (count in:(intersection (sites Empty) (sites ""Water"")))) (is In (trackSite Move steps:(mapEntry (count Pips))) (union {(sites ""Baw"") (sites ""Two Men"") (sites ""Horus"")}))) (move Swap Pieces (from) (trackSite Move steps:(mapEntry (count Pips))) (then (fromTo (from (last From)) (to (trackSite Move from:(last From) steps:1))))))))))) (if (is In (from) (union {(sites ""Two Men"") (sites ""Baw"")})) (if (!= (trackSite Move steps:(mapEntry (count Pips))) -1) (if (= (trackSite Move steps:(mapEntry (count Pips))) -2) (move Remove (from))))) (if (is In (from) (sites ""Horus"")) (if (or (= (trackSite Move steps:(mapEntry (count Pips))) -2) (= (trackSite Move steps:(mapEntry (count Pips))) -1)) (move Remove (from)))) (if (not (is In (from) (union {(sites ""Neferu"") (sites ""Water"") (sites ""Baw"") (sites ""Two Men"") (sites ""Horus"")}))) (or {(if (not (or {(= (trackSite Move steps:(mapEntry (count Pips))) -2) (= (trackSite Move steps:(mapEntry (count Pips))) -1) (is In (trackSite Move steps:(mapEntry (count Pips))) (union {(sites ""Water"") (sites ""Baw"") (sites ""Two Men"") (sites ""Horus"")}))})) (if (is Empty (trackSite Move steps:(mapEntry (count Pips)))) (move (from) (to (trackSite Move steps:(mapEntry (count Pips))))) (if (and (not (if (= (trackSite Move steps:(mapEntry (count Pips))) 19) (or (is Line 2 W through:(trackSite Move steps:(mapEntry (count Pips)))) (is Line 2 N through:(trackSite Move steps:(mapEntry (count Pips))))) (if (= (trackSite Move steps:(mapEntry (count Pips))) 29) (or (is Line 2 W through:(trackSite Move steps:(mapEntry (count Pips)))) (is Line 2 S through:(trackSite Move steps:(mapEntry (count Pips))))) (if (= (trackSite Move steps:(mapEntry (count Pips))) 10) (or (is Line 2 E through:(trackSite Move steps:(mapEntry (count Pips)))) (is Line 2 S through:(trackSite Move steps:(mapEntry (count Pips))))) (if (= (trackSite Move steps:(mapEntry (count Pips))) 0) (or (is Line 2 E through:(trackSite Move steps:(mapEntry (count Pips)))) (is Line 2 N through:(trackSite Move steps:(mapEntry (count Pips))))) (or (is Line 2 W through:(trackSite Move steps:(mapEntry (count Pips)))) (is Line 2 E through:(trackSite Move steps:(mapEntry (count Pips)))))))))) (is Enemy (who at:(trackSite Move steps:(mapEntry (count Pips)))))) (move Swap Pieces (from) (trackSite Move steps:(mapEntry (count Pips)))))))}))})) (forEach Piece (or {(if (is In (from) (sites ""Neferu"")) (if (!= (trackSite Move ""TrackOpposite"" steps:(mapEntry (count Pips))) -1) (if (is Empty (trackSite Move ""TrackOpposite"" steps:(mapEntry (count Pips)))) (move (from) (to (trackSite Move ""TrackOpposite"" steps:(mapEntry (count Pips))))) (if (and (not (if (= (trackSite Move ""TrackOpposite"" steps:(mapEntry (count Pips))) 19) (or (is Line 2 W through:(trackSite Move ""TrackOpposite"" steps:(mapEntry (count Pips)))) (is Line 2 N through:(trackSite Move ""TrackOpposite"" steps:(mapEntry (count Pips))))) (if (= (trackSite Move ""TrackOpposite"" steps:(mapEntry (count Pips))) 29) (or (is Line 2 W through:(trackSite Move ""TrackOpposite"" steps:(mapEntry (count Pips)))) (is Line 2 S through:(trackSite Move ""TrackOpposite"" steps:(mapEntry (count Pips))))) (if (= (trackSite Move ""TrackOpposite"" steps:(mapEntry (count Pips))) 10) (or (is Line 2 E through:(trackSite Move ""TrackOpposite"" steps:(mapEntry (count Pips)))) (is Line 2 S through:(trackSite Move ""TrackOpposite"" steps:(mapEntry (count Pips))))) (if (= (trackSite Move ""TrackOpposite"" steps:(mapEntry (count Pips))) 0) (or (is Line 2 E through:(trackSite Move ""TrackOpposite"" steps:(mapEntry (count Pips)))) (is Line 2 N through:(trackSite Move ""TrackOpposite"" steps:(mapEntry (count Pips))))) (or (is Line 2 W through:(trackSite Move ""TrackOpposite"" steps:(mapEntry (count Pips)))) (is Line 2 E through:(trackSite Move ""TrackOpposite"" steps:(mapEntry (count Pips)))))))))) (is Enemy (who at:(trackSite Move ""TrackOpposite"" steps:(mapEntry (count Pips)))))) (move Swap Pieces (from) (trackSite Move ""TrackOpposite"" steps:(mapEntry (count Pips)))))))) (if (not (is In (from) (union {(sites ""Neferu"") (sites ""Water"") (sites ""Baw"") (sites ""Two Men"") (sites ""Horus"")}))) (if (!= (trackSite Move ""TrackOpposite"" steps:(mapEntry (count Pips))) -1) (if (is Empty (trackSite Move ""TrackOpposite"" steps:(mapEntry (count Pips)))) (move (from) (to (trackSite Move ""TrackOpposite"" steps:(mapEntry (count Pips))))) (if (and (not (if (= (trackSite Move ""TrackOpposite"" steps:(mapEntry (count Pips))) 19) (or (is Line 2 W through:(trackSite Move ""TrackOpposite"" steps:(mapEntry (count Pips)))) (is Line 2 N through:(trackSite Move ""TrackOpposite"" steps:(mapEntry (count Pips))))) (if (= (trackSite Move ""TrackOpposite"" steps:(mapEntry (count Pips))) 29) (or (is Line 2 W through:(trackSite Move ""TrackOpposite"" steps:(mapEntry (count Pips)))) (is Line 2 S through:(trackSite Move ""TrackOpposite"" steps:(mapEntry (count Pips))))) (if (= (trackSite Move ""TrackOpposite"" steps:(mapEntry (count Pips))) 10) (or (is Line 2 E through:(trackSite Move ""TrackOpposite"" steps:(mapEntry (count Pips)))) (is Line 2 S through:(trackSite Move ""TrackOpposite"" steps:(mapEntry (count Pips))))) (if (= (trackSite Move ""TrackOpposite"" steps:(mapEntry (count Pips))) 0) (or (is Line 2 E through:(trackSite Move ""TrackOpposite"" steps:(mapEntry (count Pips)))) (is Line 2 N through:(trackSite Move ""TrackOpposite"" steps:(mapEntry (count Pips))))) (or (is Line 2 W through:(trackSite Move ""TrackOpposite"" steps:(mapEntry (count Pips)))) (is Line 2 E through:(trackSite Move ""TrackOpposite"" steps:(mapEntry (count Pips)))))))))) (is Enemy (who at:(trackSite Move ""TrackOpposite"" steps:(mapEntry (count Pips)))))) (move Swap Pieces (from) (trackSite Move ""TrackOpposite"" steps:(mapEntry (count Pips))))))))}))} (then (if (is In (mapEntry (count Pips)) (sites {1 4 5})) (moveAgain))))))) (move Pass (then (if (is In (mapEntry (count Pips)) (sites {1 4 5})) (moveAgain))))))))} (end (if (no Pieces Mover) (result Mover Win)))))" "2x12 board, divided in half. Spaces on each side take the form of semi-circular sockets, into which the pieces fit. Fifteen pieces per player. Three six-sided dice. Players move according to the number on each die by moving one piece the value on one die then another piece the value on the other die, or by moving one piece the value of one die and then the value of the other. Both players begin in the same quadrant of the board. One player's pieces are arranged as follows: Eight on the first point of the quadrant to their left, four on the fifth, and three on the sixth. The other player places five on the second, third, and fourth space of the same quadrant. The track proceeds in a clockwise direction around the board. When a player's piece lands on a space occupied by a single piece of the opponent, it is sent back to the beginning of the quadrant to the right of the starting quadrant. Pieces bear off from the quadrant diagonal from the starting quadrant. The first player to bear off all their pieces wins.","(game ""Seys Dos y As"" (players 2) (equipment {(board (merge {(rectangle 1 6) (shift 7 0 (rectangle 1 6)) (shift 0 6 (rectangle 1 6)) (shift 7 6 (rectangle 1 6))}) {(track ""Track1"" {24 11 10 9 8 7 6 5 4 3 2 1 0 12 13 14 15 16 17} P1 directed:True) (track ""Track2"" {25 11 10 9 8 7 6 5 4 3 2 1 0 12 13 14 15 16 17} P2 directed:True)} use:Vertex) (dice d:6 num:3) (piece ""Disc"" Each (forEach Die if:(!= (pips) 0) (if (= (trackSite Move from:(from) steps:(pips)) -1) (move Remove (from)) (move (from (from)) (to (trackSite Move from:(from) steps:(pips)) if:(or (not (is Enemy (who at:(to)))) (= 1 (size Stack at:(to)))) (apply if:(is Enemy (who at:(to))) (fromTo (from (to)) (to (handSite Next))))))) (then (if (not (all DiceUsed)) (moveAgain))))) (hand Each)}) (rules (start {(place Stack ""Disc1"" 11 count:8) (place Stack ""Disc1"" 6 count:3) (place Stack ""Disc1"" 7 count:4) (place Stack ""Disc2"" (sites {10 9 8}) count:5)}) (play (do (if (not (is Prev Mover)) (roll)) next:(or (forEach Piece top:True) (forEach Piece container:(mover) top:True)))) (end (if (no Pieces Mover) (result Mover Win)))))","###Description 2x12 board, divided in half. Spaces on each side take the form of semi-circular sockets, into which the pieces fit. Fifteen pieces per player. Three six-sided dice. Players move according to the number on each die by moving one piece the value on one die then another piece the value on the other die, or by moving one piece the value of one die and then the value of the other. Both players begin in the same quadrant of the board. One player's pieces are arranged as follows: Eight on the first point of the quadrant to their left, four on the fifth, and three on the sixth. The other player places five on the second, third, and fourth space of the same quadrant. The track proceeds in a clockwise direction around the board. When a player's piece lands on a space occupied by a single piece of the opponent, it is sent back to the beginning of the quadrant to the right of the starting quadrant. Pieces bear off from the quadrant diagonal from the starting quadrant. The first player to bear off all their pieces wins. @@ -884,11 +874,6 @@ Players alternate moving their pieces forward or backward diagonally. A piece ma ###Ludii (game ""Shanzak Kammar"" (players 2) (equipment {(board (add (merge {(square 5 diagonals:Alternating) (shift 0 4 (rotate 180 (wedge 3))) (shift 0 -2 (wedge 3))}) edges:{{5 1} {1 7} {7 3} {3 9} {13 9} {7 13} {11 5} {15 11} {11 17} {7 11} {17 13} {13 19} {23 19} {23 17} {17 21} {15 21}}) use:Vertex) (piece ""Marker"" Each (or (move Step (to if:(is Empty (to)))) (move Hop (between if:(is Enemy (who at:(between))) (apply (remove (between)))) (to if:(is Empty (to)))))) (regions ""Goal"" P1 (expand (sites Top))) (regions ""Goal"" P2 (expand (sites Bottom)))}) (rules (start {(place ""Marker1"" (expand (sites Bottom) steps:3)) (place ""Marker2"" (expand (sites Top) steps:3))}) (play (forEach Piece)) (end (if (= 6 (count Pieces Mover in:(sites Mover ""Goal""))) (result Mover Win)))))" -"The game is for two players, each of who has 21 pieces — 5 large pieces [pawns] and 16 small pieces [discs], representing the Suffragettes and the Police. The Suffragettes are colored green, and the large pieces are distinguished as Leaders of the Suffragette Party. The Police Forceis colored dark blue, and the large pieces are distinguished as Inspectors of Police. The Suffragettes are placed on the squares marked ‘S’ near ‘Albert Hall.’ The leaders ofthe party are positioned as follows: One leader is placed in the middle of the front row, and the other four Leaders are placed at the ends of the front and second rows. The Police Force is placed upon the squares marked ‘P’ near the House of Commons. One Inspector is placed in the middle of the front row, and the remaining four Inspectors at the ends of the front and second rows. Each player alternatively moves or hops one of his or her own pieces. Moving can result in moving to one space into a single adjacent square, hopping over your own pieces to move farther along the board, or hopping over an opponent’s piece to 'arrest' or 'disable' your opponent’s piece. A piece may move horizontally or diagonally one square a turn into any of the 8 adjoining squares, but that square must be unoccupied. Pieces may freely move over any part of the board except: a.) No piece can be moved (except when arrested or disabled) onto the spaces marked Prison, Prison Yard [PY], Hospital, or Hospital Grounds [HG]. b.) A Suffragette cannot move onto the spaces marked Albert Hall [AH]. c.) A Policeman cannot move onto the spaces marked House of Commons [HC]. On a player’s turn, they may hop a piece rather than move it a single square. Hopping means jumping over one of your own pieces into the unoccupied squareon the other side of the hopped over piece (as in Checkers). A player may string together hops into multiple jumps, provided that each jump lands in a permitted zone (as listed above) and there is a space in between each piece hopped over. If the square behind a piece is occupied, the hop cannot be completed. Any piece having gained entrance into their opponent’s House of Commons or Albert Hall may move about freely on the squares representing the building, but must not move or hop away from those squares. Moving within either the House of Commons or Albert Hall spends a player’s turn. Properly hopping over your opponent’s pieces results in arresting or disabling your opponent’s piece(s). Police may arrest Suffragettes and Suffragettes may disable Police through jiu jitsu. Disable is a term used in jiu jitsu when an opponent is neutralized. Any piece standing on one of the squares in The Arena (squares marked pink) is liable to be arrested or disabled by their opponent. Any of your pieces may arrest or disable your opponent’spieces. A Suffragette disables the Police by hopping over him in a diagonal direction. A Leader of the Suffragette Partycan disable any member of the Police Force by hopping over him in any direction. A Policeman arrests a Suffragette by hopping over her in a diagonal direction. An Inspector of Police arrests any Suffragette member by hopping over her in any direction. A piece can only arrest or disable its opponents when it is hopping, not when simply moving. Thus, one of the smaller pieces may hop over a Leader or Inspector simply to move about the board. A single piece may arrest or disable multiple pieces during one series of jumps. Suffragettes who are arrested are moved to the Prison. Police who are disabled are moved to the Hospital. No piece can be arrested or disabled on yellow squares outside the Arena, but may move or hop freely on these squares. If at any point, the Prison andthe Hospital each contain 12 or more inmates, either player may propose a release. The other player accept or reject this. If accepted the proposer moves one of their disabled pieces to the Prison Yard [PY] or Hospital Grounds [HG] as appropriate. Then the other player does the same but the piece chosen must be of the same value as the one the proposer released. The proposer cannot release a major piece if the other player does not have any disabled major pieces. This is repeated until either the Prison Yard and Hospital Grounds are full or the proposer passes. No exchange can be proposed while any piece remains on the Prison Yard or the Hospital Grounds.","(game ""Suffragetto"" (players 2) (equipment {(board (square 17)) (regions ""House of Commons"" Shared (sites {""H14"" ""I14"" ""J14"" ""H13"" ""I13"" ""J13""})) (regions ""Albert Hall"" Shared (sites {""H4"" ""I4"" ""J4"" ""H5"" ""I5"" ""J5""})) (regions ""The Arena"" Shared (difference (expand (expand (sites {""E17""}) steps:8 E) steps:16 S) (union (sites ""House of Commons"") (sites ""Albert Hall"")))) (regions ""The Free Zone"" Shared (union {(expand (sites {""P5""}) steps:6 N) (expand (sites {""B13""}) steps:6 S) (expand (sites {""C17"" ""D17"" ""N17"" ""O17""}) steps:16 S)})) (regions ""Hospital Grounds"" Shared (expand (sites {""P17""}) steps:5 S)) (regions ""Prison Yard"" Shared (expand (sites {""B1""}) steps:5 N)) (regions ""Prison"" Shared (union (expand (sites {""A1""}) steps:16 N) (expand (sites {""B17""}) steps:3 S))) (regions ""Hospital"" Shared (union (expand (sites {""Q1""}) steps:16 N) (expand (sites {""P1""}) steps:3 N))) (piece ""Suffragette"" P1 (or {(move (from (from) if:(is In (from) (union {(sites ""The Arena"") (sites ""The Free Zone"") (sites ""Prison Yard"")}))) (to (intersection {(sites Around (from)) (sites Empty) (union {(sites ""The Arena"") (sites ""The Free Zone"") (sites ""House of Commons"")})}))) (move (from (from) if:(is In (from) (sites ""House of Commons""))) (to (intersection {(sites Around (from)) (sites Empty) (sites ""House of Commons"")}))) (move Hop (from if:(is In (from) (union {(sites ""The Arena"") (sites ""The Free Zone"") (sites ""Prison Yard"")}))) (between if:(is Occupied (between)) (apply (if (if (= 0 (state at:(from))) (and (and (is Enemy (who at:(between))) (is In (between) (sites ""The Arena""))) (is In (between) (sites Around (from) Diagonal))) (and (is Enemy (who at:(between))) (is In (between) (sites ""The Arena"")))) (fromTo (from (between)) (to (sites Random (intersection (sites Empty) (sites ""Hospital"")))))))) (to if:(and (is Empty (to)) (is In (to) (union {(sites ""The Arena"") (sites ""The Free Zone"") (sites ""House of Commons"")})))) (then (moveAgain))) (move Hop (from if:(is In (from) (sites ""House of Commons""))) (between if:(is Occupied (between)) (apply (if (if (= 0 (state at:(from))) (and (and (is Enemy (who at:(between))) (is In (between) (sites ""The Arena""))) (is In (between) (sites Around (from) Diagonal))) (and (is Enemy (who at:(between))) (is In (between) (sites ""The Arena"")))) (fromTo (from (between)) (to (sites Random (intersection (sites Empty) (sites ""Hospital"")))))))) (to if:(and (is Empty (to)) (is In (to) (sites ""House of Commons"")))))})) (piece ""Policeman"" P2 (or {(move (from (from) if:(is In (from) (union {(sites ""The Arena"") (sites ""The Free Zone"") (sites ""Hospital Grounds"")}))) (to (intersection {(sites Around (from)) (sites Empty) (union {(sites ""The Arena"") (sites ""The Free Zone"") (sites ""Albert Hall"")})}))) (move (from (from) if:(is In (from) (sites ""Albert Hall""))) (to (intersection {(sites Around (from)) (sites Empty) (sites ""Albert Hall"")}))) (move Hop (from if:(is In (from) (union {(sites ""The Arena"") (sites ""The Free Zone"") (sites ""Hospital Grounds"")}))) (between if:(is Occupied (between)) (apply (if (if (= 0 (state at:(from))) (and (and (is Enemy (who at:(between))) (is In (between) (sites ""The Arena""))) (is In (between) (sites Around (from) Diagonal))) (and (is Enemy (who at:(between))) (is In (between) (sites ""The Arena"")))) (fromTo (from (between)) (to (sites Random (intersection (sites Empty) (sites ""Prison"")))))))) (to if:(and (is Empty (to)) (is In (to) (union {(sites ""The Arena"") (sites ""The Free Zone"") (sites ""Albert Hall"")})))) (then (moveAgain))) (move Hop (from if:(is In (from) (sites ""Albert Hall""))) (between if:(is Occupied (between)) (apply (if (if (= 0 (state at:(from))) (and (and (is Enemy (who at:(between))) (is In (between) (sites ""The Arena""))) (is In (between) (sites Around (from) Diagonal))) (and (is Enemy (who at:(between))) (is In (between) (sites ""The Arena"")))) (fromTo (from (between)) (to (sites Random (intersection (sites Empty) (sites ""Prison"")))))))) (to if:(and (is Empty (to)) (is In (to) (sites ""Albert Hall"")))))})) (piece ""Leader"" P1 (or {(move (from (from) if:(is In (from) (union {(sites ""The Arena"") (sites ""The Free Zone"") (sites ""Prison Yard"")}))) (to (intersection {(sites Around (from)) (sites Empty) (union {(sites ""The Arena"") (sites ""The Free Zone"") (sites ""House of Commons"")})}))) (move (from (from) if:(is In (from) (sites ""House of Commons""))) (to (intersection {(sites Around (from)) (sites Empty) (sites ""House of Commons"")}))) (move Hop (from if:(is In (from) (union {(sites ""The Arena"") (sites ""The Free Zone"") (sites ""Prison Yard"")}))) (between if:(is Occupied (between)) (apply (if (if (= 0 (state at:(from))) (and (and (is Enemy (who at:(between))) (is In (between) (sites ""The Arena""))) (is In (between) (sites Around (from) Diagonal))) (and (is Enemy (who at:(between))) (is In (between) (sites ""The Arena"")))) (fromTo (from (between)) (to (sites Random (intersection (sites Empty) (sites ""Hospital"")))))))) (to if:(and (is Empty (to)) (is In (to) (union {(sites ""The Arena"") (sites ""The Free Zone"") (sites ""House of Commons"")})))) (then (moveAgain))) (move Hop (from if:(is In (from) (sites ""House of Commons""))) (between if:(is Occupied (between)) (apply (if (if (= 0 (state at:(from))) (and (and (is Enemy (who at:(between))) (is In (between) (sites ""The Arena""))) (is In (between) (sites Around (from) Diagonal))) (and (is Enemy (who at:(between))) (is In (between) (sites ""The Arena"")))) (fromTo (from (between)) (to (sites Random (intersection (sites Empty) (sites ""Hospital"")))))))) (to if:(and (is Empty (to)) (is In (to) (sites ""House of Commons"")))))})) (piece ""Inspector"" P2 (or {(move (from (from) if:(is In (from) (union {(sites ""The Arena"") (sites ""The Free Zone"") (sites ""Hospital Grounds"")}))) (to (intersection {(sites Around (from)) (sites Empty) (union {(sites ""The Arena"") (sites ""The Free Zone"") (sites ""Albert Hall"")})}))) (move (from (from) if:(is In (from) (sites ""Albert Hall""))) (to (intersection {(sites Around (from)) (sites Empty) (sites ""Albert Hall"")}))) (move Hop (from if:(is In (from) (union {(sites ""The Arena"") (sites ""The Free Zone"") (sites ""Hospital Grounds"")}))) (between if:(is Occupied (between)) (apply (if (if (= 0 (state at:(from))) (and (and (is Enemy (who at:(between))) (is In (between) (sites ""The Arena""))) (is In (between) (sites Around (from) Diagonal))) (and (is Enemy (who at:(between))) (is In (between) (sites ""The Arena"")))) (fromTo (from (between)) (to (sites Random (intersection (sites Empty) (sites ""Prison"")))))))) (to if:(and (is Empty (to)) (is In (to) (union {(sites ""The Arena"") (sites ""The Free Zone"") (sites ""Albert Hall"")})))) (then (moveAgain))) (move Hop (from if:(is In (from) (sites ""Albert Hall""))) (between if:(is Occupied (between)) (apply (if (if (= 0 (state at:(from))) (and (and (is Enemy (who at:(between))) (is In (between) (sites ""The Arena""))) (is In (between) (sites Around (from) Diagonal))) (and (is Enemy (who at:(between))) (is In (between) (sites ""The Arena"")))) (fromTo (from (between)) (to (sites Random (intersection (sites Empty) (sites ""Prison"")))))))) (to if:(and (is Empty (to)) (is In (to) (sites ""Albert Hall"")))))}))}) (rules (start {(place ""Suffragette1"" {57 61 73 74 78 79 88 89 90 91 92 94 95 96 97 98} state:0) (place ""Policeman2"" {227 231 209 210 214 215 196 197 198 199 200 194 193 192 191 190} state:0) (place ""Leader1"" {87 93 99 72 80} state:1) (place ""Inspector2"" {189 195 201 208 216} state:1)}) (play (priority {(if (< 0 (var ""ReleaseCountdown"")) (if (is Odd (var ""ReleaseCountdown"")) (move (from (if (= (id P1) (id Mover)) (if (and (<= 1 (count Sites in:(forEach (intersection (sites ""Prison"") (sites Occupied by:All)) if:(= (var ""LastState"") (state at:(site)))))) (<= 1 (count Sites in:(forEach (intersection (sites ""Hospital"") (sites Occupied by:All)) if:(= (var ""LastState"") (state at:(site))))))) (forEach (intersection (sites ""Prison"") (sites Occupied by:All)) if:(= (var ""LastState"") (state at:(site))))) (if (and (<= 1 (count Sites in:(forEach (intersection (sites ""Prison"") (sites Occupied by:All)) if:(= (var ""LastState"") (state at:(site)))))) (<= 1 (count Sites in:(forEach (intersection (sites ""Hospital"") (sites Occupied by:All)) if:(= (var ""LastState"") (state at:(site))))))) (forEach (intersection (sites ""Hospital"") (sites Occupied by:All)) if:(= (var ""LastState"") (state at:(site))))))) (to (intersection (sites Empty) (if (= (id P1) (id Mover)) (sites ""Prison Yard"") (sites ""Hospital Grounds"")))) (then (and (set Var ""LastState"" -2) (set Var ""ReleaseCountdown"" (- (var ""ReleaseCountdown"") 1))))) (or (move (from (if (= (id P1) (id Mover)) (if (and (<= 1 (count Sites in:(forEach (intersection (sites ""Prison"") (sites Occupied by:All)) if:(= 0 (state at:(site)))))) (<= 1 (count Sites in:(forEach (intersection (sites ""Hospital"") (sites Occupied by:All)) if:(= 0 (state at:(site))))))) (if (and (<= 1 (count Sites in:(forEach (intersection (sites ""Prison"") (sites Occupied by:All)) if:(= 1 (state at:(site)))))) (<= 1 (count Sites in:(forEach (intersection (sites ""Hospital"") (sites Occupied by:All)) if:(= 1 (state at:(site))))))) (intersection (sites ""Prison"") (sites Occupied by:All)) (forEach (intersection (sites ""Prison"") (sites Occupied by:All)) if:(= 0 (state at:(site))))) (if (and (<= 1 (count Sites in:(forEach (intersection (sites ""Prison"") (sites Occupied by:All)) if:(= 1 (state at:(site)))))) (<= 1 (count Sites in:(forEach (intersection (sites ""Hospital"") (sites Occupied by:All)) if:(= 1 (state at:(site))))))) (forEach (intersection (sites ""Prison"") (sites Occupied by:All)) if:(= 1 (state at:(site)))))) (if (and (<= 1 (count Sites in:(forEach (intersection (sites ""Prison"") (sites Occupied by:All)) if:(= 0 (state at:(site)))))) (<= 1 (count Sites in:(forEach (intersection (sites ""Hospital"") (sites Occupied by:All)) if:(= 0 (state at:(site))))))) (if (and (<= 1 (count Sites in:(forEach (intersection (sites ""Prison"") (sites Occupied by:All)) if:(= 1 (state at:(site)))))) (<= 1 (count Sites in:(forEach (intersection (sites ""Hospital"") (sites Occupied by:All)) if:(= 1 (state at:(site))))))) (intersection (sites ""Hospital"") (sites Occupied by:All)) (forEach (intersection (sites ""Hospital"") (sites Occupied by:All)) if:(= 0 (state at:(site))))) (if (and (<= 1 (count Sites in:(forEach (intersection (sites ""Prison"") (sites Occupied by:All)) if:(= 1 (state at:(site)))))) (<= 1 (count Sites in:(forEach (intersection (sites ""Hospital"") (sites Occupied by:All)) if:(= 1 (state at:(site))))))) (forEach (intersection (sites ""Hospital"") (sites Occupied by:All)) if:(= 1 (state at:(site)))))))) (to (intersection (sites Empty) (if (= (id P1) (id Mover)) (sites ""Prison Yard"") (sites ""Hospital Grounds"")))) (then (and (set Var ""LastState"" (state at:(last To))) (set Var ""ReleaseCountdown"" (- (var ""ReleaseCountdown"") 1))))) (move Pass (then (and (set Var ""LastState"" -2) (set Var ""ReleaseCountdown"" 0))))))) (if (is Decided ""Release"") (move (from (if (= (id P1) (id Mover)) (if (and (<= 1 (count Sites in:(forEach (intersection (sites ""Prison"") (sites Occupied by:All)) if:(= 0 (state at:(site)))))) (<= 1 (count Sites in:(forEach (intersection (sites ""Hospital"") (sites Occupied by:All)) if:(= 0 (state at:(site))))))) (if (and (<= 1 (count Sites in:(forEach (intersection (sites ""Prison"") (sites Occupied by:All)) if:(= 1 (state at:(site)))))) (<= 1 (count Sites in:(forEach (intersection (sites ""Hospital"") (sites Occupied by:All)) if:(= 1 (state at:(site))))))) (intersection (sites ""Prison"") (sites Occupied by:All)) (forEach (intersection (sites ""Prison"") (sites Occupied by:All)) if:(= 0 (state at:(site))))) (if (and (<= 1 (count Sites in:(forEach (intersection (sites ""Prison"") (sites Occupied by:All)) if:(= 1 (state at:(site)))))) (<= 1 (count Sites in:(forEach (intersection (sites ""Hospital"") (sites Occupied by:All)) if:(= 1 (state at:(site))))))) (forEach (intersection (sites ""Prison"") (sites Occupied by:All)) if:(= 1 (state at:(site)))))) (if (and (<= 1 (count Sites in:(forEach (intersection (sites ""Prison"") (sites Occupied by:All)) if:(= 0 (state at:(site)))))) (<= 1 (count Sites in:(forEach (intersection (sites ""Hospital"") (sites Occupied by:All)) if:(= 0 (state at:(site))))))) (if (and (<= 1 (count Sites in:(forEach (intersection (sites ""Prison"") (sites Occupied by:All)) if:(= 1 (state at:(site)))))) (<= 1 (count Sites in:(forEach (intersection (sites ""Hospital"") (sites Occupied by:All)) if:(= 1 (state at:(site))))))) (intersection (sites ""Hospital"") (sites Occupied by:All)) (forEach (intersection (sites ""Hospital"") (sites Occupied by:All)) if:(= 0 (state at:(site))))) (if (and (<= 1 (count Sites in:(forEach (intersection (sites ""Prison"") (sites Occupied by:All)) if:(= 1 (state at:(site)))))) (<= 1 (count Sites in:(forEach (intersection (sites ""Hospital"") (sites Occupied by:All)) if:(= 1 (state at:(site))))))) (forEach (intersection (sites ""Hospital"") (sites Occupied by:All)) if:(= 1 (state at:(site)))))))) (to (intersection (sites Empty) (if (= (id P1) (id Mover)) (sites ""Prison Yard"") (sites ""Hospital Grounds"")))) (then (and (set Var ""LastState"" (state at:(last To))) (set Var ""ReleaseCountdown"" 11))))) (if (is Proposed ""Release"") (or (move Vote ""Release"") (move Vote ""No""))) (if (is Prev Mover) (or (if (= (id P1) (id Mover)) (move Hop (from (last To) if:(is In (from) (union {(sites ""The Arena"") (sites ""The Free Zone"") (sites ""Prison Yard"")}))) (between if:(is Occupied (between)) (apply (if (if (= 0 (state at:(from))) (and (and (is Enemy (who at:(between))) (is In (between) (sites ""The Arena""))) (is In (between) (sites Around (from) Diagonal))) (and (is Enemy (who at:(between))) (is In (between) (sites ""The Arena"")))) (fromTo (from (between)) (to (sites Random (intersection (sites Empty) (sites ""Hospital"")))))))) (to if:(and (is Empty (to)) (is In (to) (union {(sites ""The Arena"") (sites ""The Free Zone"") (sites ""House of Commons"")})))) (then (moveAgain))) (move Hop (from (last To) if:(is In (from) (union {(sites ""The Arena"") (sites ""The Free Zone"") (sites ""Hospital Grounds"")}))) (between if:(is Occupied (between)) (apply (if (if (= 0 (state at:(from))) (and (and (is Enemy (who at:(between))) (is In (between) (sites ""The Arena""))) (is In (between) (sites Around (from) Diagonal))) (and (is Enemy (who at:(between))) (is In (between) (sites ""The Arena"")))) (fromTo (from (between)) (to (sites Random (intersection (sites Empty) (sites ""Prison"")))))))) (to if:(and (is Empty (to)) (is In (to) (union {(sites ""The Arena"") (sites ""The Free Zone"") (sites ""Albert Hall"")})))) (then (moveAgain)))) (move Pass)) (or (if (and {(= 0 (count Sites in:(intersection (sites ""Prison Yard"") (sites Occupied by:All)))) (= 0 (count Sites in:(intersection (sites ""Hospital Grounds"") (sites Occupied by:All)))) (<= 12 (count Sites in:(intersection (sites ""Prison"") (sites Occupied by:All)))) (<= 12 (count Sites in:(intersection (sites ""Hospital"") (sites Occupied by:All))))}) (move Propose ""Release"" (then (do (note ""Release prisoners?"" to:Next) next:(vote ""Release""))))) (forEach Piece)))})) (end {(if (= 6 (count Pieces P1 in:(sites ""House of Commons""))) (result P1 Win)) (if (= 6 (count Pieces P2 in:(sites ""Albert Hall""))) (result P2 Win))})))","###Description -The game is for two players, each of who has 21 pieces — 5 large pieces [pawns] and 16 small pieces [discs], representing the Suffragettes and the Police. The Suffragettes are colored green, and the large pieces are distinguished as Leaders of the Suffragette Party. The Police Forceis colored dark blue, and the large pieces are distinguished as Inspectors of Police. The Suffragettes are placed on the squares marked ‘S’ near ‘Albert Hall.’ The leaders ofthe party are positioned as follows: One leader is placed in the middle of the front row, and the other four Leaders are placed at the ends of the front and second rows. The Police Force is placed upon the squares marked ‘P’ near the House of Commons. One Inspector is placed in the middle of the front row, and the remaining four Inspectors at the ends of the front and second rows. Each player alternatively moves or hops one of his or her own pieces. Moving can result in moving to one space into a single adjacent square, hopping over your own pieces to move farther along the board, or hopping over an opponent’s piece to 'arrest' or 'disable' your opponent’s piece. A piece may move horizontally or diagonally one square a turn into any of the 8 adjoining squares, but that square must be unoccupied. Pieces may freely move over any part of the board except: a.) No piece can be moved (except when arrested or disabled) onto the spaces marked Prison, Prison Yard [PY], Hospital, or Hospital Grounds [HG]. b.) A Suffragette cannot move onto the spaces marked Albert Hall [AH]. c.) A Policeman cannot move onto the spaces marked House of Commons [HC]. On a player’s turn, they may hop a piece rather than move it a single square. Hopping means jumping over one of your own pieces into the unoccupied squareon the other side of the hopped over piece (as in Checkers). A player may string together hops into multiple jumps, provided that each jump lands in a permitted zone (as listed above) and there is a space in between each piece hopped over. If the square behind a piece is occupied, the hop cannot be completed. Any piece having gained entrance into their opponent’s House of Commons or Albert Hall may move about freely on the squares representing the building, but must not move or hop away from those squares. Moving within either the House of Commons or Albert Hall spends a player’s turn. Properly hopping over your opponent’s pieces results in arresting or disabling your opponent’s piece(s). Police may arrest Suffragettes and Suffragettes may disable Police through jiu jitsu. Disable is a term used in jiu jitsu when an opponent is neutralized. Any piece standing on one of the squares in The Arena (squares marked pink) is liable to be arrested or disabled by their opponent. Any of your pieces may arrest or disable your opponent’spieces. A Suffragette disables the Police by hopping over him in a diagonal direction. A Leader of the Suffragette Partycan disable any member of the Police Force by hopping over him in any direction. A Policeman arrests a Suffragette by hopping over her in a diagonal direction. An Inspector of Police arrests any Suffragette member by hopping over her in any direction. A piece can only arrest or disable its opponents when it is hopping, not when simply moving. Thus, one of the smaller pieces may hop over a Leader or Inspector simply to move about the board. A single piece may arrest or disable multiple pieces during one series of jumps. Suffragettes who are arrested are moved to the Prison. Police who are disabled are moved to the Hospital. No piece can be arrested or disabled on yellow squares outside the Arena, but may move or hop freely on these squares. If at any point, the Prison andthe Hospital each contain 12 or more inmates, either player may propose a release. The other player accept or reject this. If accepted the proposer moves one of their disabled pieces to the Prison Yard [PY] or Hospital Grounds [HG] as appropriate. Then the other player does the same but the piece chosen must be of the same value as the one the proposer released. The proposer cannot release a major piece if the other player does not have any disabled major pieces. This is repeated until either the Prison Yard and Hospital Grounds are full or the proposer passes. No exchange can be proposed while any piece remains on the Prison Yard or the Hospital Grounds. - -###Ludii -(game ""Suffragetto"" (players 2) (equipment {(board (square 17)) (regions ""House of Commons"" Shared (sites {""H14"" ""I14"" ""J14"" ""H13"" ""I13"" ""J13""})) (regions ""Albert Hall"" Shared (sites {""H4"" ""I4"" ""J4"" ""H5"" ""I5"" ""J5""})) (regions ""The Arena"" Shared (difference (expand (expand (sites {""E17""}) steps:8 E) steps:16 S) (union (sites ""House of Commons"") (sites ""Albert Hall"")))) (regions ""The Free Zone"" Shared (union {(expand (sites {""P5""}) steps:6 N) (expand (sites {""B13""}) steps:6 S) (expand (sites {""C17"" ""D17"" ""N17"" ""O17""}) steps:16 S)})) (regions ""Hospital Grounds"" Shared (expand (sites {""P17""}) steps:5 S)) (regions ""Prison Yard"" Shared (expand (sites {""B1""}) steps:5 N)) (regions ""Prison"" Shared (union (expand (sites {""A1""}) steps:16 N) (expand (sites {""B17""}) steps:3 S))) (regions ""Hospital"" Shared (union (expand (sites {""Q1""}) steps:16 N) (expand (sites {""P1""}) steps:3 N))) (piece ""Suffragette"" P1 (or {(move (from (from) if:(is In (from) (union {(sites ""The Arena"") (sites ""The Free Zone"") (sites ""Prison Yard"")}))) (to (intersection {(sites Around (from)) (sites Empty) (union {(sites ""The Arena"") (sites ""The Free Zone"") (sites ""House of Commons"")})}))) (move (from (from) if:(is In (from) (sites ""House of Commons""))) (to (intersection {(sites Around (from)) (sites Empty) (sites ""House of Commons"")}))) (move Hop (from if:(is In (from) (union {(sites ""The Arena"") (sites ""The Free Zone"") (sites ""Prison Yard"")}))) (between if:(is Occupied (between)) (apply (if (if (= 0 (state at:(from))) (and (and (is Enemy (who at:(between))) (is In (between) (sites ""The Arena""))) (is In (between) (sites Around (from) Diagonal))) (and (is Enemy (who at:(between))) (is In (between) (sites ""The Arena"")))) (fromTo (from (between)) (to (sites Random (intersection (sites Empty) (sites ""Hospital"")))))))) (to if:(and (is Empty (to)) (is In (to) (union {(sites ""The Arena"") (sites ""The Free Zone"") (sites ""House of Commons"")})))) (then (moveAgain))) (move Hop (from if:(is In (from) (sites ""House of Commons""))) (between if:(is Occupied (between)) (apply (if (if (= 0 (state at:(from))) (and (and (is Enemy (who at:(between))) (is In (between) (sites ""The Arena""))) (is In (between) (sites Around (from) Diagonal))) (and (is Enemy (who at:(between))) (is In (between) (sites ""The Arena"")))) (fromTo (from (between)) (to (sites Random (intersection (sites Empty) (sites ""Hospital"")))))))) (to if:(and (is Empty (to)) (is In (to) (sites ""House of Commons"")))))})) (piece ""Policeman"" P2 (or {(move (from (from) if:(is In (from) (union {(sites ""The Arena"") (sites ""The Free Zone"") (sites ""Hospital Grounds"")}))) (to (intersection {(sites Around (from)) (sites Empty) (union {(sites ""The Arena"") (sites ""The Free Zone"") (sites ""Albert Hall"")})}))) (move (from (from) if:(is In (from) (sites ""Albert Hall""))) (to (intersection {(sites Around (from)) (sites Empty) (sites ""Albert Hall"")}))) (move Hop (from if:(is In (from) (union {(sites ""The Arena"") (sites ""The Free Zone"") (sites ""Hospital Grounds"")}))) (between if:(is Occupied (between)) (apply (if (if (= 0 (state at:(from))) (and (and (is Enemy (who at:(between))) (is In (between) (sites ""The Arena""))) (is In (between) (sites Around (from) Diagonal))) (and (is Enemy (who at:(between))) (is In (between) (sites ""The Arena"")))) (fromTo (from (between)) (to (sites Random (intersection (sites Empty) (sites ""Prison"")))))))) (to if:(and (is Empty (to)) (is In (to) (union {(sites ""The Arena"") (sites ""The Free Zone"") (sites ""Albert Hall"")})))) (then (moveAgain))) (move Hop (from if:(is In (from) (sites ""Albert Hall""))) (between if:(is Occupied (between)) (apply (if (if (= 0 (state at:(from))) (and (and (is Enemy (who at:(between))) (is In (between) (sites ""The Arena""))) (is In (between) (sites Around (from) Diagonal))) (and (is Enemy (who at:(between))) (is In (between) (sites ""The Arena"")))) (fromTo (from (between)) (to (sites Random (intersection (sites Empty) (sites ""Prison"")))))))) (to if:(and (is Empty (to)) (is In (to) (sites ""Albert Hall"")))))})) (piece ""Leader"" P1 (or {(move (from (from) if:(is In (from) (union {(sites ""The Arena"") (sites ""The Free Zone"") (sites ""Prison Yard"")}))) (to (intersection {(sites Around (from)) (sites Empty) (union {(sites ""The Arena"") (sites ""The Free Zone"") (sites ""House of Commons"")})}))) (move (from (from) if:(is In (from) (sites ""House of Commons""))) (to (intersection {(sites Around (from)) (sites Empty) (sites ""House of Commons"")}))) (move Hop (from if:(is In (from) (union {(sites ""The Arena"") (sites ""The Free Zone"") (sites ""Prison Yard"")}))) (between if:(is Occupied (between)) (apply (if (if (= 0 (state at:(from))) (and (and (is Enemy (who at:(between))) (is In (between) (sites ""The Arena""))) (is In (between) (sites Around (from) Diagonal))) (and (is Enemy (who at:(between))) (is In (between) (sites ""The Arena"")))) (fromTo (from (between)) (to (sites Random (intersection (sites Empty) (sites ""Hospital"")))))))) (to if:(and (is Empty (to)) (is In (to) (union {(sites ""The Arena"") (sites ""The Free Zone"") (sites ""House of Commons"")})))) (then (moveAgain))) (move Hop (from if:(is In (from) (sites ""House of Commons""))) (between if:(is Occupied (between)) (apply (if (if (= 0 (state at:(from))) (and (and (is Enemy (who at:(between))) (is In (between) (sites ""The Arena""))) (is In (between) (sites Around (from) Diagonal))) (and (is Enemy (who at:(between))) (is In (between) (sites ""The Arena"")))) (fromTo (from (between)) (to (sites Random (intersection (sites Empty) (sites ""Hospital"")))))))) (to if:(and (is Empty (to)) (is In (to) (sites ""House of Commons"")))))})) (piece ""Inspector"" P2 (or {(move (from (from) if:(is In (from) (union {(sites ""The Arena"") (sites ""The Free Zone"") (sites ""Hospital Grounds"")}))) (to (intersection {(sites Around (from)) (sites Empty) (union {(sites ""The Arena"") (sites ""The Free Zone"") (sites ""Albert Hall"")})}))) (move (from (from) if:(is In (from) (sites ""Albert Hall""))) (to (intersection {(sites Around (from)) (sites Empty) (sites ""Albert Hall"")}))) (move Hop (from if:(is In (from) (union {(sites ""The Arena"") (sites ""The Free Zone"") (sites ""Hospital Grounds"")}))) (between if:(is Occupied (between)) (apply (if (if (= 0 (state at:(from))) (and (and (is Enemy (who at:(between))) (is In (between) (sites ""The Arena""))) (is In (between) (sites Around (from) Diagonal))) (and (is Enemy (who at:(between))) (is In (between) (sites ""The Arena"")))) (fromTo (from (between)) (to (sites Random (intersection (sites Empty) (sites ""Prison"")))))))) (to if:(and (is Empty (to)) (is In (to) (union {(sites ""The Arena"") (sites ""The Free Zone"") (sites ""Albert Hall"")})))) (then (moveAgain))) (move Hop (from if:(is In (from) (sites ""Albert Hall""))) (between if:(is Occupied (between)) (apply (if (if (= 0 (state at:(from))) (and (and (is Enemy (who at:(between))) (is In (between) (sites ""The Arena""))) (is In (between) (sites Around (from) Diagonal))) (and (is Enemy (who at:(between))) (is In (between) (sites ""The Arena"")))) (fromTo (from (between)) (to (sites Random (intersection (sites Empty) (sites ""Prison"")))))))) (to if:(and (is Empty (to)) (is In (to) (sites ""Albert Hall"")))))}))}) (rules (start {(place ""Suffragette1"" {57 61 73 74 78 79 88 89 90 91 92 94 95 96 97 98} state:0) (place ""Policeman2"" {227 231 209 210 214 215 196 197 198 199 200 194 193 192 191 190} state:0) (place ""Leader1"" {87 93 99 72 80} state:1) (place ""Inspector2"" {189 195 201 208 216} state:1)}) (play (priority {(if (< 0 (var ""ReleaseCountdown"")) (if (is Odd (var ""ReleaseCountdown"")) (move (from (if (= (id P1) (id Mover)) (if (and (<= 1 (count Sites in:(forEach (intersection (sites ""Prison"") (sites Occupied by:All)) if:(= (var ""LastState"") (state at:(site)))))) (<= 1 (count Sites in:(forEach (intersection (sites ""Hospital"") (sites Occupied by:All)) if:(= (var ""LastState"") (state at:(site))))))) (forEach (intersection (sites ""Prison"") (sites Occupied by:All)) if:(= (var ""LastState"") (state at:(site))))) (if (and (<= 1 (count Sites in:(forEach (intersection (sites ""Prison"") (sites Occupied by:All)) if:(= (var ""LastState"") (state at:(site)))))) (<= 1 (count Sites in:(forEach (intersection (sites ""Hospital"") (sites Occupied by:All)) if:(= (var ""LastState"") (state at:(site))))))) (forEach (intersection (sites ""Hospital"") (sites Occupied by:All)) if:(= (var ""LastState"") (state at:(site))))))) (to (intersection (sites Empty) (if (= (id P1) (id Mover)) (sites ""Prison Yard"") (sites ""Hospital Grounds"")))) (then (and (set Var ""LastState"" -2) (set Var ""ReleaseCountdown"" (- (var ""ReleaseCountdown"") 1))))) (or (move (from (if (= (id P1) (id Mover)) (if (and (<= 1 (count Sites in:(forEach (intersection (sites ""Prison"") (sites Occupied by:All)) if:(= 0 (state at:(site)))))) (<= 1 (count Sites in:(forEach (intersection (sites ""Hospital"") (sites Occupied by:All)) if:(= 0 (state at:(site))))))) (if (and (<= 1 (count Sites in:(forEach (intersection (sites ""Prison"") (sites Occupied by:All)) if:(= 1 (state at:(site)))))) (<= 1 (count Sites in:(forEach (intersection (sites ""Hospital"") (sites Occupied by:All)) if:(= 1 (state at:(site))))))) (intersection (sites ""Prison"") (sites Occupied by:All)) (forEach (intersection (sites ""Prison"") (sites Occupied by:All)) if:(= 0 (state at:(site))))) (if (and (<= 1 (count Sites in:(forEach (intersection (sites ""Prison"") (sites Occupied by:All)) if:(= 1 (state at:(site)))))) (<= 1 (count Sites in:(forEach (intersection (sites ""Hospital"") (sites Occupied by:All)) if:(= 1 (state at:(site))))))) (forEach (intersection (sites ""Prison"") (sites Occupied by:All)) if:(= 1 (state at:(site)))))) (if (and (<= 1 (count Sites in:(forEach (intersection (sites ""Prison"") (sites Occupied by:All)) if:(= 0 (state at:(site)))))) (<= 1 (count Sites in:(forEach (intersection (sites ""Hospital"") (sites Occupied by:All)) if:(= 0 (state at:(site))))))) (if (and (<= 1 (count Sites in:(forEach (intersection (sites ""Prison"") (sites Occupied by:All)) if:(= 1 (state at:(site)))))) (<= 1 (count Sites in:(forEach (intersection (sites ""Hospital"") (sites Occupied by:All)) if:(= 1 (state at:(site))))))) (intersection (sites ""Hospital"") (sites Occupied by:All)) (forEach (intersection (sites ""Hospital"") (sites Occupied by:All)) if:(= 0 (state at:(site))))) (if (and (<= 1 (count Sites in:(forEach (intersection (sites ""Prison"") (sites Occupied by:All)) if:(= 1 (state at:(site)))))) (<= 1 (count Sites in:(forEach (intersection (sites ""Hospital"") (sites Occupied by:All)) if:(= 1 (state at:(site))))))) (forEach (intersection (sites ""Hospital"") (sites Occupied by:All)) if:(= 1 (state at:(site)))))))) (to (intersection (sites Empty) (if (= (id P1) (id Mover)) (sites ""Prison Yard"") (sites ""Hospital Grounds"")))) (then (and (set Var ""LastState"" (state at:(last To))) (set Var ""ReleaseCountdown"" (- (var ""ReleaseCountdown"") 1))))) (move Pass (then (and (set Var ""LastState"" -2) (set Var ""ReleaseCountdown"" 0))))))) (if (is Decided ""Release"") (move (from (if (= (id P1) (id Mover)) (if (and (<= 1 (count Sites in:(forEach (intersection (sites ""Prison"") (sites Occupied by:All)) if:(= 0 (state at:(site)))))) (<= 1 (count Sites in:(forEach (intersection (sites ""Hospital"") (sites Occupied by:All)) if:(= 0 (state at:(site))))))) (if (and (<= 1 (count Sites in:(forEach (intersection (sites ""Prison"") (sites Occupied by:All)) if:(= 1 (state at:(site)))))) (<= 1 (count Sites in:(forEach (intersection (sites ""Hospital"") (sites Occupied by:All)) if:(= 1 (state at:(site))))))) (intersection (sites ""Prison"") (sites Occupied by:All)) (forEach (intersection (sites ""Prison"") (sites Occupied by:All)) if:(= 0 (state at:(site))))) (if (and (<= 1 (count Sites in:(forEach (intersection (sites ""Prison"") (sites Occupied by:All)) if:(= 1 (state at:(site)))))) (<= 1 (count Sites in:(forEach (intersection (sites ""Hospital"") (sites Occupied by:All)) if:(= 1 (state at:(site))))))) (forEach (intersection (sites ""Prison"") (sites Occupied by:All)) if:(= 1 (state at:(site)))))) (if (and (<= 1 (count Sites in:(forEach (intersection (sites ""Prison"") (sites Occupied by:All)) if:(= 0 (state at:(site)))))) (<= 1 (count Sites in:(forEach (intersection (sites ""Hospital"") (sites Occupied by:All)) if:(= 0 (state at:(site))))))) (if (and (<= 1 (count Sites in:(forEach (intersection (sites ""Prison"") (sites Occupied by:All)) if:(= 1 (state at:(site)))))) (<= 1 (count Sites in:(forEach (intersection (sites ""Hospital"") (sites Occupied by:All)) if:(= 1 (state at:(site))))))) (intersection (sites ""Hospital"") (sites Occupied by:All)) (forEach (intersection (sites ""Hospital"") (sites Occupied by:All)) if:(= 0 (state at:(site))))) (if (and (<= 1 (count Sites in:(forEach (intersection (sites ""Prison"") (sites Occupied by:All)) if:(= 1 (state at:(site)))))) (<= 1 (count Sites in:(forEach (intersection (sites ""Hospital"") (sites Occupied by:All)) if:(= 1 (state at:(site))))))) (forEach (intersection (sites ""Hospital"") (sites Occupied by:All)) if:(= 1 (state at:(site)))))))) (to (intersection (sites Empty) (if (= (id P1) (id Mover)) (sites ""Prison Yard"") (sites ""Hospital Grounds"")))) (then (and (set Var ""LastState"" (state at:(last To))) (set Var ""ReleaseCountdown"" 11))))) (if (is Proposed ""Release"") (or (move Vote ""Release"") (move Vote ""No""))) (if (is Prev Mover) (or (if (= (id P1) (id Mover)) (move Hop (from (last To) if:(is In (from) (union {(sites ""The Arena"") (sites ""The Free Zone"") (sites ""Prison Yard"")}))) (between if:(is Occupied (between)) (apply (if (if (= 0 (state at:(from))) (and (and (is Enemy (who at:(between))) (is In (between) (sites ""The Arena""))) (is In (between) (sites Around (from) Diagonal))) (and (is Enemy (who at:(between))) (is In (between) (sites ""The Arena"")))) (fromTo (from (between)) (to (sites Random (intersection (sites Empty) (sites ""Hospital"")))))))) (to if:(and (is Empty (to)) (is In (to) (union {(sites ""The Arena"") (sites ""The Free Zone"") (sites ""House of Commons"")})))) (then (moveAgain))) (move Hop (from (last To) if:(is In (from) (union {(sites ""The Arena"") (sites ""The Free Zone"") (sites ""Hospital Grounds"")}))) (between if:(is Occupied (between)) (apply (if (if (= 0 (state at:(from))) (and (and (is Enemy (who at:(between))) (is In (between) (sites ""The Arena""))) (is In (between) (sites Around (from) Diagonal))) (and (is Enemy (who at:(between))) (is In (between) (sites ""The Arena"")))) (fromTo (from (between)) (to (sites Random (intersection (sites Empty) (sites ""Prison"")))))))) (to if:(and (is Empty (to)) (is In (to) (union {(sites ""The Arena"") (sites ""The Free Zone"") (sites ""Albert Hall"")})))) (then (moveAgain)))) (move Pass)) (or (if (and {(= 0 (count Sites in:(intersection (sites ""Prison Yard"") (sites Occupied by:All)))) (= 0 (count Sites in:(intersection (sites ""Hospital Grounds"") (sites Occupied by:All)))) (<= 12 (count Sites in:(intersection (sites ""Prison"") (sites Occupied by:All)))) (<= 12 (count Sites in:(intersection (sites ""Hospital"") (sites Occupied by:All))))}) (move Propose ""Release"" (then (do (note ""Release prisoners?"" to:Next) next:(vote ""Release""))))) (forEach Piece)))})) (end {(if (= 6 (count Pieces P1 in:(sites ""House of Commons""))) (result P1 Win)) (if (= 6 (count Pieces P2 in:(sites ""Albert Hall""))) (result P2 Win))})))" "4x12 board. Twelve pieces per player. Pieces begin in the outer rows of the board. Four sticks serve as dice, painted on one side and blank on the other. The throws are as follows: one blank side up = 2; two blank sides up = 0; three blank sides up = 0; four blank sides up = 8; four painted sides up = 12. Throws of 2, 8, and 12 give the player another throw. Players must use each throw to move a piece. They may only subdivide a throw in half to move two pieces, otherwise they must use one full throw to move a piece. The first move for each piece must be a throw of 2. This can be divided into two throws of 1 to move two pieces. Play moves from left to right in the player's home row, from right to left in the second row, left to right in the third row, and right to left in the opponent's home row. When a piece enters the opponent's home row, it can no longer move. When a player's piece lands on a space occupied by an opponent's piece, the opponent's piece is captured. A player may not land on the same space as another of the player's pieces. The player which fills up the most of the opponent's home row wins.","(game ""Tablan"" (players 2) (equipment {(board (rectangle 4 12) {(track ""Track1"" ""0,E,N1,W,N1,E,N1,W"" P1 directed:True) (track ""Track2"" ""47,W,S1,E,S1,W,S1,E"" P2 directed:True)} use:Vertex) (piece ""Stick"" Each (if (and (not (is In (from) (sites Next ""Home""))) (!= 0 (mapEntry ""Throw"" (count Pips)))) (or (if (not (= 1 (var))) (move (from (from) if:(if (= (state at:(from)) 1) True (= 2 (mapEntry ""Throw"" (count Pips))))) (to (trackSite Move steps:(mapEntry ""Throw"" (count Pips))) if:(not (is Friend (who at:(to)))) (apply (if (is Enemy (who at:(to))) (remove (to))))) (then (if (not (= (state at:(last To)) 1)) (set State at:(last To) 1))))) (move (from (from) if:(if (= (state at:(from)) 1) True (= 2 (mapEntry ""Throw"" (count Pips))))) (to (trackSite Move steps:(/ (mapEntry ""Throw"" (count Pips)) 2)) if:(not (is Friend (who at:(to)))) (apply (if (is Enemy (who at:(to))) (remove (to))))) (then (and (if (not (= (state at:(last To)) 1)) (set State at:(last To) 1)) (if (not (= 1 (var))) (and (set Var 1) (moveAgain)) (set Var 0)))))))) (regions ""Home"" P1 (sites Bottom)) (regions ""Home"" P2 (sites Top)) (map ""Throw"" {(pair 0 8) (pair 1 0) (pair 2 0) (pair 3 2) (pair 4 12)}) (dice d:2 from:0 num:4)}) (rules (start {(place ""Stick1"" (sites Bottom)) (place ""Stick2"" (sites Top))}) (play (do (if (not (= 1 (var))) (roll)) next:(if (can Move (forEach Piece)) (forEach Piece) (move Pass (then (set Var 0)))) (then (if (is In (mapEntry ""Throw"" (count Pips)) (sites {2 8 12})) (moveAgain))))) (end (if (and (= 0 (count Sites in:(forEach (sites Occupied by:P1) if:(not (is In (site) (sites P2 ""Home"")))))) (= 0 (count Sites in:(forEach (sites Occupied by:P2) if:(not (is In (site) (sites P1 ""Home""))))))) (byScore {(score P1 (count Sites in:(forEach (sites P2 ""Home"") if:(= (who at:(site)) P1)))) (score P2 (count Sites in:(forEach (sites P1 ""Home"") if:(= (who at:(site)) P2))))})))))","###Description 4x12 board. Twelve pieces per player. Pieces begin in the outer rows of the board. Four sticks serve as dice, painted on one side and blank on the other. The throws are as follows: one blank side up = 2; two blank sides up = 0; three blank sides up = 0; four blank sides up = 8; four painted sides up = 12. Throws of 2, 8, and 12 give the player another throw. Players must use each throw to move a piece. They may only subdivide a throw in half to move two pieces, otherwise they must use one full throw to move a piece. The first move for each piece must be a throw of 2. This can be divided into two throws of 1 to move two pieces. Play moves from left to right in the player's home row, from right to left in the second row, left to right in the third row, and right to left in the opponent's home row. When a piece enters the opponent's home row, it can no longer move. When a player's piece lands on a space occupied by an opponent's piece, the opponent's piece is captured. A player may not land on the same space as another of the player's pieces. The player which fills up the most of the opponent's home row wins. @@ -944,11 +929,6 @@ Take turns placing stones on a hexhex board of size 4, or a square board of an o ###Ludii (game ""Chong (Sakhalin)"" (players 2) (equipment {(board (rectangle 3 12) {(track ""Track1"" ""0,E,N1,W,N1,E"" P1 directed:True) (track ""Track2"" ""35,W,S1,E,S1,W"" P2 directed:True)}) (dice d:6 num:4) (piece ""Marker"" Each (move (from) (to (trackSite Move from:(from) steps:(pips)) if:(or {(is Empty (to)) (and (is Enemy (who at:(to))) (if (not (= (what at:(to)) (id ""King"" Next))) True (= 1 (abs (- (to) (from))))))}) (apply if:(is Enemy (who at:(to))) (remove (to)))))) (piece ""King"" Each (if (= 1 (pips)) (if (<= 2 (count Pieces Mover)) (if (and (!= 1 (value Player Mover)) (= 1 (count Pieces Mover))) (move (from (from)) (to (from)) (then (set Value Mover 1))) (move (from) (to (trackSite Move from:(from) steps:(pips)) if:(or {(is Empty (to)) (and (is Enemy (who at:(to))) (if (not (= (what at:(to)) (id ""King"" Next))) True (= 1 (abs (- (to) (from))))))}) (apply if:(is Enemy (who at:(to))) (remove (to)))))) (firstMoveOnTrack ""Track"" Mover (if (and (> (site) (from)) (is Mover (who at:(site)))) (move Swap Pieces (from) (site)))))))}) (rules (start {(place ""Marker1"" (difference (sites Bottom) (sites Right))) (place ""King1"" (intersection (sites Bottom) (sites Right))) (place ""Marker2"" (difference (sites Top) (sites Left))) (place ""King2"" (intersection (sites Top) (sites Left)))}) phases:{(phase ""Opening"" (play (do (roll) next:(if (!= 0 (+ {(if (= 1 (face (+ 0 (count Sites in:(sites Board))))) 1 0) (if (= 1 (face (+ 1 (count Sites in:(sites Board))))) 1 0) (if (= 1 (face (+ 2 (count Sites in:(sites Board))))) 1 0) (if (= 1 (face (+ 3 (count Sites in:(sites Board))))) 1 0)})) (if (is Mover P1) (if (is Mover (who at:(- (where ""King"" Mover) (+ {(if (= 1 (face (+ 0 (count Sites in:(sites Board))))) 1 0) (if (= 1 (face (+ 1 (count Sites in:(sites Board))))) 1 0) (if (= 1 (face (+ 2 (count Sites in:(sites Board))))) 1 0) (if (= 1 (face (+ 3 (count Sites in:(sites Board))))) 1 0)})))) (move Swap Pieces (where ""King"" Mover) (- (where ""King"" Mover) (+ {(if (= 1 (face (+ 0 (count Sites in:(sites Board))))) 1 0) (if (= 1 (face (+ 1 (count Sites in:(sites Board))))) 1 0) (if (= 1 (face (+ 2 (count Sites in:(sites Board))))) 1 0) (if (= 1 (face (+ 3 (count Sites in:(sites Board))))) 1 0)})))) (if (is Mover (who at:(+ (where ""King"" Mover) (+ {(if (= 1 (face (+ 0 (count Sites in:(sites Board))))) 1 0) (if (= 1 (face (+ 1 (count Sites in:(sites Board))))) 1 0) (if (= 1 (face (+ 2 (count Sites in:(sites Board))))) 1 0) (if (= 1 (face (+ 3 (count Sites in:(sites Board))))) 1 0)})))) (move Swap Pieces (where ""King"" Mover) (+ (where ""King"" Mover) (+ {(if (= 1 (face (+ 0 (count Sites in:(sites Board))))) 1 0) (if (= 1 (face (+ 1 (count Sites in:(sites Board))))) 1 0) (if (= 1 (face (+ 2 (count Sites in:(sites Board))))) 1 0) (if (= 1 (face (+ 3 (count Sites in:(sites Board))))) 1 0)})))) (then (fromTo (from (last From)) (to (trackSite Move from:(last From) steps:(- (count Pips) (+ {(if (= 1 (face (+ 0 (count Sites in:(sites Board))))) 1 0) (if (= 1 (face (+ 1 (count Sites in:(sites Board))))) 1 0) (if (= 1 (face (+ 2 (count Sites in:(sites Board))))) 1 0) (if (= 1 (face (+ 3 (count Sites in:(sites Board))))) 1 0)}))) (apply if:(is Enemy (who at:(to))) (remove (to)))))))))) (nextPhase Mover (not (was Pass)) ""Playing"")) (phase ""Playing"" (play (do (if (not (is Prev Mover)) (roll)) next:(forEach Die if:(!= (pips) 0) (forEach Piece) (then (if (not (all DiceUsed)) (moveAgain)))))))} (end {(if (= (who at:0) P2) (result P2 Win)) (if (= (who at:(- (count Sites in:(sites Board)) 1)) P1) (result P1 Win))})))" -"Four 3x8 rectangles, arranged in a cross. No marked squares. Four players, each with four pieces, which are black, yellow, green, and red. Yellow seated at the bottom, red to their right, black to the right of red, green to the right of black. Green and red play on a team against black and yellow. Three four-sided rectangular dice, each marked 1, 2, 5, and 6. Pieces begin on the board, with one each in the sixth and seventh space of the central row of the player's arm, (counting from the top of the row), and in the seventh and eighth spaces of the left row of the arm belonging to the player to the right. The latter two pieces must move as a pair, I.e., they must always be moved together, and can only do so when doubles are thrown. The other two pieces belonging to a player may move singly. Throws may be split up as a player sees fit, but the value of one die must be used it its entirety by a piece. Pieces move around the board in an anti-clockwise direction until they reach their central row, at which point they move up the central row to the central spot. They must enter the central space by an exact throw. When a player moves all of their pieces to the center, they continue to throw the dice, and use these throws to move their partner's pieces. When all of the team's pieces reach the center, that team wins.","(game ""Chonpa"" (players 4) (equipment {(board (add (hole (merge (shift 0 (/ (- 19 3) 2) (rectangle 3 19)) (shift (/ (- 19 3) 2) 0 (rectangle 19 3))) (poly {{8 8} {8 11} {11 11} {11 8}})) cells:{{8 28 48 68 69 70 71 51 31 11 10 9}}) {(track ""TrackNormal1"" ""64,S,E,N,11,E,N,W,53,N,W,S,42,W,S,E,8,54,E1,N8"" P1 directed:True) (track ""TrackPaired1"" ""57,S,E,N,11,E,N,W,53,N,W,S,42,W,S,E,8,54,E1,N8"" P1 directed:True) (track ""TrackNormal2"" ""22,W,S,E,8,S,E,N,11,E,N,W,53,N,W,S,42,W,S1,E8"" P2 directed:True) (track ""TrackPaired2"" ""36,W,S,E,8,S,E,N,11,E,N,W,53,N,W,S,42,W,S1,E8"" P2 directed:True) (track ""TrackNormal3"" ""85,N,W,S,42,W,S,E,8,S,E,N,11,E,N,W,53,N,W1,S8"" P3 directed:True) (track ""TrackPaired3"" ""92,N,W,S,42,W,S,E,8,S,E,N,11,E,N,W,53,N,W1,S8"" P3 directed:True) (track ""TrackNormal4"" ""31,E,N,W,53,N,W,S,42,W,S,E,8,S,E,N,11,E,N1,W8"" P4 directed:True) (track ""TrackPaired4"" ""17,E,N,W,53,N,W,S,42,W,S,E,8,S,E,N,11,E,N1,W8"" P4 directed:True)}) (dice d:4 faces:{1 2 5 6} num:3) (piece ""Pawn"" Each (forEach Die if:(!= (pips) 0) (move (from (from) level:(level) if:(!= 0 (what at:(from) level:(level)))) (to (if (= 0 (state at:(from) level:(level))) (trackSite Move from:(from) ""TrackNormal"" steps:(pips)) (trackSite Move from:(from) ""TrackPaired"" steps:(pips))) if:(if (= 0 (state at:(from) level:(level))) (if (not (= 1 (var ""MovePair""))) True (or (all DiceEqual) (= (pips) (if (= (face 97) (face 98)) (face 99) (if (= (face 98) (face 99)) (face 97) (face 98)))))) (and {(not (= 1 (var ""MovePair""))) (or {(= (face 97) (face 98)) (= (face 97) (face 99)) (= (face 98) (face 99))}) (= (pips) (if (= (face 97) (face 98)) (face 97) (if (= (face 98) (face 99)) (face 98) (face 99)))) (< (count MovesThisTurn) 2) (if (= (count MovesThisTurn) 0) True (or (all DiceEqual) (!= (var ""Pips"") (if (= (face 97) (face 98)) (face 97) (if (= (face 98) (face 99)) (face 98) (face 99))))))})) (apply (and (if (= 1 (state at:(from))) (forEach Site (sites Occupied by:Mover top:False) (forEach Level (site) (if (and {(= 1 (state at:(site) level:(level))) (!= (from) (site)) (= (mover) (who at:(site) level:(level)))}) (fromTo (from (site) level:(level)) (to (trackSite Move from:(site) ""TrackPaired"" steps:(pips)))))))) (set Var ""Pips"" (pips))))) (then (if (and (not (= 1 (var ""MovePair""))) (if (= 1 (state at:(last To) level:(last LevelTo))) (< (count MovesThisTurn) 1) (< (count MovesThisTurn) 2))) (and (moveAgain) (if (= 1 (state at:(last To) level:(last LevelTo))) (set Var ""MovePair"" 1))) (and (set Var ""MovePair"" 0) (set Var ""Pips"" 0)))))))}) (rules (start {(set Team 1 {P1 P3}) (set Team 2 {P2 P4}) (place Stack ""Pawn1"" (sites {61 64})) (place Stack ""Pawn2"" (sites {21 22})) (place Stack ""Pawn3"" (sites {85 88})) (place Stack ""Pawn4"" (sites {31 32})) (place Stack ""Pawn1"" (sites {54 57}) state:1) (place Stack ""Pawn2"" (sites {35 36}) state:1) (place Stack ""Pawn3"" (sites {95 92}) state:1) (place Stack ""Pawn4"" (sites {17 18}) state:1)}) (play (do (if (not (is Prev Mover)) (roll)) next:(if (can Move (if (and (= 1 (count Sites in:(sites Occupied by:Mover top:False))) (is In (centrePoint) (sites Occupied by:Mover top:False))) (if (is Mover P1) (forEach Piece (forEach Die if:(!= (pips) 0) (move (from (from) level:(level) if:(!= 0 (what at:(from) level:(level)))) (to (if (= 0 (state at:(from) level:(level))) (trackSite Move from:(from) ""TrackNormal3"" steps:(pips)) (trackSite Move from:(from) ""TrackPaired3"" steps:(pips))) if:(if (= 0 (state at:(from) level:(level))) (if (not (= 1 (var ""MovePair""))) True (or (all DiceEqual) (= (pips) (if (= (face 97) (face 98)) (face 99) (if (= (face 98) (face 99)) (face 97) (face 98)))))) (and {(not (= 1 (var ""MovePair""))) (or {(= (face 97) (face 98)) (= (face 97) (face 99)) (= (face 98) (face 99))}) (= (pips) (if (= (face 97) (face 98)) (face 97) (if (= (face 98) (face 99)) (face 98) (face 99)))) (< (count MovesThisTurn) 2) (if (= (count MovesThisTurn) 0) True (or (all DiceEqual) (!= (var ""Pips"") (if (= (face 97) (face 98)) (face 97) (if (= (face 98) (face 99)) (face 98) (face 99))))))})) (apply (and (if (= 1 (state at:(from))) (forEach Site (sites Occupied by:Mover top:False) (forEach Level (site) (if (and {(= 1 (state at:(site) level:(level))) (!= (from) (site)) (= (mover) (who at:(site) level:(level)))}) (fromTo (from (site) level:(level)) (to (trackSite Move from:(site) ""TrackPaired3"" steps:(pips)))))))) (set Var ""Pips"" (pips))))) (then (if (and (not (= 1 (var ""MovePair""))) (if (= 1 (state at:(last To) level:(last LevelTo))) (< (count MovesThisTurn) 1) (< (count MovesThisTurn) 2))) (and (moveAgain) (if (= 1 (state at:(last To) level:(last LevelTo))) (set Var ""MovePair"" 1))) (and (set Var ""MovePair"" 0) (set Var ""Pips"" 0)))))) P3) (if (is Mover P3) (forEach Piece (forEach Die if:(!= (pips) 0) (move (from (from) level:(level) if:(!= 0 (what at:(from) level:(level)))) (to (if (= 0 (state at:(from) level:(level))) (trackSite Move from:(from) ""TrackNormal1"" steps:(pips)) (trackSite Move from:(from) ""TrackPaired1"" steps:(pips))) if:(if (= 0 (state at:(from) level:(level))) (if (not (= 1 (var ""MovePair""))) True (or (all DiceEqual) (= (pips) (if (= (face 97) (face 98)) (face 99) (if (= (face 98) (face 99)) (face 97) (face 98)))))) (and {(not (= 1 (var ""MovePair""))) (or {(= (face 97) (face 98)) (= (face 97) (face 99)) (= (face 98) (face 99))}) (= (pips) (if (= (face 97) (face 98)) (face 97) (if (= (face 98) (face 99)) (face 98) (face 99)))) (< (count MovesThisTurn) 2) (if (= (count MovesThisTurn) 0) True (or (all DiceEqual) (!= (var ""Pips"") (if (= (face 97) (face 98)) (face 97) (if (= (face 98) (face 99)) (face 98) (face 99))))))})) (apply (and (if (= 1 (state at:(from))) (forEach Site (sites Occupied by:Mover top:False) (forEach Level (site) (if (and {(= 1 (state at:(site) level:(level))) (!= (from) (site)) (= (mover) (who at:(site) level:(level)))}) (fromTo (from (site) level:(level)) (to (trackSite Move from:(site) ""TrackPaired1"" steps:(pips)))))))) (set Var ""Pips"" (pips))))) (then (if (and (not (= 1 (var ""MovePair""))) (if (= 1 (state at:(last To) level:(last LevelTo))) (< (count MovesThisTurn) 1) (< (count MovesThisTurn) 2))) (and (moveAgain) (if (= 1 (state at:(last To) level:(last LevelTo))) (set Var ""MovePair"" 1))) (and (set Var ""MovePair"" 0) (set Var ""Pips"" 0)))))) P1) (if (is Mover P4) (forEach Piece (forEach Die if:(!= (pips) 0) (move (from (from) level:(level) if:(!= 0 (what at:(from) level:(level)))) (to (if (= 0 (state at:(from) level:(level))) (trackSite Move from:(from) ""TrackNormal2"" steps:(pips)) (trackSite Move from:(from) ""TrackPaired2"" steps:(pips))) if:(if (= 0 (state at:(from) level:(level))) (if (not (= 1 (var ""MovePair""))) True (or (all DiceEqual) (= (pips) (if (= (face 97) (face 98)) (face 99) (if (= (face 98) (face 99)) (face 97) (face 98)))))) (and {(not (= 1 (var ""MovePair""))) (or {(= (face 97) (face 98)) (= (face 97) (face 99)) (= (face 98) (face 99))}) (= (pips) (if (= (face 97) (face 98)) (face 97) (if (= (face 98) (face 99)) (face 98) (face 99)))) (< (count MovesThisTurn) 2) (if (= (count MovesThisTurn) 0) True (or (all DiceEqual) (!= (var ""Pips"") (if (= (face 97) (face 98)) (face 97) (if (= (face 98) (face 99)) (face 98) (face 99))))))})) (apply (and (if (= 1 (state at:(from))) (forEach Site (sites Occupied by:Mover top:False) (forEach Level (site) (if (and {(= 1 (state at:(site) level:(level))) (!= (from) (site)) (= (mover) (who at:(site) level:(level)))}) (fromTo (from (site) level:(level)) (to (trackSite Move from:(site) ""TrackPaired2"" steps:(pips)))))))) (set Var ""Pips"" (pips))))) (then (if (and (not (= 1 (var ""MovePair""))) (if (= 1 (state at:(last To) level:(last LevelTo))) (< (count MovesThisTurn) 1) (< (count MovesThisTurn) 2))) (and (moveAgain) (if (= 1 (state at:(last To) level:(last LevelTo))) (set Var ""MovePair"" 1))) (and (set Var ""MovePair"" 0) (set Var ""Pips"" 0)))))) P2) (forEach Piece (forEach Die if:(!= (pips) 0) (move (from (from) level:(level) if:(!= 0 (what at:(from) level:(level)))) (to (if (= 0 (state at:(from) level:(level))) (trackSite Move from:(from) ""TrackNormal4"" steps:(pips)) (trackSite Move from:(from) ""TrackPaired4"" steps:(pips))) if:(if (= 0 (state at:(from) level:(level))) (if (not (= 1 (var ""MovePair""))) True (or (all DiceEqual) (= (pips) (if (= (face 97) (face 98)) (face 99) (if (= (face 98) (face 99)) (face 97) (face 98)))))) (and {(not (= 1 (var ""MovePair""))) (or {(= (face 97) (face 98)) (= (face 97) (face 99)) (= (face 98) (face 99))}) (= (pips) (if (= (face 97) (face 98)) (face 97) (if (= (face 98) (face 99)) (face 98) (face 99)))) (< (count MovesThisTurn) 2) (if (= (count MovesThisTurn) 0) True (or (all DiceEqual) (!= (var ""Pips"") (if (= (face 97) (face 98)) (face 97) (if (= (face 98) (face 99)) (face 98) (face 99))))))})) (apply (and (if (= 1 (state at:(from))) (forEach Site (sites Occupied by:Mover top:False) (forEach Level (site) (if (and {(= 1 (state at:(site) level:(level))) (!= (from) (site)) (= (mover) (who at:(site) level:(level)))}) (fromTo (from (site) level:(level)) (to (trackSite Move from:(site) ""TrackPaired4"" steps:(pips)))))))) (set Var ""Pips"" (pips))))) (then (if (and (not (= 1 (var ""MovePair""))) (if (= 1 (state at:(last To) level:(last LevelTo))) (< (count MovesThisTurn) 1) (< (count MovesThisTurn) 2))) (and (moveAgain) (if (= 1 (state at:(last To) level:(last LevelTo))) (set Var ""MovePair"" 1))) (and (set Var ""MovePair"" 0) (set Var ""Pips"" 0)))))) P4)))) (forEach Piece))) (if (and (= 1 (count Sites in:(sites Occupied by:Mover top:False))) (is In (centrePoint) (sites Occupied by:Mover top:False))) (if (is Mover P1) (forEach Piece (forEach Die if:(!= (pips) 0) (move (from (from) level:(level) if:(!= 0 (what at:(from) level:(level)))) (to (if (= 0 (state at:(from) level:(level))) (trackSite Move from:(from) ""TrackNormal3"" steps:(pips)) (trackSite Move from:(from) ""TrackPaired3"" steps:(pips))) if:(if (= 0 (state at:(from) level:(level))) (if (not (= 1 (var ""MovePair""))) True (or (all DiceEqual) (= (pips) (if (= (face 97) (face 98)) (face 99) (if (= (face 98) (face 99)) (face 97) (face 98)))))) (and {(not (= 1 (var ""MovePair""))) (or {(= (face 97) (face 98)) (= (face 97) (face 99)) (= (face 98) (face 99))}) (= (pips) (if (= (face 97) (face 98)) (face 97) (if (= (face 98) (face 99)) (face 98) (face 99)))) (< (count MovesThisTurn) 2) (if (= (count MovesThisTurn) 0) True (or (all DiceEqual) (!= (var ""Pips"") (if (= (face 97) (face 98)) (face 97) (if (= (face 98) (face 99)) (face 98) (face 99))))))})) (apply (and (if (= 1 (state at:(from))) (forEach Site (sites Occupied by:Mover top:False) (forEach Level (site) (if (and {(= 1 (state at:(site) level:(level))) (!= (from) (site)) (= (mover) (who at:(site) level:(level)))}) (fromTo (from (site) level:(level)) (to (trackSite Move from:(site) ""TrackPaired3"" steps:(pips)))))))) (set Var ""Pips"" (pips))))) (then (if (and (not (= 1 (var ""MovePair""))) (if (= 1 (state at:(last To) level:(last LevelTo))) (< (count MovesThisTurn) 1) (< (count MovesThisTurn) 2))) (and (moveAgain) (if (= 1 (state at:(last To) level:(last LevelTo))) (set Var ""MovePair"" 1))) (and (set Var ""MovePair"" 0) (set Var ""Pips"" 0)))))) P3) (if (is Mover P3) (forEach Piece (forEach Die if:(!= (pips) 0) (move (from (from) level:(level) if:(!= 0 (what at:(from) level:(level)))) (to (if (= 0 (state at:(from) level:(level))) (trackSite Move from:(from) ""TrackNormal1"" steps:(pips)) (trackSite Move from:(from) ""TrackPaired1"" steps:(pips))) if:(if (= 0 (state at:(from) level:(level))) (if (not (= 1 (var ""MovePair""))) True (or (all DiceEqual) (= (pips) (if (= (face 97) (face 98)) (face 99) (if (= (face 98) (face 99)) (face 97) (face 98)))))) (and {(not (= 1 (var ""MovePair""))) (or {(= (face 97) (face 98)) (= (face 97) (face 99)) (= (face 98) (face 99))}) (= (pips) (if (= (face 97) (face 98)) (face 97) (if (= (face 98) (face 99)) (face 98) (face 99)))) (< (count MovesThisTurn) 2) (if (= (count MovesThisTurn) 0) True (or (all DiceEqual) (!= (var ""Pips"") (if (= (face 97) (face 98)) (face 97) (if (= (face 98) (face 99)) (face 98) (face 99))))))})) (apply (and (if (= 1 (state at:(from))) (forEach Site (sites Occupied by:Mover top:False) (forEach Level (site) (if (and {(= 1 (state at:(site) level:(level))) (!= (from) (site)) (= (mover) (who at:(site) level:(level)))}) (fromTo (from (site) level:(level)) (to (trackSite Move from:(site) ""TrackPaired1"" steps:(pips)))))))) (set Var ""Pips"" (pips))))) (then (if (and (not (= 1 (var ""MovePair""))) (if (= 1 (state at:(last To) level:(last LevelTo))) (< (count MovesThisTurn) 1) (< (count MovesThisTurn) 2))) (and (moveAgain) (if (= 1 (state at:(last To) level:(last LevelTo))) (set Var ""MovePair"" 1))) (and (set Var ""MovePair"" 0) (set Var ""Pips"" 0)))))) P1) (if (is Mover P4) (forEach Piece (forEach Die if:(!= (pips) 0) (move (from (from) level:(level) if:(!= 0 (what at:(from) level:(level)))) (to (if (= 0 (state at:(from) level:(level))) (trackSite Move from:(from) ""TrackNormal2"" steps:(pips)) (trackSite Move from:(from) ""TrackPaired2"" steps:(pips))) if:(if (= 0 (state at:(from) level:(level))) (if (not (= 1 (var ""MovePair""))) True (or (all DiceEqual) (= (pips) (if (= (face 97) (face 98)) (face 99) (if (= (face 98) (face 99)) (face 97) (face 98)))))) (and {(not (= 1 (var ""MovePair""))) (or {(= (face 97) (face 98)) (= (face 97) (face 99)) (= (face 98) (face 99))}) (= (pips) (if (= (face 97) (face 98)) (face 97) (if (= (face 98) (face 99)) (face 98) (face 99)))) (< (count MovesThisTurn) 2) (if (= (count MovesThisTurn) 0) True (or (all DiceEqual) (!= (var ""Pips"") (if (= (face 97) (face 98)) (face 97) (if (= (face 98) (face 99)) (face 98) (face 99))))))})) (apply (and (if (= 1 (state at:(from))) (forEach Site (sites Occupied by:Mover top:False) (forEach Level (site) (if (and {(= 1 (state at:(site) level:(level))) (!= (from) (site)) (= (mover) (who at:(site) level:(level)))}) (fromTo (from (site) level:(level)) (to (trackSite Move from:(site) ""TrackPaired2"" steps:(pips)))))))) (set Var ""Pips"" (pips))))) (then (if (and (not (= 1 (var ""MovePair""))) (if (= 1 (state at:(last To) level:(last LevelTo))) (< (count MovesThisTurn) 1) (< (count MovesThisTurn) 2))) (and (moveAgain) (if (= 1 (state at:(last To) level:(last LevelTo))) (set Var ""MovePair"" 1))) (and (set Var ""MovePair"" 0) (set Var ""Pips"" 0)))))) P2) (forEach Piece (forEach Die if:(!= (pips) 0) (move (from (from) level:(level) if:(!= 0 (what at:(from) level:(level)))) (to (if (= 0 (state at:(from) level:(level))) (trackSite Move from:(from) ""TrackNormal4"" steps:(pips)) (trackSite Move from:(from) ""TrackPaired4"" steps:(pips))) if:(if (= 0 (state at:(from) level:(level))) (if (not (= 1 (var ""MovePair""))) True (or (all DiceEqual) (= (pips) (if (= (face 97) (face 98)) (face 99) (if (= (face 98) (face 99)) (face 97) (face 98)))))) (and {(not (= 1 (var ""MovePair""))) (or {(= (face 97) (face 98)) (= (face 97) (face 99)) (= (face 98) (face 99))}) (= (pips) (if (= (face 97) (face 98)) (face 97) (if (= (face 98) (face 99)) (face 98) (face 99)))) (< (count MovesThisTurn) 2) (if (= (count MovesThisTurn) 0) True (or (all DiceEqual) (!= (var ""Pips"") (if (= (face 97) (face 98)) (face 97) (if (= (face 98) (face 99)) (face 98) (face 99))))))})) (apply (and (if (= 1 (state at:(from))) (forEach Site (sites Occupied by:Mover top:False) (forEach Level (site) (if (and {(= 1 (state at:(site) level:(level))) (!= (from) (site)) (= (mover) (who at:(site) level:(level)))}) (fromTo (from (site) level:(level)) (to (trackSite Move from:(site) ""TrackPaired4"" steps:(pips)))))))) (set Var ""Pips"" (pips))))) (then (if (and (not (= 1 (var ""MovePair""))) (if (= 1 (state at:(last To) level:(last LevelTo))) (< (count MovesThisTurn) 1) (< (count MovesThisTurn) 2))) (and (moveAgain) (if (= 1 (state at:(last To) level:(last LevelTo))) (set Var ""MovePair"" 1))) (and (set Var ""MovePair"" 0) (set Var ""Pips"" 0)))))) P4)))) (forEach Piece)) (move Pass (then (and (set Var ""MovePair"" 0) (set Var ""Pips"" 0))))))) (end (if (and (= 1 (count Sites in:(sites Occupied by:TeamMover top:False))) (is In (centrePoint) (sites Occupied by:TeamMover top:False))) (result TeamMover Win)))))","###Description -Four 3x8 rectangles, arranged in a cross. No marked squares. Four players, each with four pieces, which are black, yellow, green, and red. Yellow seated at the bottom, red to their right, black to the right of red, green to the right of black. Green and red play on a team against black and yellow. Three four-sided rectangular dice, each marked 1, 2, 5, and 6. Pieces begin on the board, with one each in the sixth and seventh space of the central row of the player's arm, (counting from the top of the row), and in the seventh and eighth spaces of the left row of the arm belonging to the player to the right. The latter two pieces must move as a pair, I.e., they must always be moved together, and can only do so when doubles are thrown. The other two pieces belonging to a player may move singly. Throws may be split up as a player sees fit, but the value of one die must be used it its entirety by a piece. Pieces move around the board in an anti-clockwise direction until they reach their central row, at which point they move up the central row to the central spot. They must enter the central space by an exact throw. When a player moves all of their pieces to the center, they continue to throw the dice, and use these throws to move their partner's pieces. When all of the team's pieces reach the center, that team wins. - -###Ludii -(game ""Chonpa"" (players 4) (equipment {(board (add (hole (merge (shift 0 (/ (- 19 3) 2) (rectangle 3 19)) (shift (/ (- 19 3) 2) 0 (rectangle 19 3))) (poly {{8 8} {8 11} {11 11} {11 8}})) cells:{{8 28 48 68 69 70 71 51 31 11 10 9}}) {(track ""TrackNormal1"" ""64,S,E,N,11,E,N,W,53,N,W,S,42,W,S,E,8,54,E1,N8"" P1 directed:True) (track ""TrackPaired1"" ""57,S,E,N,11,E,N,W,53,N,W,S,42,W,S,E,8,54,E1,N8"" P1 directed:True) (track ""TrackNormal2"" ""22,W,S,E,8,S,E,N,11,E,N,W,53,N,W,S,42,W,S1,E8"" P2 directed:True) (track ""TrackPaired2"" ""36,W,S,E,8,S,E,N,11,E,N,W,53,N,W,S,42,W,S1,E8"" P2 directed:True) (track ""TrackNormal3"" ""85,N,W,S,42,W,S,E,8,S,E,N,11,E,N,W,53,N,W1,S8"" P3 directed:True) (track ""TrackPaired3"" ""92,N,W,S,42,W,S,E,8,S,E,N,11,E,N,W,53,N,W1,S8"" P3 directed:True) (track ""TrackNormal4"" ""31,E,N,W,53,N,W,S,42,W,S,E,8,S,E,N,11,E,N1,W8"" P4 directed:True) (track ""TrackPaired4"" ""17,E,N,W,53,N,W,S,42,W,S,E,8,S,E,N,11,E,N1,W8"" P4 directed:True)}) (dice d:4 faces:{1 2 5 6} num:3) (piece ""Pawn"" Each (forEach Die if:(!= (pips) 0) (move (from (from) level:(level) if:(!= 0 (what at:(from) level:(level)))) (to (if (= 0 (state at:(from) level:(level))) (trackSite Move from:(from) ""TrackNormal"" steps:(pips)) (trackSite Move from:(from) ""TrackPaired"" steps:(pips))) if:(if (= 0 (state at:(from) level:(level))) (if (not (= 1 (var ""MovePair""))) True (or (all DiceEqual) (= (pips) (if (= (face 97) (face 98)) (face 99) (if (= (face 98) (face 99)) (face 97) (face 98)))))) (and {(not (= 1 (var ""MovePair""))) (or {(= (face 97) (face 98)) (= (face 97) (face 99)) (= (face 98) (face 99))}) (= (pips) (if (= (face 97) (face 98)) (face 97) (if (= (face 98) (face 99)) (face 98) (face 99)))) (< (count MovesThisTurn) 2) (if (= (count MovesThisTurn) 0) True (or (all DiceEqual) (!= (var ""Pips"") (if (= (face 97) (face 98)) (face 97) (if (= (face 98) (face 99)) (face 98) (face 99))))))})) (apply (and (if (= 1 (state at:(from))) (forEach Site (sites Occupied by:Mover top:False) (forEach Level (site) (if (and {(= 1 (state at:(site) level:(level))) (!= (from) (site)) (= (mover) (who at:(site) level:(level)))}) (fromTo (from (site) level:(level)) (to (trackSite Move from:(site) ""TrackPaired"" steps:(pips)))))))) (set Var ""Pips"" (pips))))) (then (if (and (not (= 1 (var ""MovePair""))) (if (= 1 (state at:(last To) level:(last LevelTo))) (< (count MovesThisTurn) 1) (< (count MovesThisTurn) 2))) (and (moveAgain) (if (= 1 (state at:(last To) level:(last LevelTo))) (set Var ""MovePair"" 1))) (and (set Var ""MovePair"" 0) (set Var ""Pips"" 0)))))))}) (rules (start {(set Team 1 {P1 P3}) (set Team 2 {P2 P4}) (place Stack ""Pawn1"" (sites {61 64})) (place Stack ""Pawn2"" (sites {21 22})) (place Stack ""Pawn3"" (sites {85 88})) (place Stack ""Pawn4"" (sites {31 32})) (place Stack ""Pawn1"" (sites {54 57}) state:1) (place Stack ""Pawn2"" (sites {35 36}) state:1) (place Stack ""Pawn3"" (sites {95 92}) state:1) (place Stack ""Pawn4"" (sites {17 18}) state:1)}) (play (do (if (not (is Prev Mover)) (roll)) next:(if (can Move (if (and (= 1 (count Sites in:(sites Occupied by:Mover top:False))) (is In (centrePoint) (sites Occupied by:Mover top:False))) (if (is Mover P1) (forEach Piece (forEach Die if:(!= (pips) 0) (move (from (from) level:(level) if:(!= 0 (what at:(from) level:(level)))) (to (if (= 0 (state at:(from) level:(level))) (trackSite Move from:(from) ""TrackNormal3"" steps:(pips)) (trackSite Move from:(from) ""TrackPaired3"" steps:(pips))) if:(if (= 0 (state at:(from) level:(level))) (if (not (= 1 (var ""MovePair""))) True (or (all DiceEqual) (= (pips) (if (= (face 97) (face 98)) (face 99) (if (= (face 98) (face 99)) (face 97) (face 98)))))) (and {(not (= 1 (var ""MovePair""))) (or {(= (face 97) (face 98)) (= (face 97) (face 99)) (= (face 98) (face 99))}) (= (pips) (if (= (face 97) (face 98)) (face 97) (if (= (face 98) (face 99)) (face 98) (face 99)))) (< (count MovesThisTurn) 2) (if (= (count MovesThisTurn) 0) True (or (all DiceEqual) (!= (var ""Pips"") (if (= (face 97) (face 98)) (face 97) (if (= (face 98) (face 99)) (face 98) (face 99))))))})) (apply (and (if (= 1 (state at:(from))) (forEach Site (sites Occupied by:Mover top:False) (forEach Level (site) (if (and {(= 1 (state at:(site) level:(level))) (!= (from) (site)) (= (mover) (who at:(site) level:(level)))}) (fromTo (from (site) level:(level)) (to (trackSite Move from:(site) ""TrackPaired3"" steps:(pips)))))))) (set Var ""Pips"" (pips))))) (then (if (and (not (= 1 (var ""MovePair""))) (if (= 1 (state at:(last To) level:(last LevelTo))) (< (count MovesThisTurn) 1) (< (count MovesThisTurn) 2))) (and (moveAgain) (if (= 1 (state at:(last To) level:(last LevelTo))) (set Var ""MovePair"" 1))) (and (set Var ""MovePair"" 0) (set Var ""Pips"" 0)))))) P3) (if (is Mover P3) (forEach Piece (forEach Die if:(!= (pips) 0) (move (from (from) level:(level) if:(!= 0 (what at:(from) level:(level)))) (to (if (= 0 (state at:(from) level:(level))) (trackSite Move from:(from) ""TrackNormal1"" steps:(pips)) (trackSite Move from:(from) ""TrackPaired1"" steps:(pips))) if:(if (= 0 (state at:(from) level:(level))) (if (not (= 1 (var ""MovePair""))) True (or (all DiceEqual) (= (pips) (if (= (face 97) (face 98)) (face 99) (if (= (face 98) (face 99)) (face 97) (face 98)))))) (and {(not (= 1 (var ""MovePair""))) (or {(= (face 97) (face 98)) (= (face 97) (face 99)) (= (face 98) (face 99))}) (= (pips) (if (= (face 97) (face 98)) (face 97) (if (= (face 98) (face 99)) (face 98) (face 99)))) (< (count MovesThisTurn) 2) (if (= (count MovesThisTurn) 0) True (or (all DiceEqual) (!= (var ""Pips"") (if (= (face 97) (face 98)) (face 97) (if (= (face 98) (face 99)) (face 98) (face 99))))))})) (apply (and (if (= 1 (state at:(from))) (forEach Site (sites Occupied by:Mover top:False) (forEach Level (site) (if (and {(= 1 (state at:(site) level:(level))) (!= (from) (site)) (= (mover) (who at:(site) level:(level)))}) (fromTo (from (site) level:(level)) (to (trackSite Move from:(site) ""TrackPaired1"" steps:(pips)))))))) (set Var ""Pips"" (pips))))) (then (if (and (not (= 1 (var ""MovePair""))) (if (= 1 (state at:(last To) level:(last LevelTo))) (< (count MovesThisTurn) 1) (< (count MovesThisTurn) 2))) (and (moveAgain) (if (= 1 (state at:(last To) level:(last LevelTo))) (set Var ""MovePair"" 1))) (and (set Var ""MovePair"" 0) (set Var ""Pips"" 0)))))) P1) (if (is Mover P4) (forEach Piece (forEach Die if:(!= (pips) 0) (move (from (from) level:(level) if:(!= 0 (what at:(from) level:(level)))) (to (if (= 0 (state at:(from) level:(level))) (trackSite Move from:(from) ""TrackNormal2"" steps:(pips)) (trackSite Move from:(from) ""TrackPaired2"" steps:(pips))) if:(if (= 0 (state at:(from) level:(level))) (if (not (= 1 (var ""MovePair""))) True (or (all DiceEqual) (= (pips) (if (= (face 97) (face 98)) (face 99) (if (= (face 98) (face 99)) (face 97) (face 98)))))) (and {(not (= 1 (var ""MovePair""))) (or {(= (face 97) (face 98)) (= (face 97) (face 99)) (= (face 98) (face 99))}) (= (pips) (if (= (face 97) (face 98)) (face 97) (if (= (face 98) (face 99)) (face 98) (face 99)))) (< (count MovesThisTurn) 2) (if (= (count MovesThisTurn) 0) True (or (all DiceEqual) (!= (var ""Pips"") (if (= (face 97) (face 98)) (face 97) (if (= (face 98) (face 99)) (face 98) (face 99))))))})) (apply (and (if (= 1 (state at:(from))) (forEach Site (sites Occupied by:Mover top:False) (forEach Level (site) (if (and {(= 1 (state at:(site) level:(level))) (!= (from) (site)) (= (mover) (who at:(site) level:(level)))}) (fromTo (from (site) level:(level)) (to (trackSite Move from:(site) ""TrackPaired2"" steps:(pips)))))))) (set Var ""Pips"" (pips))))) (then (if (and (not (= 1 (var ""MovePair""))) (if (= 1 (state at:(last To) level:(last LevelTo))) (< (count MovesThisTurn) 1) (< (count MovesThisTurn) 2))) (and (moveAgain) (if (= 1 (state at:(last To) level:(last LevelTo))) (set Var ""MovePair"" 1))) (and (set Var ""MovePair"" 0) (set Var ""Pips"" 0)))))) P2) (forEach Piece (forEach Die if:(!= (pips) 0) (move (from (from) level:(level) if:(!= 0 (what at:(from) level:(level)))) (to (if (= 0 (state at:(from) level:(level))) (trackSite Move from:(from) ""TrackNormal4"" steps:(pips)) (trackSite Move from:(from) ""TrackPaired4"" steps:(pips))) if:(if (= 0 (state at:(from) level:(level))) (if (not (= 1 (var ""MovePair""))) True (or (all DiceEqual) (= (pips) (if (= (face 97) (face 98)) (face 99) (if (= (face 98) (face 99)) (face 97) (face 98)))))) (and {(not (= 1 (var ""MovePair""))) (or {(= (face 97) (face 98)) (= (face 97) (face 99)) (= (face 98) (face 99))}) (= (pips) (if (= (face 97) (face 98)) (face 97) (if (= (face 98) (face 99)) (face 98) (face 99)))) (< (count MovesThisTurn) 2) (if (= (count MovesThisTurn) 0) True (or (all DiceEqual) (!= (var ""Pips"") (if (= (face 97) (face 98)) (face 97) (if (= (face 98) (face 99)) (face 98) (face 99))))))})) (apply (and (if (= 1 (state at:(from))) (forEach Site (sites Occupied by:Mover top:False) (forEach Level (site) (if (and {(= 1 (state at:(site) level:(level))) (!= (from) (site)) (= (mover) (who at:(site) level:(level)))}) (fromTo (from (site) level:(level)) (to (trackSite Move from:(site) ""TrackPaired4"" steps:(pips)))))))) (set Var ""Pips"" (pips))))) (then (if (and (not (= 1 (var ""MovePair""))) (if (= 1 (state at:(last To) level:(last LevelTo))) (< (count MovesThisTurn) 1) (< (count MovesThisTurn) 2))) (and (moveAgain) (if (= 1 (state at:(last To) level:(last LevelTo))) (set Var ""MovePair"" 1))) (and (set Var ""MovePair"" 0) (set Var ""Pips"" 0)))))) P4)))) (forEach Piece))) (if (and (= 1 (count Sites in:(sites Occupied by:Mover top:False))) (is In (centrePoint) (sites Occupied by:Mover top:False))) (if (is Mover P1) (forEach Piece (forEach Die if:(!= (pips) 0) (move (from (from) level:(level) if:(!= 0 (what at:(from) level:(level)))) (to (if (= 0 (state at:(from) level:(level))) (trackSite Move from:(from) ""TrackNormal3"" steps:(pips)) (trackSite Move from:(from) ""TrackPaired3"" steps:(pips))) if:(if (= 0 (state at:(from) level:(level))) (if (not (= 1 (var ""MovePair""))) True (or (all DiceEqual) (= (pips) (if (= (face 97) (face 98)) (face 99) (if (= (face 98) (face 99)) (face 97) (face 98)))))) (and {(not (= 1 (var ""MovePair""))) (or {(= (face 97) (face 98)) (= (face 97) (face 99)) (= (face 98) (face 99))}) (= (pips) (if (= (face 97) (face 98)) (face 97) (if (= (face 98) (face 99)) (face 98) (face 99)))) (< (count MovesThisTurn) 2) (if (= (count MovesThisTurn) 0) True (or (all DiceEqual) (!= (var ""Pips"") (if (= (face 97) (face 98)) (face 97) (if (= (face 98) (face 99)) (face 98) (face 99))))))})) (apply (and (if (= 1 (state at:(from))) (forEach Site (sites Occupied by:Mover top:False) (forEach Level (site) (if (and {(= 1 (state at:(site) level:(level))) (!= (from) (site)) (= (mover) (who at:(site) level:(level)))}) (fromTo (from (site) level:(level)) (to (trackSite Move from:(site) ""TrackPaired3"" steps:(pips)))))))) (set Var ""Pips"" (pips))))) (then (if (and (not (= 1 (var ""MovePair""))) (if (= 1 (state at:(last To) level:(last LevelTo))) (< (count MovesThisTurn) 1) (< (count MovesThisTurn) 2))) (and (moveAgain) (if (= 1 (state at:(last To) level:(last LevelTo))) (set Var ""MovePair"" 1))) (and (set Var ""MovePair"" 0) (set Var ""Pips"" 0)))))) P3) (if (is Mover P3) (forEach Piece (forEach Die if:(!= (pips) 0) (move (from (from) level:(level) if:(!= 0 (what at:(from) level:(level)))) (to (if (= 0 (state at:(from) level:(level))) (trackSite Move from:(from) ""TrackNormal1"" steps:(pips)) (trackSite Move from:(from) ""TrackPaired1"" steps:(pips))) if:(if (= 0 (state at:(from) level:(level))) (if (not (= 1 (var ""MovePair""))) True (or (all DiceEqual) (= (pips) (if (= (face 97) (face 98)) (face 99) (if (= (face 98) (face 99)) (face 97) (face 98)))))) (and {(not (= 1 (var ""MovePair""))) (or {(= (face 97) (face 98)) (= (face 97) (face 99)) (= (face 98) (face 99))}) (= (pips) (if (= (face 97) (face 98)) (face 97) (if (= (face 98) (face 99)) (face 98) (face 99)))) (< (count MovesThisTurn) 2) (if (= (count MovesThisTurn) 0) True (or (all DiceEqual) (!= (var ""Pips"") (if (= (face 97) (face 98)) (face 97) (if (= (face 98) (face 99)) (face 98) (face 99))))))})) (apply (and (if (= 1 (state at:(from))) (forEach Site (sites Occupied by:Mover top:False) (forEach Level (site) (if (and {(= 1 (state at:(site) level:(level))) (!= (from) (site)) (= (mover) (who at:(site) level:(level)))}) (fromTo (from (site) level:(level)) (to (trackSite Move from:(site) ""TrackPaired1"" steps:(pips)))))))) (set Var ""Pips"" (pips))))) (then (if (and (not (= 1 (var ""MovePair""))) (if (= 1 (state at:(last To) level:(last LevelTo))) (< (count MovesThisTurn) 1) (< (count MovesThisTurn) 2))) (and (moveAgain) (if (= 1 (state at:(last To) level:(last LevelTo))) (set Var ""MovePair"" 1))) (and (set Var ""MovePair"" 0) (set Var ""Pips"" 0)))))) P1) (if (is Mover P4) (forEach Piece (forEach Die if:(!= (pips) 0) (move (from (from) level:(level) if:(!= 0 (what at:(from) level:(level)))) (to (if (= 0 (state at:(from) level:(level))) (trackSite Move from:(from) ""TrackNormal2"" steps:(pips)) (trackSite Move from:(from) ""TrackPaired2"" steps:(pips))) if:(if (= 0 (state at:(from) level:(level))) (if (not (= 1 (var ""MovePair""))) True (or (all DiceEqual) (= (pips) (if (= (face 97) (face 98)) (face 99) (if (= (face 98) (face 99)) (face 97) (face 98)))))) (and {(not (= 1 (var ""MovePair""))) (or {(= (face 97) (face 98)) (= (face 97) (face 99)) (= (face 98) (face 99))}) (= (pips) (if (= (face 97) (face 98)) (face 97) (if (= (face 98) (face 99)) (face 98) (face 99)))) (< (count MovesThisTurn) 2) (if (= (count MovesThisTurn) 0) True (or (all DiceEqual) (!= (var ""Pips"") (if (= (face 97) (face 98)) (face 97) (if (= (face 98) (face 99)) (face 98) (face 99))))))})) (apply (and (if (= 1 (state at:(from))) (forEach Site (sites Occupied by:Mover top:False) (forEach Level (site) (if (and {(= 1 (state at:(site) level:(level))) (!= (from) (site)) (= (mover) (who at:(site) level:(level)))}) (fromTo (from (site) level:(level)) (to (trackSite Move from:(site) ""TrackPaired2"" steps:(pips)))))))) (set Var ""Pips"" (pips))))) (then (if (and (not (= 1 (var ""MovePair""))) (if (= 1 (state at:(last To) level:(last LevelTo))) (< (count MovesThisTurn) 1) (< (count MovesThisTurn) 2))) (and (moveAgain) (if (= 1 (state at:(last To) level:(last LevelTo))) (set Var ""MovePair"" 1))) (and (set Var ""MovePair"" 0) (set Var ""Pips"" 0)))))) P2) (forEach Piece (forEach Die if:(!= (pips) 0) (move (from (from) level:(level) if:(!= 0 (what at:(from) level:(level)))) (to (if (= 0 (state at:(from) level:(level))) (trackSite Move from:(from) ""TrackNormal4"" steps:(pips)) (trackSite Move from:(from) ""TrackPaired4"" steps:(pips))) if:(if (= 0 (state at:(from) level:(level))) (if (not (= 1 (var ""MovePair""))) True (or (all DiceEqual) (= (pips) (if (= (face 97) (face 98)) (face 99) (if (= (face 98) (face 99)) (face 97) (face 98)))))) (and {(not (= 1 (var ""MovePair""))) (or {(= (face 97) (face 98)) (= (face 97) (face 99)) (= (face 98) (face 99))}) (= (pips) (if (= (face 97) (face 98)) (face 97) (if (= (face 98) (face 99)) (face 98) (face 99)))) (< (count MovesThisTurn) 2) (if (= (count MovesThisTurn) 0) True (or (all DiceEqual) (!= (var ""Pips"") (if (= (face 97) (face 98)) (face 97) (if (= (face 98) (face 99)) (face 98) (face 99))))))})) (apply (and (if (= 1 (state at:(from))) (forEach Site (sites Occupied by:Mover top:False) (forEach Level (site) (if (and {(= 1 (state at:(site) level:(level))) (!= (from) (site)) (= (mover) (who at:(site) level:(level)))}) (fromTo (from (site) level:(level)) (to (trackSite Move from:(site) ""TrackPaired4"" steps:(pips)))))))) (set Var ""Pips"" (pips))))) (then (if (and (not (= 1 (var ""MovePair""))) (if (= 1 (state at:(last To) level:(last LevelTo))) (< (count MovesThisTurn) 1) (< (count MovesThisTurn) 2))) (and (moveAgain) (if (= 1 (state at:(last To) level:(last LevelTo))) (set Var ""MovePair"" 1))) (and (set Var ""MovePair"" 0) (set Var ""Pips"" 0)))))) P4)))) (forEach Piece)) (move Pass (then (and (set Var ""MovePair"" 0) (set Var ""Pips"" 0))))))) (end (if (and (= 1 (count Sites in:(sites Occupied by:TeamMover top:False))) (is In (centrePoint) (sites Occupied by:TeamMover top:False))) (result TeamMover Win)))))" "The game is played on a square board with a 5×5 grid. Each player has six cubes, numbered one to six. During setup, each player can arrange the cubes as he or she sees fit within the triangular area of their own color. The players take turns rolling a six-sided die and then moving the matching cube. If the matching cube is no longer on the board, the player moves a remaining cube whose number is next-higher or next-lower to the rolled number. The player starting in the top-left may move that cube one square to the right, down, or on the diagonal down and to the right; the player starting in the bottom-right may move that cube one square to the left, up, or on the diagonal up and to the left. Any cube which already lies in the target square is removed from the board. The objective of the game is for a player to either get one of their cubes to the far corner square in the grid (where their opponent started) or to remove all of their opponent's cubes from the board. The version of the game played on 5x5 board.","(game ""EinStein Wurfelt Nicht"" (players {(player SE) (player NW)}) (equipment {(board (square 5)) (piece ""Square"" Each) (hand Each size:6) (dice num:1) (regions ""Home"" P1 (expand (intersection (sites Top) (sites Left)) steps:2 Orthogonal)) (regions ""Home"" P2 (expand (intersection (sites Bottom) (sites Right)) steps:2 Orthogonal)) (regions ""Goal"" P1 (intersection (sites Bottom) (sites Right))) (regions ""Goal"" P2 (intersection (sites Top) (sites Left)))}) (rules (start {(place ""Square1"" (handSite P1) state:1) (place ""Square1"" (handSite P1 1) state:2) (place ""Square1"" (handSite P1 2) state:3) (place ""Square1"" (handSite P1 3) state:4) (place ""Square1"" (handSite P1 4) state:5) (place ""Square1"" (handSite P1 5) state:6) (place ""Square2"" (handSite P2) state:1) (place ""Square2"" (handSite P2 1) state:2) (place ""Square2"" (handSite P2 2) state:3) (place ""Square2"" (handSite P2 3) state:4) (place ""Square2"" (handSite P2 4) state:5) (place ""Square2"" (handSite P2 5) state:6)}) phases:{(phase ""Placement"" (play (move (from (sites Occupied by:Mover container:(mover))) (to (forEach (sites Mover ""Home"") if:(is Empty (site)))))) (nextPhase Mover (all Sites (sites Hand Mover) if:(= 0 (count Cell at:(site)))) ""Movement"")) (phase ""Movement"" (play (do (roll) next:(if (!= (where ""Square"" Mover state:(count Pips)) -1) (forEach Piece (if (= (state at:(from)) (count Pips)) (move Step Forwards (to if:True (apply (if (is Occupied (to)) (remove (to)))))))) (or (forEach Piece (if (if (!= (where ""Square"" Mover state:(+ (count Pips) 1)) -1) (= (state at:(from)) (+ (count Pips) 1)) (if (!= (where ""Square"" Mover state:(+ (count Pips) 2)) -1) (= (state at:(from)) (+ (count Pips) 2)) (if (!= (where ""Square"" Mover state:(+ (count Pips) 3)) -1) (= (state at:(from)) (+ (count Pips) 3)) (if (!= (where ""Square"" Mover state:(+ (count Pips) 4)) -1) (= (state at:(from)) (+ (count Pips) 4)) (= (state at:(from)) (+ (count Pips) 5)))))) (move Step Forwards (to if:True (apply (if (is Occupied (to)) (remove (to)))))))) (forEach Piece (if (if (!= (where ""Square"" Mover state:(- (count Pips) 1)) -1) (= (state at:(from)) (- (count Pips) 1)) (if (!= (where ""Square"" Mover state:(- (count Pips) 2)) -1) (= (state at:(from)) (- (count Pips) 2)) (if (!= (where ""Square"" Mover state:(- (count Pips) 3)) -1) (= (state at:(from)) (- (count Pips) 3)) (if (!= (where ""Square"" Mover state:(- (count Pips) 4)) -1) (= (state at:(from)) (- (count Pips) 4)) (= (state at:(from)) (- (count Pips) 5)))))) (move Step Forwards (to if:True (apply (if (is Occupied (to)) (remove (to)))))))))))))} (end (if (or (no Pieces Next) (all Sites (sites Mover ""Goal"") if:(is In (site) (sites Occupied by:Mover)))) (result Mover Win)))))","###Description The game is played on a square board with a 5×5 grid. Each player has six cubes, numbered one to six. During setup, each player can arrange the cubes as he or she sees fit within the triangular area of their own color. The players take turns rolling a six-sided die and then moving the matching cube. If the matching cube is no longer on the board, the player moves a remaining cube whose number is next-higher or next-lower to the rolled number. The player starting in the top-left may move that cube one square to the right, down, or on the diagonal down and to the right; the player starting in the bottom-right may move that cube one square to the left, up, or on the diagonal up and to the left. Any cube which already lies in the target square is removed from the board. The objective of the game is for a player to either get one of their cubes to the far corner square in the grid (where their opponent started) or to remove all of their opponent's cubes from the board. The version of the game played on 5x5 board. @@ -959,11 +939,6 @@ The game is played on a square board with a 5×5 grid. Each player has six cubes ###Ludii (game ""Es-Sig"" (players 4) (equipment {(board (merge {(rectangle 8 1) (square 7) (shift 8 0 (square 1))}) {(track ""Track"" ""50,19,W,N1,E,N1,W,N1,E,N1,W,N1,E,N1,W4"" directed:True) (track ""ExtensionTrack"" ""45,W,N"" directed:True) (track ""GhoulaTrack"" ""19,W,N1,E,N1,W,N1,E,N1,W,N1,E,N1,W"" directed:True) (track ""ReverseGhoulaTrack"" ""50,12,E,S1,W,S1,E,S1,W,S1,E,S1,W,S1,E"" directed:True)}) (piece ""Ghoula"" Neutral) (piece ""Stick"" Each (if (= (from) 49) (if (= (state at:(from) level:(level)) 6) (move (from (from) level:(level)) (to 48) (then (forEach Level (last To) (set State at:(last To) level:(level) 0)))) (if (= (mapEntry ""Throw"" (count Pips)) 1) (move Select (from (from) level:(level)) (then (set State at:(last To) level:(last LevelTo) (+ 1 (state at:(last To) level:(last LevelTo)))))))) (if (= (from) 31) (if (= (state at:(from) level:(level)) 11) (move (from (from) level:(level)) (to 32) (then (forEach Level (last To) (set State at:(last To) level:(level) 0)))) (if (= (mapEntry ""Throw"" (count Pips)) 1) (move Select (from (from) level:(level)) (then (set State at:(last To) level:(last LevelTo) (+ 1 (state at:(last To) level:(last LevelTo)))))))) (if (and (!= (from) 45) (is In (from) (sites Track ""Track""))) (move (from (from) level:(level) if:(if (<= 1 (state at:(from) level:(level))) True (= (mapEntry ""Throw"" (count Pips)) 1))) (to (trackSite Move ""Track"" steps:(mapEntry ""Throw"" (count Pips))) if:True) (then (if (not (<= 1 (state at:(last To) level:(topLevel at:(last To))))) (set State at:(last To) level:(topLevel at:(last To)) 1)))) (if (is In (from) (sites Track ""ExtensionTrack"")) (or {(if (and (!= (from) 14) (= (mapEntry ""Throw"" (count Pips)) 1)) (move (from (from) level:(level)) (to (trackSite Move ""ExtensionTrack"" steps:1)))) (if (= (from) 14) (move Pass (then (if (!= 1 (count Pips)) (and (moveAgain) (set Var 1))))))})))) (then (if (and (= (last To) 14) (!= (last From) 14)) (if (!= -1 (var ""ScoreToGet"")) (and (set Score Mover (- (var ""ScoreToGet"") 1)) (set Var ""ScoreToGet"" (- (var ""ScoreToGet"") 1))) (and (set Score Mover (count Players)) (set Var ""ScoreToGet"" (count Players))))))) maxState:12) (dice d:2 from:0 num:4) (map ""Throw"" {(pair 0 4) (pair 1 3) (pair 2 0) (pair 3 1) (pair 4 6)}) (map ""ThrowGhoula"" {(pair 0 4) (pair 1 6) (pair 2 4) (pair 3 2) (pair 4 6)})}) (rules (start (place Stack items:{""Ghoula0"" ""Stick4"" ""Stick3"" ""Stick2"" ""Stick1""} 50)) (play (do (roll) next:(if (> (var) 0) (if (= 1 (size Stack at:(where ""Ghoula"" Neutral))) (or (move (from (where ""Ghoula"" Neutral) level:(where Level ""Ghoula"" Neutral at:(where ""Ghoula"" Neutral))) (to (trackSite Move from:(where ""Ghoula"" Neutral) ""GhoulaTrack"" steps:(mapEntry ""ThrowGhoula"" (count Pips))))) (move (from (where ""Ghoula"" Neutral) level:(where Level ""Ghoula"" Neutral at:(where ""Ghoula"" Neutral))) (to (trackSite Move from:(where ""Ghoula"" Neutral) ""ReverseGhoulaTrack"" steps:(mapEntry ""ThrowGhoula"" (count Pips)))))) (move (from (where ""Ghoula"" Neutral) level:(where Level ""Ghoula"" Neutral at:(where ""Ghoula"" Neutral))) (to (trackSite Move from:(where ""Ghoula"" Neutral) ""ReverseGhoulaTrack"" steps:(mapEntry ""ThrowGhoula"" (count Pips)))) (then (if (= (last From) 19) (forEach Level (last From) FromTop (remove (last From) level:(level))) (forEach Level (last From) FromTop (fromTo (from (last From) level:(level)) (to (last To))))))) (then (set Var 0))) (if (or (= (where ""Stick"" Mover) 14) (!= 0 (mapEntry ""Throw"" (count Pips)))) (forEach Piece))))) (end {(forEach Player if:(no Pieces Player) (result Player Loss)) (if (or (and (= 1 (size Stack at:(where ""Ghoula"" Neutral))) (= 12 (where ""Ghoula"" Neutral))) (and (all Sites (difference (sites Board) (sites {50 14})) if:(or (is Empty (site)) (and (= 1 (size Stack at:(site))) (= (site) (where ""Ghoula"" Neutral))))) (is Empty 50))) (byScore))})))" -"A move of a player consists of two parts: he first makes a normal move with one of his pieces (this is not obligatory), but no piece may move to a goal, i.e., to e1 or e9. (Pieces like rooks and queens however may move across it, e.g. from d1 to f1.) However, no captures are made, and check is disregarded. Then, after this move, the player may, if he can, have a piece kick the ball. A piece can kick the ball if the ball is adjacent to it (i.e., a kings move away.) The ball moves in the same way as the piece that kicks the ball, and the ball must be moved directly away from the piece. Also, the ball cannot be moved to or over occupied squares (except when a knight kicks the ball). For instance, a rook on a3 can kick a ball on a4 to squares a5, a6, a7, a8, a9, as long as the ball isn't moved to an occupied square; but a rook on a3 cannot kick a ball on b4. A knight can kick the ball to any square, a knight-move away from the square where the ball was before the kick, but not to a square, adjacent to the knight. When the ball is kicked to a square adjacent to another piece of the same player, the player may make another kick. This is called a `pass'. If after a second kick, a third kick is possible, the player may also make this third kick, and similar for successive kicks. Making an infinite number of passes, in order to draw the game, however is not allowed. Note that when kicking, only the ball moves but all normal pieces remain on the same places. The object of the game is to kick to ball to the goal at the opponents side of the board. However, it is not allowed to kick the ball into or across the goal from a square on the 1st or 9th row.","(game ""Football Chess"" (players 2) (equipment {(board (square 9)) (piece ""Rook"" Each (move Slide Orthogonal (to (apply if:(not (is In (to) (sites ""Goals""))))))) (piece ""King"" Each (move Step (to if:(and (is Empty (to)) (not (is In (to) (sites ""Goals""))))))) (piece ""Bishop"" Each (move Slide Diagonal (to (apply if:(not (is In (to) (sites ""Goals""))))))) (piece ""Knight"" Each (move Leap {{F F R F} {F F L F}} (to if:(and (is Empty (to)) (not (is In (to) (sites ""Goals""))))))) (piece ""Queen"" Each (move Slide (to (apply if:(not (is In (to) (sites ""Goals""))))))) (piece ""Ball"" Shared) (regions ""Goals"" (sites {""E1"" ""E9""})) (map ""Goal"" {(pair P1 ""E9"") (pair P2 ""E1"")})}) (rules (meta (no Repeat PositionalInTurn)) (start {(place ""Rook1"" {""A1"" ""I1""}) (place ""Knight1"" {""B1"" ""H1""}) (place ""Bishop1"" {""C1"" ""G1""}) (place ""Queen1"" coord:""D1"") (place ""King1"" coord:""F1"") (place ""Rook2"" {""A9"" ""I9""}) (place ""Knight2"" {""B9"" ""H9""}) (place ""Bishop2"" {""C9"" ""G9""}) (place ""Queen2"" coord:""D9"") (place ""King2"" coord:""F9"") (place ""Ball"" {""E5""})}) (play (if (is Prev Mover) (or (if (is Pending) (forEach Site (sites Around (where ""Ball"" Shared)) (if (and (= (what at:(site)) (id ""Knight"" Mover)) (is In (where ""Ball"" Shared) (sites Around (site)))) (move (from (where ""Ball"" Shared)) (to (sites To (leap (from (where ""Ball"" Shared)) {{F F R F} {F F L F}} (to if:(is Empty (to))))) if:(not (is In (to) (sites Around (site)))))) (if (and (= (what at:(site)) (id ""King"" Mover)) (is In (where ""Ball"" Shared) (sites Around (site)))) (move (from (where ""Ball"" Shared)) (to (sites To (step (from (where ""Ball"" Shared)) (directions Cell from:(site) to:(where ""Ball"" Shared)) (to if:(is Empty (to))))) if:(if (is In (site) (union (sites Bottom) (sites Top))) (not (is In (to) (sites ""Goals""))) True))) (if (and (= (what at:(site)) (id ""Queen"" Mover)) (is In (where ""Ball"" Shared) (sites Around (site)))) (move (from (where ""Ball"" Shared)) (to (sites To (slide (from (where ""Ball"" Shared)) (directions Cell from:(site) to:(where ""Ball"" Shared)) (between if:(if (is In (site) (union (sites Bottom) (sites Top))) (and (is Empty (between)) (not (is In (between) (sites ""Goals"")))) (is Empty (between)))))))) (if (and (= (what at:(site)) (id ""Rook"" Mover)) (is In (where ""Ball"" Shared) (sites Around (site) Orthogonal))) (move (from (where ""Ball"" Shared)) (to (sites To (slide (from (where ""Ball"" Shared)) (directions Cell from:(site) to:(where ""Ball"" Shared)) (between if:(if (is In (site) (union (sites Bottom) (sites Top))) (and (is Empty (between)) (not (is In (between) (sites ""Goals"")))) (is Empty (between)))))))) (if (and (= (what at:(site)) (id ""Bishop"" Mover)) (is In (where ""Ball"" Shared) (sites Around (site) Diagonal))) (move (from (where ""Ball"" Shared)) (to (sites To (slide (from (where ""Ball"" Shared)) (directions Cell from:(site) to:(where ""Ball"" Shared)) (between if:(if (is In (site) (union (sites Bottom) (sites Top))) (and (is Empty (between)) (not (is In (between) (sites ""Goals"")))) (is Empty (between))))))))))))) (then (if (can Move (forEach Site (sites Around (where ""Ball"" Shared)) (if (and (= (what at:(site)) (id ""Knight"" Mover)) (is In (where ""Ball"" Shared) (sites Around (site)))) (move (from (where ""Ball"" Shared)) (to (sites To (leap (from (where ""Ball"" Shared)) {{F F R F} {F F L F}} (to if:(is Empty (to))))) if:(not (is In (to) (sites Around (site)))))) (if (and (= (what at:(site)) (id ""King"" Mover)) (is In (where ""Ball"" Shared) (sites Around (site)))) (move (from (where ""Ball"" Shared)) (to (sites To (step (from (where ""Ball"" Shared)) (directions Cell from:(site) to:(where ""Ball"" Shared)) (to if:(is Empty (to))))) if:(if (is In (site) (union (sites Bottom) (sites Top))) (not (is In (to) (sites ""Goals""))) True))) (if (and (= (what at:(site)) (id ""Queen"" Mover)) (is In (where ""Ball"" Shared) (sites Around (site)))) (move (from (where ""Ball"" Shared)) (to (sites To (slide (from (where ""Ball"" Shared)) (directions Cell from:(site) to:(where ""Ball"" Shared)) (between if:(if (is In (site) (union (sites Bottom) (sites Top))) (and (is Empty (between)) (not (is In (between) (sites ""Goals"")))) (is Empty (between)))))))) (if (and (= (what at:(site)) (id ""Rook"" Mover)) (is In (where ""Ball"" Shared) (sites Around (site) Orthogonal))) (move (from (where ""Ball"" Shared)) (to (sites To (slide (from (where ""Ball"" Shared)) (directions Cell from:(site) to:(where ""Ball"" Shared)) (between if:(if (is In (site) (union (sites Bottom) (sites Top))) (and (is Empty (between)) (not (is In (between) (sites ""Goals"")))) (is Empty (between)))))))) (if (and (= (what at:(site)) (id ""Bishop"" Mover)) (is In (where ""Ball"" Shared) (sites Around (site) Diagonal))) (move (from (where ""Ball"" Shared)) (to (sites To (slide (from (where ""Ball"" Shared)) (directions Cell from:(site) to:(where ""Ball"" Shared)) (between if:(if (is In (site) (union (sites Bottom) (sites Top))) (and (is Empty (between)) (not (is In (between) (sites ""Goals"")))) (is Empty (between))))))))))))))) (and (set Pending) (moveAgain))))) (if (and (= (what at:(last To)) (id ""Knight"" Mover)) (is In (where ""Ball"" Shared) (sites Around (last To)))) (move (from (where ""Ball"" Shared)) (to (sites To (leap (from (where ""Ball"" Shared)) {{F F R F} {F F L F}} (to if:(is Empty (to))))) if:(not (is In (to) (sites Around (last To)))))) (if (and (= (what at:(last To)) (id ""King"" Mover)) (is In (where ""Ball"" Shared) (sites Around (last To)))) (move (from (where ""Ball"" Shared)) (to (sites To (step (from (where ""Ball"" Shared)) (directions Cell from:(last To) to:(where ""Ball"" Shared)) (to if:(is Empty (to))))) if:(if (is In (last To) (union (sites Bottom) (sites Top))) (not (is In (to) (sites ""Goals""))) True))) (if (and (= (what at:(last To)) (id ""Queen"" Mover)) (is In (where ""Ball"" Shared) (sites Around (last To)))) (move (from (where ""Ball"" Shared)) (to (sites To (slide (from (where ""Ball"" Shared)) (directions Cell from:(last To) to:(where ""Ball"" Shared)) (between if:(if (is In (last To) (union (sites Bottom) (sites Top))) (and (is Empty (between)) (not (is In (between) (sites ""Goals"")))) (is Empty (between)))))))) (if (and (= (what at:(last To)) (id ""Rook"" Mover)) (is In (where ""Ball"" Shared) (sites Around (last To) Orthogonal))) (move (from (where ""Ball"" Shared)) (to (sites To (slide (from (where ""Ball"" Shared)) (directions Cell from:(last To) to:(where ""Ball"" Shared)) (between if:(if (is In (last To) (union (sites Bottom) (sites Top))) (and (is Empty (between)) (not (is In (between) (sites ""Goals"")))) (is Empty (between)))))))) (if (and (= (what at:(last To)) (id ""Bishop"" Mover)) (is In (where ""Ball"" Shared) (sites Around (last To) Diagonal))) (move (from (where ""Ball"" Shared)) (to (sites To (slide (from (where ""Ball"" Shared)) (directions Cell from:(last To) to:(where ""Ball"" Shared)) (between if:(if (is In (last To) (union (sites Bottom) (sites Top))) (and (is Empty (between)) (not (is In (between) (sites ""Goals"")))) (is Empty (between)))))))))))) (then (if (can Move (forEach Site (sites Around (where ""Ball"" Shared)) (if (and (= (what at:(site)) (id ""Knight"" Mover)) (is In (where ""Ball"" Shared) (sites Around (site)))) (move (from (where ""Ball"" Shared)) (to (sites To (leap (from (where ""Ball"" Shared)) {{F F R F} {F F L F}} (to if:(is Empty (to))))) if:(not (is In (to) (sites Around (site)))))) (if (and (= (what at:(site)) (id ""King"" Mover)) (is In (where ""Ball"" Shared) (sites Around (site)))) (move (from (where ""Ball"" Shared)) (to (sites To (step (from (where ""Ball"" Shared)) (directions Cell from:(site) to:(where ""Ball"" Shared)) (to if:(is Empty (to))))) if:(if (is In (site) (union (sites Bottom) (sites Top))) (not (is In (to) (sites ""Goals""))) True))) (if (and (= (what at:(site)) (id ""Queen"" Mover)) (is In (where ""Ball"" Shared) (sites Around (site)))) (move (from (where ""Ball"" Shared)) (to (sites To (slide (from (where ""Ball"" Shared)) (directions Cell from:(site) to:(where ""Ball"" Shared)) (between if:(if (is In (site) (union (sites Bottom) (sites Top))) (and (is Empty (between)) (not (is In (between) (sites ""Goals"")))) (is Empty (between)))))))) (if (and (= (what at:(site)) (id ""Rook"" Mover)) (is In (where ""Ball"" Shared) (sites Around (site) Orthogonal))) (move (from (where ""Ball"" Shared)) (to (sites To (slide (from (where ""Ball"" Shared)) (directions Cell from:(site) to:(where ""Ball"" Shared)) (between if:(if (is In (site) (union (sites Bottom) (sites Top))) (and (is Empty (between)) (not (is In (between) (sites ""Goals"")))) (is Empty (between)))))))) (if (and (= (what at:(site)) (id ""Bishop"" Mover)) (is In (where ""Ball"" Shared) (sites Around (site) Diagonal))) (move (from (where ""Ball"" Shared)) (to (sites To (slide (from (where ""Ball"" Shared)) (directions Cell from:(site) to:(where ""Ball"" Shared)) (between if:(if (is In (site) (union (sites Bottom) (sites Top))) (and (is Empty (between)) (not (is In (between) (sites ""Goals"")))) (is Empty (between))))))))))))))) (and (set Pending) (moveAgain)))))) (move Pass)) (or (forEach Piece (then (if (can Move (if (and (= (what at:(last To)) (id ""Knight"" Mover)) (is In (where ""Ball"" Shared) (sites Around (last To)))) (move (from (where ""Ball"" Shared)) (to (sites To (leap (from (where ""Ball"" Shared)) {{F F R F} {F F L F}} (to if:(is Empty (to))))) if:(not (is In (to) (sites Around (last To)))))) (if (and (= (what at:(last To)) (id ""King"" Mover)) (is In (where ""Ball"" Shared) (sites Around (last To)))) (move (from (where ""Ball"" Shared)) (to (sites To (step (from (where ""Ball"" Shared)) (directions Cell from:(last To) to:(where ""Ball"" Shared)) (to if:(is Empty (to))))) if:(if (is In (last To) (union (sites Bottom) (sites Top))) (not (is In (to) (sites ""Goals""))) True))) (if (and (= (what at:(last To)) (id ""Queen"" Mover)) (is In (where ""Ball"" Shared) (sites Around (last To)))) (move (from (where ""Ball"" Shared)) (to (sites To (slide (from (where ""Ball"" Shared)) (directions Cell from:(last To) to:(where ""Ball"" Shared)) (between if:(if (is In (last To) (union (sites Bottom) (sites Top))) (and (is Empty (between)) (not (is In (between) (sites ""Goals"")))) (is Empty (between)))))))) (if (and (= (what at:(last To)) (id ""Rook"" Mover)) (is In (where ""Ball"" Shared) (sites Around (last To) Orthogonal))) (move (from (where ""Ball"" Shared)) (to (sites To (slide (from (where ""Ball"" Shared)) (directions Cell from:(last To) to:(where ""Ball"" Shared)) (between if:(if (is In (last To) (union (sites Bottom) (sites Top))) (and (is Empty (between)) (not (is In (between) (sites ""Goals"")))) (is Empty (between)))))))) (if (and (= (what at:(last To)) (id ""Bishop"" Mover)) (is In (where ""Ball"" Shared) (sites Around (last To) Diagonal))) (move (from (where ""Ball"" Shared)) (to (sites To (slide (from (where ""Ball"" Shared)) (directions Cell from:(last To) to:(where ""Ball"" Shared)) (between if:(if (is In (last To) (union (sites Bottom) (sites Top))) (and (is Empty (between)) (not (is In (between) (sites ""Goals"")))) (is Empty (between)))))))))))))) (moveAgain)))) (forEach Site (sites Around (where ""Ball"" Shared)) (if (and (= (what at:(site)) (id ""Knight"" Mover)) (is In (where ""Ball"" Shared) (sites Around (site)))) (move (from (where ""Ball"" Shared)) (to (sites To (leap (from (where ""Ball"" Shared)) {{F F R F} {F F L F}} (to if:(is Empty (to))))) if:(not (is In (to) (sites Around (site)))))) (if (and (= (what at:(site)) (id ""King"" Mover)) (is In (where ""Ball"" Shared) (sites Around (site)))) (move (from (where ""Ball"" Shared)) (to (sites To (step (from (where ""Ball"" Shared)) (directions Cell from:(site) to:(where ""Ball"" Shared)) (to if:(is Empty (to))))) if:(if (is In (site) (union (sites Bottom) (sites Top))) (not (is In (to) (sites ""Goals""))) True))) (if (and (= (what at:(site)) (id ""Queen"" Mover)) (is In (where ""Ball"" Shared) (sites Around (site)))) (move (from (where ""Ball"" Shared)) (to (sites To (slide (from (where ""Ball"" Shared)) (directions Cell from:(site) to:(where ""Ball"" Shared)) (between if:(if (is In (site) (union (sites Bottom) (sites Top))) (and (is Empty (between)) (not (is In (between) (sites ""Goals"")))) (is Empty (between)))))))) (if (and (= (what at:(site)) (id ""Rook"" Mover)) (is In (where ""Ball"" Shared) (sites Around (site) Orthogonal))) (move (from (where ""Ball"" Shared)) (to (sites To (slide (from (where ""Ball"" Shared)) (directions Cell from:(site) to:(where ""Ball"" Shared)) (between if:(if (is In (site) (union (sites Bottom) (sites Top))) (and (is Empty (between)) (not (is In (between) (sites ""Goals"")))) (is Empty (between)))))))) (if (and (= (what at:(site)) (id ""Bishop"" Mover)) (is In (where ""Ball"" Shared) (sites Around (site) Diagonal))) (move (from (where ""Ball"" Shared)) (to (sites To (slide (from (where ""Ball"" Shared)) (directions Cell from:(site) to:(where ""Ball"" Shared)) (between if:(if (is In (site) (union (sites Bottom) (sites Top))) (and (is Empty (between)) (not (is In (between) (sites ""Goals"")))) (is Empty (between))))))))))))) (then (if (can Move (forEach Site (sites Around (where ""Ball"" Shared)) (if (and (= (what at:(site)) (id ""Knight"" Mover)) (is In (where ""Ball"" Shared) (sites Around (site)))) (move (from (where ""Ball"" Shared)) (to (sites To (leap (from (where ""Ball"" Shared)) {{F F R F} {F F L F}} (to if:(is Empty (to))))) if:(not (is In (to) (sites Around (site)))))) (if (and (= (what at:(site)) (id ""King"" Mover)) (is In (where ""Ball"" Shared) (sites Around (site)))) (move (from (where ""Ball"" Shared)) (to (sites To (step (from (where ""Ball"" Shared)) (directions Cell from:(site) to:(where ""Ball"" Shared)) (to if:(is Empty (to))))) if:(if (is In (site) (union (sites Bottom) (sites Top))) (not (is In (to) (sites ""Goals""))) True))) (if (and (= (what at:(site)) (id ""Queen"" Mover)) (is In (where ""Ball"" Shared) (sites Around (site)))) (move (from (where ""Ball"" Shared)) (to (sites To (slide (from (where ""Ball"" Shared)) (directions Cell from:(site) to:(where ""Ball"" Shared)) (between if:(if (is In (site) (union (sites Bottom) (sites Top))) (and (is Empty (between)) (not (is In (between) (sites ""Goals"")))) (is Empty (between)))))))) (if (and (= (what at:(site)) (id ""Rook"" Mover)) (is In (where ""Ball"" Shared) (sites Around (site) Orthogonal))) (move (from (where ""Ball"" Shared)) (to (sites To (slide (from (where ""Ball"" Shared)) (directions Cell from:(site) to:(where ""Ball"" Shared)) (between if:(if (is In (site) (union (sites Bottom) (sites Top))) (and (is Empty (between)) (not (is In (between) (sites ""Goals"")))) (is Empty (between)))))))) (if (and (= (what at:(site)) (id ""Bishop"" Mover)) (is In (where ""Ball"" Shared) (sites Around (site) Diagonal))) (move (from (where ""Ball"" Shared)) (to (sites To (slide (from (where ""Ball"" Shared)) (directions Cell from:(site) to:(where ""Ball"" Shared)) (between if:(if (is In (site) (union (sites Bottom) (sites Top))) (and (is Empty (between)) (not (is In (between) (sites ""Goals"")))) (is Empty (between))))))))))))))) (and (set Pending) (moveAgain)))))))) (end {(if (= (where ""Ball"" Shared) (mapEntry P1)) (result P1 Win)) (if (= (where ""Ball"" Shared) (mapEntry P2)) (result P2 Win))})))","###Description -A move of a player consists of two parts: he first makes a normal move with one of his pieces (this is not obligatory), but no piece may move to a goal, i.e., to e1 or e9. (Pieces like rooks and queens however may move across it, e.g. from d1 to f1.) However, no captures are made, and check is disregarded. Then, after this move, the player may, if he can, have a piece kick the ball. A piece can kick the ball if the ball is adjacent to it (i.e., a kings move away.) The ball moves in the same way as the piece that kicks the ball, and the ball must be moved directly away from the piece. Also, the ball cannot be moved to or over occupied squares (except when a knight kicks the ball). For instance, a rook on a3 can kick a ball on a4 to squares a5, a6, a7, a8, a9, as long as the ball isn't moved to an occupied square; but a rook on a3 cannot kick a ball on b4. A knight can kick the ball to any square, a knight-move away from the square where the ball was before the kick, but not to a square, adjacent to the knight. When the ball is kicked to a square adjacent to another piece of the same player, the player may make another kick. This is called a `pass'. If after a second kick, a third kick is possible, the player may also make this third kick, and similar for successive kicks. Making an infinite number of passes, in order to draw the game, however is not allowed. Note that when kicking, only the ball moves but all normal pieces remain on the same places. The object of the game is to kick to ball to the goal at the opponents side of the board. However, it is not allowed to kick the ball into or across the goal from a square on the 1st or 9th row. - -###Ludii -(game ""Football Chess"" (players 2) (equipment {(board (square 9)) (piece ""Rook"" Each (move Slide Orthogonal (to (apply if:(not (is In (to) (sites ""Goals""))))))) (piece ""King"" Each (move Step (to if:(and (is Empty (to)) (not (is In (to) (sites ""Goals""))))))) (piece ""Bishop"" Each (move Slide Diagonal (to (apply if:(not (is In (to) (sites ""Goals""))))))) (piece ""Knight"" Each (move Leap {{F F R F} {F F L F}} (to if:(and (is Empty (to)) (not (is In (to) (sites ""Goals""))))))) (piece ""Queen"" Each (move Slide (to (apply if:(not (is In (to) (sites ""Goals""))))))) (piece ""Ball"" Shared) (regions ""Goals"" (sites {""E1"" ""E9""})) (map ""Goal"" {(pair P1 ""E9"") (pair P2 ""E1"")})}) (rules (meta (no Repeat PositionalInTurn)) (start {(place ""Rook1"" {""A1"" ""I1""}) (place ""Knight1"" {""B1"" ""H1""}) (place ""Bishop1"" {""C1"" ""G1""}) (place ""Queen1"" coord:""D1"") (place ""King1"" coord:""F1"") (place ""Rook2"" {""A9"" ""I9""}) (place ""Knight2"" {""B9"" ""H9""}) (place ""Bishop2"" {""C9"" ""G9""}) (place ""Queen2"" coord:""D9"") (place ""King2"" coord:""F9"") (place ""Ball"" {""E5""})}) (play (if (is Prev Mover) (or (if (is Pending) (forEach Site (sites Around (where ""Ball"" Shared)) (if (and (= (what at:(site)) (id ""Knight"" Mover)) (is In (where ""Ball"" Shared) (sites Around (site)))) (move (from (where ""Ball"" Shared)) (to (sites To (leap (from (where ""Ball"" Shared)) {{F F R F} {F F L F}} (to if:(is Empty (to))))) if:(not (is In (to) (sites Around (site)))))) (if (and (= (what at:(site)) (id ""King"" Mover)) (is In (where ""Ball"" Shared) (sites Around (site)))) (move (from (where ""Ball"" Shared)) (to (sites To (step (from (where ""Ball"" Shared)) (directions Cell from:(site) to:(where ""Ball"" Shared)) (to if:(is Empty (to))))) if:(if (is In (site) (union (sites Bottom) (sites Top))) (not (is In (to) (sites ""Goals""))) True))) (if (and (= (what at:(site)) (id ""Queen"" Mover)) (is In (where ""Ball"" Shared) (sites Around (site)))) (move (from (where ""Ball"" Shared)) (to (sites To (slide (from (where ""Ball"" Shared)) (directions Cell from:(site) to:(where ""Ball"" Shared)) (between if:(if (is In (site) (union (sites Bottom) (sites Top))) (and (is Empty (between)) (not (is In (between) (sites ""Goals"")))) (is Empty (between)))))))) (if (and (= (what at:(site)) (id ""Rook"" Mover)) (is In (where ""Ball"" Shared) (sites Around (site) Orthogonal))) (move (from (where ""Ball"" Shared)) (to (sites To (slide (from (where ""Ball"" Shared)) (directions Cell from:(site) to:(where ""Ball"" Shared)) (between if:(if (is In (site) (union (sites Bottom) (sites Top))) (and (is Empty (between)) (not (is In (between) (sites ""Goals"")))) (is Empty (between)))))))) (if (and (= (what at:(site)) (id ""Bishop"" Mover)) (is In (where ""Ball"" Shared) (sites Around (site) Diagonal))) (move (from (where ""Ball"" Shared)) (to (sites To (slide (from (where ""Ball"" Shared)) (directions Cell from:(site) to:(where ""Ball"" Shared)) (between if:(if (is In (site) (union (sites Bottom) (sites Top))) (and (is Empty (between)) (not (is In (between) (sites ""Goals"")))) (is Empty (between))))))))))))) (then (if (can Move (forEach Site (sites Around (where ""Ball"" Shared)) (if (and (= (what at:(site)) (id ""Knight"" Mover)) (is In (where ""Ball"" Shared) (sites Around (site)))) (move (from (where ""Ball"" Shared)) (to (sites To (leap (from (where ""Ball"" Shared)) {{F F R F} {F F L F}} (to if:(is Empty (to))))) if:(not (is In (to) (sites Around (site)))))) (if (and (= (what at:(site)) (id ""King"" Mover)) (is In (where ""Ball"" Shared) (sites Around (site)))) (move (from (where ""Ball"" Shared)) (to (sites To (step (from (where ""Ball"" Shared)) (directions Cell from:(site) to:(where ""Ball"" Shared)) (to if:(is Empty (to))))) if:(if (is In (site) (union (sites Bottom) (sites Top))) (not (is In (to) (sites ""Goals""))) True))) (if (and (= (what at:(site)) (id ""Queen"" Mover)) (is In (where ""Ball"" Shared) (sites Around (site)))) (move (from (where ""Ball"" Shared)) (to (sites To (slide (from (where ""Ball"" Shared)) (directions Cell from:(site) to:(where ""Ball"" Shared)) (between if:(if (is In (site) (union (sites Bottom) (sites Top))) (and (is Empty (between)) (not (is In (between) (sites ""Goals"")))) (is Empty (between)))))))) (if (and (= (what at:(site)) (id ""Rook"" Mover)) (is In (where ""Ball"" Shared) (sites Around (site) Orthogonal))) (move (from (where ""Ball"" Shared)) (to (sites To (slide (from (where ""Ball"" Shared)) (directions Cell from:(site) to:(where ""Ball"" Shared)) (between if:(if (is In (site) (union (sites Bottom) (sites Top))) (and (is Empty (between)) (not (is In (between) (sites ""Goals"")))) (is Empty (between)))))))) (if (and (= (what at:(site)) (id ""Bishop"" Mover)) (is In (where ""Ball"" Shared) (sites Around (site) Diagonal))) (move (from (where ""Ball"" Shared)) (to (sites To (slide (from (where ""Ball"" Shared)) (directions Cell from:(site) to:(where ""Ball"" Shared)) (between if:(if (is In (site) (union (sites Bottom) (sites Top))) (and (is Empty (between)) (not (is In (between) (sites ""Goals"")))) (is Empty (between))))))))))))))) (and (set Pending) (moveAgain))))) (if (and (= (what at:(last To)) (id ""Knight"" Mover)) (is In (where ""Ball"" Shared) (sites Around (last To)))) (move (from (where ""Ball"" Shared)) (to (sites To (leap (from (where ""Ball"" Shared)) {{F F R F} {F F L F}} (to if:(is Empty (to))))) if:(not (is In (to) (sites Around (last To)))))) (if (and (= (what at:(last To)) (id ""King"" Mover)) (is In (where ""Ball"" Shared) (sites Around (last To)))) (move (from (where ""Ball"" Shared)) (to (sites To (step (from (where ""Ball"" Shared)) (directions Cell from:(last To) to:(where ""Ball"" Shared)) (to if:(is Empty (to))))) if:(if (is In (last To) (union (sites Bottom) (sites Top))) (not (is In (to) (sites ""Goals""))) True))) (if (and (= (what at:(last To)) (id ""Queen"" Mover)) (is In (where ""Ball"" Shared) (sites Around (last To)))) (move (from (where ""Ball"" Shared)) (to (sites To (slide (from (where ""Ball"" Shared)) (directions Cell from:(last To) to:(where ""Ball"" Shared)) (between if:(if (is In (last To) (union (sites Bottom) (sites Top))) (and (is Empty (between)) (not (is In (between) (sites ""Goals"")))) (is Empty (between)))))))) (if (and (= (what at:(last To)) (id ""Rook"" Mover)) (is In (where ""Ball"" Shared) (sites Around (last To) Orthogonal))) (move (from (where ""Ball"" Shared)) (to (sites To (slide (from (where ""Ball"" Shared)) (directions Cell from:(last To) to:(where ""Ball"" Shared)) (between if:(if (is In (last To) (union (sites Bottom) (sites Top))) (and (is Empty (between)) (not (is In (between) (sites ""Goals"")))) (is Empty (between)))))))) (if (and (= (what at:(last To)) (id ""Bishop"" Mover)) (is In (where ""Ball"" Shared) (sites Around (last To) Diagonal))) (move (from (where ""Ball"" Shared)) (to (sites To (slide (from (where ""Ball"" Shared)) (directions Cell from:(last To) to:(where ""Ball"" Shared)) (between if:(if (is In (last To) (union (sites Bottom) (sites Top))) (and (is Empty (between)) (not (is In (between) (sites ""Goals"")))) (is Empty (between)))))))))))) (then (if (can Move (forEach Site (sites Around (where ""Ball"" Shared)) (if (and (= (what at:(site)) (id ""Knight"" Mover)) (is In (where ""Ball"" Shared) (sites Around (site)))) (move (from (where ""Ball"" Shared)) (to (sites To (leap (from (where ""Ball"" Shared)) {{F F R F} {F F L F}} (to if:(is Empty (to))))) if:(not (is In (to) (sites Around (site)))))) (if (and (= (what at:(site)) (id ""King"" Mover)) (is In (where ""Ball"" Shared) (sites Around (site)))) (move (from (where ""Ball"" Shared)) (to (sites To (step (from (where ""Ball"" Shared)) (directions Cell from:(site) to:(where ""Ball"" Shared)) (to if:(is Empty (to))))) if:(if (is In (site) (union (sites Bottom) (sites Top))) (not (is In (to) (sites ""Goals""))) True))) (if (and (= (what at:(site)) (id ""Queen"" Mover)) (is In (where ""Ball"" Shared) (sites Around (site)))) (move (from (where ""Ball"" Shared)) (to (sites To (slide (from (where ""Ball"" Shared)) (directions Cell from:(site) to:(where ""Ball"" Shared)) (between if:(if (is In (site) (union (sites Bottom) (sites Top))) (and (is Empty (between)) (not (is In (between) (sites ""Goals"")))) (is Empty (between)))))))) (if (and (= (what at:(site)) (id ""Rook"" Mover)) (is In (where ""Ball"" Shared) (sites Around (site) Orthogonal))) (move (from (where ""Ball"" Shared)) (to (sites To (slide (from (where ""Ball"" Shared)) (directions Cell from:(site) to:(where ""Ball"" Shared)) (between if:(if (is In (site) (union (sites Bottom) (sites Top))) (and (is Empty (between)) (not (is In (between) (sites ""Goals"")))) (is Empty (between)))))))) (if (and (= (what at:(site)) (id ""Bishop"" Mover)) (is In (where ""Ball"" Shared) (sites Around (site) Diagonal))) (move (from (where ""Ball"" Shared)) (to (sites To (slide (from (where ""Ball"" Shared)) (directions Cell from:(site) to:(where ""Ball"" Shared)) (between if:(if (is In (site) (union (sites Bottom) (sites Top))) (and (is Empty (between)) (not (is In (between) (sites ""Goals"")))) (is Empty (between))))))))))))))) (and (set Pending) (moveAgain)))))) (move Pass)) (or (forEach Piece (then (if (can Move (if (and (= (what at:(last To)) (id ""Knight"" Mover)) (is In (where ""Ball"" Shared) (sites Around (last To)))) (move (from (where ""Ball"" Shared)) (to (sites To (leap (from (where ""Ball"" Shared)) {{F F R F} {F F L F}} (to if:(is Empty (to))))) if:(not (is In (to) (sites Around (last To)))))) (if (and (= (what at:(last To)) (id ""King"" Mover)) (is In (where ""Ball"" Shared) (sites Around (last To)))) (move (from (where ""Ball"" Shared)) (to (sites To (step (from (where ""Ball"" Shared)) (directions Cell from:(last To) to:(where ""Ball"" Shared)) (to if:(is Empty (to))))) if:(if (is In (last To) (union (sites Bottom) (sites Top))) (not (is In (to) (sites ""Goals""))) True))) (if (and (= (what at:(last To)) (id ""Queen"" Mover)) (is In (where ""Ball"" Shared) (sites Around (last To)))) (move (from (where ""Ball"" Shared)) (to (sites To (slide (from (where ""Ball"" Shared)) (directions Cell from:(last To) to:(where ""Ball"" Shared)) (between if:(if (is In (last To) (union (sites Bottom) (sites Top))) (and (is Empty (between)) (not (is In (between) (sites ""Goals"")))) (is Empty (between)))))))) (if (and (= (what at:(last To)) (id ""Rook"" Mover)) (is In (where ""Ball"" Shared) (sites Around (last To) Orthogonal))) (move (from (where ""Ball"" Shared)) (to (sites To (slide (from (where ""Ball"" Shared)) (directions Cell from:(last To) to:(where ""Ball"" Shared)) (between if:(if (is In (last To) (union (sites Bottom) (sites Top))) (and (is Empty (between)) (not (is In (between) (sites ""Goals"")))) (is Empty (between)))))))) (if (and (= (what at:(last To)) (id ""Bishop"" Mover)) (is In (where ""Ball"" Shared) (sites Around (last To) Diagonal))) (move (from (where ""Ball"" Shared)) (to (sites To (slide (from (where ""Ball"" Shared)) (directions Cell from:(last To) to:(where ""Ball"" Shared)) (between if:(if (is In (last To) (union (sites Bottom) (sites Top))) (and (is Empty (between)) (not (is In (between) (sites ""Goals"")))) (is Empty (between)))))))))))))) (moveAgain)))) (forEach Site (sites Around (where ""Ball"" Shared)) (if (and (= (what at:(site)) (id ""Knight"" Mover)) (is In (where ""Ball"" Shared) (sites Around (site)))) (move (from (where ""Ball"" Shared)) (to (sites To (leap (from (where ""Ball"" Shared)) {{F F R F} {F F L F}} (to if:(is Empty (to))))) if:(not (is In (to) (sites Around (site)))))) (if (and (= (what at:(site)) (id ""King"" Mover)) (is In (where ""Ball"" Shared) (sites Around (site)))) (move (from (where ""Ball"" Shared)) (to (sites To (step (from (where ""Ball"" Shared)) (directions Cell from:(site) to:(where ""Ball"" Shared)) (to if:(is Empty (to))))) if:(if (is In (site) (union (sites Bottom) (sites Top))) (not (is In (to) (sites ""Goals""))) True))) (if (and (= (what at:(site)) (id ""Queen"" Mover)) (is In (where ""Ball"" Shared) (sites Around (site)))) (move (from (where ""Ball"" Shared)) (to (sites To (slide (from (where ""Ball"" Shared)) (directions Cell from:(site) to:(where ""Ball"" Shared)) (between if:(if (is In (site) (union (sites Bottom) (sites Top))) (and (is Empty (between)) (not (is In (between) (sites ""Goals"")))) (is Empty (between)))))))) (if (and (= (what at:(site)) (id ""Rook"" Mover)) (is In (where ""Ball"" Shared) (sites Around (site) Orthogonal))) (move (from (where ""Ball"" Shared)) (to (sites To (slide (from (where ""Ball"" Shared)) (directions Cell from:(site) to:(where ""Ball"" Shared)) (between if:(if (is In (site) (union (sites Bottom) (sites Top))) (and (is Empty (between)) (not (is In (between) (sites ""Goals"")))) (is Empty (between)))))))) (if (and (= (what at:(site)) (id ""Bishop"" Mover)) (is In (where ""Ball"" Shared) (sites Around (site) Diagonal))) (move (from (where ""Ball"" Shared)) (to (sites To (slide (from (where ""Ball"" Shared)) (directions Cell from:(site) to:(where ""Ball"" Shared)) (between if:(if (is In (site) (union (sites Bottom) (sites Top))) (and (is Empty (between)) (not (is In (between) (sites ""Goals"")))) (is Empty (between))))))))))))) (then (if (can Move (forEach Site (sites Around (where ""Ball"" Shared)) (if (and (= (what at:(site)) (id ""Knight"" Mover)) (is In (where ""Ball"" Shared) (sites Around (site)))) (move (from (where ""Ball"" Shared)) (to (sites To (leap (from (where ""Ball"" Shared)) {{F F R F} {F F L F}} (to if:(is Empty (to))))) if:(not (is In (to) (sites Around (site)))))) (if (and (= (what at:(site)) (id ""King"" Mover)) (is In (where ""Ball"" Shared) (sites Around (site)))) (move (from (where ""Ball"" Shared)) (to (sites To (step (from (where ""Ball"" Shared)) (directions Cell from:(site) to:(where ""Ball"" Shared)) (to if:(is Empty (to))))) if:(if (is In (site) (union (sites Bottom) (sites Top))) (not (is In (to) (sites ""Goals""))) True))) (if (and (= (what at:(site)) (id ""Queen"" Mover)) (is In (where ""Ball"" Shared) (sites Around (site)))) (move (from (where ""Ball"" Shared)) (to (sites To (slide (from (where ""Ball"" Shared)) (directions Cell from:(site) to:(where ""Ball"" Shared)) (between if:(if (is In (site) (union (sites Bottom) (sites Top))) (and (is Empty (between)) (not (is In (between) (sites ""Goals"")))) (is Empty (between)))))))) (if (and (= (what at:(site)) (id ""Rook"" Mover)) (is In (where ""Ball"" Shared) (sites Around (site) Orthogonal))) (move (from (where ""Ball"" Shared)) (to (sites To (slide (from (where ""Ball"" Shared)) (directions Cell from:(site) to:(where ""Ball"" Shared)) (between if:(if (is In (site) (union (sites Bottom) (sites Top))) (and (is Empty (between)) (not (is In (between) (sites ""Goals"")))) (is Empty (between)))))))) (if (and (= (what at:(site)) (id ""Bishop"" Mover)) (is In (where ""Ball"" Shared) (sites Around (site) Diagonal))) (move (from (where ""Ball"" Shared)) (to (sites To (slide (from (where ""Ball"" Shared)) (directions Cell from:(site) to:(where ""Ball"" Shared)) (between if:(if (is In (site) (union (sites Bottom) (sites Top))) (and (is Empty (between)) (not (is In (between) (sites ""Goals"")))) (is Empty (between))))))))))))))) (and (set Pending) (moveAgain)))))))) (end {(if (= (where ""Ball"" Shared) (mapEntry P1)) (result P1 Win)) (if (= (where ""Ball"" Shared) (mapEntry P2)) (result P2 Win))})))" "Starting with the runner player, players alternate moving one of their checker tokens. Each token moves in one orthogonal direction only. Runner tokens move vertically from the first rank, either by moving into an adjacent empty space or by jumping over an adjacent opponent token into an empty space and capturing the jumped token. Blocker tokens move horizontally in a similar manner - the left tokens always move toward the right and the right tokens always move towards the left. In the standard/introductory game, played on an 8x8 board, captures are mandatory and multiple capture are possible with maximum capture sequences having priority. In tournament games, played on a 10 x 10 board, captures are optional. Blocker tokens may not jump over or capture other blocker tokens. The game ends when a runner token reaches the last rank or the runner player cannot move. Two games should be played, with players swapping roles. At the end of each game, the runner player scores the rank/row of each of his or her remaining tokens on the board. The player with the highest score after two games wins the match. 8 x 8 board Forced captures","(game ""Gauntlet"" (players {(player N) (player W)}) (equipment {(board (square 8)) (piece ""Counter"" Each) (piece ""DoubleCounter"" Each) (regions ""RunnerGoal"" P1 (difference (sites Top) (sites Corners))) (regions ""RunnerGoalRed"" Neutral (intersection (difference (sites Top) (sites Corners)) (sites Phase 0))) (regions ""RunnerGoalPink"" Neutral (intersection (difference (sites Top) (sites Corners)) (sites Phase 1)))}) (rules (start {(place ""Counter1"" (difference (sites Bottom) (sites Corners))) (place ""DoubleCounter2"" (difference (sites Left) (sites Corners))) (place ""Counter2"" (difference (sites Right) (sites Corners)))}) (play (priority {(max Moves (or (forEach Piece ""Counter"" (move Hop (from (from)) Forward (between if:(and (not (is In (between) (sites ToClear))) (is Enemy (who at:(between)))) (apply (remove (between) at:EndOfTurn))) (to if:(is Empty (to))) (then (if (can Move (move Hop (from (last To)) Forward (between if:(and (not (is In (between) (sites ToClear))) (is Enemy (who at:(between)))) (apply (remove (between) at:EndOfTurn))) (to if:(is Empty (to))))) (moveAgain))))) (forEach Piece ""DoubleCounter"" (move Hop (from (from)) Backward (between if:(and (not (is In (between) (sites ToClear))) (is Enemy (who at:(between)))) (apply (remove (between) at:EndOfTurn))) (to if:(is Empty (to))) (then (if (can Move (move Hop (from (last To)) Backward (between if:(and (not (is In (between) (sites ToClear))) (is Enemy (who at:(between)))) (apply (remove (between) at:EndOfTurn))) (to if:(is Empty (to))))) (moveAgain))))))) (or (forEach Piece ""Counter"" (move Step (directions Forward) (to if:(is Empty (to))))) (forEach Piece ""DoubleCounter"" (move Step (directions Backward) (to if:(is Empty (to))))))})) (end {(if (no Moves Next) (result Next Loss)) (if (is In (last To) (sites Mover)) (result Mover Win))})))","###Description Starting with the runner player, players alternate moving one of their checker tokens. Each token moves in one orthogonal direction only. Runner tokens move vertically from the first rank, either by moving into an adjacent empty space or by jumping over an adjacent opponent token into an empty space and capturing the jumped token. Blocker tokens move horizontally in a similar manner - the left tokens always move toward the right and the right tokens always move towards the left. In the standard/introductory game, played on an 8x8 board, captures are mandatory and multiple capture are possible with maximum capture sequences having priority. In tournament games, played on a 10 x 10 board, captures are optional. Blocker tokens may not jump over or capture other blocker tokens. The game ends when a runner token reaches the last rank or the runner player cannot move. Two games should be played, with players swapping roles. At the end of each game, the runner player scores the rank/row of each of his or her remaining tokens on the board. The player with the highest score after two games wins the match. 8 x 8 board Forced captures @@ -1014,11 +989,6 @@ Pieces move as knights in Chess. The goal is to be the first player to reach the ###Ludii (game ""Knightthrough"" (players {(player N) (player S)}) (equipment {(board (square 8)) (piece ""Knight"" Each (move Leap {{F F R F} {F F L F}} forward:True (to if:(not (is Friend (who at:(to)))) (apply (remove (to)))))) (regions P1 (sites Top)) (regions P2 (sites Bottom))}) (rules (start {(place ""Knight1"" (expand (sites Bottom))) (place ""Knight2"" (expand (sites Top)))}) (play (forEach Piece)) (end (if (is In (last To) (sites Mover)) (result Mover Win)))))" -"The board is a square spiral of any number of spaces. Each player begins with one piece. Three casting sticks, each with a round and a flat side, are used as dice. The throws are as follows: One flat side up = 1; two flat sides up = 2; three flat sides up = 4, zero flat sides up = 6. The pieces begin on the outer end of the track, and must throw a 1 to begin play. Once a player has left the starting spot, they move according to the throws, except on throws of 1, which are tabulated for use later. Players continue to throw until they throw 2. Players must land on the last space of the track, I.e. at the center of the spiral, by an exact throw. The player must then roll 1 five times before leaving this space and proceeding back to the starting point. Accumulated rolls of 1 may be used for this. The first player to reach the starting space by an exact throw releases the hyena. The hyena proceeds along the track in the same manner, but moving twice the value of each throw. When the hyena reaches the end of the track, it must throw or pay 1 ten times. The hyena captures any piece it overtakes on the return to the starting space, eliminating that player from the game. The game has 4 players.","(game ""Li'b el-Merafib"" (players 4) (equipment {(board (merge {(shift 4 4 (rectangle 2 1)) (shift 4 4 (rectangle 1 4)) (shift 7 4 (rectangle 4 1)) (shift 2 7 (rectangle 1 6)) (shift 2 2 (rectangle 6 1)) (shift 2 2 (rectangle 1 8)) (shift 9 2 (rectangle 8 1)) (shift 0 9 (rectangle 1 10)) (rectangle 10 1) (rectangle 1 12) (shift 11 0 (rectangle 12 1)) (shift 0 11 (rectangle 1 12))}) {(track ""Track"" ""73,E,S,W,N,E,S,W,N,E,S,W,N"" directed:True) (track ""ReverseTrack"" ""0,E,N,W,S,E,N,W,S,E,N,W"" directed:True)}) (dice d:2 from:0 num:3) (piece ""Stick"" Each (if (= (from) 2) (if (= 4 (state at:(from) level:(level))) (move (from (from) level:(level)) (to 0)) (if (= (mapEntry ""Throw"" (count Pips)) 1) (move Select (from (from) level:(level)) (then (set State at:(last To) level:(last LevelTo) (+ 1 (state at:(last To) level:(last LevelTo)))))) (if (is In 1 (if (is Mover P1) (values Remembered ""TabulatedP1"") (if (is Mover P2) (values Remembered ""TabulatedP2"") (if (is Mover P3) (values Remembered ""TabulatedP3"") (if (is Mover P4) (values Remembered ""TabulatedP4"") (if (is Mover P5) (values Remembered ""TabulatedP5"") (if (is Mover P6) (values Remembered ""TabulatedP6"") (if (is Mover P7) (values Remembered ""TabulatedP7"") (values Remembered ""TabulatedP8""))))))))) (move Select (from (from) level:(level)) (then (and (set State at:(last To) level:(last LevelTo) (+ 1 (state at:(last To) level:(last LevelTo)))) (if (is Mover P1) (forget Value ""TabulatedP1"" 1) (if (is Mover P2) (forget Value ""TabulatedP2"" 1) (if (is Mover P3) (forget Value ""TabulatedP3"" 1) (if (is Mover P4) (forget Value ""TabulatedP4"" 1) (if (is Mover P5) (forget Value ""TabulatedP5"" 1) (if (is Mover P6) (forget Value ""TabulatedP6"" 1) (if (is Mover P7) (forget Value ""TabulatedP7"" 1) (forget Value ""TabulatedP8"" 1)))))))))))))) (if (and {(= 0 (state at:(from) level:(level))) (= (from) 0) (is In 1 (if (is Mover P1) (values Remembered ""TabulatedP1"") (if (is Mover P2) (values Remembered ""TabulatedP2"") (if (is Mover P3) (values Remembered ""TabulatedP3"") (if (is Mover P4) (values Remembered ""TabulatedP4"") (if (is Mover P5) (values Remembered ""TabulatedP5"") (if (is Mover P6) (values Remembered ""TabulatedP6"") (if (is Mover P7) (values Remembered ""TabulatedP7"") (values Remembered ""TabulatedP8"")))))))))}) (move (from (from) level:(level)) (to 2) (then (if (is Mover P1) (forget Value ""TabulatedP1"" 1) (if (is Mover P2) (forget Value ""TabulatedP2"" 1) (if (is Mover P3) (forget Value ""TabulatedP3"" 1) (if (is Mover P4) (forget Value ""TabulatedP4"" 1) (if (is Mover P5) (forget Value ""TabulatedP5"" 1) (if (is Mover P6) (forget Value ""TabulatedP6"" 1) (if (is Mover P7) (forget Value ""TabulatedP7"" 1) (forget Value ""TabulatedP8"" 1)))))))))) (if (= (from) 73) (move (from (from) level:(level) if:(= (mapEntry ""Throw"" (count Pips)) 1)) (to (trackSite Move from:(from) ""Track"" steps:(mapEntry ""Throw"" (count Pips))))) (if (= 0 (state at:(from) level:(level))) (if (not (= (mapEntry ""Throw"" (count Pips)) 1)) (move (from (from) level:(level)) (to (trackSite Move from:(from) ""Track"" steps:(mapEntry ""Throw"" (count Pips))))) (move Pass (then (if (is Mover P1) (remember Value ""TabulatedP1"" (mapEntry ""Throw"" (count Pips))) (if (is Mover P2) (remember Value ""TabulatedP2"" (mapEntry ""Throw"" (count Pips))) (if (is Mover P3) (remember Value ""TabulatedP3"" (mapEntry ""Throw"" (count Pips))) (if (is Mover P4) (remember Value ""TabulatedP4"" (mapEntry ""Throw"" (count Pips))) (if (is Mover P5) (remember Value ""TabulatedP5"" (mapEntry ""Throw"" (count Pips))) (if (is Mover P6) (remember Value ""TabulatedP6"" (mapEntry ""Throw"" (count Pips))) (if (is Mover P7) (remember Value ""TabulatedP7"" (mapEntry ""Throw"" (count Pips))) (remember Value ""TabulatedP8"" (mapEntry ""Throw"" (count Pips))))))))))))) (or (move (from (from) level:(level)) (to (trackSite Move from:(from) ""ReverseTrack"" steps:(mapEntry ""Throw"" (count Pips)))) (then (if (= (last To) 73) (if (= (where ""Hyena"" Neutral) -1) (add (piece (id ""Hyena"" Neutral)) (to (last To))))))) (if (= (mapEntry ""Throw"" (count Pips)) 1) (move Pass (then (if (is Mover P1) (remember Value ""TabulatedP1"" (mapEntry ""Throw"" (count Pips))) (if (is Mover P2) (remember Value ""TabulatedP2"" (mapEntry ""Throw"" (count Pips))) (if (is Mover P3) (remember Value ""TabulatedP3"" (mapEntry ""Throw"" (count Pips))) (if (is Mover P4) (remember Value ""TabulatedP4"" (mapEntry ""Throw"" (count Pips))) (if (is Mover P5) (remember Value ""TabulatedP5"" (mapEntry ""Throw"" (count Pips))) (if (is Mover P6) (remember Value ""TabulatedP6"" (mapEntry ""Throw"" (count Pips))) (if (is Mover P7) (remember Value ""TabulatedP7"" (mapEntry ""Throw"" (count Pips))) (remember Value ""TabulatedP8"" (mapEntry ""Throw"" (count Pips))))))))))))))))))) (piece ""Hyena"" Neutral maxState:10) (map ""Throw"" {(pair 0 6) (pair 1 1) (pair 2 2) (pair 3 4)})}) (rules (start {(place Stack items:{""Stick4"" ""Stick3"" ""Stick2"" ""Stick1""} 73)}) (play (do (roll) next:(if (and (= 73 (where ""Stick"" Mover)) (!= 0 (state at:(where ""Stick"" Mover) level:(where Level ""Stick"" Mover at:(where ""Stick"" Mover))))) (if (= (where ""Hyena"" Neutral) 2) (if (= 9 (state at:(where ""Hyena"" Neutral) level:(where Level ""Hyena"" Neutral at:(where ""Hyena"" Neutral)))) (move (from (where ""Hyena"" Neutral) level:(where Level ""Hyena"" Neutral at:(where ""Hyena"" Neutral))) (to 0)) (if (= (mapEntry ""Throw"" (count Pips)) 1) (move Select (from (where ""Hyena"" Neutral) level:(where Level ""Hyena"" Neutral at:(where ""Hyena"" Neutral))) (then (set State at:(last To) level:(last LevelTo) (+ 1 (state at:(last To) level:(last LevelTo)))))) (if (is In 1 (if (is Mover P1) (values Remembered ""TabulatedP1"") (if (is Mover P2) (values Remembered ""TabulatedP2"") (if (is Mover P3) (values Remembered ""TabulatedP3"") (if (is Mover P4) (values Remembered ""TabulatedP4"") (if (is Mover P5) (values Remembered ""TabulatedP5"") (if (is Mover P6) (values Remembered ""TabulatedP6"") (if (is Mover P7) (values Remembered ""TabulatedP7"") (values Remembered ""TabulatedP8""))))))))) (move Select (from (where ""Hyena"" Neutral) level:(where Level ""Hyena"" Neutral at:(where ""Hyena"" Neutral))) (then (and (set State at:(last To) level:(last LevelTo) (+ 1 (state at:(last To) level:(last LevelTo)))) (if (is Mover P1) (forget Value ""TabulatedP1"" 1) (if (is Mover P2) (forget Value ""TabulatedP2"" 1) (if (is Mover P3) (forget Value ""TabulatedP3"" 1) (if (is Mover P4) (forget Value ""TabulatedP4"" 1) (if (is Mover P5) (forget Value ""TabulatedP5"" 1) (if (is Mover P6) (forget Value ""TabulatedP6"" 1) (if (is Mover P7) (forget Value ""TabulatedP7"" 1) (forget Value ""TabulatedP8"" 1)))))))))))))) (if (= 0 (state at:(where ""Hyena"" Neutral) level:(where Level ""Hyena"" Neutral at:(where ""Hyena"" Neutral)))) (or {(if (= (mapEntry ""Throw"" (count Pips)) 1) (move Pass (then (if (is Mover P1) (remember Value ""TabulatedP1"" (mapEntry ""Throw"" (count Pips))) (if (is Mover P2) (remember Value ""TabulatedP2"" (mapEntry ""Throw"" (count Pips))) (if (is Mover P3) (remember Value ""TabulatedP3"" (mapEntry ""Throw"" (count Pips))) (if (is Mover P4) (remember Value ""TabulatedP4"" (mapEntry ""Throw"" (count Pips))) (if (is Mover P5) (remember Value ""TabulatedP5"" (mapEntry ""Throw"" (count Pips))) (if (is Mover P6) (remember Value ""TabulatedP6"" (mapEntry ""Throw"" (count Pips))) (if (is Mover P7) (remember Value ""TabulatedP7"" (mapEntry ""Throw"" (count Pips))) (remember Value ""TabulatedP8"" (mapEntry ""Throw"" (count Pips))))))))))))) (move (from (where ""Hyena"" Neutral) level:(where Level ""Hyena"" Neutral at:(where ""Hyena"" Neutral))) (to (trackSite Move from:(where ""Hyena"" Neutral) ""Track"" steps:(* 2 (mapEntry ""Throw"" (count Pips)))))) (if (is In 1 (if (is Mover P1) (values Remembered ""TabulatedP1"") (if (is Mover P2) (values Remembered ""TabulatedP2"") (if (is Mover P3) (values Remembered ""TabulatedP3"") (if (is Mover P4) (values Remembered ""TabulatedP4"") (if (is Mover P5) (values Remembered ""TabulatedP5"") (if (is Mover P6) (values Remembered ""TabulatedP6"") (if (is Mover P7) (values Remembered ""TabulatedP7"") (values Remembered ""TabulatedP8""))))))))) (move (from (where ""Hyena"" Neutral) level:(where Level ""Hyena"" Neutral at:(where ""Hyena"" Neutral))) (to (trackSite Move from:(where ""Hyena"" Neutral) ""Track"" steps:1)) (then (if (is Mover P1) (forget Value ""TabulatedP1"" 1) (if (is Mover P2) (forget Value ""TabulatedP2"" 1) (if (is Mover P3) (forget Value ""TabulatedP3"" 1) (if (is Mover P4) (forget Value ""TabulatedP4"" 1) (if (is Mover P5) (forget Value ""TabulatedP5"" 1) (if (is Mover P6) (forget Value ""TabulatedP6"" 1) (if (is Mover P7) (forget Value ""TabulatedP7"" 1) (forget Value ""TabulatedP8"" 1)))))))))))}) (or (move (from (where ""Hyena"" Neutral) level:(where Level ""Hyena"" Neutral at:(where ""Hyena"" Neutral))) (to (trackSite Move from:(where ""Hyena"" Neutral) ""ReverseTrack"" steps:(* 2 (mapEntry ""Throw"" (count Pips))))) (then (forEach Site (sites Track ""ReverseTrack"" from:(last From) to:(trackSite Move from:(last From) ""ReverseTrack"" steps:(- (* 2 (mapEntry ""Throw"" (count Pips))) 1))) (forEach Level (site) FromTop (remove (site) level:(level)))))) (if (is In 1 (if (is Mover P1) (values Remembered ""TabulatedP1"") (if (is Mover P2) (values Remembered ""TabulatedP2"") (if (is Mover P3) (values Remembered ""TabulatedP3"") (if (is Mover P4) (values Remembered ""TabulatedP4"") (if (is Mover P5) (values Remembered ""TabulatedP5"") (if (is Mover P6) (values Remembered ""TabulatedP6"") (if (is Mover P7) (values Remembered ""TabulatedP7"") (values Remembered ""TabulatedP8""))))))))) (move (from (where ""Hyena"" Neutral) level:(where Level ""Hyena"" Neutral at:(where ""Hyena"" Neutral))) (to (trackSite Move from:(where ""Hyena"" Neutral) ""ReverseTrack"" steps:1)) (then (and (if (is Mover P1) (forget Value ""TabulatedP1"" 1) (if (is Mover P2) (forget Value ""TabulatedP2"" 1) (if (is Mover P3) (forget Value ""TabulatedP3"" 1) (if (is Mover P4) (forget Value ""TabulatedP4"" 1) (if (is Mover P5) (forget Value ""TabulatedP5"" 1) (if (is Mover P6) (forget Value ""TabulatedP6"" 1) (if (is Mover P7) (forget Value ""TabulatedP7"" 1) (forget Value ""TabulatedP8"" 1)))))))) (forEach Level (last From) FromTop (remove (last From) level:(level)))))))))) (forEach Piece)) (then (if (not (= (mapEntry ""Throw"" (count Pips)) 2)) (moveAgain))))) (end {(forEach Player if:(= 0 (count Sites in:(sites Occupied by:Player top:False))) (result Player Loss)) (forEach Player if:(and {(if (!= 73 (where ""Hyena"" Neutral)) (= 1 (size Stack at:(where ""Hyena"" Neutral))) True) (!= (where ""Hyena"" Neutral) -1) (all Sites (sites Occupied by:All top:False) if:(is In (site) (union (sites Hand Shared) (sites {73 (where ""Hyena"" Neutral)}))))}) (result Player Win))})))","###Description -The board is a square spiral of any number of spaces. Each player begins with one piece. Three casting sticks, each with a round and a flat side, are used as dice. The throws are as follows: One flat side up = 1; two flat sides up = 2; three flat sides up = 4, zero flat sides up = 6. The pieces begin on the outer end of the track, and must throw a 1 to begin play. Once a player has left the starting spot, they move according to the throws, except on throws of 1, which are tabulated for use later. Players continue to throw until they throw 2. Players must land on the last space of the track, I.e. at the center of the spiral, by an exact throw. The player must then roll 1 five times before leaving this space and proceeding back to the starting point. Accumulated rolls of 1 may be used for this. The first player to reach the starting space by an exact throw releases the hyena. The hyena proceeds along the track in the same manner, but moving twice the value of each throw. When the hyena reaches the end of the track, it must throw or pay 1 ten times. The hyena captures any piece it overtakes on the return to the starting space, eliminating that player from the game. The game has 4 players. - -###Ludii -(game ""Li'b el-Merafib"" (players 4) (equipment {(board (merge {(shift 4 4 (rectangle 2 1)) (shift 4 4 (rectangle 1 4)) (shift 7 4 (rectangle 4 1)) (shift 2 7 (rectangle 1 6)) (shift 2 2 (rectangle 6 1)) (shift 2 2 (rectangle 1 8)) (shift 9 2 (rectangle 8 1)) (shift 0 9 (rectangle 1 10)) (rectangle 10 1) (rectangle 1 12) (shift 11 0 (rectangle 12 1)) (shift 0 11 (rectangle 1 12))}) {(track ""Track"" ""73,E,S,W,N,E,S,W,N,E,S,W,N"" directed:True) (track ""ReverseTrack"" ""0,E,N,W,S,E,N,W,S,E,N,W"" directed:True)}) (dice d:2 from:0 num:3) (piece ""Stick"" Each (if (= (from) 2) (if (= 4 (state at:(from) level:(level))) (move (from (from) level:(level)) (to 0)) (if (= (mapEntry ""Throw"" (count Pips)) 1) (move Select (from (from) level:(level)) (then (set State at:(last To) level:(last LevelTo) (+ 1 (state at:(last To) level:(last LevelTo)))))) (if (is In 1 (if (is Mover P1) (values Remembered ""TabulatedP1"") (if (is Mover P2) (values Remembered ""TabulatedP2"") (if (is Mover P3) (values Remembered ""TabulatedP3"") (if (is Mover P4) (values Remembered ""TabulatedP4"") (if (is Mover P5) (values Remembered ""TabulatedP5"") (if (is Mover P6) (values Remembered ""TabulatedP6"") (if (is Mover P7) (values Remembered ""TabulatedP7"") (values Remembered ""TabulatedP8""))))))))) (move Select (from (from) level:(level)) (then (and (set State at:(last To) level:(last LevelTo) (+ 1 (state at:(last To) level:(last LevelTo)))) (if (is Mover P1) (forget Value ""TabulatedP1"" 1) (if (is Mover P2) (forget Value ""TabulatedP2"" 1) (if (is Mover P3) (forget Value ""TabulatedP3"" 1) (if (is Mover P4) (forget Value ""TabulatedP4"" 1) (if (is Mover P5) (forget Value ""TabulatedP5"" 1) (if (is Mover P6) (forget Value ""TabulatedP6"" 1) (if (is Mover P7) (forget Value ""TabulatedP7"" 1) (forget Value ""TabulatedP8"" 1)))))))))))))) (if (and {(= 0 (state at:(from) level:(level))) (= (from) 0) (is In 1 (if (is Mover P1) (values Remembered ""TabulatedP1"") (if (is Mover P2) (values Remembered ""TabulatedP2"") (if (is Mover P3) (values Remembered ""TabulatedP3"") (if (is Mover P4) (values Remembered ""TabulatedP4"") (if (is Mover P5) (values Remembered ""TabulatedP5"") (if (is Mover P6) (values Remembered ""TabulatedP6"") (if (is Mover P7) (values Remembered ""TabulatedP7"") (values Remembered ""TabulatedP8"")))))))))}) (move (from (from) level:(level)) (to 2) (then (if (is Mover P1) (forget Value ""TabulatedP1"" 1) (if (is Mover P2) (forget Value ""TabulatedP2"" 1) (if (is Mover P3) (forget Value ""TabulatedP3"" 1) (if (is Mover P4) (forget Value ""TabulatedP4"" 1) (if (is Mover P5) (forget Value ""TabulatedP5"" 1) (if (is Mover P6) (forget Value ""TabulatedP6"" 1) (if (is Mover P7) (forget Value ""TabulatedP7"" 1) (forget Value ""TabulatedP8"" 1)))))))))) (if (= (from) 73) (move (from (from) level:(level) if:(= (mapEntry ""Throw"" (count Pips)) 1)) (to (trackSite Move from:(from) ""Track"" steps:(mapEntry ""Throw"" (count Pips))))) (if (= 0 (state at:(from) level:(level))) (if (not (= (mapEntry ""Throw"" (count Pips)) 1)) (move (from (from) level:(level)) (to (trackSite Move from:(from) ""Track"" steps:(mapEntry ""Throw"" (count Pips))))) (move Pass (then (if (is Mover P1) (remember Value ""TabulatedP1"" (mapEntry ""Throw"" (count Pips))) (if (is Mover P2) (remember Value ""TabulatedP2"" (mapEntry ""Throw"" (count Pips))) (if (is Mover P3) (remember Value ""TabulatedP3"" (mapEntry ""Throw"" (count Pips))) (if (is Mover P4) (remember Value ""TabulatedP4"" (mapEntry ""Throw"" (count Pips))) (if (is Mover P5) (remember Value ""TabulatedP5"" (mapEntry ""Throw"" (count Pips))) (if (is Mover P6) (remember Value ""TabulatedP6"" (mapEntry ""Throw"" (count Pips))) (if (is Mover P7) (remember Value ""TabulatedP7"" (mapEntry ""Throw"" (count Pips))) (remember Value ""TabulatedP8"" (mapEntry ""Throw"" (count Pips))))))))))))) (or (move (from (from) level:(level)) (to (trackSite Move from:(from) ""ReverseTrack"" steps:(mapEntry ""Throw"" (count Pips)))) (then (if (= (last To) 73) (if (= (where ""Hyena"" Neutral) -1) (add (piece (id ""Hyena"" Neutral)) (to (last To))))))) (if (= (mapEntry ""Throw"" (count Pips)) 1) (move Pass (then (if (is Mover P1) (remember Value ""TabulatedP1"" (mapEntry ""Throw"" (count Pips))) (if (is Mover P2) (remember Value ""TabulatedP2"" (mapEntry ""Throw"" (count Pips))) (if (is Mover P3) (remember Value ""TabulatedP3"" (mapEntry ""Throw"" (count Pips))) (if (is Mover P4) (remember Value ""TabulatedP4"" (mapEntry ""Throw"" (count Pips))) (if (is Mover P5) (remember Value ""TabulatedP5"" (mapEntry ""Throw"" (count Pips))) (if (is Mover P6) (remember Value ""TabulatedP6"" (mapEntry ""Throw"" (count Pips))) (if (is Mover P7) (remember Value ""TabulatedP7"" (mapEntry ""Throw"" (count Pips))) (remember Value ""TabulatedP8"" (mapEntry ""Throw"" (count Pips))))))))))))))))))) (piece ""Hyena"" Neutral maxState:10) (map ""Throw"" {(pair 0 6) (pair 1 1) (pair 2 2) (pair 3 4)})}) (rules (start {(place Stack items:{""Stick4"" ""Stick3"" ""Stick2"" ""Stick1""} 73)}) (play (do (roll) next:(if (and (= 73 (where ""Stick"" Mover)) (!= 0 (state at:(where ""Stick"" Mover) level:(where Level ""Stick"" Mover at:(where ""Stick"" Mover))))) (if (= (where ""Hyena"" Neutral) 2) (if (= 9 (state at:(where ""Hyena"" Neutral) level:(where Level ""Hyena"" Neutral at:(where ""Hyena"" Neutral)))) (move (from (where ""Hyena"" Neutral) level:(where Level ""Hyena"" Neutral at:(where ""Hyena"" Neutral))) (to 0)) (if (= (mapEntry ""Throw"" (count Pips)) 1) (move Select (from (where ""Hyena"" Neutral) level:(where Level ""Hyena"" Neutral at:(where ""Hyena"" Neutral))) (then (set State at:(last To) level:(last LevelTo) (+ 1 (state at:(last To) level:(last LevelTo)))))) (if (is In 1 (if (is Mover P1) (values Remembered ""TabulatedP1"") (if (is Mover P2) (values Remembered ""TabulatedP2"") (if (is Mover P3) (values Remembered ""TabulatedP3"") (if (is Mover P4) (values Remembered ""TabulatedP4"") (if (is Mover P5) (values Remembered ""TabulatedP5"") (if (is Mover P6) (values Remembered ""TabulatedP6"") (if (is Mover P7) (values Remembered ""TabulatedP7"") (values Remembered ""TabulatedP8""))))))))) (move Select (from (where ""Hyena"" Neutral) level:(where Level ""Hyena"" Neutral at:(where ""Hyena"" Neutral))) (then (and (set State at:(last To) level:(last LevelTo) (+ 1 (state at:(last To) level:(last LevelTo)))) (if (is Mover P1) (forget Value ""TabulatedP1"" 1) (if (is Mover P2) (forget Value ""TabulatedP2"" 1) (if (is Mover P3) (forget Value ""TabulatedP3"" 1) (if (is Mover P4) (forget Value ""TabulatedP4"" 1) (if (is Mover P5) (forget Value ""TabulatedP5"" 1) (if (is Mover P6) (forget Value ""TabulatedP6"" 1) (if (is Mover P7) (forget Value ""TabulatedP7"" 1) (forget Value ""TabulatedP8"" 1)))))))))))))) (if (= 0 (state at:(where ""Hyena"" Neutral) level:(where Level ""Hyena"" Neutral at:(where ""Hyena"" Neutral)))) (or {(if (= (mapEntry ""Throw"" (count Pips)) 1) (move Pass (then (if (is Mover P1) (remember Value ""TabulatedP1"" (mapEntry ""Throw"" (count Pips))) (if (is Mover P2) (remember Value ""TabulatedP2"" (mapEntry ""Throw"" (count Pips))) (if (is Mover P3) (remember Value ""TabulatedP3"" (mapEntry ""Throw"" (count Pips))) (if (is Mover P4) (remember Value ""TabulatedP4"" (mapEntry ""Throw"" (count Pips))) (if (is Mover P5) (remember Value ""TabulatedP5"" (mapEntry ""Throw"" (count Pips))) (if (is Mover P6) (remember Value ""TabulatedP6"" (mapEntry ""Throw"" (count Pips))) (if (is Mover P7) (remember Value ""TabulatedP7"" (mapEntry ""Throw"" (count Pips))) (remember Value ""TabulatedP8"" (mapEntry ""Throw"" (count Pips))))))))))))) (move (from (where ""Hyena"" Neutral) level:(where Level ""Hyena"" Neutral at:(where ""Hyena"" Neutral))) (to (trackSite Move from:(where ""Hyena"" Neutral) ""Track"" steps:(* 2 (mapEntry ""Throw"" (count Pips)))))) (if (is In 1 (if (is Mover P1) (values Remembered ""TabulatedP1"") (if (is Mover P2) (values Remembered ""TabulatedP2"") (if (is Mover P3) (values Remembered ""TabulatedP3"") (if (is Mover P4) (values Remembered ""TabulatedP4"") (if (is Mover P5) (values Remembered ""TabulatedP5"") (if (is Mover P6) (values Remembered ""TabulatedP6"") (if (is Mover P7) (values Remembered ""TabulatedP7"") (values Remembered ""TabulatedP8""))))))))) (move (from (where ""Hyena"" Neutral) level:(where Level ""Hyena"" Neutral at:(where ""Hyena"" Neutral))) (to (trackSite Move from:(where ""Hyena"" Neutral) ""Track"" steps:1)) (then (if (is Mover P1) (forget Value ""TabulatedP1"" 1) (if (is Mover P2) (forget Value ""TabulatedP2"" 1) (if (is Mover P3) (forget Value ""TabulatedP3"" 1) (if (is Mover P4) (forget Value ""TabulatedP4"" 1) (if (is Mover P5) (forget Value ""TabulatedP5"" 1) (if (is Mover P6) (forget Value ""TabulatedP6"" 1) (if (is Mover P7) (forget Value ""TabulatedP7"" 1) (forget Value ""TabulatedP8"" 1)))))))))))}) (or (move (from (where ""Hyena"" Neutral) level:(where Level ""Hyena"" Neutral at:(where ""Hyena"" Neutral))) (to (trackSite Move from:(where ""Hyena"" Neutral) ""ReverseTrack"" steps:(* 2 (mapEntry ""Throw"" (count Pips))))) (then (forEach Site (sites Track ""ReverseTrack"" from:(last From) to:(trackSite Move from:(last From) ""ReverseTrack"" steps:(- (* 2 (mapEntry ""Throw"" (count Pips))) 1))) (forEach Level (site) FromTop (remove (site) level:(level)))))) (if (is In 1 (if (is Mover P1) (values Remembered ""TabulatedP1"") (if (is Mover P2) (values Remembered ""TabulatedP2"") (if (is Mover P3) (values Remembered ""TabulatedP3"") (if (is Mover P4) (values Remembered ""TabulatedP4"") (if (is Mover P5) (values Remembered ""TabulatedP5"") (if (is Mover P6) (values Remembered ""TabulatedP6"") (if (is Mover P7) (values Remembered ""TabulatedP7"") (values Remembered ""TabulatedP8""))))))))) (move (from (where ""Hyena"" Neutral) level:(where Level ""Hyena"" Neutral at:(where ""Hyena"" Neutral))) (to (trackSite Move from:(where ""Hyena"" Neutral) ""ReverseTrack"" steps:1)) (then (and (if (is Mover P1) (forget Value ""TabulatedP1"" 1) (if (is Mover P2) (forget Value ""TabulatedP2"" 1) (if (is Mover P3) (forget Value ""TabulatedP3"" 1) (if (is Mover P4) (forget Value ""TabulatedP4"" 1) (if (is Mover P5) (forget Value ""TabulatedP5"" 1) (if (is Mover P6) (forget Value ""TabulatedP6"" 1) (if (is Mover P7) (forget Value ""TabulatedP7"" 1) (forget Value ""TabulatedP8"" 1)))))))) (forEach Level (last From) FromTop (remove (last From) level:(level)))))))))) (forEach Piece)) (then (if (not (= (mapEntry ""Throw"" (count Pips)) 2)) (moveAgain))))) (end {(forEach Player if:(= 0 (count Sites in:(sites Occupied by:Player top:False))) (result Player Loss)) (forEach Player if:(and {(if (!= 73 (where ""Hyena"" Neutral)) (= 1 (size Stack at:(where ""Hyena"" Neutral))) True) (!= (where ""Hyena"" Neutral) -1) (all Sites (sites Occupied by:All top:False) if:(is In (site) (union (sites Hand Shared) (sites {73 (where ""Hyena"" Neutral)}))))}) (result Player Win))})))" "5x5 board, with the central square on each side and the central square of the board marked with an X. Two to four players, each with four pieces, which start on one of the marked squares on the edge of the board. Four cowrie shells used as dice. The throws are as follows, with the value of the throws equaling the number of mouths which land up, all mouths down = 8, and grants the player another throw. Pieces moves in a spiral track around the board in an anti-clockwise direction until they reach the space before the starting point, at which point they proceed around the inner circles in a clockwise direction, and then to the central space. When a player lands on a space occupied by an opponent's piece, the opponent's piece is sent back to their starting position. When a player reaches the central square by an exact throw, it is removed from the board. The first player to remove all four of their pieces from the board wins. The game involves 4 players.","(game ""Main Pacheh"" (players 4) (equipment {(board (square 5) {(track ""Track1"" ""2,E,N,W,S,E1,N3,E2,S2,W1,12"" P1 directed:True) (track ""Track2"" ""22,W,S,E,N,W1,S3,W2,N2,E1,12"" P2 directed:True) (track ""Track3"" ""14,N,W,S,E,N1,W3,N2,E2,S1,12"" P3 directed:True) (track ""Track4"" ""10,S,E,N,W,S1,E3,S2,W2,N1,12"" P4 directed:True)}) (piece ""Marker"" Each (if (!= (trackSite Move steps:(mapEntry ""ThrowDiceValue"" (count Pips))) -1) (if (or (is Empty (trackSite Move steps:(mapEntry ""ThrowDiceValue"" (count Pips)))) (is Enemy (who at:(trackSite Move steps:(mapEntry ""ThrowDiceValue"" (count Pips)))))) (move (from (from) level:(level)) (to (trackSite Move steps:(mapEntry ""ThrowDiceValue"" (count Pips))) (apply if:(is Enemy (who at:(to))) (fromTo (from (to)) (to (mapEntry ""StartingPoint"" (who at:(to))))))))) (then (if (= 12 (last To)) (remove (last To)))))) (map ""ThrowDiceValue"" {(pair 0 8) (pair 1 1) (pair 2 2) (pair 3 3) (pair 4 4)}) (map ""StartingPoint"" {(pair 1 2) (pair 2 22) (pair 3 14) (pair 4 10)}) (dice d:2 from:0 num:4)}) (rules (start {(place Stack ""Marker1"" 2 count:4) (place Stack ""Marker2"" 22 count:4) (place Stack ""Marker3"" 14 count:4) (place Stack ""Marker4"" 10 count:4)}) (play (do (roll) next:(if (can Move (forEach Piece)) (forEach Piece (then (if (= (mapEntry ""ThrowDiceValue"" (count Pips)) 8) (moveAgain)))) (move Pass (then (if (= (mapEntry ""ThrowDiceValue"" (count Pips)) 8) (moveAgain))))))) (end (if (no Pieces Mover) (result Mover Win)))))","###Description 5x5 board, with the central square on each side and the central square of the board marked with an X. Two to four players, each with four pieces, which start on one of the marked squares on the edge of the board. Four cowrie shells used as dice. The throws are as follows, with the value of the throws equaling the number of mouths which land up, all mouths down = 8, and grants the player another throw. Pieces moves in a spiral track around the board in an anti-clockwise direction until they reach the space before the starting point, at which point they proceed around the inner circles in a clockwise direction, and then to the central space. When a player lands on a space occupied by an opponent's piece, the opponent's piece is sent back to their starting position. When a player reaches the central square by an exact throw, it is removed from the board. The first player to remove all four of their pieces from the board wins. The game involves 4 players. @@ -1094,16 +1064,6 @@ Forty stones arranged in a circle, with a larger gap after every tenth stone, th ###Ludii (game ""Setichch"" (players 6) (equipment {(board (add (remove (concentric {44}) vertices:{43 21 0 22}) edges:{{20 18} {0 1} {19 21} {38 39}}) {(track ""TrackCW"" {39 35 33 31 29 27 25 23 21 19 38 17 15 13 11 9 7 5 3 1 37 0 2 4 6 8 10 12 14 16 36 18 20 22 24 26 28 30 32 34} loop:True) (track ""TrackCCW"" {39 34 32 30 28 26 24 22 20 18 36 16 14 12 10 8 6 4 2 0 37 1 3 5 7 9 11 13 15 17 38 19 21 23 25 27 29 31 33 35} loop:True)} use:Edge) (regions ""AllSites"" (sites Board)) (piece ""Stick"" P1) (piece ""Stick"" P2) (dice d:2 from:0 num:3) (hand Each) (map ""Throw"" {(pair 0 5) (pair 1 3) (pair 2 2) (pair 3 10)})}) (rules (start {(place Stack ""Stick1"" Edge 36 count:2) (place Stack ""Stick2"" Edge 38 count:2) (set Team 1 {P1 P3 P5}) (set Team 2 {P2 P4 P6})}) (play (do (roll) next:(if (is In (mover) (players Team1)) (move (from (sites Occupied by:Team1)) (to (trackSite Move ""TrackCW"" steps:(mapEntry ""Throw"" (count Pips))) if:(not (is Enemy (who at:(to)))))) (move (from (sites Occupied by:Team2)) (to (trackSite Move ""TrackCCW"" steps:(mapEntry ""Throw"" (count Pips))) if:(not (is Enemy (who at:(to))))))) (then (if (= 10 (mapEntry ""Throw"" (count Pips))) (moveAgain))))) (end {(if (and {(is In (mover) (players Team1)) (= 1 (count Sites in:(sites Occupied by:Team1))) (= 36 (where ""Stick"" Team1))}) (result Team1 Win)) (if (and {(is In (mover) (players Team2)) (= 1 (count Sites in:(sites Occupied by:Team2))) (= 38 (where ""Stick"" Team2))}) (result Team2 Win))})))" -"98 spaces on the board. Six six-sided dice. One piece per player. Pieces are initially placed on the board based on the values of the throws of the dice. The throws are as follows: Space one: two 1s; Space 2: two 2s; Space 3: two 3s; Space 4: two 4s Space 5: two 5s; Space 6: two 6s; Space 7: five of any number; Space 8: six of any number; Space 9: three 1s; Space 10; three 2s; Space 11; three 3s; Space 12; three 4s; Space 13; three 5s; Space 14; three 6s; Space 16; four 1s; Space 17; four 2s; Space 18; four 3s; Space 19; four 4s; Space 20: four 5s; Space 21: four 6s. From here, the players move to prescribed spaces based on the throw they make, based on the instructions for the space they are currently on. There are three throws which result in a move: Te (""Influence""; double 4s), Cung (""Pair""; double 2, 3, 5, or 6) or Chang (""Failure""; double 1). The players use the throws as many times as allowed (e.g., six 5s = three Cung, allowing the player to move Cung from each successive square). Throws which do not produce a result where the player can move result in a pass. Throws of Te generally advance the player along the board. A throw of Te moves the player to the next consecutively numbered space, with the following exceptions: 1-3 to 37; 4-6 to 38; 7 to 73; 8 to 72; 9 to 52; 10 to 51; 11 to 50; 12 to 49; 13 to 48; 14 to 47; 15 to 55; 16-21 to 23; 27 to 56; 30 to 32; 35 to 67; 36 to 66; 46 to 89; 47 to 59; 48 to 74; 49 to 71; 50 to 47; 51 to 50; 52 to 51; 59 to 71; 60 to 62; 61 to 47; 62 to 61; 63 to 65; 64 to 69; 65 to 64; 66 to 60; 67 to 70; 68 to 86; 69 to 84; 70 to 68; 71 to 74; 72 to 90; 73 to 92; 75 to 93; 81 to 31; 82 to 91; 83-88 to the previous consecutively numbered square; 89 to 91; 90 to 92; 91 to 93; 92 to 94; 94 to 97; 95 to 98; 96 to 95. Throws of Cung move players from: 1, 2, and 3 to 76; 8 to 60; 9 to 23; 15 to 53; 16-21 to 22; 27 to 25; 37 to 36; 41 to 30; 42 to 31; 47 to 54; 48 to 65; 49 to 54; 69 to 88. Throws of Chang move the player to space 28 from spaces 54-59, or to space 29 from spaces 30-35 and 68. Players must throw Te to leave spaces 28 or 29, and return to the space they previously occupied. The player who throws Te while in space 97 or 98 first moves to the palace and wins. The game is played with 16 players.","(game ""Shing Quon Tu"" (players 16) (equipment {(board (union {(scale 2 2.2 (square 1)) (shift 0 -0.5 (scale 1 0.5 (square 1))) (shift 1 -0.5 (scale 1 0.5 (square 1))) (shift 0 -1 (scale 0.5 0.5 (rectangle 1 2))) (shift 1 -1 (scale 0.5 0.5 (rectangle 1 2))) (shift 0 -2 (scale 1 0.5 (rectangle 2 1))) (shift 1 -2 (scale 1 0.5 (rectangle 2 1))) (shift 2 -2 (scale 1 0.5 (rectangle 6 1))) (shift 2 1 (scale 1 1.2 (square 1))) (shift 0 2.2 (scale 0.5 1 (rectangle 1 6))) (shift -2 -2 (scale 1 1.04 (rectangle 5 2))) (shift -2 -3 (rectangle 1 5)) (shift 3 -3 (scale 1 1.55 (rectangle 4 1))) (shift -2 3.2 (scale 2 1 (rectangle 1 3))) (shift -2 4.2 (scale 3 1 (rectangle 1 2))) (shift -3.2 -2 (scale 1.2 (rectangle 6 1))) (shift 4 -2.6 (scale 1.3 (rectangle 6 1))) (shift 4 -3 (scale 1.3 0.4 (square 1))) (shift -2 -4.3 (scale 1 1.3 (square 1))) (shift -3.2 -4.3 (scale 1.2 0.383 (rectangle 6 1))) (shift -3.2 -5.5 (scale 1.2 (square 1))) (shift -1 -4.3 (scale 0.335 1.29 (rectangle 1 6))) (shift 1.01 -4.3 (scale 0.4 1.29 (rectangle 1 9))) (shift 4.61 -4.3 (scale 0.7 1.29 (square 1))) (shift -2 -5.5 (scale 0.501 1.2 (rectangle 1 6))) (shift 2 -5.5 (scale 0.4 1.2 (rectangle 1 6))) (shift 1.005 -5.5 (scale 1 1.2 (square 1))) (shift 4.4 -5.5 (scale 0.91 1.2 (square 1)))}) (track ""Track"" {98 96 95 94 93 92 91 97 90 89 88 87 86 85 68 62 63 64 65 66 67 48 49 50 51 52 53 46 47 59 58 57 56 55 54 60 84 83 82 81 80 79 78 77 76 75 74 73 72 71 70 69 61 34 24 26 28 30 32 43 44 45 42 41 40 39 38 37 36 35 25 27 29 31 33 18 19 20 21 22 23 17 16 15 14 13 12 11 9 7 10 8 6 5 4 3 2 1} directed:True)) (dice d:6 num:6) (hand Each) (piece ""Pawn"" Each) (map ""Site"" {(pair 1 98) (pair 2 96) (pair 3 95) (pair 4 94) (pair 5 93) (pair 6 92) (pair 7 91) (pair 8 97) (pair 9 90) (pair 10 89) (pair 11 88) (pair 12 87) (pair 13 86) (pair 14 85) (pair 15 68) (pair 16 62) (pair 17 63) (pair 18 64) (pair 19 65) (pair 20 66) (pair 21 67) (pair 22 48) (pair 23 49) (pair 24 50) (pair 25 51) (pair 26 52) (pair 27 53) (pair 28 46) (pair 29 47) (pair 30 59) (pair 31 58) (pair 32 57) (pair 33 56) (pair 34 55) (pair 35 54) (pair 36 60) (pair 37 84) (pair 38 83) (pair 39 82) (pair 40 81) (pair 41 80) (pair 42 79) (pair 43 78) (pair 44 77) (pair 45 76) (pair 46 75) (pair 47 74) (pair 48 73) (pair 49 72) (pair 50 71) (pair 51 70) (pair 52 69) (pair 53 61) (pair 54 34) (pair 55 24) (pair 56 26) (pair 57 28) (pair 58 30) (pair 59 32) (pair 60 43) (pair 61 44) (pair 62 45) (pair 63 42) (pair 64 41) (pair 65 40) (pair 66 39) (pair 67 38) (pair 68 37) (pair 69 36) (pair 70 35) (pair 71 25) (pair 72 27) (pair 73 29) (pair 74 31) (pair 75 33) (pair 76 18) (pair 77 19) (pair 78 20) (pair 79 21) (pair 80 22) (pair 81 23) (pair 82 17) (pair 83 16) (pair 84 15) (pair 85 14) (pair 86 13) (pair 87 12) (pair 88 11) (pair 89 9) (pair 90 7) (pair 91 10) (pair 92 8) (pair 93 6) (pair 94 5) (pair 95 4) (pair 96 3) (pair 97 2) (pair 98 1) (pair 0 0)}) (map ""OppositeSite"" {(pair 98 1) (pair 96 2) (pair 95 3) (pair 94 4) (pair 93 5) (pair 92 6) (pair 91 7) (pair 97 8) (pair 90 9) (pair 89 10) (pair 88 11) (pair 87 12) (pair 86 13) (pair 85 14) (pair 68 15) (pair 62 16) (pair 63 17) (pair 64 18) (pair 65 19) (pair 66 20) (pair 67 21) (pair 48 22) (pair 49 23) (pair 50 24) (pair 51 25) (pair 52 26) (pair 53 27) (pair 46 28) (pair 47 29) (pair 59 30) (pair 58 31) (pair 57 32) (pair 56 33) (pair 55 34) (pair 54 35) (pair 60 36) (pair 84 37) (pair 83 38) (pair 82 39) (pair 81 40) (pair 80 41) (pair 79 42) (pair 78 43) (pair 77 44) (pair 76 45) (pair 75 46) (pair 74 47) (pair 73 48) (pair 72 49) (pair 71 50) (pair 70 51) (pair 69 52) (pair 61 53) (pair 34 54) (pair 24 55) (pair 26 56) (pair 28 57) (pair 30 58) (pair 32 59) (pair 43 60) (pair 44 61) (pair 45 62) (pair 42 63) (pair 41 64) (pair 40 65) (pair 39 66) (pair 38 67) (pair 37 68) (pair 36 69) (pair 35 70) (pair 25 71) (pair 27 72) (pair 29 73) (pair 31 74) (pair 33 75) (pair 18 76) (pair 19 77) (pair 20 78) (pair 21 79) (pair 22 80) (pair 23 81) (pair 17 82) (pair 16 83) (pair 15 84) (pair 14 85) (pair 13 86) (pair 12 87) (pair 11 88) (pair 9 89) (pair 7 90) (pair 10 91) (pair 8 92) (pair 6 93) (pair 5 94) (pair 4 95) (pair 3 96) (pair 2 97) (pair 1 98) (pair 0 0)}) (map ""TeMove"" {(pair 1 37) (pair 2 37) (pair 3 37) (pair 4 38) (pair 5 38) (pair 6 38) (pair 7 73) (pair 8 72) (pair 9 52) (pair 10 51) (pair 11 50) (pair 12 49) (pair 13 48) (pair 14 47) (pair 15 55) (pair 16 23) (pair 17 23) (pair 18 23) (pair 19 23) (pair 20 23) (pair 21 23) (pair 27 56) (pair 30 32) (pair 35 67) (pair 36 66) (pair 46 89) (pair 47 59) (pair 48 74) (pair 49 71) (pair 50 47) (pair 51 50) (pair 52 51) (pair 59 71) (pair 60 62) (pair 61 47) (pair 62 61) (pair 63 65) (pair 64 69) (pair 65 64) (pair 66 60) (pair 67 70) (pair 68 86) (pair 69 84) (pair 70 68) (pair 71 74) (pair 72 90) (pair 73 92) (pair 75 93) (pair 81 31) (pair 82 91) (pair 83 82) (pair 84 83) (pair 85 84) (pair 86 85) (pair 87 86) (pair 88 87) (pair 89 91) (pair 90 92) (pair 91 93) (pair 92 94) (pair 94 97) (pair 95 98) (pair 96 95) (pair 97 0) (pair 98 0)}) (map ""CungMove"" {(pair 1 76) (pair 2 76) (pair 3 76) (pair 8 60) (pair 9 23) (pair 15 53) (pair 16 22) (pair 17 22) (pair 18 22) (pair 19 22) (pair 20 22) (pair 21 22) (pair 27 25) (pair 37 36) (pair 41 30) (pair 42 31) (pair 47 54) (pair 48 65) (pair 49 54) (pair 69 88)}) (map ""ChangMove"" {(pair 30 29) (pair 31 29) (pair 32 29) (pair 33 29) (pair 34 29) (pair 35 29) (pair 54 28) (pair 55 28) (pair 56 28) (pair 57 28) (pair 58 28) (pair 59 28) (pair 68 29)})}) (rules (start {(place Stack ""Pawn1"" (handSite P1)) (place Stack ""Pawn2"" (handSite P2)) (place Stack ""Pawn3"" (handSite P3)) (place Stack ""Pawn4"" (handSite P4)) (place Stack ""Pawn5"" (handSite P5)) (place Stack ""Pawn6"" (handSite P6)) (place Stack ""Pawn7"" (handSite P7)) (place Stack ""Pawn8"" (handSite P8)) (place Stack ""Pawn9"" (handSite P9)) (place Stack ""Pawn10"" (handSite P10)) (place Stack ""Pawn11"" (handSite P11)) (place Stack ""Pawn12"" (handSite P12)) (place Stack ""Pawn13"" (handSite P13)) (place Stack ""Pawn14"" (handSite P14)) (place Stack ""Pawn15"" (handSite P15)) (place Stack ""Pawn16"" (handSite P16))}) phases:{(phase ""Opening"" (play (do (roll) next:(or {(if (= 2 (count Value 1 in:(array {(face (+ (count Players) 99)) (face (+ (count Players) 100)) (face (+ (count Players) 101)) (face (+ (count Players) 102)) (face (+ (count Players) 103)) (face (+ (count Players) 104))}))) (move (from (handSite Mover)) (to (mapEntry ""Site"" 1)))) (if (= 2 (count Value 2 in:(array {(face (+ (count Players) 99)) (face (+ (count Players) 100)) (face (+ (count Players) 101)) (face (+ (count Players) 102)) (face (+ (count Players) 103)) (face (+ (count Players) 104))}))) (move (from (handSite Mover)) (to (mapEntry ""Site"" 2)))) (if (= 2 (count Value 4 in:(array {(face (+ (count Players) 99)) (face (+ (count Players) 100)) (face (+ (count Players) 101)) (face (+ (count Players) 102)) (face (+ (count Players) 103)) (face (+ (count Players) 104))}))) (move (from (handSite Mover)) (to (mapEntry ""Site"" 3)))) (if (= 2 (count Value 3 in:(array {(face (+ (count Players) 99)) (face (+ (count Players) 100)) (face (+ (count Players) 101)) (face (+ (count Players) 102)) (face (+ (count Players) 103)) (face (+ (count Players) 104))}))) (move (from (handSite Mover)) (to (mapEntry ""Site"" 4)))) (if (= 2 (count Value 5 in:(array {(face (+ (count Players) 99)) (face (+ (count Players) 100)) (face (+ (count Players) 101)) (face (+ (count Players) 102)) (face (+ (count Players) 103)) (face (+ (count Players) 104))}))) (move (from (handSite Mover)) (to (mapEntry ""Site"" 5)))) (if (= 2 (count Value 6 in:(array {(face (+ (count Players) 99)) (face (+ (count Players) 100)) (face (+ (count Players) 101)) (face (+ (count Players) 102)) (face (+ (count Players) 103)) (face (+ (count Players) 104))}))) (move (from (handSite Mover)) (to (mapEntry ""Site"" 6)))) (if (or {(= 5 (count Value 1 in:(array {(face (+ (count Players) 99)) (face (+ (count Players) 100)) (face (+ (count Players) 101)) (face (+ (count Players) 102)) (face (+ (count Players) 103)) (face (+ (count Players) 104))}))) (= 5 (count Value 2 in:(array {(face (+ (count Players) 99)) (face (+ (count Players) 100)) (face (+ (count Players) 101)) (face (+ (count Players) 102)) (face (+ (count Players) 103)) (face (+ (count Players) 104))}))) (= 5 (count Value 3 in:(array {(face (+ (count Players) 99)) (face (+ (count Players) 100)) (face (+ (count Players) 101)) (face (+ (count Players) 102)) (face (+ (count Players) 103)) (face (+ (count Players) 104))}))) (= 5 (count Value 4 in:(array {(face (+ (count Players) 99)) (face (+ (count Players) 100)) (face (+ (count Players) 101)) (face (+ (count Players) 102)) (face (+ (count Players) 103)) (face (+ (count Players) 104))}))) (= 5 (count Value 5 in:(array {(face (+ (count Players) 99)) (face (+ (count Players) 100)) (face (+ (count Players) 101)) (face (+ (count Players) 102)) (face (+ (count Players) 103)) (face (+ (count Players) 104))}))) (= 5 (count Value 6 in:(array {(face (+ (count Players) 99)) (face (+ (count Players) 100)) (face (+ (count Players) 101)) (face (+ (count Players) 102)) (face (+ (count Players) 103)) (face (+ (count Players) 104))})))}) (move (from (handSite Mover)) (to (mapEntry ""Site"" 7)))) (if (or {(= 6 (count Value 1 in:(array {(face (+ (count Players) 99)) (face (+ (count Players) 100)) (face (+ (count Players) 101)) (face (+ (count Players) 102)) (face (+ (count Players) 103)) (face (+ (count Players) 104))}))) (= 6 (count Value 2 in:(array {(face (+ (count Players) 99)) (face (+ (count Players) 100)) (face (+ (count Players) 101)) (face (+ (count Players) 102)) (face (+ (count Players) 103)) (face (+ (count Players) 104))}))) (= 6 (count Value 3 in:(array {(face (+ (count Players) 99)) (face (+ (count Players) 100)) (face (+ (count Players) 101)) (face (+ (count Players) 102)) (face (+ (count Players) 103)) (face (+ (count Players) 104))}))) (= 6 (count Value 4 in:(array {(face (+ (count Players) 99)) (face (+ (count Players) 100)) (face (+ (count Players) 101)) (face (+ (count Players) 102)) (face (+ (count Players) 103)) (face (+ (count Players) 104))}))) (= 6 (count Value 5 in:(array {(face (+ (count Players) 99)) (face (+ (count Players) 100)) (face (+ (count Players) 101)) (face (+ (count Players) 102)) (face (+ (count Players) 103)) (face (+ (count Players) 104))}))) (= 6 (count Value 6 in:(array {(face (+ (count Players) 99)) (face (+ (count Players) 100)) (face (+ (count Players) 101)) (face (+ (count Players) 102)) (face (+ (count Players) 103)) (face (+ (count Players) 104))})))}) (move (from (handSite Mover)) (to (mapEntry ""Site"" 8)))) (if (= 3 (count Value 1 in:(array {(face (+ (count Players) 99)) (face (+ (count Players) 100)) (face (+ (count Players) 101)) (face (+ (count Players) 102)) (face (+ (count Players) 103)) (face (+ (count Players) 104))}))) (move (from (handSite Mover)) (to (mapEntry ""Site"" 9)))) (if (= 3 (count Value 2 in:(array {(face (+ (count Players) 99)) (face (+ (count Players) 100)) (face (+ (count Players) 101)) (face (+ (count Players) 102)) (face (+ (count Players) 103)) (face (+ (count Players) 104))}))) (move (from (handSite Mover)) (to (mapEntry ""Site"" 10)))) (if (= 3 (count Value 3 in:(array {(face (+ (count Players) 99)) (face (+ (count Players) 100)) (face (+ (count Players) 101)) (face (+ (count Players) 102)) (face (+ (count Players) 103)) (face (+ (count Players) 104))}))) (move (from (handSite Mover)) (to (mapEntry ""Site"" 11)))) (if (= 3 (count Value 4 in:(array {(face (+ (count Players) 99)) (face (+ (count Players) 100)) (face (+ (count Players) 101)) (face (+ (count Players) 102)) (face (+ (count Players) 103)) (face (+ (count Players) 104))}))) (move (from (handSite Mover)) (to (mapEntry ""Site"" 12)))) (if (= 3 (count Value 5 in:(array {(face (+ (count Players) 99)) (face (+ (count Players) 100)) (face (+ (count Players) 101)) (face (+ (count Players) 102)) (face (+ (count Players) 103)) (face (+ (count Players) 104))}))) (move (from (handSite Mover)) (to (mapEntry ""Site"" 13)))) (if (= 3 (count Value 6 in:(array {(face (+ (count Players) 99)) (face (+ (count Players) 100)) (face (+ (count Players) 101)) (face (+ (count Players) 102)) (face (+ (count Players) 103)) (face (+ (count Players) 104))}))) (move (from (handSite Mover)) (to (mapEntry ""Site"" 14)))) (if (= 4 (count Value 1 in:(array {(face (+ (count Players) 99)) (face (+ (count Players) 100)) (face (+ (count Players) 101)) (face (+ (count Players) 102)) (face (+ (count Players) 103)) (face (+ (count Players) 104))}))) (move (from (handSite Mover)) (to (mapEntry ""Site"" 16)))) (if (= 4 (count Value 2 in:(array {(face (+ (count Players) 99)) (face (+ (count Players) 100)) (face (+ (count Players) 101)) (face (+ (count Players) 102)) (face (+ (count Players) 103)) (face (+ (count Players) 104))}))) (move (from (handSite Mover)) (to (mapEntry ""Site"" 17)))) (if (= 4 (count Value 3 in:(array {(face (+ (count Players) 99)) (face (+ (count Players) 100)) (face (+ (count Players) 101)) (face (+ (count Players) 102)) (face (+ (count Players) 103)) (face (+ (count Players) 104))}))) (move (from (handSite Mover)) (to (mapEntry ""Site"" 18)))) (if (= 4 (count Value 4 in:(array {(face (+ (count Players) 99)) (face (+ (count Players) 100)) (face (+ (count Players) 101)) (face (+ (count Players) 102)) (face (+ (count Players) 103)) (face (+ (count Players) 104))}))) (move (from (handSite Mover)) (to (mapEntry ""Site"" 19)))) (if (= 4 (count Value 5 in:(array {(face (+ (count Players) 99)) (face (+ (count Players) 100)) (face (+ (count Players) 101)) (face (+ (count Players) 102)) (face (+ (count Players) 103)) (face (+ (count Players) 104))}))) (move (from (handSite Mover)) (to (mapEntry ""Site"" 20)))) (if (= 4 (count Value 6 in:(array {(face (+ (count Players) 99)) (face (+ (count Players) 100)) (face (+ (count Players) 101)) (face (+ (count Players) 102)) (face (+ (count Players) 103)) (face (+ (count Players) 104))}))) (move (from (handSite Mover)) (to (mapEntry ""Site"" 21))))}))) (nextPhase Mover (is Empty (handSite Mover)) ""Playing"")) (phase ""Playing"" (play (if (is Prev Mover) (if (can Move (or {(if (!= 0 (size Array (values Remembered ""Te""))) (if (!= (mapEntry ""Site"" (where ""Pawn"" Mover)) (mapEntry ""TeMove"" (mapEntry ""Site"" (where ""Pawn"" Mover)))) (move (from (where ""Pawn"" Mover)) (to (mapEntry ""OppositeSite"" (mapEntry ""TeMove"" (mapEntry ""Site"" (where ""Pawn"" Mover))))) (then (and (forget Value ""Te"" 1) (if (< 1 (+ {(size Array (values Remembered ""Te"")) (size Array (values Remembered ""Cung"")) (size Array (values Remembered ""Chang""))})) (moveAgain))))) (move (from (where ""Pawn"" Mover)) (to (trackSite Move from:(where ""Pawn"" Mover) steps:1)) (then (and (forget Value ""Te"" 1) (if (< 1 (+ {(size Array (values Remembered ""Te"")) (size Array (values Remembered ""Cung"")) (size Array (values Remembered ""Chang""))})) (moveAgain))))))) (if (!= 0 (size Array (values Remembered ""Cung""))) (if (!= (mapEntry ""Site"" (where ""Pawn"" Mover)) (mapEntry ""CungMove"" (mapEntry ""Site"" (where ""Pawn"" Mover)))) (move (from (where ""Pawn"" Mover)) (to (mapEntry ""OppositeSite"" (mapEntry ""CungMove"" (mapEntry ""Site"" (where ""Pawn"" Mover))))) (then (and (forget Value ""Cung"" 1) (if (< 1 (+ {(size Array (values Remembered ""Te"")) (size Array (values Remembered ""Cung"")) (size Array (values Remembered ""Chang""))})) (moveAgain))))))) (if (!= 0 (size Array (values Remembered ""Chang""))) (if (!= (mapEntry ""Site"" (where ""Pawn"" Mover)) (mapEntry ""ChangMove"" (mapEntry ""Site"" (where ""Pawn"" Mover)))) (move (from (where ""Pawn"" Mover)) (to (mapEntry ""OppositeSite"" (mapEntry ""ChangMove"" (mapEntry ""Site"" (where ""Pawn"" Mover))))))))})) (or {(if (!= 0 (size Array (values Remembered ""Te""))) (if (!= (mapEntry ""Site"" (where ""Pawn"" Mover)) (mapEntry ""TeMove"" (mapEntry ""Site"" (where ""Pawn"" Mover)))) (move (from (where ""Pawn"" Mover)) (to (mapEntry ""OppositeSite"" (mapEntry ""TeMove"" (mapEntry ""Site"" (where ""Pawn"" Mover))))) (then (and (forget Value ""Te"" 1) (if (< 1 (+ {(size Array (values Remembered ""Te"")) (size Array (values Remembered ""Cung"")) (size Array (values Remembered ""Chang""))})) (moveAgain))))) (move (from (where ""Pawn"" Mover)) (to (trackSite Move from:(where ""Pawn"" Mover) steps:1)) (then (and (forget Value ""Te"" 1) (if (< 1 (+ {(size Array (values Remembered ""Te"")) (size Array (values Remembered ""Cung"")) (size Array (values Remembered ""Chang""))})) (moveAgain))))))) (if (!= 0 (size Array (values Remembered ""Cung""))) (if (!= (mapEntry ""Site"" (where ""Pawn"" Mover)) (mapEntry ""CungMove"" (mapEntry ""Site"" (where ""Pawn"" Mover)))) (move (from (where ""Pawn"" Mover)) (to (mapEntry ""OppositeSite"" (mapEntry ""CungMove"" (mapEntry ""Site"" (where ""Pawn"" Mover))))) (then (and (forget Value ""Cung"" 1) (if (< 1 (+ {(size Array (values Remembered ""Te"")) (size Array (values Remembered ""Cung"")) (size Array (values Remembered ""Chang""))})) (moveAgain))))))) (if (!= 0 (size Array (values Remembered ""Chang""))) (if (!= (mapEntry ""Site"" (where ""Pawn"" Mover)) (mapEntry ""ChangMove"" (mapEntry ""Site"" (where ""Pawn"" Mover)))) (move (from (where ""Pawn"" Mover)) (to (mapEntry ""OppositeSite"" (mapEntry ""ChangMove"" (mapEntry ""Site"" (where ""Pawn"" Mover))))))))}) (move Pass (then (and {(forget Value ""Te"" All) (forget Value ""Cung"" All) (forget Value ""Chang"" All)})))) (do (roll) next:(move Pass) (then (and {(moveAgain) (if (= 2 (count Value 4 in:(array {(face (+ (count Players) 99)) (face (+ (count Players) 100)) (face (+ (count Players) 101)) (face (+ (count Players) 102)) (face (+ (count Players) 103)) (face (+ (count Players) 104))}))) (remember Value ""Te"" 1) (if (= 4 (count Value 4 in:(array {(face (+ (count Players) 99)) (face (+ (count Players) 100)) (face (+ (count Players) 101)) (face (+ (count Players) 102)) (face (+ (count Players) 103)) (face (+ (count Players) 104))}))) (and (remember Value ""Te"" 1) (remember Value ""Te"" 1)) (if (= 6 (count Value 4 in:(array {(face (+ (count Players) 99)) (face (+ (count Players) 100)) (face (+ (count Players) 101)) (face (+ (count Players) 102)) (face (+ (count Players) 103)) (face (+ (count Players) 104))}))) (and {(remember Value ""Te"" 1) (remember Value ""Te"" 1) (remember Value ""Te"" 1)})))) (if (= 2 (count Value 1 in:(array {(face (+ (count Players) 99)) (face (+ (count Players) 100)) (face (+ (count Players) 101)) (face (+ (count Players) 102)) (face (+ (count Players) 103)) (face (+ (count Players) 104))}))) (remember Value ""Chang"" 1) (if (= 4 (count Value 1 in:(array {(face (+ (count Players) 99)) (face (+ (count Players) 100)) (face (+ (count Players) 101)) (face (+ (count Players) 102)) (face (+ (count Players) 103)) (face (+ (count Players) 104))}))) (and (remember Value ""Chang"" 1) (remember Value ""Chang"" 1)) (if (= 6 (count Value 1 in:(array {(face (+ (count Players) 99)) (face (+ (count Players) 100)) (face (+ (count Players) 101)) (face (+ (count Players) 102)) (face (+ (count Players) 103)) (face (+ (count Players) 104))}))) (and {(remember Value ""Chang"" 1) (remember Value ""Chang"" 1) (remember Value ""Chang"" 1)})))) (if (= 2 (count Value 2 in:(array {(face (+ (count Players) 99)) (face (+ (count Players) 100)) (face (+ (count Players) 101)) (face (+ (count Players) 102)) (face (+ (count Players) 103)) (face (+ (count Players) 104))}))) (remember Value ""Cung"" 1) (if (= 4 (count Value 2 in:(array {(face (+ (count Players) 99)) (face (+ (count Players) 100)) (face (+ (count Players) 101)) (face (+ (count Players) 102)) (face (+ (count Players) 103)) (face (+ (count Players) 104))}))) (and (remember Value ""Cung"" 1) (remember Value ""Cung"" 1)) (if (= 6 (count Value 2 in:(array {(face (+ (count Players) 99)) (face (+ (count Players) 100)) (face (+ (count Players) 101)) (face (+ (count Players) 102)) (face (+ (count Players) 103)) (face (+ (count Players) 104))}))) (and {(remember Value ""Cung"" 1) (remember Value ""Cung"" 1) (remember Value ""Cung"" 1)})))) (if (= 2 (count Value 3 in:(array {(face (+ (count Players) 99)) (face (+ (count Players) 100)) (face (+ (count Players) 101)) (face (+ (count Players) 102)) (face (+ (count Players) 103)) (face (+ (count Players) 104))}))) (remember Value ""Cung"" 1) (if (= 4 (count Value 3 in:(array {(face (+ (count Players) 99)) (face (+ (count Players) 100)) (face (+ (count Players) 101)) (face (+ (count Players) 102)) (face (+ (count Players) 103)) (face (+ (count Players) 104))}))) (and (remember Value ""Cung"" 1) (remember Value ""Cung"" 1)) (if (= 6 (count Value 3 in:(array {(face (+ (count Players) 99)) (face (+ (count Players) 100)) (face (+ (count Players) 101)) (face (+ (count Players) 102)) (face (+ (count Players) 103)) (face (+ (count Players) 104))}))) (and {(remember Value ""Cung"" 1) (remember Value ""Cung"" 1) (remember Value ""Cung"" 1)})))) (if (= 2 (count Value 5 in:(array {(face (+ (count Players) 99)) (face (+ (count Players) 100)) (face (+ (count Players) 101)) (face (+ (count Players) 102)) (face (+ (count Players) 103)) (face (+ (count Players) 104))}))) (remember Value ""Cung"" 1) (if (= 4 (count Value 5 in:(array {(face (+ (count Players) 99)) (face (+ (count Players) 100)) (face (+ (count Players) 101)) (face (+ (count Players) 102)) (face (+ (count Players) 103)) (face (+ (count Players) 104))}))) (and (remember Value ""Cung"" 1) (remember Value ""Cung"" 1)) (if (= 6 (count Value 5 in:(array {(face (+ (count Players) 99)) (face (+ (count Players) 100)) (face (+ (count Players) 101)) (face (+ (count Players) 102)) (face (+ (count Players) 103)) (face (+ (count Players) 104))}))) (and {(remember Value ""Cung"" 1) (remember Value ""Cung"" 1) (remember Value ""Cung"" 1)})))) (if (= 2 (count Value 6 in:(array {(face (+ (count Players) 99)) (face (+ (count Players) 100)) (face (+ (count Players) 101)) (face (+ (count Players) 102)) (face (+ (count Players) 103)) (face (+ (count Players) 104))}))) (remember Value ""Cung"" 1) (if (= 4 (count Value 6 in:(array {(face (+ (count Players) 99)) (face (+ (count Players) 100)) (face (+ (count Players) 101)) (face (+ (count Players) 102)) (face (+ (count Players) 103)) (face (+ (count Players) 104))}))) (and (remember Value ""Cung"" 1) (remember Value ""Cung"" 1)) (if (= 6 (count Value 6 in:(array {(face (+ (count Players) 99)) (face (+ (count Players) 100)) (face (+ (count Players) 101)) (face (+ (count Players) 102)) (face (+ (count Players) 103)) (face (+ (count Players) 104))}))) (and {(remember Value ""Cung"" 1) (remember Value ""Cung"" 1) (remember Value ""Cung"" 1)}))))}))))))} (end (if (= 0 (where ""Pawn"" Mover)) (result Mover Win)))))","###Description -98 spaces on the board. Six six-sided dice. One piece per player. Pieces are initially placed on the board based on the values of the throws of the dice. The throws are as follows: Space one: two 1s; Space 2: two 2s; Space 3: two 3s; Space 4: two 4s Space 5: two 5s; Space 6: two 6s; Space 7: five of any number; Space 8: six of any number; Space 9: three 1s; Space 10; three 2s; Space 11; three 3s; Space 12; three 4s; Space 13; three 5s; Space 14; three 6s; Space 16; four 1s; Space 17; four 2s; Space 18; four 3s; Space 19; four 4s; Space 20: four 5s; Space 21: four 6s. From here, the players move to prescribed spaces based on the throw they make, based on the instructions for the space they are currently on. There are three throws which result in a move: Te (""Influence""; double 4s), Cung (""Pair""; double 2, 3, 5, or 6) or Chang (""Failure""; double 1). The players use the throws as many times as allowed (e.g., six 5s = three Cung, allowing the player to move Cung from each successive square). Throws which do not produce a result where the player can move result in a pass. Throws of Te generally advance the player along the board. A throw of Te moves the player to the next consecutively numbered space, with the following exceptions: 1-3 to 37; 4-6 to 38; 7 to 73; 8 to 72; 9 to 52; 10 to 51; 11 to 50; 12 to 49; 13 to 48; 14 to 47; 15 to 55; 16-21 to 23; 27 to 56; 30 to 32; 35 to 67; 36 to 66; 46 to 89; 47 to 59; 48 to 74; 49 to 71; 50 to 47; 51 to 50; 52 to 51; 59 to 71; 60 to 62; 61 to 47; 62 to 61; 63 to 65; 64 to 69; 65 to 64; 66 to 60; 67 to 70; 68 to 86; 69 to 84; 70 to 68; 71 to 74; 72 to 90; 73 to 92; 75 to 93; 81 to 31; 82 to 91; 83-88 to the previous consecutively numbered square; 89 to 91; 90 to 92; 91 to 93; 92 to 94; 94 to 97; 95 to 98; 96 to 95. Throws of Cung move players from: 1, 2, and 3 to 76; 8 to 60; 9 to 23; 15 to 53; 16-21 to 22; 27 to 25; 37 to 36; 41 to 30; 42 to 31; 47 to 54; 48 to 65; 49 to 54; 69 to 88. Throws of Chang move the player to space 28 from spaces 54-59, or to space 29 from spaces 30-35 and 68. Players must throw Te to leave spaces 28 or 29, and return to the space they previously occupied. The player who throws Te while in space 97 or 98 first moves to the palace and wins. The game is played with 16 players. - -###Ludii -(game ""Shing Quon Tu"" (players 16) (equipment {(board (union {(scale 2 2.2 (square 1)) (shift 0 -0.5 (scale 1 0.5 (square 1))) (shift 1 -0.5 (scale 1 0.5 (square 1))) (shift 0 -1 (scale 0.5 0.5 (rectangle 1 2))) (shift 1 -1 (scale 0.5 0.5 (rectangle 1 2))) (shift 0 -2 (scale 1 0.5 (rectangle 2 1))) (shift 1 -2 (scale 1 0.5 (rectangle 2 1))) (shift 2 -2 (scale 1 0.5 (rectangle 6 1))) (shift 2 1 (scale 1 1.2 (square 1))) (shift 0 2.2 (scale 0.5 1 (rectangle 1 6))) (shift -2 -2 (scale 1 1.04 (rectangle 5 2))) (shift -2 -3 (rectangle 1 5)) (shift 3 -3 (scale 1 1.55 (rectangle 4 1))) (shift -2 3.2 (scale 2 1 (rectangle 1 3))) (shift -2 4.2 (scale 3 1 (rectangle 1 2))) (shift -3.2 -2 (scale 1.2 (rectangle 6 1))) (shift 4 -2.6 (scale 1.3 (rectangle 6 1))) (shift 4 -3 (scale 1.3 0.4 (square 1))) (shift -2 -4.3 (scale 1 1.3 (square 1))) (shift -3.2 -4.3 (scale 1.2 0.383 (rectangle 6 1))) (shift -3.2 -5.5 (scale 1.2 (square 1))) (shift -1 -4.3 (scale 0.335 1.29 (rectangle 1 6))) (shift 1.01 -4.3 (scale 0.4 1.29 (rectangle 1 9))) (shift 4.61 -4.3 (scale 0.7 1.29 (square 1))) (shift -2 -5.5 (scale 0.501 1.2 (rectangle 1 6))) (shift 2 -5.5 (scale 0.4 1.2 (rectangle 1 6))) (shift 1.005 -5.5 (scale 1 1.2 (square 1))) (shift 4.4 -5.5 (scale 0.91 1.2 (square 1)))}) (track ""Track"" {98 96 95 94 93 92 91 97 90 89 88 87 86 85 68 62 63 64 65 66 67 48 49 50 51 52 53 46 47 59 58 57 56 55 54 60 84 83 82 81 80 79 78 77 76 75 74 73 72 71 70 69 61 34 24 26 28 30 32 43 44 45 42 41 40 39 38 37 36 35 25 27 29 31 33 18 19 20 21 22 23 17 16 15 14 13 12 11 9 7 10 8 6 5 4 3 2 1} directed:True)) (dice d:6 num:6) (hand Each) (piece ""Pawn"" Each) (map ""Site"" {(pair 1 98) (pair 2 96) (pair 3 95) (pair 4 94) (pair 5 93) (pair 6 92) (pair 7 91) (pair 8 97) (pair 9 90) (pair 10 89) (pair 11 88) (pair 12 87) (pair 13 86) (pair 14 85) (pair 15 68) (pair 16 62) (pair 17 63) (pair 18 64) (pair 19 65) (pair 20 66) (pair 21 67) (pair 22 48) (pair 23 49) (pair 24 50) (pair 25 51) (pair 26 52) (pair 27 53) (pair 28 46) (pair 29 47) (pair 30 59) (pair 31 58) (pair 32 57) (pair 33 56) (pair 34 55) (pair 35 54) (pair 36 60) (pair 37 84) (pair 38 83) (pair 39 82) (pair 40 81) (pair 41 80) (pair 42 79) (pair 43 78) (pair 44 77) (pair 45 76) (pair 46 75) (pair 47 74) (pair 48 73) (pair 49 72) (pair 50 71) (pair 51 70) (pair 52 69) (pair 53 61) (pair 54 34) (pair 55 24) (pair 56 26) (pair 57 28) (pair 58 30) (pair 59 32) (pair 60 43) (pair 61 44) (pair 62 45) (pair 63 42) (pair 64 41) (pair 65 40) (pair 66 39) (pair 67 38) (pair 68 37) (pair 69 36) (pair 70 35) (pair 71 25) (pair 72 27) (pair 73 29) (pair 74 31) (pair 75 33) (pair 76 18) (pair 77 19) (pair 78 20) (pair 79 21) (pair 80 22) (pair 81 23) (pair 82 17) (pair 83 16) (pair 84 15) (pair 85 14) (pair 86 13) (pair 87 12) (pair 88 11) (pair 89 9) (pair 90 7) (pair 91 10) (pair 92 8) (pair 93 6) (pair 94 5) (pair 95 4) (pair 96 3) (pair 97 2) (pair 98 1) (pair 0 0)}) (map ""OppositeSite"" {(pair 98 1) (pair 96 2) (pair 95 3) (pair 94 4) (pair 93 5) (pair 92 6) (pair 91 7) (pair 97 8) (pair 90 9) (pair 89 10) (pair 88 11) (pair 87 12) (pair 86 13) (pair 85 14) (pair 68 15) (pair 62 16) (pair 63 17) (pair 64 18) (pair 65 19) (pair 66 20) (pair 67 21) (pair 48 22) (pair 49 23) (pair 50 24) (pair 51 25) (pair 52 26) (pair 53 27) (pair 46 28) (pair 47 29) (pair 59 30) (pair 58 31) (pair 57 32) (pair 56 33) (pair 55 34) (pair 54 35) (pair 60 36) (pair 84 37) (pair 83 38) (pair 82 39) (pair 81 40) (pair 80 41) (pair 79 42) (pair 78 43) (pair 77 44) (pair 76 45) (pair 75 46) (pair 74 47) (pair 73 48) (pair 72 49) (pair 71 50) (pair 70 51) (pair 69 52) (pair 61 53) (pair 34 54) (pair 24 55) (pair 26 56) (pair 28 57) (pair 30 58) (pair 32 59) (pair 43 60) (pair 44 61) (pair 45 62) (pair 42 63) (pair 41 64) (pair 40 65) (pair 39 66) (pair 38 67) (pair 37 68) (pair 36 69) (pair 35 70) (pair 25 71) (pair 27 72) (pair 29 73) (pair 31 74) (pair 33 75) (pair 18 76) (pair 19 77) (pair 20 78) (pair 21 79) (pair 22 80) (pair 23 81) (pair 17 82) (pair 16 83) (pair 15 84) (pair 14 85) (pair 13 86) (pair 12 87) (pair 11 88) (pair 9 89) (pair 7 90) (pair 10 91) (pair 8 92) (pair 6 93) (pair 5 94) (pair 4 95) (pair 3 96) (pair 2 97) (pair 1 98) (pair 0 0)}) (map ""TeMove"" {(pair 1 37) (pair 2 37) (pair 3 37) (pair 4 38) (pair 5 38) (pair 6 38) (pair 7 73) (pair 8 72) (pair 9 52) (pair 10 51) (pair 11 50) (pair 12 49) (pair 13 48) (pair 14 47) (pair 15 55) (pair 16 23) (pair 17 23) (pair 18 23) (pair 19 23) (pair 20 23) (pair 21 23) (pair 27 56) (pair 30 32) (pair 35 67) (pair 36 66) (pair 46 89) (pair 47 59) (pair 48 74) (pair 49 71) (pair 50 47) (pair 51 50) (pair 52 51) (pair 59 71) (pair 60 62) (pair 61 47) (pair 62 61) (pair 63 65) (pair 64 69) (pair 65 64) (pair 66 60) (pair 67 70) (pair 68 86) (pair 69 84) (pair 70 68) (pair 71 74) (pair 72 90) (pair 73 92) (pair 75 93) (pair 81 31) (pair 82 91) (pair 83 82) (pair 84 83) (pair 85 84) (pair 86 85) (pair 87 86) (pair 88 87) (pair 89 91) (pair 90 92) (pair 91 93) (pair 92 94) (pair 94 97) (pair 95 98) (pair 96 95) (pair 97 0) (pair 98 0)}) (map ""CungMove"" {(pair 1 76) (pair 2 76) (pair 3 76) (pair 8 60) (pair 9 23) (pair 15 53) (pair 16 22) (pair 17 22) (pair 18 22) (pair 19 22) (pair 20 22) (pair 21 22) (pair 27 25) (pair 37 36) (pair 41 30) (pair 42 31) (pair 47 54) (pair 48 65) (pair 49 54) (pair 69 88)}) (map ""ChangMove"" {(pair 30 29) (pair 31 29) (pair 32 29) (pair 33 29) (pair 34 29) (pair 35 29) (pair 54 28) (pair 55 28) (pair 56 28) (pair 57 28) (pair 58 28) (pair 59 28) (pair 68 29)})}) (rules (start {(place Stack ""Pawn1"" (handSite P1)) (place Stack ""Pawn2"" (handSite P2)) (place Stack ""Pawn3"" (handSite P3)) (place Stack ""Pawn4"" (handSite P4)) (place Stack ""Pawn5"" (handSite P5)) (place Stack ""Pawn6"" (handSite P6)) (place Stack ""Pawn7"" (handSite P7)) (place Stack ""Pawn8"" (handSite P8)) (place Stack ""Pawn9"" (handSite P9)) (place Stack ""Pawn10"" (handSite P10)) (place Stack ""Pawn11"" (handSite P11)) (place Stack ""Pawn12"" (handSite P12)) (place Stack ""Pawn13"" (handSite P13)) (place Stack ""Pawn14"" (handSite P14)) (place Stack ""Pawn15"" (handSite P15)) (place Stack ""Pawn16"" (handSite P16))}) phases:{(phase ""Opening"" (play (do (roll) next:(or {(if (= 2 (count Value 1 in:(array {(face (+ (count Players) 99)) (face (+ (count Players) 100)) (face (+ (count Players) 101)) (face (+ (count Players) 102)) (face (+ (count Players) 103)) (face (+ (count Players) 104))}))) (move (from (handSite Mover)) (to (mapEntry ""Site"" 1)))) (if (= 2 (count Value 2 in:(array {(face (+ (count Players) 99)) (face (+ (count Players) 100)) (face (+ (count Players) 101)) (face (+ (count Players) 102)) (face (+ (count Players) 103)) (face (+ (count Players) 104))}))) (move (from (handSite Mover)) (to (mapEntry ""Site"" 2)))) (if (= 2 (count Value 4 in:(array {(face (+ (count Players) 99)) (face (+ (count Players) 100)) (face (+ (count Players) 101)) (face (+ (count Players) 102)) (face (+ (count Players) 103)) (face (+ (count Players) 104))}))) (move (from (handSite Mover)) (to (mapEntry ""Site"" 3)))) (if (= 2 (count Value 3 in:(array {(face (+ (count Players) 99)) (face (+ (count Players) 100)) (face (+ (count Players) 101)) (face (+ (count Players) 102)) (face (+ (count Players) 103)) (face (+ (count Players) 104))}))) (move (from (handSite Mover)) (to (mapEntry ""Site"" 4)))) (if (= 2 (count Value 5 in:(array {(face (+ (count Players) 99)) (face (+ (count Players) 100)) (face (+ (count Players) 101)) (face (+ (count Players) 102)) (face (+ (count Players) 103)) (face (+ (count Players) 104))}))) (move (from (handSite Mover)) (to (mapEntry ""Site"" 5)))) (if (= 2 (count Value 6 in:(array {(face (+ (count Players) 99)) (face (+ (count Players) 100)) (face (+ (count Players) 101)) (face (+ (count Players) 102)) (face (+ (count Players) 103)) (face (+ (count Players) 104))}))) (move (from (handSite Mover)) (to (mapEntry ""Site"" 6)))) (if (or {(= 5 (count Value 1 in:(array {(face (+ (count Players) 99)) (face (+ (count Players) 100)) (face (+ (count Players) 101)) (face (+ (count Players) 102)) (face (+ (count Players) 103)) (face (+ (count Players) 104))}))) (= 5 (count Value 2 in:(array {(face (+ (count Players) 99)) (face (+ (count Players) 100)) (face (+ (count Players) 101)) (face (+ (count Players) 102)) (face (+ (count Players) 103)) (face (+ (count Players) 104))}))) (= 5 (count Value 3 in:(array {(face (+ (count Players) 99)) (face (+ (count Players) 100)) (face (+ (count Players) 101)) (face (+ (count Players) 102)) (face (+ (count Players) 103)) (face (+ (count Players) 104))}))) (= 5 (count Value 4 in:(array {(face (+ (count Players) 99)) (face (+ (count Players) 100)) (face (+ (count Players) 101)) (face (+ (count Players) 102)) (face (+ (count Players) 103)) (face (+ (count Players) 104))}))) (= 5 (count Value 5 in:(array {(face (+ (count Players) 99)) (face (+ (count Players) 100)) (face (+ (count Players) 101)) (face (+ (count Players) 102)) (face (+ (count Players) 103)) (face (+ (count Players) 104))}))) (= 5 (count Value 6 in:(array {(face (+ (count Players) 99)) (face (+ (count Players) 100)) (face (+ (count Players) 101)) (face (+ (count Players) 102)) (face (+ (count Players) 103)) (face (+ (count Players) 104))})))}) (move (from (handSite Mover)) (to (mapEntry ""Site"" 7)))) (if (or {(= 6 (count Value 1 in:(array {(face (+ (count Players) 99)) (face (+ (count Players) 100)) (face (+ (count Players) 101)) (face (+ (count Players) 102)) (face (+ (count Players) 103)) (face (+ (count Players) 104))}))) (= 6 (count Value 2 in:(array {(face (+ (count Players) 99)) (face (+ (count Players) 100)) (face (+ (count Players) 101)) (face (+ (count Players) 102)) (face (+ (count Players) 103)) (face (+ (count Players) 104))}))) (= 6 (count Value 3 in:(array {(face (+ (count Players) 99)) (face (+ (count Players) 100)) (face (+ (count Players) 101)) (face (+ (count Players) 102)) (face (+ (count Players) 103)) (face (+ (count Players) 104))}))) (= 6 (count Value 4 in:(array {(face (+ (count Players) 99)) (face (+ (count Players) 100)) (face (+ (count Players) 101)) (face (+ (count Players) 102)) (face (+ (count Players) 103)) (face (+ (count Players) 104))}))) (= 6 (count Value 5 in:(array {(face (+ (count Players) 99)) (face (+ (count Players) 100)) (face (+ (count Players) 101)) (face (+ (count Players) 102)) (face (+ (count Players) 103)) (face (+ (count Players) 104))}))) (= 6 (count Value 6 in:(array {(face (+ (count Players) 99)) (face (+ (count Players) 100)) (face (+ (count Players) 101)) (face (+ (count Players) 102)) (face (+ (count Players) 103)) (face (+ (count Players) 104))})))}) (move (from (handSite Mover)) (to (mapEntry ""Site"" 8)))) (if (= 3 (count Value 1 in:(array {(face (+ (count Players) 99)) (face (+ (count Players) 100)) (face (+ (count Players) 101)) (face (+ (count Players) 102)) (face (+ (count Players) 103)) (face (+ (count Players) 104))}))) (move (from (handSite Mover)) (to (mapEntry ""Site"" 9)))) (if (= 3 (count Value 2 in:(array {(face (+ (count Players) 99)) (face (+ (count Players) 100)) (face (+ (count Players) 101)) (face (+ (count Players) 102)) (face (+ (count Players) 103)) (face (+ (count Players) 104))}))) (move (from (handSite Mover)) (to (mapEntry ""Site"" 10)))) (if (= 3 (count Value 3 in:(array {(face (+ (count Players) 99)) (face (+ (count Players) 100)) (face (+ (count Players) 101)) (face (+ (count Players) 102)) (face (+ (count Players) 103)) (face (+ (count Players) 104))}))) (move (from (handSite Mover)) (to (mapEntry ""Site"" 11)))) (if (= 3 (count Value 4 in:(array {(face (+ (count Players) 99)) (face (+ (count Players) 100)) (face (+ (count Players) 101)) (face (+ (count Players) 102)) (face (+ (count Players) 103)) (face (+ (count Players) 104))}))) (move (from (handSite Mover)) (to (mapEntry ""Site"" 12)))) (if (= 3 (count Value 5 in:(array {(face (+ (count Players) 99)) (face (+ (count Players) 100)) (face (+ (count Players) 101)) (face (+ (count Players) 102)) (face (+ (count Players) 103)) (face (+ (count Players) 104))}))) (move (from (handSite Mover)) (to (mapEntry ""Site"" 13)))) (if (= 3 (count Value 6 in:(array {(face (+ (count Players) 99)) (face (+ (count Players) 100)) (face (+ (count Players) 101)) (face (+ (count Players) 102)) (face (+ (count Players) 103)) (face (+ (count Players) 104))}))) (move (from (handSite Mover)) (to (mapEntry ""Site"" 14)))) (if (= 4 (count Value 1 in:(array {(face (+ (count Players) 99)) (face (+ (count Players) 100)) (face (+ (count Players) 101)) (face (+ (count Players) 102)) (face (+ (count Players) 103)) (face (+ (count Players) 104))}))) (move (from (handSite Mover)) (to (mapEntry ""Site"" 16)))) (if (= 4 (count Value 2 in:(array {(face (+ (count Players) 99)) (face (+ (count Players) 100)) (face (+ (count Players) 101)) (face (+ (count Players) 102)) (face (+ (count Players) 103)) (face (+ (count Players) 104))}))) (move (from (handSite Mover)) (to (mapEntry ""Site"" 17)))) (if (= 4 (count Value 3 in:(array {(face (+ (count Players) 99)) (face (+ (count Players) 100)) (face (+ (count Players) 101)) (face (+ (count Players) 102)) (face (+ (count Players) 103)) (face (+ (count Players) 104))}))) (move (from (handSite Mover)) (to (mapEntry ""Site"" 18)))) (if (= 4 (count Value 4 in:(array {(face (+ (count Players) 99)) (face (+ (count Players) 100)) (face (+ (count Players) 101)) (face (+ (count Players) 102)) (face (+ (count Players) 103)) (face (+ (count Players) 104))}))) (move (from (handSite Mover)) (to (mapEntry ""Site"" 19)))) (if (= 4 (count Value 5 in:(array {(face (+ (count Players) 99)) (face (+ (count Players) 100)) (face (+ (count Players) 101)) (face (+ (count Players) 102)) (face (+ (count Players) 103)) (face (+ (count Players) 104))}))) (move (from (handSite Mover)) (to (mapEntry ""Site"" 20)))) (if (= 4 (count Value 6 in:(array {(face (+ (count Players) 99)) (face (+ (count Players) 100)) (face (+ (count Players) 101)) (face (+ (count Players) 102)) (face (+ (count Players) 103)) (face (+ (count Players) 104))}))) (move (from (handSite Mover)) (to (mapEntry ""Site"" 21))))}))) (nextPhase Mover (is Empty (handSite Mover)) ""Playing"")) (phase ""Playing"" (play (if (is Prev Mover) (if (can Move (or {(if (!= 0 (size Array (values Remembered ""Te""))) (if (!= (mapEntry ""Site"" (where ""Pawn"" Mover)) (mapEntry ""TeMove"" (mapEntry ""Site"" (where ""Pawn"" Mover)))) (move (from (where ""Pawn"" Mover)) (to (mapEntry ""OppositeSite"" (mapEntry ""TeMove"" (mapEntry ""Site"" (where ""Pawn"" Mover))))) (then (and (forget Value ""Te"" 1) (if (< 1 (+ {(size Array (values Remembered ""Te"")) (size Array (values Remembered ""Cung"")) (size Array (values Remembered ""Chang""))})) (moveAgain))))) (move (from (where ""Pawn"" Mover)) (to (trackSite Move from:(where ""Pawn"" Mover) steps:1)) (then (and (forget Value ""Te"" 1) (if (< 1 (+ {(size Array (values Remembered ""Te"")) (size Array (values Remembered ""Cung"")) (size Array (values Remembered ""Chang""))})) (moveAgain))))))) (if (!= 0 (size Array (values Remembered ""Cung""))) (if (!= (mapEntry ""Site"" (where ""Pawn"" Mover)) (mapEntry ""CungMove"" (mapEntry ""Site"" (where ""Pawn"" Mover)))) (move (from (where ""Pawn"" Mover)) (to (mapEntry ""OppositeSite"" (mapEntry ""CungMove"" (mapEntry ""Site"" (where ""Pawn"" Mover))))) (then (and (forget Value ""Cung"" 1) (if (< 1 (+ {(size Array (values Remembered ""Te"")) (size Array (values Remembered ""Cung"")) (size Array (values Remembered ""Chang""))})) (moveAgain))))))) (if (!= 0 (size Array (values Remembered ""Chang""))) (if (!= (mapEntry ""Site"" (where ""Pawn"" Mover)) (mapEntry ""ChangMove"" (mapEntry ""Site"" (where ""Pawn"" Mover)))) (move (from (where ""Pawn"" Mover)) (to (mapEntry ""OppositeSite"" (mapEntry ""ChangMove"" (mapEntry ""Site"" (where ""Pawn"" Mover))))))))})) (or {(if (!= 0 (size Array (values Remembered ""Te""))) (if (!= (mapEntry ""Site"" (where ""Pawn"" Mover)) (mapEntry ""TeMove"" (mapEntry ""Site"" (where ""Pawn"" Mover)))) (move (from (where ""Pawn"" Mover)) (to (mapEntry ""OppositeSite"" (mapEntry ""TeMove"" (mapEntry ""Site"" (where ""Pawn"" Mover))))) (then (and (forget Value ""Te"" 1) (if (< 1 (+ {(size Array (values Remembered ""Te"")) (size Array (values Remembered ""Cung"")) (size Array (values Remembered ""Chang""))})) (moveAgain))))) (move (from (where ""Pawn"" Mover)) (to (trackSite Move from:(where ""Pawn"" Mover) steps:1)) (then (and (forget Value ""Te"" 1) (if (< 1 (+ {(size Array (values Remembered ""Te"")) (size Array (values Remembered ""Cung"")) (size Array (values Remembered ""Chang""))})) (moveAgain))))))) (if (!= 0 (size Array (values Remembered ""Cung""))) (if (!= (mapEntry ""Site"" (where ""Pawn"" Mover)) (mapEntry ""CungMove"" (mapEntry ""Site"" (where ""Pawn"" Mover)))) (move (from (where ""Pawn"" Mover)) (to (mapEntry ""OppositeSite"" (mapEntry ""CungMove"" (mapEntry ""Site"" (where ""Pawn"" Mover))))) (then (and (forget Value ""Cung"" 1) (if (< 1 (+ {(size Array (values Remembered ""Te"")) (size Array (values Remembered ""Cung"")) (size Array (values Remembered ""Chang""))})) (moveAgain))))))) (if (!= 0 (size Array (values Remembered ""Chang""))) (if (!= (mapEntry ""Site"" (where ""Pawn"" Mover)) (mapEntry ""ChangMove"" (mapEntry ""Site"" (where ""Pawn"" Mover)))) (move (from (where ""Pawn"" Mover)) (to (mapEntry ""OppositeSite"" (mapEntry ""ChangMove"" (mapEntry ""Site"" (where ""Pawn"" Mover))))))))}) (move Pass (then (and {(forget Value ""Te"" All) (forget Value ""Cung"" All) (forget Value ""Chang"" All)})))) (do (roll) next:(move Pass) (then (and {(moveAgain) (if (= 2 (count Value 4 in:(array {(face (+ (count Players) 99)) (face (+ (count Players) 100)) (face (+ (count Players) 101)) (face (+ (count Players) 102)) (face (+ (count Players) 103)) (face (+ (count Players) 104))}))) (remember Value ""Te"" 1) (if (= 4 (count Value 4 in:(array {(face (+ (count Players) 99)) (face (+ (count Players) 100)) (face (+ (count Players) 101)) (face (+ (count Players) 102)) (face (+ (count Players) 103)) (face (+ (count Players) 104))}))) (and (remember Value ""Te"" 1) (remember Value ""Te"" 1)) (if (= 6 (count Value 4 in:(array {(face (+ (count Players) 99)) (face (+ (count Players) 100)) (face (+ (count Players) 101)) (face (+ (count Players) 102)) (face (+ (count Players) 103)) (face (+ (count Players) 104))}))) (and {(remember Value ""Te"" 1) (remember Value ""Te"" 1) (remember Value ""Te"" 1)})))) (if (= 2 (count Value 1 in:(array {(face (+ (count Players) 99)) (face (+ (count Players) 100)) (face (+ (count Players) 101)) (face (+ (count Players) 102)) (face (+ (count Players) 103)) (face (+ (count Players) 104))}))) (remember Value ""Chang"" 1) (if (= 4 (count Value 1 in:(array {(face (+ (count Players) 99)) (face (+ (count Players) 100)) (face (+ (count Players) 101)) (face (+ (count Players) 102)) (face (+ (count Players) 103)) (face (+ (count Players) 104))}))) (and (remember Value ""Chang"" 1) (remember Value ""Chang"" 1)) (if (= 6 (count Value 1 in:(array {(face (+ (count Players) 99)) (face (+ (count Players) 100)) (face (+ (count Players) 101)) (face (+ (count Players) 102)) (face (+ (count Players) 103)) (face (+ (count Players) 104))}))) (and {(remember Value ""Chang"" 1) (remember Value ""Chang"" 1) (remember Value ""Chang"" 1)})))) (if (= 2 (count Value 2 in:(array {(face (+ (count Players) 99)) (face (+ (count Players) 100)) (face (+ (count Players) 101)) (face (+ (count Players) 102)) (face (+ (count Players) 103)) (face (+ (count Players) 104))}))) (remember Value ""Cung"" 1) (if (= 4 (count Value 2 in:(array {(face (+ (count Players) 99)) (face (+ (count Players) 100)) (face (+ (count Players) 101)) (face (+ (count Players) 102)) (face (+ (count Players) 103)) (face (+ (count Players) 104))}))) (and (remember Value ""Cung"" 1) (remember Value ""Cung"" 1)) (if (= 6 (count Value 2 in:(array {(face (+ (count Players) 99)) (face (+ (count Players) 100)) (face (+ (count Players) 101)) (face (+ (count Players) 102)) (face (+ (count Players) 103)) (face (+ (count Players) 104))}))) (and {(remember Value ""Cung"" 1) (remember Value ""Cung"" 1) (remember Value ""Cung"" 1)})))) (if (= 2 (count Value 3 in:(array {(face (+ (count Players) 99)) (face (+ (count Players) 100)) (face (+ (count Players) 101)) (face (+ (count Players) 102)) (face (+ (count Players) 103)) (face (+ (count Players) 104))}))) (remember Value ""Cung"" 1) (if (= 4 (count Value 3 in:(array {(face (+ (count Players) 99)) (face (+ (count Players) 100)) (face (+ (count Players) 101)) (face (+ (count Players) 102)) (face (+ (count Players) 103)) (face (+ (count Players) 104))}))) (and (remember Value ""Cung"" 1) (remember Value ""Cung"" 1)) (if (= 6 (count Value 3 in:(array {(face (+ (count Players) 99)) (face (+ (count Players) 100)) (face (+ (count Players) 101)) (face (+ (count Players) 102)) (face (+ (count Players) 103)) (face (+ (count Players) 104))}))) (and {(remember Value ""Cung"" 1) (remember Value ""Cung"" 1) (remember Value ""Cung"" 1)})))) (if (= 2 (count Value 5 in:(array {(face (+ (count Players) 99)) (face (+ (count Players) 100)) (face (+ (count Players) 101)) (face (+ (count Players) 102)) (face (+ (count Players) 103)) (face (+ (count Players) 104))}))) (remember Value ""Cung"" 1) (if (= 4 (count Value 5 in:(array {(face (+ (count Players) 99)) (face (+ (count Players) 100)) (face (+ (count Players) 101)) (face (+ (count Players) 102)) (face (+ (count Players) 103)) (face (+ (count Players) 104))}))) (and (remember Value ""Cung"" 1) (remember Value ""Cung"" 1)) (if (= 6 (count Value 5 in:(array {(face (+ (count Players) 99)) (face (+ (count Players) 100)) (face (+ (count Players) 101)) (face (+ (count Players) 102)) (face (+ (count Players) 103)) (face (+ (count Players) 104))}))) (and {(remember Value ""Cung"" 1) (remember Value ""Cung"" 1) (remember Value ""Cung"" 1)})))) (if (= 2 (count Value 6 in:(array {(face (+ (count Players) 99)) (face (+ (count Players) 100)) (face (+ (count Players) 101)) (face (+ (count Players) 102)) (face (+ (count Players) 103)) (face (+ (count Players) 104))}))) (remember Value ""Cung"" 1) (if (= 4 (count Value 6 in:(array {(face (+ (count Players) 99)) (face (+ (count Players) 100)) (face (+ (count Players) 101)) (face (+ (count Players) 102)) (face (+ (count Players) 103)) (face (+ (count Players) 104))}))) (and (remember Value ""Cung"" 1) (remember Value ""Cung"" 1)) (if (= 6 (count Value 6 in:(array {(face (+ (count Players) 99)) (face (+ (count Players) 100)) (face (+ (count Players) 101)) (face (+ (count Players) 102)) (face (+ (count Players) 103)) (face (+ (count Players) 104))}))) (and {(remember Value ""Cung"" 1) (remember Value ""Cung"" 1) (remember Value ""Cung"" 1)}))))}))))))} (end (if (= 0 (where ""Pawn"" Mover)) (result Mover Win)))))" -"5x5 grid, with six spaces extending up from the rightmost column. The central space of the grid is the minaret, the final three spaces in the extending track are Cairo, Medina, and Mecca. Three pieces per player, each having one father, one mother, and one djinn, which all begin on the first space. The track is boustrophedon, starting in the bottom left corner and moving to the right, until it reaches the top right corner where it proceeds down the extended track. Six sticks, used as dice, with one polished side and one rough side. Throws equal the number of polished sides which land face-up, with the following exceptions: five polished or five rough sides = sig, this grants a move of one plus another throw, in which the player moves the number of polished sides up, six polished = sig of 6, grants the player another throw, and the player moves the number of polished sides up; if the second throw is regular sig, the value is 7, six rough = sig of twelve, grants the player three throws and the player moves the number of polished sides up; if any of those three extra throws are a regular sig, the total value of the extra throws is 13. Pieces move one at a time from the starting space. The first piece to move is the father, the second the djinn, and the third is the mother. The djinn moves twice the value of the throw in any space that does not require a sig to move through it. A player must throw a regular sig to leave the starting space; when they do, they move one space and throw again. When a player passes the piece of an opponent, the opponent's piece returns to the starting space and must enter the board according to the same rules. Certain spaces require a throw of sig to move into and out of them. This means that the move of 1 given by the regular sig can be used to do this, but the extra throw granted by it does not; however, the total value awarded by a sig of six or twelve does count. These are the Minaret, and all of the spaces in the extended track. If a player cannot enter a space because their is not a sig attached to their throw, they stop their move at the point before it. The space for Cairo counts for three of the value of the throw. When a piece reaches Mecca and there is still value left in the throw, the next piece may be entered and moved using the remaining moves left in the throw. The djinn is entered when the father reaches Mecca, and the mother is entered once the djinn reaches Mecca. The first player to place all of their pieces on Mecca wins. The game has 4 players.","(game ""Sig (El Oued)"" (players 4) (equipment {(board (scale 2 1 (merge {(square 5) (shift 4 5 (rectangle 3 1)) (scale 2 1 (shift 1.5 8 (rectangle 3 1)))})) {(track ""FirstTrack"" ""0,E,N1,W,N1,E1"" directed:True) (track ""SecondTrack"" ""13,E,N1,W,N1,E"" directed:True)}) (dice d:2 from:0 num:6) (piece ""Father"" Each (or {(if (and (!= (from) 0) (is In (from) (sites Track ""FirstTrack""))) (move (from (from) level:(level)) (to (trackSite Move ""FirstTrack"" steps:(if (= 1 (var ""SpecialSig"")) (+ 1 (mapEntry ""Throw"" (count Pips))) (mapEntry ""Throw"" (count Pips)))))) (then (forEach Site (sites Track Mover ""FirstTrack"" from:(last From) to:(last To)) (if (!= (site) (last To)) (forEach Level (site) FromTop (if (is Enemy (who at:(site) level:(level))) (fromTo (from (site) level:(level)) (to 0)))))))) (if (is In (from) (sites Track ""SecondTrack"")) (move (from (from) level:(level)) (to (trackSite Move ""SecondTrack"" steps:(if (= 1 (var ""SpecialSig"")) (+ 1 (mapEntry ""Throw"" (count Pips))) (mapEntry ""Throw"" (count Pips))))) (then (forEach Site (sites Track Mover ""SecondTrack"" from:(last From) to:(last To)) (if (!= (site) (last To)) (forEach Level (site) FromTop (if (is Enemy (who at:(site) level:(level))) (fromTo (from (site) level:(level)) (to 0))))))))) (if (and {(= (mapEntry ""Throw"" (count Pips)) 1) (= (from) 0) (if (not (is Prev Mover)) True (= 1 (var ""SpecialSig"")))}) (move (from (from) level:(level)) (to 1))) (if (and {(= (mapEntry ""Throw"" (count Pips)) 1) (= (from) 11) (if (not (is Prev Mover)) True (= 1 (var ""SpecialSig"")))}) (move (from (from) level:(level)) (to 12))) (if (and {(= (mapEntry ""Throw"" (count Pips)) 1) (= (from) 12) (if (not (is Prev Mover)) True (= 1 (var ""SpecialSig"")))}) (move (from (from) level:(level)) (to 13))) (if (and {(= (mapEntry ""Throw"" (count Pips)) 1) (= (from) 24) (if (not (is Prev Mover)) True (= 1 (var ""SpecialSig"")))}) (move (from (from) level:(level)) (to 25))) (if (and {(= (mapEntry ""Throw"" (count Pips)) 1) (= (from) 25) (if (not (is Prev Mover)) True (= 1 (var ""SpecialSig"")))}) (move (from (from) level:(level)) (to 26))) (if (and {(= (mapEntry ""Throw"" (count Pips)) 1) (= (from) 26) (if (not (is Prev Mover)) True (= 1 (var ""SpecialSig"")))}) (move (from (from) level:(level)) (to 28))) (if (and {(= (mapEntry ""Throw"" (count Pips)) 1) (= (from) 28) (if (not (is Prev Mover)) True (= 1 (var ""SpecialSig"")))}) (move (from (from) level:(level)) (to 27))) (if (and {(= (mapEntry ""Throw"" (count Pips)) 1) (= (from) 27) (if (not (is Prev Mover)) True (= 1 (var ""SpecialSig"")))}) (move (from (from) level:(level)) (to 29))) (if (and {(= (mapEntry ""Throw"" (count Pips)) 1) (= (from) 29) (if (not (is Prev Mover)) True (= 1 (var ""SpecialSig"")))}) (move (from (from) level:(level)) (to 30)))})) (piece ""Djinn"" Each (if (= 30 (where ""Father"" Mover)) (or {(if (and (!= (from) 0) (is In (from) (sites Track ""FirstTrack""))) (move (from (from) level:(level)) (to (trackSite Move ""FirstTrack"" steps:(* 2 (if (= 1 (var ""SpecialSig"")) (+ 1 (mapEntry ""Throw"" (count Pips))) (mapEntry ""Throw"" (count Pips))))))) (then (forEach Site (sites Track Mover ""FirstTrack"" from:(last From) to:(last To)) (if (!= (site) (last To)) (forEach Level (site) FromTop (if (is Enemy (who at:(site) level:(level))) (fromTo (from (site) level:(level)) (to 0)))))))) (if (is In (from) (sites Track ""SecondTrack"")) (move (from (from) level:(level)) (to (trackSite Move ""SecondTrack"" steps:(* 2 (if (= 1 (var ""SpecialSig"")) (+ 1 (mapEntry ""Throw"" (count Pips))) (mapEntry ""Throw"" (count Pips)))))) (then (forEach Site (sites Track Mover ""SecondTrack"" from:(last From) to:(last To)) (if (!= (site) (last To)) (forEach Level (site) FromTop (if (is Enemy (who at:(site) level:(level))) (fromTo (from (site) level:(level)) (to 0))))))))) (if (and {(= (mapEntry ""Throw"" (count Pips)) 1) (= (from) 0) (if (not (is Prev Mover)) True (= 1 (var ""SpecialSig"")))}) (move (from (from) level:(level)) (to 1))) (if (and {(= (mapEntry ""Throw"" (count Pips)) 1) (= (from) 11) (if (not (is Prev Mover)) True (= 1 (var ""SpecialSig"")))}) (move (from (from) level:(level)) (to 12))) (if (and {(= (mapEntry ""Throw"" (count Pips)) 1) (= (from) 12) (if (not (is Prev Mover)) True (= 1 (var ""SpecialSig"")))}) (move (from (from) level:(level)) (to 13))) (if (and {(= (mapEntry ""Throw"" (count Pips)) 1) (= (from) 24) (if (not (is Prev Mover)) True (= 1 (var ""SpecialSig"")))}) (move (from (from) level:(level)) (to 25))) (if (and {(= (mapEntry ""Throw"" (count Pips)) 1) (= (from) 25) (if (not (is Prev Mover)) True (= 1 (var ""SpecialSig"")))}) (move (from (from) level:(level)) (to 26))) (if (and {(= (mapEntry ""Throw"" (count Pips)) 1) (= (from) 26) (if (not (is Prev Mover)) True (= 1 (var ""SpecialSig"")))}) (move (from (from) level:(level)) (to 28))) (if (and {(= (mapEntry ""Throw"" (count Pips)) 1) (= (from) 28) (if (not (is Prev Mover)) True (= 1 (var ""SpecialSig"")))}) (move (from (from) level:(level)) (to 27))) (if (and {(= (mapEntry ""Throw"" (count Pips)) 1) (= (from) 27) (if (not (is Prev Mover)) True (= 1 (var ""SpecialSig"")))}) (move (from (from) level:(level)) (to 29))) (if (and {(= (mapEntry ""Throw"" (count Pips)) 1) (= (from) 29) (if (not (is Prev Mover)) True (= 1 (var ""SpecialSig"")))}) (move (from (from) level:(level)) (to 30))) (if (and {(= (mapEntry ""Throw"" (count Pips)) 1) (= (from) 23) (if (not (is Prev Mover)) True (= 1 (var ""SpecialSig"")))}) (move (from (from) level:(level)) (to 25)))}))) (piece ""Mother"" Each (if (= 30 (where ""Djinn"" Mover)) (or {(if (and (!= (from) 0) (is In (from) (sites Track ""FirstTrack""))) (move (from (from) level:(level)) (to (trackSite Move ""FirstTrack"" steps:(if (= 1 (var ""SpecialSig"")) (+ 1 (mapEntry ""Throw"" (count Pips))) (mapEntry ""Throw"" (count Pips)))))) (then (forEach Site (sites Track Mover ""FirstTrack"" from:(last From) to:(last To)) (if (!= (site) (last To)) (forEach Level (site) FromTop (if (is Enemy (who at:(site) level:(level))) (fromTo (from (site) level:(level)) (to 0)))))))) (if (is In (from) (sites Track ""SecondTrack"")) (move (from (from) level:(level)) (to (trackSite Move ""SecondTrack"" steps:(if (= 1 (var ""SpecialSig"")) (+ 1 (mapEntry ""Throw"" (count Pips))) (mapEntry ""Throw"" (count Pips))))) (then (forEach Site (sites Track Mover ""SecondTrack"" from:(last From) to:(last To)) (if (!= (site) (last To)) (forEach Level (site) FromTop (if (is Enemy (who at:(site) level:(level))) (fromTo (from (site) level:(level)) (to 0))))))))) (if (and {(= (mapEntry ""Throw"" (count Pips)) 1) (= (from) 0) (if (not (is Prev Mover)) True (= 1 (var ""SpecialSig"")))}) (move (from (from) level:(level)) (to 1))) (if (and {(= (mapEntry ""Throw"" (count Pips)) 1) (= (from) 11) (if (not (is Prev Mover)) True (= 1 (var ""SpecialSig"")))}) (move (from (from) level:(level)) (to 12))) (if (and {(= (mapEntry ""Throw"" (count Pips)) 1) (= (from) 12) (if (not (is Prev Mover)) True (= 1 (var ""SpecialSig"")))}) (move (from (from) level:(level)) (to 13))) (if (and {(= (mapEntry ""Throw"" (count Pips)) 1) (= (from) 24) (if (not (is Prev Mover)) True (= 1 (var ""SpecialSig"")))}) (move (from (from) level:(level)) (to 25))) (if (and {(= (mapEntry ""Throw"" (count Pips)) 1) (= (from) 25) (if (not (is Prev Mover)) True (= 1 (var ""SpecialSig"")))}) (move (from (from) level:(level)) (to 26))) (if (and {(= (mapEntry ""Throw"" (count Pips)) 1) (= (from) 26) (if (not (is Prev Mover)) True (= 1 (var ""SpecialSig"")))}) (move (from (from) level:(level)) (to 28))) (if (and {(= (mapEntry ""Throw"" (count Pips)) 1) (= (from) 28) (if (not (is Prev Mover)) True (= 1 (var ""SpecialSig"")))}) (move (from (from) level:(level)) (to 27))) (if (and {(= (mapEntry ""Throw"" (count Pips)) 1) (= (from) 27) (if (not (is Prev Mover)) True (= 1 (var ""SpecialSig"")))}) (move (from (from) level:(level)) (to 29))) (if (and {(= (mapEntry ""Throw"" (count Pips)) 1) (= (from) 29) (if (not (is Prev Mover)) True (= 1 (var ""SpecialSig"")))}) (move (from (from) level:(level)) (to 30)))}))) (map ""Throw"" {(pair 0 12) (pair 1 1) (pair 2 2) (pair 3 3) (pair 4 4) (pair 5 1) (pair 6 6)}) (map ""ExtraThrow"" {(pair 0 3) (pair 1 1) (pair 2 0) (pair 3 0) (pair 4 0) (pair 5 1) (pair 6 1)})}) (rules (start {(place Stack ""Father1"" 0) (place Stack ""Djinn1"" 0) (place Stack ""Mother1"" 0) (place Stack ""Father2"" 0) (place Stack ""Djinn2"" 0) (place Stack ""Mother2"" 0) (place Stack ""Father3"" 0) (place Stack ""Djinn3"" 0) (place Stack ""Mother3"" 0) (place Stack ""Father4"" 0) (place Stack ""Djinn4"" 0) (place Stack ""Mother4"" 0)}) (play (do (roll) next:(if (can Move (forEach Piece)) (forEach Piece) (move Pass)) (then (if (!= 0 (mapEntry ""ExtraThrow"" (count Pips))) (and (if (= 3 (mapEntry ""ExtraThrow"" (count Pips))) (if (<= (var) 0) (set Var 2))) (if (!= (mover) (prev)) (and (moveAgain) (if (!= 1 (mapEntry ""Throw"" (count Pips))) (set Var ""SpecialSig"" 1))))) (if (> (var) 0) (and {(set Var (- (var) 1)) (moveAgain)}) (set Var ""SpecialSig"" 0)))))) (end (if (and {(= 30 (where ""Djinn"" Mover)) (= 30 (where ""Father"" Mover)) (= 30 (where ""Mother"" Mover))}) (result Mover Win)))))","###Description -5x5 grid, with six spaces extending up from the rightmost column. The central space of the grid is the minaret, the final three spaces in the extending track are Cairo, Medina, and Mecca. Three pieces per player, each having one father, one mother, and one djinn, which all begin on the first space. The track is boustrophedon, starting in the bottom left corner and moving to the right, until it reaches the top right corner where it proceeds down the extended track. Six sticks, used as dice, with one polished side and one rough side. Throws equal the number of polished sides which land face-up, with the following exceptions: five polished or five rough sides = sig, this grants a move of one plus another throw, in which the player moves the number of polished sides up, six polished = sig of 6, grants the player another throw, and the player moves the number of polished sides up; if the second throw is regular sig, the value is 7, six rough = sig of twelve, grants the player three throws and the player moves the number of polished sides up; if any of those three extra throws are a regular sig, the total value of the extra throws is 13. Pieces move one at a time from the starting space. The first piece to move is the father, the second the djinn, and the third is the mother. The djinn moves twice the value of the throw in any space that does not require a sig to move through it. A player must throw a regular sig to leave the starting space; when they do, they move one space and throw again. When a player passes the piece of an opponent, the opponent's piece returns to the starting space and must enter the board according to the same rules. Certain spaces require a throw of sig to move into and out of them. This means that the move of 1 given by the regular sig can be used to do this, but the extra throw granted by it does not; however, the total value awarded by a sig of six or twelve does count. These are the Minaret, and all of the spaces in the extended track. If a player cannot enter a space because their is not a sig attached to their throw, they stop their move at the point before it. The space for Cairo counts for three of the value of the throw. When a piece reaches Mecca and there is still value left in the throw, the next piece may be entered and moved using the remaining moves left in the throw. The djinn is entered when the father reaches Mecca, and the mother is entered once the djinn reaches Mecca. The first player to place all of their pieces on Mecca wins. The game has 4 players. - -###Ludii -(game ""Sig (El Oued)"" (players 4) (equipment {(board (scale 2 1 (merge {(square 5) (shift 4 5 (rectangle 3 1)) (scale 2 1 (shift 1.5 8 (rectangle 3 1)))})) {(track ""FirstTrack"" ""0,E,N1,W,N1,E1"" directed:True) (track ""SecondTrack"" ""13,E,N1,W,N1,E"" directed:True)}) (dice d:2 from:0 num:6) (piece ""Father"" Each (or {(if (and (!= (from) 0) (is In (from) (sites Track ""FirstTrack""))) (move (from (from) level:(level)) (to (trackSite Move ""FirstTrack"" steps:(if (= 1 (var ""SpecialSig"")) (+ 1 (mapEntry ""Throw"" (count Pips))) (mapEntry ""Throw"" (count Pips)))))) (then (forEach Site (sites Track Mover ""FirstTrack"" from:(last From) to:(last To)) (if (!= (site) (last To)) (forEach Level (site) FromTop (if (is Enemy (who at:(site) level:(level))) (fromTo (from (site) level:(level)) (to 0)))))))) (if (is In (from) (sites Track ""SecondTrack"")) (move (from (from) level:(level)) (to (trackSite Move ""SecondTrack"" steps:(if (= 1 (var ""SpecialSig"")) (+ 1 (mapEntry ""Throw"" (count Pips))) (mapEntry ""Throw"" (count Pips))))) (then (forEach Site (sites Track Mover ""SecondTrack"" from:(last From) to:(last To)) (if (!= (site) (last To)) (forEach Level (site) FromTop (if (is Enemy (who at:(site) level:(level))) (fromTo (from (site) level:(level)) (to 0))))))))) (if (and {(= (mapEntry ""Throw"" (count Pips)) 1) (= (from) 0) (if (not (is Prev Mover)) True (= 1 (var ""SpecialSig"")))}) (move (from (from) level:(level)) (to 1))) (if (and {(= (mapEntry ""Throw"" (count Pips)) 1) (= (from) 11) (if (not (is Prev Mover)) True (= 1 (var ""SpecialSig"")))}) (move (from (from) level:(level)) (to 12))) (if (and {(= (mapEntry ""Throw"" (count Pips)) 1) (= (from) 12) (if (not (is Prev Mover)) True (= 1 (var ""SpecialSig"")))}) (move (from (from) level:(level)) (to 13))) (if (and {(= (mapEntry ""Throw"" (count Pips)) 1) (= (from) 24) (if (not (is Prev Mover)) True (= 1 (var ""SpecialSig"")))}) (move (from (from) level:(level)) (to 25))) (if (and {(= (mapEntry ""Throw"" (count Pips)) 1) (= (from) 25) (if (not (is Prev Mover)) True (= 1 (var ""SpecialSig"")))}) (move (from (from) level:(level)) (to 26))) (if (and {(= (mapEntry ""Throw"" (count Pips)) 1) (= (from) 26) (if (not (is Prev Mover)) True (= 1 (var ""SpecialSig"")))}) (move (from (from) level:(level)) (to 28))) (if (and {(= (mapEntry ""Throw"" (count Pips)) 1) (= (from) 28) (if (not (is Prev Mover)) True (= 1 (var ""SpecialSig"")))}) (move (from (from) level:(level)) (to 27))) (if (and {(= (mapEntry ""Throw"" (count Pips)) 1) (= (from) 27) (if (not (is Prev Mover)) True (= 1 (var ""SpecialSig"")))}) (move (from (from) level:(level)) (to 29))) (if (and {(= (mapEntry ""Throw"" (count Pips)) 1) (= (from) 29) (if (not (is Prev Mover)) True (= 1 (var ""SpecialSig"")))}) (move (from (from) level:(level)) (to 30)))})) (piece ""Djinn"" Each (if (= 30 (where ""Father"" Mover)) (or {(if (and (!= (from) 0) (is In (from) (sites Track ""FirstTrack""))) (move (from (from) level:(level)) (to (trackSite Move ""FirstTrack"" steps:(* 2 (if (= 1 (var ""SpecialSig"")) (+ 1 (mapEntry ""Throw"" (count Pips))) (mapEntry ""Throw"" (count Pips))))))) (then (forEach Site (sites Track Mover ""FirstTrack"" from:(last From) to:(last To)) (if (!= (site) (last To)) (forEach Level (site) FromTop (if (is Enemy (who at:(site) level:(level))) (fromTo (from (site) level:(level)) (to 0)))))))) (if (is In (from) (sites Track ""SecondTrack"")) (move (from (from) level:(level)) (to (trackSite Move ""SecondTrack"" steps:(* 2 (if (= 1 (var ""SpecialSig"")) (+ 1 (mapEntry ""Throw"" (count Pips))) (mapEntry ""Throw"" (count Pips)))))) (then (forEach Site (sites Track Mover ""SecondTrack"" from:(last From) to:(last To)) (if (!= (site) (last To)) (forEach Level (site) FromTop (if (is Enemy (who at:(site) level:(level))) (fromTo (from (site) level:(level)) (to 0))))))))) (if (and {(= (mapEntry ""Throw"" (count Pips)) 1) (= (from) 0) (if (not (is Prev Mover)) True (= 1 (var ""SpecialSig"")))}) (move (from (from) level:(level)) (to 1))) (if (and {(= (mapEntry ""Throw"" (count Pips)) 1) (= (from) 11) (if (not (is Prev Mover)) True (= 1 (var ""SpecialSig"")))}) (move (from (from) level:(level)) (to 12))) (if (and {(= (mapEntry ""Throw"" (count Pips)) 1) (= (from) 12) (if (not (is Prev Mover)) True (= 1 (var ""SpecialSig"")))}) (move (from (from) level:(level)) (to 13))) (if (and {(= (mapEntry ""Throw"" (count Pips)) 1) (= (from) 24) (if (not (is Prev Mover)) True (= 1 (var ""SpecialSig"")))}) (move (from (from) level:(level)) (to 25))) (if (and {(= (mapEntry ""Throw"" (count Pips)) 1) (= (from) 25) (if (not (is Prev Mover)) True (= 1 (var ""SpecialSig"")))}) (move (from (from) level:(level)) (to 26))) (if (and {(= (mapEntry ""Throw"" (count Pips)) 1) (= (from) 26) (if (not (is Prev Mover)) True (= 1 (var ""SpecialSig"")))}) (move (from (from) level:(level)) (to 28))) (if (and {(= (mapEntry ""Throw"" (count Pips)) 1) (= (from) 28) (if (not (is Prev Mover)) True (= 1 (var ""SpecialSig"")))}) (move (from (from) level:(level)) (to 27))) (if (and {(= (mapEntry ""Throw"" (count Pips)) 1) (= (from) 27) (if (not (is Prev Mover)) True (= 1 (var ""SpecialSig"")))}) (move (from (from) level:(level)) (to 29))) (if (and {(= (mapEntry ""Throw"" (count Pips)) 1) (= (from) 29) (if (not (is Prev Mover)) True (= 1 (var ""SpecialSig"")))}) (move (from (from) level:(level)) (to 30))) (if (and {(= (mapEntry ""Throw"" (count Pips)) 1) (= (from) 23) (if (not (is Prev Mover)) True (= 1 (var ""SpecialSig"")))}) (move (from (from) level:(level)) (to 25)))}))) (piece ""Mother"" Each (if (= 30 (where ""Djinn"" Mover)) (or {(if (and (!= (from) 0) (is In (from) (sites Track ""FirstTrack""))) (move (from (from) level:(level)) (to (trackSite Move ""FirstTrack"" steps:(if (= 1 (var ""SpecialSig"")) (+ 1 (mapEntry ""Throw"" (count Pips))) (mapEntry ""Throw"" (count Pips)))))) (then (forEach Site (sites Track Mover ""FirstTrack"" from:(last From) to:(last To)) (if (!= (site) (last To)) (forEach Level (site) FromTop (if (is Enemy (who at:(site) level:(level))) (fromTo (from (site) level:(level)) (to 0)))))))) (if (is In (from) (sites Track ""SecondTrack"")) (move (from (from) level:(level)) (to (trackSite Move ""SecondTrack"" steps:(if (= 1 (var ""SpecialSig"")) (+ 1 (mapEntry ""Throw"" (count Pips))) (mapEntry ""Throw"" (count Pips))))) (then (forEach Site (sites Track Mover ""SecondTrack"" from:(last From) to:(last To)) (if (!= (site) (last To)) (forEach Level (site) FromTop (if (is Enemy (who at:(site) level:(level))) (fromTo (from (site) level:(level)) (to 0))))))))) (if (and {(= (mapEntry ""Throw"" (count Pips)) 1) (= (from) 0) (if (not (is Prev Mover)) True (= 1 (var ""SpecialSig"")))}) (move (from (from) level:(level)) (to 1))) (if (and {(= (mapEntry ""Throw"" (count Pips)) 1) (= (from) 11) (if (not (is Prev Mover)) True (= 1 (var ""SpecialSig"")))}) (move (from (from) level:(level)) (to 12))) (if (and {(= (mapEntry ""Throw"" (count Pips)) 1) (= (from) 12) (if (not (is Prev Mover)) True (= 1 (var ""SpecialSig"")))}) (move (from (from) level:(level)) (to 13))) (if (and {(= (mapEntry ""Throw"" (count Pips)) 1) (= (from) 24) (if (not (is Prev Mover)) True (= 1 (var ""SpecialSig"")))}) (move (from (from) level:(level)) (to 25))) (if (and {(= (mapEntry ""Throw"" (count Pips)) 1) (= (from) 25) (if (not (is Prev Mover)) True (= 1 (var ""SpecialSig"")))}) (move (from (from) level:(level)) (to 26))) (if (and {(= (mapEntry ""Throw"" (count Pips)) 1) (= (from) 26) (if (not (is Prev Mover)) True (= 1 (var ""SpecialSig"")))}) (move (from (from) level:(level)) (to 28))) (if (and {(= (mapEntry ""Throw"" (count Pips)) 1) (= (from) 28) (if (not (is Prev Mover)) True (= 1 (var ""SpecialSig"")))}) (move (from (from) level:(level)) (to 27))) (if (and {(= (mapEntry ""Throw"" (count Pips)) 1) (= (from) 27) (if (not (is Prev Mover)) True (= 1 (var ""SpecialSig"")))}) (move (from (from) level:(level)) (to 29))) (if (and {(= (mapEntry ""Throw"" (count Pips)) 1) (= (from) 29) (if (not (is Prev Mover)) True (= 1 (var ""SpecialSig"")))}) (move (from (from) level:(level)) (to 30)))}))) (map ""Throw"" {(pair 0 12) (pair 1 1) (pair 2 2) (pair 3 3) (pair 4 4) (pair 5 1) (pair 6 6)}) (map ""ExtraThrow"" {(pair 0 3) (pair 1 1) (pair 2 0) (pair 3 0) (pair 4 0) (pair 5 1) (pair 6 1)})}) (rules (start {(place Stack ""Father1"" 0) (place Stack ""Djinn1"" 0) (place Stack ""Mother1"" 0) (place Stack ""Father2"" 0) (place Stack ""Djinn2"" 0) (place Stack ""Mother2"" 0) (place Stack ""Father3"" 0) (place Stack ""Djinn3"" 0) (place Stack ""Mother3"" 0) (place Stack ""Father4"" 0) (place Stack ""Djinn4"" 0) (place Stack ""Mother4"" 0)}) (play (do (roll) next:(if (can Move (forEach Piece)) (forEach Piece) (move Pass)) (then (if (!= 0 (mapEntry ""ExtraThrow"" (count Pips))) (and (if (= 3 (mapEntry ""ExtraThrow"" (count Pips))) (if (<= (var) 0) (set Var 2))) (if (!= (mover) (prev)) (and (moveAgain) (if (!= 1 (mapEntry ""Throw"" (count Pips))) (set Var ""SpecialSig"" 1))))) (if (> (var) 0) (and {(set Var (- (var) 1)) (moveAgain)}) (set Var ""SpecialSig"" 0)))))) (end (if (and {(= 30 (where ""Djinn"" Mover)) (= 30 (where ""Father"" Mover)) (= 30 (where ""Mother"" Mover))}) (result Mover Win)))))" "86 spaces in a spiral track. Any number of players, each having one piece, which starts on the first space in the outer ring of the spiral. A lump of charcoal, the Ghoula, also is placed on this space. Four sticks, with one green side and one white side, used as dice. The throws are as follows: One white side up = 1, this throw is known as ""sig""; two white sides up = 0; three white sides up = 3; four white sides up = 4; all green sides up = 6. Throws of sig, 6, and 4 grant the player another throw. Players move their pieces along the track toward the central space. when they reach the sixth space from the end, they must make seven throws of sig before moving on, moving to the sixteenth spot on the seventh throw. After reaching the next spot, only throws of sig and 3 are used; sig to move one space, and 3 to move the Ghoula three spaces. When players reach the central space, Players control the Ghoula. When controlling the Ghoula, throws of 0 count as 6. Any pieces which have not moved from the starting space when the Ghoula is first moved are dragged with the Ghoula, and then may move normally on their next turn. The Ghoula, when reaching a space occupied by a player, continues their turn dragging the player back to the starting space. A player that is forced back to the starting space by any means loses. All players reaching the central space of the board win. The game has 4 players.","(game ""Sig wa Duqqan (Houmt Taourit)"" (players 4) (equipment {(board (spiral turns:5 sites:86) {(track ""Track"" {85 84 83 82 81 80 79 78 77 76 75 74 73 72 71 70 69 68 67 66 65 64 63 62 61 60 59 58 57 56 55 54 53 52 51 50 49 48 47 46 45 44 43 42 41 40 39 38 37 36 35 34 33 32 31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 15 14 13 12 11 10 9 8 7 6 5} directed:True) (track ""ExtensionTrack"" {4 3 2 1 0} directed:True) (track ""GhoulaTrack"" {86 85 84 83 82 81 80 79 78 77 76 75 74 73 72 71 70 69 68 67 66 65 64 63 62 61 60 59 58 57 56 55 54 53 52 51 50 49 48 47 46 45 44 43 42 41 40 39 38 37 36 35 34 33 32 31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 15 14 13 12 11 10 9 8 7 6 5} directed:True) (track ""ReverseGhoulaTrack"" {5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85} directed:True)} use:Vertex) (dice d:2 from:0 num:4) (map ""Throw"" {(pair 0 4) (pair 1 3) (pair 2 0) (pair 3 1) (pair 4 6)}) (piece ""Stick"" Each (if (= (from) 5) (if (= (state at:(from) level:(level)) 7) (move (from (from) level:(level)) (to 4)) (if (= (mapEntry ""Throw"" (count Pips)) 1) (move Select (from (from) level:(level)) (then (set State at:(last To) level:(last LevelTo) (+ 1 (state at:(last To) level:(last LevelTo)))))))) (if (is In (from) (sites Track ""Track"")) (move (from (from) level:(level)) (to (trackSite Move ""Track"" steps:(mapEntry ""Throw"" (count Pips))) if:True)) (if (is In (from) (sites Track ""ExtensionTrack"")) (or {(if (and (!= (from) 0) (= (mapEntry ""Throw"" (count Pips)) 1)) (move (from (from) level:(level)) (to (trackSite Move ""ExtensionTrack"" steps:1)))) (if (= (from) 0) (move Pass (then (and (if (= 0 (mapEntry ""Throw"" (count Pips))) (set Var 6) (set Var (mapEntry ""Throw"" (count Pips)))) (moveAgain)))) (if (= 3 (mapEntry ""Throw"" (count Pips))) (move Pass (then (and (set Var 3) (moveAgain))))))})))) maxState:7) (piece ""Ghoula"" Neutral) (hand P1 size:1)}) (rules (start {(place Stack ""Ghoula0"" 86) (place Stack items:{""Stick4"" ""Stick3"" ""Stick2"" ""Stick1""} 85)}) (play (do (if (<= (var) 0) (roll)) next:(if (> (var) 0) (if (= 1 (size Stack at:(if (!= (where ""Ghoula"" Neutral) -1) (where ""Ghoula"" Neutral) (handSite P1)))) (move (from (if (!= (where ""Ghoula"" Neutral) -1) (where ""Ghoula"" Neutral) (handSite P1)) level:(where Level ""Ghoula"" Neutral at:(if (!= (where ""Ghoula"" Neutral) -1) (where ""Ghoula"" Neutral) (handSite P1)))) (to (trackSite Move from:(if (!= (where ""Ghoula"" Neutral) -1) (where ""Ghoula"" Neutral) (handSite P1)) ""GhoulaTrack"" steps:1))) (move (from (if (!= (where ""Ghoula"" Neutral) -1) (where ""Ghoula"" Neutral) (handSite P1)) level:(where Level ""Ghoula"" Neutral at:(if (!= (where ""Ghoula"" Neutral) -1) (where ""Ghoula"" Neutral) (handSite P1)))) (to (trackSite Move from:(if (!= (where ""Ghoula"" Neutral) -1) (where ""Ghoula"" Neutral) (handSite P1)) ""ReverseGhoulaTrack"" steps:1)) (then (if (= (last From) 84) (forEach Level (last From) FromTop (remove (last From) level:(level))) (forEach Level (last From) FromTop (fromTo (from (last From) level:(level)) (to (last To))))))) (then (if (and (= 1 (size Stack at:(if (!= (where ""Ghoula"" Neutral) -1) (where ""Ghoula"" Neutral) (handSite P1)))) (= 5 (if (!= (where ""Ghoula"" Neutral) -1) (where ""Ghoula"" Neutral) (handSite P1)))) (set Var 0) (and (if (> (var) 1) (moveAgain)) (set Var (- (var) 1)))))) (if (!= 0 (mapEntry ""Throw"" (count Pips))) (forEach Piece))) (then (if (is In (mapEntry ""Throw"" (count Pips)) (sites {1 6 4})) (moveAgain))))) (end {(forEach Player if:(no Pieces Player) (result Player Loss)) (forEach Player if:(and (= 1 (size Stack at:(if (!= (where ""Ghoula"" Neutral) -1) (where ""Ghoula"" Neutral) (handSite P1)))) (= 5 (if (!= (where ""Ghoula"" Neutral) -1) (where ""Ghoula"" Neutral) (handSite P1)))) (result Player Win))})))","###Description 86 spaces in a spiral track. Any number of players, each having one piece, which starts on the first space in the outer ring of the spiral. A lump of charcoal, the Ghoula, also is placed on this space. Four sticks, with one green side and one white side, used as dice. The throws are as follows: One white side up = 1, this throw is known as ""sig""; two white sides up = 0; three white sides up = 3; four white sides up = 4; all green sides up = 6. Throws of sig, 6, and 4 grant the player another throw. Players move their pieces along the track toward the central space. when they reach the sixth space from the end, they must make seven throws of sig before moving on, moving to the sixteenth spot on the seventh throw. After reaching the next spot, only throws of sig and 3 are used; sig to move one space, and 3 to move the Ghoula three spaces. When players reach the central space, Players control the Ghoula. When controlling the Ghoula, throws of 0 count as 6. Any pieces which have not moved from the starting space when the Ghoula is first moved are dragged with the Ghoula, and then may move normally on their next turn. The Ghoula, when reaching a space occupied by a player, continues their turn dragging the player back to the starting space. A player that is forced back to the starting space by any means loses. All players reaching the central space of the board win. The game has 4 players. @@ -1174,11 +1134,6 @@ TURN - On each turn, each player drops a friendly stone on an empty cell. If a d ###Ludii (game ""Diagonals"" (players 2) (equipment {(board (square 8) use:Vertex) (piece ""Ball"" Each)}) (rules (play (move Add (to (sites Empty)) (then (and (if (not (is In (last To) (sites {""A8"" ""H1""}))) (if (all Sites (union (sites Direction from:(last To) NE included:True) (sites Direction from:(last To) SW)) if:(is Occupied (site))) (addScore Mover (count Sites in:(forEach (union (sites Direction from:(last To) NE included:True) (sites Direction from:(last To) SW)) if:(is Friend (who at:(site)))))))) (if (not (is In (last To) (sites {""A1"" ""H8""}))) (if (all Sites (union (sites Direction from:(last To) SE included:True) (sites Direction from:(last To) NW)) if:(is Occupied (site))) (addScore Mover (count Sites in:(forEach (union (sites Direction from:(last To) SE included:True) (sites Direction from:(last To) NW)) if:(is Friend (who at:(site)))))))))))) (end (if (is Full) (byScore)))))" -"Seven players. Seven concentric circles, divided into twelve equal sections, labeled after the twelve zodiac signs. The inner circle has one space per section, the next circle out has two per section, and so on, with the outer circle having seven spaces per section. Each player controls one piece, which travels in its circle only. Each piece begins in a different section, on the first space in that section: Saturn, beginning in Aquarius; Jupiter, beginning in Sagittarius; Mars, beginning in Scorpio; Sun, beginning in Leo; Venus, beginning in Taurus; Mercury, beginning in Virgo, and the Moon, beginning in Cancer. Each player rolls a seven-sided die, to determine which piece they play as, seven being Saturn and one being the Moon, and the others in order as already given. Movement is determined by the roll of this die, and proceeds in a clockwise direction. When a piece enters a new section, the player gains or loses points. Points are allocated based on how many sections away (either forward or behind) from the new section the other pieces are located. If a piece is two sections away, the player gains 24 points; if four sections away, 36; if three sections away, the player loses 36, if six sections away, loses 72; if the same section; 144.","(game ""Los Escaques"" (players 7) (equipment {(board (remove (concentric {0 12 24 36 48 60 72 84}) cells:{1}) {(track ""Ring7"" {11 10 9 8 7 6 5 4 3 2 0 1} loop:True) (track ""Ring6"" {35 34 33 32 31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 15 14 12 13} loop:True) (track ""Ring5"" {71 70 69 68 67 66 65 64 63 62 61 60 59 58 57 56 55 54 53 52 51 50 49 48 47 46 45 44 43 42 41 40 39 38 36 37} loop:True) (track ""Ring4"" {119 118 117 116 115 114 113 112 111 110 109 108 107 106 105 104 103 102 101 100 99 98 97 96 95 94 93 92 91 90 89 88 87 86 85 84 83 82 81 80 79 78 77 76 75 74 72 73} loop:True) (track ""Ring3"" {179 178 177 176 175 174 173 172 171 170 169 168 167 166 165 164 163 162 161 160 159 158 157 156 155 154 153 152 151 150 149 148 147 146 145 144 143 142 141 140 139 138 137 136 135 134 133 132 131 130 129 128 127 126 125 124 123 122 120 121} loop:True) (track ""Ring2"" {251 250 249 248 247 246 245 244 243 242 241 240 239 238 237 236 235 234 233 232 231 230 229 228 227 226 225 224 223 222 221 220 219 218 217 216 215 214 213 212 211 210 209 208 207 206 205 204 203 202 201 200 199 198 197 196 195 194 193 192 191 190 189 188 187 186 185 184 183 182 180 181} loop:True) (track ""Ring1"" {335 334 333 332 331 330 329 328 327 326 325 324 323 322 321 320 319 318 317 316 315 314 313 312 311 310 309 308 307 306 305 304 303 302 301 300 299 298 297 296 295 294 293 292 291 290 289 288 287 286 285 284 283 282 281 280 279 278 277 276 275 274 273 272 271 270 269 268 267 266 265 264 263 262 261 260 259 258 257 256 255 254 252 253} loop:True)}) (regions ""AllSites"" (sites Board)) (piece ""Marker"" Each (move (from) (to (if (is In (from) (sites Track ""Ring7"")) (trackSite Move ""Ring7"" steps:(count Pips)) (if (is In (from) (sites Track ""Ring6"")) (trackSite Move ""Ring6"" steps:(count Pips)) (if (is In (from) (sites Track ""Ring5"")) (trackSite Move ""Ring5"" steps:(count Pips)) (if (is In (from) (sites Track ""Ring4"")) (trackSite Move ""Ring4"" steps:(count Pips)) (if (is In (from) (sites Track ""Ring3"")) (trackSite Move ""Ring3"" steps:(count Pips)) (if (is In (from) (sites Track ""Ring2"")) (trackSite Move ""Ring2"" steps:(count Pips)) (trackSite Move ""Ring1"" steps:(count Pips))))))))) (then (if (not (or {(and (is In (last From) (sites ""Section0"")) (is In (last To) (sites ""Section0""))) (and (is In (last From) (sites ""Section1"")) (is In (last To) (sites ""Section1""))) (and (is In (last From) (sites ""Section2"")) (is In (last To) (sites ""Section2""))) (and (is In (last From) (sites ""Section3"")) (is In (last To) (sites ""Section3""))) (and (is In (last From) (sites ""Section4"")) (is In (last To) (sites ""Section4""))) (and (is In (last From) (sites ""Section5"")) (is In (last To) (sites ""Section5""))) (and (is In (last From) (sites ""Section6"")) (is In (last To) (sites ""Section6""))) (and (is In (last From) (sites ""Section7"")) (is In (last To) (sites ""Section7""))) (and (is In (last From) (sites ""Section8"")) (is In (last To) (sites ""Section8""))) (and (is In (last From) (sites ""Section9"")) (is In (last To) (sites ""Section9""))) (and (is In (last From) (sites ""Section10"")) (is In (last To) (sites ""Section10""))) (and (is In (last From) (sites ""Section11"")) (is In (last To) (sites ""Section11"")))})) (forEach Site (sites Occupied by:Enemy) (addScore Mover (mapEntry ""Score"" (if (is In (last To) (sites ""Section0"")) (if (is In (site) (sites ""Section0"")) 0 (if (or (is In (site) (sites ""Section1"")) (is In (site) (sites ""Section11""))) 1 (if (or (is In (site) (sites ""Section2"")) (is In (site) (sites ""Section10""))) 2 (if (or (is In (site) (sites ""Section3"")) (is In (site) (sites ""Section9""))) 3 (if (or (is In (site) (sites ""Section4"")) (is In (site) (sites ""Section8""))) 4 (if (or (is In (site) (sites ""Section5"")) (is In (site) (sites ""Section7""))) 5 6)))))) (if (is In (last To) (sites ""Section1"")) (if (is In (site) (sites ""Section1"")) 0 (if (or (is In (site) (sites ""Section2"")) (is In (site) (sites ""Section0""))) 1 (if (or (is In (site) (sites ""Section3"")) (is In (site) (sites ""Section11""))) 2 (if (or (is In (site) (sites ""Section4"")) (is In (site) (sites ""Section10""))) 3 (if (or (is In (site) (sites ""Section5"")) (is In (site) (sites ""Section9""))) 4 (if (or (is In (site) (sites ""Section6"")) (is In (site) (sites ""Section8""))) 5 6)))))) (if (is In (last To) (sites ""Section2"")) (if (is In (site) (sites ""Section2"")) 0 (if (or (is In (site) (sites ""Section3"")) (is In (site) (sites ""Section1""))) 1 (if (or (is In (site) (sites ""Section4"")) (is In (site) (sites ""Section0""))) 2 (if (or (is In (site) (sites ""Section5"")) (is In (site) (sites ""Section11""))) 3 (if (or (is In (site) (sites ""Section6"")) (is In (site) (sites ""Section10""))) 4 (if (or (is In (site) (sites ""Section7"")) (is In (site) (sites ""Section9""))) 5 6)))))) (if (is In (last To) (sites ""Section3"")) (if (is In (site) (sites ""Section3"")) 0 (if (or (is In (site) (sites ""Section4"")) (is In (site) (sites ""Section2""))) 1 (if (or (is In (site) (sites ""Section5"")) (is In (site) (sites ""Section1""))) 2 (if (or (is In (site) (sites ""Section6"")) (is In (site) (sites ""Section0""))) 3 (if (or (is In (site) (sites ""Section7"")) (is In (site) (sites ""Section11""))) 4 (if (or (is In (site) (sites ""Section8"")) (is In (site) (sites ""Section10""))) 5 6)))))) (if (is In (last To) (sites ""Section4"")) (if (is In (site) (sites ""Section4"")) 0 (if (or (is In (site) (sites ""Section5"")) (is In (site) (sites ""Section3""))) 1 (if (or (is In (site) (sites ""Section6"")) (is In (site) (sites ""Section2""))) 2 (if (or (is In (site) (sites ""Section7"")) (is In (site) (sites ""Section1""))) 3 (if (or (is In (site) (sites ""Section8"")) (is In (site) (sites ""Section0""))) 4 (if (or (is In (site) (sites ""Section9"")) (is In (site) (sites ""Section11""))) 5 6)))))) (if (is In (last To) (sites ""Section5"")) (if (is In (site) (sites ""Section5"")) 0 (if (or (is In (site) (sites ""Section6"")) (is In (site) (sites ""Section4""))) 1 (if (or (is In (site) (sites ""Section7"")) (is In (site) (sites ""Section3""))) 2 (if (or (is In (site) (sites ""Section8"")) (is In (site) (sites ""Section2""))) 3 (if (or (is In (site) (sites ""Section9"")) (is In (site) (sites ""Section1""))) 4 (if (or (is In (site) (sites ""Section10"")) (is In (site) (sites ""Section0""))) 5 6)))))) (if (is In (last To) (sites ""Section6"")) (if (is In (site) (sites ""Section6"")) 0 (if (or (is In (site) (sites ""Section7"")) (is In (site) (sites ""Section5""))) 1 (if (or (is In (site) (sites ""Section8"")) (is In (site) (sites ""Section4""))) 2 (if (or (is In (site) (sites ""Section9"")) (is In (site) (sites ""Section3""))) 3 (if (or (is In (site) (sites ""Section10"")) (is In (site) (sites ""Section2""))) 4 (if (or (is In (site) (sites ""Section11"")) (is In (site) (sites ""Section1""))) 5 6)))))) (if (is In (last To) (sites ""Section7"")) (if (is In (site) (sites ""Section7"")) 0 (if (or (is In (site) (sites ""Section8"")) (is In (site) (sites ""Section6""))) 1 (if (or (is In (site) (sites ""Section9"")) (is In (site) (sites ""Section5""))) 2 (if (or (is In (site) (sites ""Section10"")) (is In (site) (sites ""Section4""))) 3 (if (or (is In (site) (sites ""Section11"")) (is In (site) (sites ""Section3""))) 4 (if (or (is In (site) (sites ""Section0"")) (is In (site) (sites ""Section2""))) 5 6)))))) (if (is In (last To) (sites ""Section8"")) (if (is In (site) (sites ""Section8"")) 0 (if (or (is In (site) (sites ""Section9"")) (is In (site) (sites ""Section7""))) 1 (if (or (is In (site) (sites ""Section10"")) (is In (site) (sites ""Section6""))) 2 (if (or (is In (site) (sites ""Section11"")) (is In (site) (sites ""Section5""))) 3 (if (or (is In (site) (sites ""Section0"")) (is In (site) (sites ""Section4""))) 4 (if (or (is In (site) (sites ""Section1"")) (is In (site) (sites ""Section3""))) 5 6)))))) (if (is In (last To) (sites ""Section9"")) (if (is In (site) (sites ""Section9"")) 0 (if (or (is In (site) (sites ""Section10"")) (is In (site) (sites ""Section8""))) 1 (if (or (is In (site) (sites ""Section11"")) (is In (site) (sites ""Section7""))) 2 (if (or (is In (site) (sites ""Section0"")) (is In (site) (sites ""Section6""))) 3 (if (or (is In (site) (sites ""Section1"")) (is In (site) (sites ""Section5""))) 4 (if (or (is In (site) (sites ""Section2"")) (is In (site) (sites ""Section4""))) 5 6)))))) (if (is In (last To) (sites ""Section10"")) (if (is In (site) (sites ""Section10"")) 0 (if (or (is In (site) (sites ""Section11"")) (is In (site) (sites ""Section9""))) 1 (if (or (is In (site) (sites ""Section0"")) (is In (site) (sites ""Section8""))) 2 (if (or (is In (site) (sites ""Section1"")) (is In (site) (sites ""Section7""))) 3 (if (or (is In (site) (sites ""Section2"")) (is In (site) (sites ""Section6""))) 4 (if (or (is In (site) (sites ""Section3"")) (is In (site) (sites ""Section5""))) 5 6)))))) (if (is In (site) (sites ""Section11"")) 0 (if (or (is In (site) (sites ""Section0"")) (is In (site) (sites ""Section10""))) 1 (if (or (is In (site) (sites ""Section1"")) (is In (site) (sites ""Section9""))) 2 (if (or (is In (site) (sites ""Section2"")) (is In (site) (sites ""Section8""))) 3 (if (or (is In (site) (sites ""Section3"")) (is In (site) (sites ""Section7""))) 4 (if (or (is In (site) (sites ""Section4"")) (is In (site) (sites ""Section6""))) 5 6)))))))))))))))))))))))) (dice d:7 num:1) (hand Each) (map ""FirstSite"" {(pair 7 1) (pair 6 13) (pair 5 37) (pair 4 73) (pair 3 121) (pair 2 181) (pair 1 253)}) (map ""Score"" {(pair 0 144) (pair 1 0) (pair 2 24) (pair 3 -36) (pair 4 36) (pair 5 0) (pair 6 -72)}) (regions ""Section0"" (expand origin:1 steps:6 Out)) (regions ""Section1"" (expand origin:0 steps:6 Out)) (regions ""Section2"" (expand origin:2 steps:6 Out)) (regions ""Section3"" (expand origin:3 steps:6 Out)) (regions ""Section4"" (expand origin:4 steps:6 Out)) (regions ""Section5"" (expand origin:5 steps:6 Out)) (regions ""Section6"" (expand origin:6 steps:6 Out)) (regions ""Section7"" (expand origin:7 steps:6 Out)) (regions ""Section8"" (expand origin:8 steps:6 Out)) (regions ""Section9"" (expand origin:9 steps:6 Out)) (regions ""Section10"" (expand origin:10 steps:6 Out)) (regions ""Section11"" (expand origin:11 steps:6 Out))}) (rules (start (place ""Marker"" ""Hand"")) phases:{(phase ""Opening"" (play (do (roll) next:(if (is Empty (mapEntry ""FirstSite"" (count Pips))) (move (from (handSite Mover)) (to (mapEntry ""FirstSite"" (count Pips)))) (move Pass (then (moveAgain)))))) (nextPhase (and (is Mover P7) (is Next P1)) ""Playing"")) (phase ""Playing"" (play (if (is Proposed ""End"") (or (move Vote ""End"") (move Vote ""No"")) (do (roll) next:(or (forEach Piece) (move Propose ""End""))))))} (end (if (is Decided ""End"") (byScore)))))","###Description -Seven players. Seven concentric circles, divided into twelve equal sections, labeled after the twelve zodiac signs. The inner circle has one space per section, the next circle out has two per section, and so on, with the outer circle having seven spaces per section. Each player controls one piece, which travels in its circle only. Each piece begins in a different section, on the first space in that section: Saturn, beginning in Aquarius; Jupiter, beginning in Sagittarius; Mars, beginning in Scorpio; Sun, beginning in Leo; Venus, beginning in Taurus; Mercury, beginning in Virgo, and the Moon, beginning in Cancer. Each player rolls a seven-sided die, to determine which piece they play as, seven being Saturn and one being the Moon, and the others in order as already given. Movement is determined by the roll of this die, and proceeds in a clockwise direction. When a piece enters a new section, the player gains or loses points. Points are allocated based on how many sections away (either forward or behind) from the new section the other pieces are located. If a piece is two sections away, the player gains 24 points; if four sections away, 36; if three sections away, the player loses 36, if six sections away, loses 72; if the same section; 144. - -###Ludii -(game ""Los Escaques"" (players 7) (equipment {(board (remove (concentric {0 12 24 36 48 60 72 84}) cells:{1}) {(track ""Ring7"" {11 10 9 8 7 6 5 4 3 2 0 1} loop:True) (track ""Ring6"" {35 34 33 32 31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 15 14 12 13} loop:True) (track ""Ring5"" {71 70 69 68 67 66 65 64 63 62 61 60 59 58 57 56 55 54 53 52 51 50 49 48 47 46 45 44 43 42 41 40 39 38 36 37} loop:True) (track ""Ring4"" {119 118 117 116 115 114 113 112 111 110 109 108 107 106 105 104 103 102 101 100 99 98 97 96 95 94 93 92 91 90 89 88 87 86 85 84 83 82 81 80 79 78 77 76 75 74 72 73} loop:True) (track ""Ring3"" {179 178 177 176 175 174 173 172 171 170 169 168 167 166 165 164 163 162 161 160 159 158 157 156 155 154 153 152 151 150 149 148 147 146 145 144 143 142 141 140 139 138 137 136 135 134 133 132 131 130 129 128 127 126 125 124 123 122 120 121} loop:True) (track ""Ring2"" {251 250 249 248 247 246 245 244 243 242 241 240 239 238 237 236 235 234 233 232 231 230 229 228 227 226 225 224 223 222 221 220 219 218 217 216 215 214 213 212 211 210 209 208 207 206 205 204 203 202 201 200 199 198 197 196 195 194 193 192 191 190 189 188 187 186 185 184 183 182 180 181} loop:True) (track ""Ring1"" {335 334 333 332 331 330 329 328 327 326 325 324 323 322 321 320 319 318 317 316 315 314 313 312 311 310 309 308 307 306 305 304 303 302 301 300 299 298 297 296 295 294 293 292 291 290 289 288 287 286 285 284 283 282 281 280 279 278 277 276 275 274 273 272 271 270 269 268 267 266 265 264 263 262 261 260 259 258 257 256 255 254 252 253} loop:True)}) (regions ""AllSites"" (sites Board)) (piece ""Marker"" Each (move (from) (to (if (is In (from) (sites Track ""Ring7"")) (trackSite Move ""Ring7"" steps:(count Pips)) (if (is In (from) (sites Track ""Ring6"")) (trackSite Move ""Ring6"" steps:(count Pips)) (if (is In (from) (sites Track ""Ring5"")) (trackSite Move ""Ring5"" steps:(count Pips)) (if (is In (from) (sites Track ""Ring4"")) (trackSite Move ""Ring4"" steps:(count Pips)) (if (is In (from) (sites Track ""Ring3"")) (trackSite Move ""Ring3"" steps:(count Pips)) (if (is In (from) (sites Track ""Ring2"")) (trackSite Move ""Ring2"" steps:(count Pips)) (trackSite Move ""Ring1"" steps:(count Pips))))))))) (then (if (not (or {(and (is In (last From) (sites ""Section0"")) (is In (last To) (sites ""Section0""))) (and (is In (last From) (sites ""Section1"")) (is In (last To) (sites ""Section1""))) (and (is In (last From) (sites ""Section2"")) (is In (last To) (sites ""Section2""))) (and (is In (last From) (sites ""Section3"")) (is In (last To) (sites ""Section3""))) (and (is In (last From) (sites ""Section4"")) (is In (last To) (sites ""Section4""))) (and (is In (last From) (sites ""Section5"")) (is In (last To) (sites ""Section5""))) (and (is In (last From) (sites ""Section6"")) (is In (last To) (sites ""Section6""))) (and (is In (last From) (sites ""Section7"")) (is In (last To) (sites ""Section7""))) (and (is In (last From) (sites ""Section8"")) (is In (last To) (sites ""Section8""))) (and (is In (last From) (sites ""Section9"")) (is In (last To) (sites ""Section9""))) (and (is In (last From) (sites ""Section10"")) (is In (last To) (sites ""Section10""))) (and (is In (last From) (sites ""Section11"")) (is In (last To) (sites ""Section11"")))})) (forEach Site (sites Occupied by:Enemy) (addScore Mover (mapEntry ""Score"" (if (is In (last To) (sites ""Section0"")) (if (is In (site) (sites ""Section0"")) 0 (if (or (is In (site) (sites ""Section1"")) (is In (site) (sites ""Section11""))) 1 (if (or (is In (site) (sites ""Section2"")) (is In (site) (sites ""Section10""))) 2 (if (or (is In (site) (sites ""Section3"")) (is In (site) (sites ""Section9""))) 3 (if (or (is In (site) (sites ""Section4"")) (is In (site) (sites ""Section8""))) 4 (if (or (is In (site) (sites ""Section5"")) (is In (site) (sites ""Section7""))) 5 6)))))) (if (is In (last To) (sites ""Section1"")) (if (is In (site) (sites ""Section1"")) 0 (if (or (is In (site) (sites ""Section2"")) (is In (site) (sites ""Section0""))) 1 (if (or (is In (site) (sites ""Section3"")) (is In (site) (sites ""Section11""))) 2 (if (or (is In (site) (sites ""Section4"")) (is In (site) (sites ""Section10""))) 3 (if (or (is In (site) (sites ""Section5"")) (is In (site) (sites ""Section9""))) 4 (if (or (is In (site) (sites ""Section6"")) (is In (site) (sites ""Section8""))) 5 6)))))) (if (is In (last To) (sites ""Section2"")) (if (is In (site) (sites ""Section2"")) 0 (if (or (is In (site) (sites ""Section3"")) (is In (site) (sites ""Section1""))) 1 (if (or (is In (site) (sites ""Section4"")) (is In (site) (sites ""Section0""))) 2 (if (or (is In (site) (sites ""Section5"")) (is In (site) (sites ""Section11""))) 3 (if (or (is In (site) (sites ""Section6"")) (is In (site) (sites ""Section10""))) 4 (if (or (is In (site) (sites ""Section7"")) (is In (site) (sites ""Section9""))) 5 6)))))) (if (is In (last To) (sites ""Section3"")) (if (is In (site) (sites ""Section3"")) 0 (if (or (is In (site) (sites ""Section4"")) (is In (site) (sites ""Section2""))) 1 (if (or (is In (site) (sites ""Section5"")) (is In (site) (sites ""Section1""))) 2 (if (or (is In (site) (sites ""Section6"")) (is In (site) (sites ""Section0""))) 3 (if (or (is In (site) (sites ""Section7"")) (is In (site) (sites ""Section11""))) 4 (if (or (is In (site) (sites ""Section8"")) (is In (site) (sites ""Section10""))) 5 6)))))) (if (is In (last To) (sites ""Section4"")) (if (is In (site) (sites ""Section4"")) 0 (if (or (is In (site) (sites ""Section5"")) (is In (site) (sites ""Section3""))) 1 (if (or (is In (site) (sites ""Section6"")) (is In (site) (sites ""Section2""))) 2 (if (or (is In (site) (sites ""Section7"")) (is In (site) (sites ""Section1""))) 3 (if (or (is In (site) (sites ""Section8"")) (is In (site) (sites ""Section0""))) 4 (if (or (is In (site) (sites ""Section9"")) (is In (site) (sites ""Section11""))) 5 6)))))) (if (is In (last To) (sites ""Section5"")) (if (is In (site) (sites ""Section5"")) 0 (if (or (is In (site) (sites ""Section6"")) (is In (site) (sites ""Section4""))) 1 (if (or (is In (site) (sites ""Section7"")) (is In (site) (sites ""Section3""))) 2 (if (or (is In (site) (sites ""Section8"")) (is In (site) (sites ""Section2""))) 3 (if (or (is In (site) (sites ""Section9"")) (is In (site) (sites ""Section1""))) 4 (if (or (is In (site) (sites ""Section10"")) (is In (site) (sites ""Section0""))) 5 6)))))) (if (is In (last To) (sites ""Section6"")) (if (is In (site) (sites ""Section6"")) 0 (if (or (is In (site) (sites ""Section7"")) (is In (site) (sites ""Section5""))) 1 (if (or (is In (site) (sites ""Section8"")) (is In (site) (sites ""Section4""))) 2 (if (or (is In (site) (sites ""Section9"")) (is In (site) (sites ""Section3""))) 3 (if (or (is In (site) (sites ""Section10"")) (is In (site) (sites ""Section2""))) 4 (if (or (is In (site) (sites ""Section11"")) (is In (site) (sites ""Section1""))) 5 6)))))) (if (is In (last To) (sites ""Section7"")) (if (is In (site) (sites ""Section7"")) 0 (if (or (is In (site) (sites ""Section8"")) (is In (site) (sites ""Section6""))) 1 (if (or (is In (site) (sites ""Section9"")) (is In (site) (sites ""Section5""))) 2 (if (or (is In (site) (sites ""Section10"")) (is In (site) (sites ""Section4""))) 3 (if (or (is In (site) (sites ""Section11"")) (is In (site) (sites ""Section3""))) 4 (if (or (is In (site) (sites ""Section0"")) (is In (site) (sites ""Section2""))) 5 6)))))) (if (is In (last To) (sites ""Section8"")) (if (is In (site) (sites ""Section8"")) 0 (if (or (is In (site) (sites ""Section9"")) (is In (site) (sites ""Section7""))) 1 (if (or (is In (site) (sites ""Section10"")) (is In (site) (sites ""Section6""))) 2 (if (or (is In (site) (sites ""Section11"")) (is In (site) (sites ""Section5""))) 3 (if (or (is In (site) (sites ""Section0"")) (is In (site) (sites ""Section4""))) 4 (if (or (is In (site) (sites ""Section1"")) (is In (site) (sites ""Section3""))) 5 6)))))) (if (is In (last To) (sites ""Section9"")) (if (is In (site) (sites ""Section9"")) 0 (if (or (is In (site) (sites ""Section10"")) (is In (site) (sites ""Section8""))) 1 (if (or (is In (site) (sites ""Section11"")) (is In (site) (sites ""Section7""))) 2 (if (or (is In (site) (sites ""Section0"")) (is In (site) (sites ""Section6""))) 3 (if (or (is In (site) (sites ""Section1"")) (is In (site) (sites ""Section5""))) 4 (if (or (is In (site) (sites ""Section2"")) (is In (site) (sites ""Section4""))) 5 6)))))) (if (is In (last To) (sites ""Section10"")) (if (is In (site) (sites ""Section10"")) 0 (if (or (is In (site) (sites ""Section11"")) (is In (site) (sites ""Section9""))) 1 (if (or (is In (site) (sites ""Section0"")) (is In (site) (sites ""Section8""))) 2 (if (or (is In (site) (sites ""Section1"")) (is In (site) (sites ""Section7""))) 3 (if (or (is In (site) (sites ""Section2"")) (is In (site) (sites ""Section6""))) 4 (if (or (is In (site) (sites ""Section3"")) (is In (site) (sites ""Section5""))) 5 6)))))) (if (is In (site) (sites ""Section11"")) 0 (if (or (is In (site) (sites ""Section0"")) (is In (site) (sites ""Section10""))) 1 (if (or (is In (site) (sites ""Section1"")) (is In (site) (sites ""Section9""))) 2 (if (or (is In (site) (sites ""Section2"")) (is In (site) (sites ""Section8""))) 3 (if (or (is In (site) (sites ""Section3"")) (is In (site) (sites ""Section7""))) 4 (if (or (is In (site) (sites ""Section4"")) (is In (site) (sites ""Section6""))) 5 6)))))))))))))))))))))))) (dice d:7 num:1) (hand Each) (map ""FirstSite"" {(pair 7 1) (pair 6 13) (pair 5 37) (pair 4 73) (pair 3 121) (pair 2 181) (pair 1 253)}) (map ""Score"" {(pair 0 144) (pair 1 0) (pair 2 24) (pair 3 -36) (pair 4 36) (pair 5 0) (pair 6 -72)}) (regions ""Section0"" (expand origin:1 steps:6 Out)) (regions ""Section1"" (expand origin:0 steps:6 Out)) (regions ""Section2"" (expand origin:2 steps:6 Out)) (regions ""Section3"" (expand origin:3 steps:6 Out)) (regions ""Section4"" (expand origin:4 steps:6 Out)) (regions ""Section5"" (expand origin:5 steps:6 Out)) (regions ""Section6"" (expand origin:6 steps:6 Out)) (regions ""Section7"" (expand origin:7 steps:6 Out)) (regions ""Section8"" (expand origin:8 steps:6 Out)) (regions ""Section9"" (expand origin:9 steps:6 Out)) (regions ""Section10"" (expand origin:10 steps:6 Out)) (regions ""Section11"" (expand origin:11 steps:6 Out))}) (rules (start (place ""Marker"" ""Hand"")) phases:{(phase ""Opening"" (play (do (roll) next:(if (is Empty (mapEntry ""FirstSite"" (count Pips))) (move (from (handSite Mover)) (to (mapEntry ""FirstSite"" (count Pips)))) (move Pass (then (moveAgain)))))) (nextPhase (and (is Mover P7) (is Next P1)) ""Playing"")) (phase ""Playing"" (play (if (is Proposed ""End"") (or (move Vote ""End"") (move Vote ""No"")) (do (roll) next:(or (forEach Piece) (move Propose ""End""))))))} (end (if (is Decided ""End"") (byScore)))))" "The board is a double-headed eagle, with two lines of ten holes. One seven-sided die. One side has a special mark, one is blank, and the others are numbered 1-5. The special mark scores 10, the blank side scores -10. Players roll the die, and add up their scores as they go, placing a peg in a hole to mark ten points. The player who reaches 100 points first wins.","(game ""Pasa"" (players 2) (equipment {(board (rectangle 10 2)) (piece ""Disc"" Each) (dice d:7 from:0 num:1) (map {(pair 0 -10) (pair 1 1) (pair 2 2) (pair 3 3) (pair 4 4) (pair 5 5) (pair 6 6) (pair 7 10)})}) (rules (play (do (roll (then (addScore Mover (mapEntry (count Pips))))) next:(move Pass (then (and (remove (sites Column (- (mover) 1))) (if (>= (score Mover) 10) (add (piece (id ""Disc"" Mover)) (to (intersection (sites Column (- (mover) 1)) (sites Row (- (/ (score Mover) 10) 1))))))))))) (end (if (>= (score Mover) 100) (result Mover Win)))))","###Description The board is a double-headed eagle, with two lines of ten holes. One seven-sided die. One side has a special mark, one is blank, and the others are numbered 1-5. The special mark scores 10, the blank side scores -10. Players roll the die, and add up their scores as they go, placing a peg in a hole to mark ten points. The player who reaches 100 points first wins. @@ -1199,16 +1154,6 @@ The board is a double-headed eagle, with two lines of ten holes. One seven-sided ###Ludii (game ""Bao Kiswahili (DR Congo)"" (players 2) (equipment {(mancalaBoard 4 8 store:None {(track ""TrackCCW1"" ""0,E,N1,W"" loop:True P1) (track ""TrackCCW2"" ""16,E,N1,W"" loop:True P2) (track ""TrackCW1"" ""7,W,N1,E"" loop:True P1) (track ""TrackCW2"" ""23,W,N1,E"" loop:True P2)}) (piece ""Seed"" Shared) (hand Each) (regions ""Home"" P1 (expand (sites Bottom))) (regions ""Home"" P2 (expand (sites Top))) (regions ""Inner"" P1 (sites Row 1)) (regions ""Inner"" P2 (sites Row 2)) (map ""LeftMostInner"" {(pair P1 8) (pair P2 23)}) (map ""RightMostInner"" {(pair P1 15) (pair P2 16)}) (map ""AdjacentLeftMostInner"" {(pair P1 9) (pair P2 22)}) (map ""AdjacentRightMostInner"" {(pair P1 14) (pair P2 17)})}) (rules (start {(set Count 24 at:(handSite P1)) (set Count 24 at:(handSite P2)) (set Count 1 to:(union (sites Row 1) (sites Row 2)))}) phases:{(phase ""Placement"" (play (if (is Prev Mover) (if (is Pending) (or (if (or (= 1 (value Player Mover)) (= 0 (value Player Mover))) (do (fromTo (from (if (is Mover P1) (+ (last To afterConsequence:True) 8) (- (last To afterConsequence:True) 8))) (to (mapEntry ""LeftMostInner"" Mover)) count:(count at:(if (is Mover P1) (+ (last To afterConsequence:True) 8) (- (last To afterConsequence:True) 8)))) next:(move Select (from (mapEntry ""LeftMostInner"" Mover)) (then (sow ""TrackCW"" owner:(mover) apply:(if (is In (to) (sites Mover ""Inner"")) (if (is Occupied (if (is Mover P1) (+ (to) 8) (- (to) 8))) (and {(moveAgain) (set Pending) (if (is In (to) (expand (sites Right))) (set Value Mover 2) (if (is In (to) (expand (sites Left))) (set Value Mover 1) (set Value Mover 0)))}) (if (< 1 (count at:(to))) (and {(moveAgain) (set Var ""Replay"" (to)) (set Var ""Direction"" 1)}))) (if (< 1 (count at:(to))) (and {(moveAgain) (set Var ""Replay"" (to)) (set Var ""Direction"" 1)})))))))) (if (or (= 2 (value Player Mover)) (= 0 (value Player Mover))) (do (fromTo (from (if (is Mover P1) (+ (last To afterConsequence:True) 8) (- (last To afterConsequence:True) 8))) (to (mapEntry ""RightMostInner"" Mover)) count:(count at:(if (is Mover P1) (+ (last To afterConsequence:True) 8) (- (last To afterConsequence:True) 8)))) next:(move Select (from (mapEntry ""RightMostInner"" Mover)) (then (sow ""TrackCCW"" owner:(mover) apply:(if (is In (to) (sites Mover ""Inner"")) (if (is Occupied (if (is Mover P1) (+ (to) 8) (- (to) 8))) (and {(moveAgain) (set Pending) (if (is In (to) (expand (sites Right))) (set Value Mover 2) (if (is In (to) (expand (sites Left))) (set Value Mover 1) (set Value Mover 0)))}) (if (< 1 (count at:(to))) (and {(moveAgain) (set Var ""Replay"" (to)) (set Var ""Direction"" 2)}))) (if (< 1 (count at:(to))) (and {(moveAgain) (set Var ""Replay"" (to)) (set Var ""Direction"" 2)}))))))))) (or (if (or (= (var ""Direction"") 1) (= (var ""Direction"") 3)) (move Select (from (var ""Replay"")) (then (sow ""TrackCW"" owner:(mover) apply:(if (is In (to) (sites Mover ""Inner"")) (if (is Occupied (if (is Mover P1) (+ (to) 8) (- (to) 8))) (and {(moveAgain) (set Pending) (if (is In (to) (expand (sites Right))) (set Value Mover 2) (if (is In (to) (expand (sites Left))) (set Value Mover 1) (set Value Mover 0)))}) (if (< 1 (count at:(to))) (and {(moveAgain) (set Var ""Replay"" (to)) (set Var ""Direction"" 1)}))) (if (< 1 (count at:(to))) (and {(moveAgain) (set Var ""Replay"" (to)) (set Var ""Direction"" 1)}))))))) (if (or (= (var ""Direction"") 2) (= (var ""Direction"") 3)) (move Select (from (var ""Replay"")) (then (sow ""TrackCCW"" owner:(mover) apply:(if (is In (to) (sites Mover ""Inner"")) (if (is Occupied (if (is Mover P1) (+ (to) 8) (- (to) 8))) (and {(moveAgain) (set Pending) (if (is In (to) (expand (sites Right))) (set Value Mover 2) (if (is In (to) (expand (sites Left))) (set Value Mover 1) (set Value Mover 0)))}) (if (< 1 (count at:(to))) (and {(moveAgain) (set Var ""Replay"" (to)) (set Var ""Direction"" 2)}))) (if (< 1 (count at:(to))) (and {(moveAgain) (set Var ""Replay"" (to)) (set Var ""Direction"" 2)}))))))))) (if (is Occupied (handSite Mover)) (priority {(move (from (handSite Mover)) (to (sites Mover ""Inner"") if:(is Occupied (if (is Mover P1) (+ (to) 8) (- (to) 8)))) count:1 (then (and {(moveAgain) (set Pending) (if (is In (last To) (expand (sites Right))) (set Value Mover 2) (if (is In (last To) (expand (sites Left))) (set Value Mover 1) (set Value Mover 0)))}))) (move (from (handSite Mover)) (to (sites Mover ""Inner"")) count:1 (then (and {(moveAgain) (set Var ""Replay"" (last To)) (set Var ""Direction"" 3)})))}) (or (move Select (from (sites Mover) if:(is Occupied (from))) (then (sow ""TrackCW"" owner:(mover) apply:(if (< 1 (count at:(to))) (and {(moveAgain) (set Var ""Replay"" (to)) (set Var ""Direction"" 1)}))))) (move Select (from (sites Mover) if:(is Occupied (from))) (then (sow ""TrackCCW"" owner:(mover) apply:(if (< 1 (count at:(to))) (and {(moveAgain) (set Var ""Replay"" (to)) (set Var ""Direction"" 2)}))))))))))} (end (forEach Player if:(all Sites (sites Player ""Inner"") if:(= 0 (count at:(site)))) (result Player Loss)))))" -"4x8 board. The fourth hole from the right in the inner rows of each player is larger and square. Total of 64 counters. Starting position: in the inner row, the first four holes, number of counters from the right: 0; 2; 2; 6. Play begins with each player alternately introducing the remaining counters in their holes. Each is introduced in such a way as to capture an opponent's counters, by placing it into an occupied hole which is opposite one of the opponent's occupied inner-row holes. The opponent's counters are then captured and sown along the inner row from either the leftmost or rightmost hole. If the capture occurs in the rightmost or leftmost holes in the inner row, or the hole immediately adjacent to them in the inner row, the counters must be sown from the leftmost or rightmost hole (whichever is closest), and sown along the inner row. Captures on these subsequent sowings happen according to the same rules as in the second phase, with certain exceptions explained below. If no capture is available, a counter may be placed in any occupied hole in the inner hole except the square hole, and sows them in either direction. If the square hole is the only occupied hole in the inner row, the counter is placed there and the player sows only two seeds from it in either direction. If a loaded square hole is reduced to six counters, the player places a counter there and sows the entire contents, forfeiting the special status for this hole for the rest of the game. Moves that start without a capture on the first sowing which end in the square hole stops there without further sowing. Sowing cannot start from a square hole except to capture, except as described above. If a sowing from an initial capturing move ends in an occupied square hole and no capture is possible, the player may choose to stop there or continue to sow. Once the contents of this hole have been relayed or captured the square hole loses its special status and the player may not introduce a counter into hole with one counter if there are other holes in the inner row containing multiple counters. Once all of the counters are introduced, second phase starts. Players move by sowing seeds from a player's holes. Sowing can happen in any direction, but must continue in that direction throughout the turn except in the special cases below. When the final counter of a sowing lands in a hole in the inner row and there are counters in the opponent's hole in the inner row opposite, these are captured. The captured counters are placed in the leftmost or rightmost hole of the inner row and sown along the inner row. The leftmost or rightmost hole is chosen based on which continues the sowing direction of the move that made the capture. If the capture occurs in the rightmost or leftmost holes in the inner row, or the hole immediately adjacent to them in the inner row, the counters must be sown from the leftmost or rightmost hole (whichever is closest), and sown along the inner row, even if this incurs a change of direction. If the final counter lands in an occupied hole and a capture is not possible, the counters are picked up and sowing continues. If the final counter lands in an empty hole, the turn ends. A player must make a capturing move on their initial sowing if it is available. If a capturing move is not possible on the first sowing, no captures can be made on subsequent sowings in that turn. The game is won when the opponent's inner row is cleared of counters.","(game ""Bao Kiswahili (East Africa)"" (players 2) (equipment {(mancalaBoard 4 8 store:None {(track ""TrackCCW1"" ""0,E,N1,W"" loop:True P1) (track ""TrackCCW2"" ""16,E,N1,W"" loop:True P2) (track ""TrackCW1"" ""7,W,N1,E"" loop:True P1) (track ""TrackCW2"" ""23,W,N1,E"" loop:True P2)}) (piece ""Seed"" Shared) (hand Each) (regions ""Home"" P1 (expand (sites Bottom))) (regions ""Home"" P2 (expand (sites Top))) (regions ""Inner"" P1 (sites Row 1)) (regions ""Inner"" P2 (sites Row 2)) (regions ""SquaresHoles"" (sites {12 19})) (map ""LeftMostInner"" {(pair P1 8) (pair P2 23)}) (map ""RightMostInner"" {(pair P1 15) (pair P2 16)}) (map ""AdjacentLeftMostInner"" {(pair P1 9) (pair P2 22)}) (map ""AdjacentRightMostInner"" {(pair P1 14) (pair P2 17)})}) (rules (start {(set Count 22 at:(handSite P1)) (set Count 22 at:(handSite P2)) (set Count 2 to:(sites {""G2"" ""F2"" ""B3"" ""C3""})) (set Count 6 to:(sites {""E2"" ""D3""}))}) (play (if (is Prev Mover) (if (is Pending) (or (if (or (= 1 (var ""Side"")) (= 0 (var ""Side""))) (do (fromTo (from (if (is Mover P1) (+ (last To afterConsequence:True) 8) (- (last To afterConsequence:True) 8))) (to (mapEntry ""LeftMostInner"" Mover)) count:(count at:(if (is Mover P1) (+ (last To afterConsequence:True) 8) (- (last To afterConsequence:True) 8)))) next:(move Select (from (mapEntry ""LeftMostInner"" Mover)) (then (sow count:(if (!= (value Player Mover) 1) (if (is In (last From) (sites ""SquaresHoles"")) (if (<= (count at:(last From)) 6) (count at:(last From)) (min 2 (count at:(last From)))) (count at:(last From))) (count at:(last From))) ""TrackCW"" owner:(mover) apply:(if (is In (to) (sites Mover ""Inner"")) (if (is Occupied (if (is Mover P1) (+ (to) 8) (- (to) 8))) (and {(moveAgain) (set Pending) (if (is In (to) (expand (sites Right))) (set Var ""Side"" 2) (if (is In (to) (expand (sites Left))) (set Var ""Side"" 1) (set Var ""Side"" 0)))}) (if (< 1 (count at:(to))) (if (or (= 1 (value Player Mover)) (and (!= 1 (value Player Mover)) (not (is In (to) (sites ""SquaresHoles""))))) (and {(moveAgain) (set Var ""Replay"" (to)) (set Var ""Direction"" 1)}) (set Var ""Direction"" 0)))) (if (< 1 (count at:(to))) (if (or (= 1 (value Player Mover)) (and (!= 1 (value Player Mover)) (not (is In (to) (sites ""SquaresHoles""))))) (and {(moveAgain) (set Var ""Replay"" (to)) (set Var ""Direction"" 1)}) (set Var ""Direction"" 0)))) (then (if (and {(!= 1 (value Player Mover)) (is In (last From) (sites ""SquaresHoles"")) (< (count at:(last From)) 6)}) (set Value Mover 1)))))))) (if (or (= 2 (var ""Side"")) (= 0 (var ""Side""))) (do (fromTo (from (if (is Mover P1) (+ (last To afterConsequence:True) 8) (- (last To afterConsequence:True) 8))) (to (mapEntry ""RightMostInner"" Mover)) count:(count at:(if (is Mover P1) (+ (last To afterConsequence:True) 8) (- (last To afterConsequence:True) 8)))) next:(move Select (from (mapEntry ""RightMostInner"" Mover)) (then (sow count:(if (!= (value Player Mover) 1) (if (is In (last From) (sites ""SquaresHoles"")) (if (<= (count at:(last From)) 6) (count at:(last From)) (min 2 (count at:(last From)))) (count at:(last From))) (count at:(last From))) ""TrackCCW"" owner:(mover) apply:(if (is In (to) (sites Mover ""Inner"")) (if (is Occupied (if (is Mover P1) (+ (to) 8) (- (to) 8))) (and {(moveAgain) (set Pending) (if (is In (to) (expand (sites Right))) (set Var ""Side"" 2) (if (is In (to) (expand (sites Left))) (set Var ""Side"" 1) (set Var ""Side"" 0)))}) (if (< 1 (count at:(to))) (if (or (= 1 (value Player Mover)) (and (!= 1 (value Player Mover)) (not (is In (to) (sites ""SquaresHoles""))))) (and {(moveAgain) (set Var ""Replay"" (to)) (set Var ""Direction"" 2)}) (set Var ""Direction"" 0)))) (if (< 1 (count at:(to))) (if (or (= 1 (value Player Mover)) (and (!= 1 (value Player Mover)) (not (is In (to) (sites ""SquaresHoles""))))) (and {(moveAgain) (set Var ""Replay"" (to)) (set Var ""Direction"" 2)}) (set Var ""Direction"" 0)))) (then (if (and {(!= 1 (value Player Mover)) (is In (last From) (sites ""SquaresHoles"")) (< (count at:(last From)) 6)}) (set Value Mover 1))))))))) (or (if (or (= (var ""Direction"") 1) (= (var ""Direction"") 3)) (move Select (from (var ""Replay"")) (then (sow count:(if (!= (value Player Mover) 1) (if (is In (last From) (sites ""SquaresHoles"")) (if (<= (count at:(last From)) 6) (count at:(last From)) (min 2 (count at:(last From)))) (count at:(last From))) (count at:(last From))) ""TrackCW"" owner:(mover) apply:(if (is In (to) (sites Mover ""Inner"")) (if (is Occupied (if (is Mover P1) (+ (to) 8) (- (to) 8))) (and {(moveAgain) (set Pending) (if (is In (to) (expand (sites Right))) (set Var ""Side"" 2) (if (is In (to) (expand (sites Left))) (set Var ""Side"" 1) (set Var ""Side"" 0)))}) (if (< 1 (count at:(to))) (if (or (= 1 (value Player Mover)) (and (!= 1 (value Player Mover)) (not (is In (to) (sites ""SquaresHoles""))))) (and {(moveAgain) (set Var ""Replay"" (to)) (set Var ""Direction"" 1)}) (set Var ""Direction"" 0)))) (if (< 1 (count at:(to))) (if (or (= 1 (value Player Mover)) (and (!= 1 (value Player Mover)) (not (is In (to) (sites ""SquaresHoles""))))) (and {(moveAgain) (set Var ""Replay"" (to)) (set Var ""Direction"" 1)}) (set Var ""Direction"" 0)))) (then (if (and {(!= 1 (value Player Mover)) (is In (last From) (sites ""SquaresHoles"")) (< (count at:(last From)) 6)}) (set Value Mover 1))))))) (if (or (= (var ""Direction"") 2) (= (var ""Direction"") 3)) (move Select (from (var ""Replay"")) (then (sow count:(if (!= (value Player Mover) 1) (if (is In (last From) (sites ""SquaresHoles"")) (if (<= (count at:(last From)) 6) (count at:(last From)) (min 2 (count at:(last From)))) (count at:(last From))) (count at:(last From))) ""TrackCCW"" owner:(mover) apply:(if (is In (to) (sites Mover ""Inner"")) (if (is Occupied (if (is Mover P1) (+ (to) 8) (- (to) 8))) (and {(moveAgain) (set Pending) (if (is In (to) (expand (sites Right))) (set Var ""Side"" 2) (if (is In (to) (expand (sites Left))) (set Var ""Side"" 1) (set Var ""Side"" 0)))}) (if (< 1 (count at:(to))) (if (or (= 1 (value Player Mover)) (and (!= 1 (value Player Mover)) (not (is In (to) (sites ""SquaresHoles""))))) (and {(moveAgain) (set Var ""Replay"" (to)) (set Var ""Direction"" 2)}) (set Var ""Direction"" 0)))) (if (< 1 (count at:(to))) (if (or (= 1 (value Player Mover)) (and (!= 1 (value Player Mover)) (not (is In (to) (sites ""SquaresHoles""))))) (and {(moveAgain) (set Var ""Replay"" (to)) (set Var ""Direction"" 2)}) (set Var ""Direction"" 0)))) (then (if (and {(!= 1 (value Player Mover)) (is In (last From) (sites ""SquaresHoles"")) (< (count at:(last From)) 6)}) (set Value Mover 1))))))))) (if (is Occupied (handSite Mover)) (priority {(move (from (handSite Mover)) (to (sites Mover ""Inner"") if:(is Occupied (if (is Mover P1) (+ (to) 8) (- (to) 8)))) count:1 (then (and {(moveAgain) (set Pending) (if (is In (last To) (expand (sites Right))) (set Var ""Side"" 2) (if (is In (last To) (expand (sites Left))) (set Var ""Side"" 1) (set Var ""Side"" 0)))}))) (if (!= (value Player Mover) 1) (move (from (handSite Mover)) (to (difference (sites Mover ""Inner"") (sites ""SquaresHoles"")) if:(is Occupied (to))) count:1 (then (and {(moveAgain) (set Var ""Replay"" (last To)) (set Var ""Direction"" 3)}))) (move (from (handSite Mover)) (to (sites Mover ""Inner"") if:(is Occupied (to))) count:1 (then (and {(moveAgain) (set Var ""Replay"" (last To)) (set Var ""Direction"" 3)})))) (if (!= (value Player Mover) 1) (move (from (handSite Mover)) (to (sites ""SquaresHoles"") if:(is Occupied (to))) count:1 (then (and {(moveAgain) (set Var ""Replay"" (last To)) (set Var ""Direction"" 3)}))))}) (priority {(or (move Select (from (sites Mover) if:(and (is Occupied (from)) (is Occupied (if (is Mover P1) (+ (trackSite Move from:(from) ""TrackCW"" steps:(count at:(from))) 8) (- (trackSite Move from:(from) ""TrackCW"" steps:(count at:(from))) 8))))) (then (sow ""TrackCW"" owner:(mover) apply:(if (is In (to) (sites Mover ""Inner"")) (if (is Occupied (if (is Mover P1) (+ (to) 8) (- (to) 8))) (and {(moveAgain) (set Pending) (if (is In (to) (expand (sites Right))) (set Var ""Side"" 2) (if (is In (to) (expand (sites Left))) (set Var ""Side"" 1) (set Var ""Side"" 0)))}) (if (< 1 (count at:(to))) (if (or (= 1 (value Player Mover)) (and (!= 1 (value Player Mover)) (not (is In (to) (sites ""SquaresHoles""))))) (and {(moveAgain) (set Var ""Replay"" (to)) (set Var ""Direction"" 1)}) (set Var ""Direction"" 0)))) (if (< 1 (count at:(to))) (if (or (= 1 (value Player Mover)) (and (!= 1 (value Player Mover)) (not (is In (to) (sites ""SquaresHoles""))))) (and {(moveAgain) (set Var ""Replay"" (to)) (set Var ""Direction"" 1)}) (set Var ""Direction"" 0))))))) (move Select (from (sites Mover) if:(and (is Occupied (from)) (is Occupied (if (is Mover P1) (+ (trackSite Move from:(from) ""TrackCCW"" steps:(count at:(from))) 8) (- (trackSite Move from:(from) ""TrackCCW"" steps:(count at:(from))) 8))))) (then (sow ""TrackCCW"" owner:(mover) apply:(if (is In (to) (sites Mover ""Inner"")) (if (is Occupied (if (is Mover P1) (+ (to) 8) (- (to) 8))) (and {(moveAgain) (set Pending) (if (is In (to) (expand (sites Right))) (set Var ""Side"" 2) (if (is In (to) (expand (sites Left))) (set Var ""Side"" 1) (set Var ""Side"" 0)))}) (if (< 1 (count at:(to))) (if (or (= 1 (value Player Mover)) (and (!= 1 (value Player Mover)) (not (is In (to) (sites ""SquaresHoles""))))) (and {(moveAgain) (set Var ""Replay"" (to)) (set Var ""Direction"" 2)}) (set Var ""Direction"" 0)))) (if (< 1 (count at:(to))) (if (or (= 1 (value Player Mover)) (and (!= 1 (value Player Mover)) (not (is In (to) (sites ""SquaresHoles""))))) (and {(moveAgain) (set Var ""Replay"" (to)) (set Var ""Direction"" 2)}) (set Var ""Direction"" 0)))))))) (or (move Select (from (if (!= (value Player Mover) 1) (sites Mover) (difference (sites Mover) (sites ""SquaresHoles""))) if:(is Occupied (from))) (then (sow ""TrackCW"" owner:(mover) apply:(if (is In (to) (sites Mover ""Inner"")) (if (is Occupied (if (is Mover P1) (+ (to) 8) (- (to) 8))) (and {(moveAgain) (set Pending) (if (is In (to) (expand (sites Right))) (set Var ""Side"" 2) (if (is In (to) (expand (sites Left))) (set Var ""Side"" 1) (set Var ""Side"" 0)))}) (if (< 1 (count at:(to))) (if (or (= 1 (value Player Mover)) (and (!= 1 (value Player Mover)) (not (is In (to) (sites ""SquaresHoles""))))) (and {(moveAgain) (set Var ""Replay"" (to)) (set Var ""Direction"" 1)}) (set Var ""Direction"" 0)))) (if (< 1 (count at:(to))) (if (or (= 1 (value Player Mover)) (and (!= 1 (value Player Mover)) (not (is In (to) (sites ""SquaresHoles""))))) (and {(moveAgain) (set Var ""Replay"" (to)) (set Var ""Direction"" 1)}) (set Var ""Direction"" 0))))))) (move Select (from (if (!= (value Player Mover) 1) (sites Mover) (difference (sites Mover) (sites ""SquaresHoles""))) if:(is Occupied (from))) (then (sow ""TrackCCW"" owner:(mover) apply:(if (is In (to) (sites Mover ""Inner"")) (if (is Occupied (if (is Mover P1) (+ (to) 8) (- (to) 8))) (and {(moveAgain) (set Pending) (if (is In (to) (expand (sites Right))) (set Var ""Side"" 2) (if (is In (to) (expand (sites Left))) (set Var ""Side"" 1) (set Var ""Side"" 0)))}) (if (< 1 (count at:(to))) (if (or (= 1 (value Player Mover)) (and (!= 1 (value Player Mover)) (not (is In (to) (sites ""SquaresHoles""))))) (and {(moveAgain) (set Var ""Replay"" (to)) (set Var ""Direction"" 2)}) (set Var ""Direction"" 0)))) (if (< 1 (count at:(to))) (if (or (= 1 (value Player Mover)) (and (!= 1 (value Player Mover)) (not (is In (to) (sites ""SquaresHoles""))))) (and {(moveAgain) (set Var ""Replay"" (to)) (set Var ""Direction"" 2)}) (set Var ""Direction"" 0))))))))})))) (end (forEach Player if:(all Sites (sites Player ""Inner"") if:(= 0 (count at:(site)))) (result Player Loss)))))","###Description -4x8 board. The fourth hole from the right in the inner rows of each player is larger and square. Total of 64 counters. Starting position: in the inner row, the first four holes, number of counters from the right: 0; 2; 2; 6. Play begins with each player alternately introducing the remaining counters in their holes. Each is introduced in such a way as to capture an opponent's counters, by placing it into an occupied hole which is opposite one of the opponent's occupied inner-row holes. The opponent's counters are then captured and sown along the inner row from either the leftmost or rightmost hole. If the capture occurs in the rightmost or leftmost holes in the inner row, or the hole immediately adjacent to them in the inner row, the counters must be sown from the leftmost or rightmost hole (whichever is closest), and sown along the inner row. Captures on these subsequent sowings happen according to the same rules as in the second phase, with certain exceptions explained below. If no capture is available, a counter may be placed in any occupied hole in the inner hole except the square hole, and sows them in either direction. If the square hole is the only occupied hole in the inner row, the counter is placed there and the player sows only two seeds from it in either direction. If a loaded square hole is reduced to six counters, the player places a counter there and sows the entire contents, forfeiting the special status for this hole for the rest of the game. Moves that start without a capture on the first sowing which end in the square hole stops there without further sowing. Sowing cannot start from a square hole except to capture, except as described above. If a sowing from an initial capturing move ends in an occupied square hole and no capture is possible, the player may choose to stop there or continue to sow. Once the contents of this hole have been relayed or captured the square hole loses its special status and the player may not introduce a counter into hole with one counter if there are other holes in the inner row containing multiple counters. Once all of the counters are introduced, second phase starts. Players move by sowing seeds from a player's holes. Sowing can happen in any direction, but must continue in that direction throughout the turn except in the special cases below. When the final counter of a sowing lands in a hole in the inner row and there are counters in the opponent's hole in the inner row opposite, these are captured. The captured counters are placed in the leftmost or rightmost hole of the inner row and sown along the inner row. The leftmost or rightmost hole is chosen based on which continues the sowing direction of the move that made the capture. If the capture occurs in the rightmost or leftmost holes in the inner row, or the hole immediately adjacent to them in the inner row, the counters must be sown from the leftmost or rightmost hole (whichever is closest), and sown along the inner row, even if this incurs a change of direction. If the final counter lands in an occupied hole and a capture is not possible, the counters are picked up and sowing continues. If the final counter lands in an empty hole, the turn ends. A player must make a capturing move on their initial sowing if it is available. If a capturing move is not possible on the first sowing, no captures can be made on subsequent sowings in that turn. The game is won when the opponent's inner row is cleared of counters. - -###Ludii -(game ""Bao Kiswahili (East Africa)"" (players 2) (equipment {(mancalaBoard 4 8 store:None {(track ""TrackCCW1"" ""0,E,N1,W"" loop:True P1) (track ""TrackCCW2"" ""16,E,N1,W"" loop:True P2) (track ""TrackCW1"" ""7,W,N1,E"" loop:True P1) (track ""TrackCW2"" ""23,W,N1,E"" loop:True P2)}) (piece ""Seed"" Shared) (hand Each) (regions ""Home"" P1 (expand (sites Bottom))) (regions ""Home"" P2 (expand (sites Top))) (regions ""Inner"" P1 (sites Row 1)) (regions ""Inner"" P2 (sites Row 2)) (regions ""SquaresHoles"" (sites {12 19})) (map ""LeftMostInner"" {(pair P1 8) (pair P2 23)}) (map ""RightMostInner"" {(pair P1 15) (pair P2 16)}) (map ""AdjacentLeftMostInner"" {(pair P1 9) (pair P2 22)}) (map ""AdjacentRightMostInner"" {(pair P1 14) (pair P2 17)})}) (rules (start {(set Count 22 at:(handSite P1)) (set Count 22 at:(handSite P2)) (set Count 2 to:(sites {""G2"" ""F2"" ""B3"" ""C3""})) (set Count 6 to:(sites {""E2"" ""D3""}))}) (play (if (is Prev Mover) (if (is Pending) (or (if (or (= 1 (var ""Side"")) (= 0 (var ""Side""))) (do (fromTo (from (if (is Mover P1) (+ (last To afterConsequence:True) 8) (- (last To afterConsequence:True) 8))) (to (mapEntry ""LeftMostInner"" Mover)) count:(count at:(if (is Mover P1) (+ (last To afterConsequence:True) 8) (- (last To afterConsequence:True) 8)))) next:(move Select (from (mapEntry ""LeftMostInner"" Mover)) (then (sow count:(if (!= (value Player Mover) 1) (if (is In (last From) (sites ""SquaresHoles"")) (if (<= (count at:(last From)) 6) (count at:(last From)) (min 2 (count at:(last From)))) (count at:(last From))) (count at:(last From))) ""TrackCW"" owner:(mover) apply:(if (is In (to) (sites Mover ""Inner"")) (if (is Occupied (if (is Mover P1) (+ (to) 8) (- (to) 8))) (and {(moveAgain) (set Pending) (if (is In (to) (expand (sites Right))) (set Var ""Side"" 2) (if (is In (to) (expand (sites Left))) (set Var ""Side"" 1) (set Var ""Side"" 0)))}) (if (< 1 (count at:(to))) (if (or (= 1 (value Player Mover)) (and (!= 1 (value Player Mover)) (not (is In (to) (sites ""SquaresHoles""))))) (and {(moveAgain) (set Var ""Replay"" (to)) (set Var ""Direction"" 1)}) (set Var ""Direction"" 0)))) (if (< 1 (count at:(to))) (if (or (= 1 (value Player Mover)) (and (!= 1 (value Player Mover)) (not (is In (to) (sites ""SquaresHoles""))))) (and {(moveAgain) (set Var ""Replay"" (to)) (set Var ""Direction"" 1)}) (set Var ""Direction"" 0)))) (then (if (and {(!= 1 (value Player Mover)) (is In (last From) (sites ""SquaresHoles"")) (< (count at:(last From)) 6)}) (set Value Mover 1)))))))) (if (or (= 2 (var ""Side"")) (= 0 (var ""Side""))) (do (fromTo (from (if (is Mover P1) (+ (last To afterConsequence:True) 8) (- (last To afterConsequence:True) 8))) (to (mapEntry ""RightMostInner"" Mover)) count:(count at:(if (is Mover P1) (+ (last To afterConsequence:True) 8) (- (last To afterConsequence:True) 8)))) next:(move Select (from (mapEntry ""RightMostInner"" Mover)) (then (sow count:(if (!= (value Player Mover) 1) (if (is In (last From) (sites ""SquaresHoles"")) (if (<= (count at:(last From)) 6) (count at:(last From)) (min 2 (count at:(last From)))) (count at:(last From))) (count at:(last From))) ""TrackCCW"" owner:(mover) apply:(if (is In (to) (sites Mover ""Inner"")) (if (is Occupied (if (is Mover P1) (+ (to) 8) (- (to) 8))) (and {(moveAgain) (set Pending) (if (is In (to) (expand (sites Right))) (set Var ""Side"" 2) (if (is In (to) (expand (sites Left))) (set Var ""Side"" 1) (set Var ""Side"" 0)))}) (if (< 1 (count at:(to))) (if (or (= 1 (value Player Mover)) (and (!= 1 (value Player Mover)) (not (is In (to) (sites ""SquaresHoles""))))) (and {(moveAgain) (set Var ""Replay"" (to)) (set Var ""Direction"" 2)}) (set Var ""Direction"" 0)))) (if (< 1 (count at:(to))) (if (or (= 1 (value Player Mover)) (and (!= 1 (value Player Mover)) (not (is In (to) (sites ""SquaresHoles""))))) (and {(moveAgain) (set Var ""Replay"" (to)) (set Var ""Direction"" 2)}) (set Var ""Direction"" 0)))) (then (if (and {(!= 1 (value Player Mover)) (is In (last From) (sites ""SquaresHoles"")) (< (count at:(last From)) 6)}) (set Value Mover 1))))))))) (or (if (or (= (var ""Direction"") 1) (= (var ""Direction"") 3)) (move Select (from (var ""Replay"")) (then (sow count:(if (!= (value Player Mover) 1) (if (is In (last From) (sites ""SquaresHoles"")) (if (<= (count at:(last From)) 6) (count at:(last From)) (min 2 (count at:(last From)))) (count at:(last From))) (count at:(last From))) ""TrackCW"" owner:(mover) apply:(if (is In (to) (sites Mover ""Inner"")) (if (is Occupied (if (is Mover P1) (+ (to) 8) (- (to) 8))) (and {(moveAgain) (set Pending) (if (is In (to) (expand (sites Right))) (set Var ""Side"" 2) (if (is In (to) (expand (sites Left))) (set Var ""Side"" 1) (set Var ""Side"" 0)))}) (if (< 1 (count at:(to))) (if (or (= 1 (value Player Mover)) (and (!= 1 (value Player Mover)) (not (is In (to) (sites ""SquaresHoles""))))) (and {(moveAgain) (set Var ""Replay"" (to)) (set Var ""Direction"" 1)}) (set Var ""Direction"" 0)))) (if (< 1 (count at:(to))) (if (or (= 1 (value Player Mover)) (and (!= 1 (value Player Mover)) (not (is In (to) (sites ""SquaresHoles""))))) (and {(moveAgain) (set Var ""Replay"" (to)) (set Var ""Direction"" 1)}) (set Var ""Direction"" 0)))) (then (if (and {(!= 1 (value Player Mover)) (is In (last From) (sites ""SquaresHoles"")) (< (count at:(last From)) 6)}) (set Value Mover 1))))))) (if (or (= (var ""Direction"") 2) (= (var ""Direction"") 3)) (move Select (from (var ""Replay"")) (then (sow count:(if (!= (value Player Mover) 1) (if (is In (last From) (sites ""SquaresHoles"")) (if (<= (count at:(last From)) 6) (count at:(last From)) (min 2 (count at:(last From)))) (count at:(last From))) (count at:(last From))) ""TrackCCW"" owner:(mover) apply:(if (is In (to) (sites Mover ""Inner"")) (if (is Occupied (if (is Mover P1) (+ (to) 8) (- (to) 8))) (and {(moveAgain) (set Pending) (if (is In (to) (expand (sites Right))) (set Var ""Side"" 2) (if (is In (to) (expand (sites Left))) (set Var ""Side"" 1) (set Var ""Side"" 0)))}) (if (< 1 (count at:(to))) (if (or (= 1 (value Player Mover)) (and (!= 1 (value Player Mover)) (not (is In (to) (sites ""SquaresHoles""))))) (and {(moveAgain) (set Var ""Replay"" (to)) (set Var ""Direction"" 2)}) (set Var ""Direction"" 0)))) (if (< 1 (count at:(to))) (if (or (= 1 (value Player Mover)) (and (!= 1 (value Player Mover)) (not (is In (to) (sites ""SquaresHoles""))))) (and {(moveAgain) (set Var ""Replay"" (to)) (set Var ""Direction"" 2)}) (set Var ""Direction"" 0)))) (then (if (and {(!= 1 (value Player Mover)) (is In (last From) (sites ""SquaresHoles"")) (< (count at:(last From)) 6)}) (set Value Mover 1))))))))) (if (is Occupied (handSite Mover)) (priority {(move (from (handSite Mover)) (to (sites Mover ""Inner"") if:(is Occupied (if (is Mover P1) (+ (to) 8) (- (to) 8)))) count:1 (then (and {(moveAgain) (set Pending) (if (is In (last To) (expand (sites Right))) (set Var ""Side"" 2) (if (is In (last To) (expand (sites Left))) (set Var ""Side"" 1) (set Var ""Side"" 0)))}))) (if (!= (value Player Mover) 1) (move (from (handSite Mover)) (to (difference (sites Mover ""Inner"") (sites ""SquaresHoles"")) if:(is Occupied (to))) count:1 (then (and {(moveAgain) (set Var ""Replay"" (last To)) (set Var ""Direction"" 3)}))) (move (from (handSite Mover)) (to (sites Mover ""Inner"") if:(is Occupied (to))) count:1 (then (and {(moveAgain) (set Var ""Replay"" (last To)) (set Var ""Direction"" 3)})))) (if (!= (value Player Mover) 1) (move (from (handSite Mover)) (to (sites ""SquaresHoles"") if:(is Occupied (to))) count:1 (then (and {(moveAgain) (set Var ""Replay"" (last To)) (set Var ""Direction"" 3)}))))}) (priority {(or (move Select (from (sites Mover) if:(and (is Occupied (from)) (is Occupied (if (is Mover P1) (+ (trackSite Move from:(from) ""TrackCW"" steps:(count at:(from))) 8) (- (trackSite Move from:(from) ""TrackCW"" steps:(count at:(from))) 8))))) (then (sow ""TrackCW"" owner:(mover) apply:(if (is In (to) (sites Mover ""Inner"")) (if (is Occupied (if (is Mover P1) (+ (to) 8) (- (to) 8))) (and {(moveAgain) (set Pending) (if (is In (to) (expand (sites Right))) (set Var ""Side"" 2) (if (is In (to) (expand (sites Left))) (set Var ""Side"" 1) (set Var ""Side"" 0)))}) (if (< 1 (count at:(to))) (if (or (= 1 (value Player Mover)) (and (!= 1 (value Player Mover)) (not (is In (to) (sites ""SquaresHoles""))))) (and {(moveAgain) (set Var ""Replay"" (to)) (set Var ""Direction"" 1)}) (set Var ""Direction"" 0)))) (if (< 1 (count at:(to))) (if (or (= 1 (value Player Mover)) (and (!= 1 (value Player Mover)) (not (is In (to) (sites ""SquaresHoles""))))) (and {(moveAgain) (set Var ""Replay"" (to)) (set Var ""Direction"" 1)}) (set Var ""Direction"" 0))))))) (move Select (from (sites Mover) if:(and (is Occupied (from)) (is Occupied (if (is Mover P1) (+ (trackSite Move from:(from) ""TrackCCW"" steps:(count at:(from))) 8) (- (trackSite Move from:(from) ""TrackCCW"" steps:(count at:(from))) 8))))) (then (sow ""TrackCCW"" owner:(mover) apply:(if (is In (to) (sites Mover ""Inner"")) (if (is Occupied (if (is Mover P1) (+ (to) 8) (- (to) 8))) (and {(moveAgain) (set Pending) (if (is In (to) (expand (sites Right))) (set Var ""Side"" 2) (if (is In (to) (expand (sites Left))) (set Var ""Side"" 1) (set Var ""Side"" 0)))}) (if (< 1 (count at:(to))) (if (or (= 1 (value Player Mover)) (and (!= 1 (value Player Mover)) (not (is In (to) (sites ""SquaresHoles""))))) (and {(moveAgain) (set Var ""Replay"" (to)) (set Var ""Direction"" 2)}) (set Var ""Direction"" 0)))) (if (< 1 (count at:(to))) (if (or (= 1 (value Player Mover)) (and (!= 1 (value Player Mover)) (not (is In (to) (sites ""SquaresHoles""))))) (and {(moveAgain) (set Var ""Replay"" (to)) (set Var ""Direction"" 2)}) (set Var ""Direction"" 0)))))))) (or (move Select (from (if (!= (value Player Mover) 1) (sites Mover) (difference (sites Mover) (sites ""SquaresHoles""))) if:(is Occupied (from))) (then (sow ""TrackCW"" owner:(mover) apply:(if (is In (to) (sites Mover ""Inner"")) (if (is Occupied (if (is Mover P1) (+ (to) 8) (- (to) 8))) (and {(moveAgain) (set Pending) (if (is In (to) (expand (sites Right))) (set Var ""Side"" 2) (if (is In (to) (expand (sites Left))) (set Var ""Side"" 1) (set Var ""Side"" 0)))}) (if (< 1 (count at:(to))) (if (or (= 1 (value Player Mover)) (and (!= 1 (value Player Mover)) (not (is In (to) (sites ""SquaresHoles""))))) (and {(moveAgain) (set Var ""Replay"" (to)) (set Var ""Direction"" 1)}) (set Var ""Direction"" 0)))) (if (< 1 (count at:(to))) (if (or (= 1 (value Player Mover)) (and (!= 1 (value Player Mover)) (not (is In (to) (sites ""SquaresHoles""))))) (and {(moveAgain) (set Var ""Replay"" (to)) (set Var ""Direction"" 1)}) (set Var ""Direction"" 0))))))) (move Select (from (if (!= (value Player Mover) 1) (sites Mover) (difference (sites Mover) (sites ""SquaresHoles""))) if:(is Occupied (from))) (then (sow ""TrackCCW"" owner:(mover) apply:(if (is In (to) (sites Mover ""Inner"")) (if (is Occupied (if (is Mover P1) (+ (to) 8) (- (to) 8))) (and {(moveAgain) (set Pending) (if (is In (to) (expand (sites Right))) (set Var ""Side"" 2) (if (is In (to) (expand (sites Left))) (set Var ""Side"" 1) (set Var ""Side"" 0)))}) (if (< 1 (count at:(to))) (if (or (= 1 (value Player Mover)) (and (!= 1 (value Player Mover)) (not (is In (to) (sites ""SquaresHoles""))))) (and {(moveAgain) (set Var ""Replay"" (to)) (set Var ""Direction"" 2)}) (set Var ""Direction"" 0)))) (if (< 1 (count at:(to))) (if (or (= 1 (value Player Mover)) (and (!= 1 (value Player Mover)) (not (is In (to) (sites ""SquaresHoles""))))) (and {(moveAgain) (set Var ""Replay"" (to)) (set Var ""Direction"" 2)}) (set Var ""Direction"" 0))))))))})))) (end (forEach Player if:(all Sites (sites Player ""Inner"") if:(= 0 (count at:(site)))) (result Player Loss)))))" -"4x8 board. One hole, the Nyumba, is square, and is the hole immediately to the right of center in the player's inner row. The holes on both ends of both players' inner rows are Kichwa, and the next holes in from those are the Kimbi. Players sow from one of their holes in either direction on the board. When the final counter lands in an occupied hole, these counters are picked up and sowing continues, when a capture is not possible. When the final counter lands in an empty hole, the turn ends. Play begins with six counters in the Nyumba, two in each of the holes to its right, and 22 counters to be entered on the board. Namua is the stage of the game where there are still counters to be placed on the board. During Namua, the Nyumba is the house, as long as it has at least six counters in it and it has not been emptied. Players place counters into an occupied hole in their front row. If this hole is opposite one of the opponent's occupied holes, the opponent's counters in that hole are captured. Captures must be made if possible. If a capture is not possible, the counter is placed into a hole and the contents of that hole are sown. The house cannot be emptied, but if it is the only occupied hole, the counter placed into it, and only that one counter, can be sown to one of the adjacent holes. Sowing from a Kichwa in the direction of the back row is not allowed unless it is the only occupied hole in the front row. Players cannot place a counter in holes with single counters unless only holes in the front row with single counters exist or the house is still present. If the final counter of a sowing lands in the house, the turn ends. Once all of the counters are placed on the board for both players, Namua ends. The next stage begins. The rules for the house mentioned above during the Namua stage no longer apply, but the rules below remain in effect until the first capture in this phase of the game has been made. Players alternate turns taking the counters from one of their holes that has more than one and less than sixteen counters and sowing them. When the final counter lands in an occupied hole in the front row opposite one of the opponent's occupied holes, the opponent's counters are captured, unless the hole from which sowing began contained sixteen or more counters. Captures must be made if possible. Single counters cannot be sown. Sowing must occur from an inner row hole when possible. A Kichwa cannot be sown toward the back row if it is the only occupied hole in the front row. Capturing rules: The counters captured from the opponent's hole are captured and sown on the player's front row. If they were captured from a Kimbi or Kichwa, they must be sown from the nearest Kichwa. If they were not captured from one of these holes, they must be sown from the Kichwa in the direction toward which the sowing was proceeding when the capture was made. If the capture was not made from a Kimbi or Kichwa and it was not made while sowing, the player can choose which Kichwa to sow from. Further captures in the same turn must be made with this sowing if possible, and are made if the final counter lands in an occupied hole in the inner row which is opposite an occupied hole in the opponent's inner row. If a capture is not possible, the sowing must end in the house. When the final counter lands in the house, the player may choose to continue sowing from the house or to end their turn. If the player cannot capture and cannot drop the final counter in the house, they must sow into an occupied hole, and continue sowing from that hole. The player may sow such that the final counter lands in an empty hole only when none of the other options are possible. When a player sows in such a way that they do not capture and the opponent is unable to capture on their next turn but the player will be able to capture on their own following move, the opponent cannot sow from this hole. The opponent is able to sow from such a hole if they can capture from this hole; if the hole in question is the house (this remains true for all phases of the game); if it is the only occupied hole in the front row; or if it is the only hole in the front row with greater than one counter. This rule does not apply during the Namua phase. A player wins when their opponent's inner row holes are empty. This includes in the middle of sowing (e.g., sowing into the outer row directly from a Kichwa when it is the only occupied hole in the front row). A player may also lose if they only have single counters in their holes.","(game ""Bao"" (players 2) (equipment {(mancalaBoard 4 8 store:None {(track ""TrackCCW1"" ""0,E,N1,W"" loop:True P1) (track ""TrackCCW2"" ""16,E,N1,W"" loop:True P2) (track ""TrackCW1"" ""7,W,N1,E"" loop:True P1) (track ""TrackCW2"" ""23,W,N1,E"" loop:True P2)}) (piece ""Seed"" Shared) (hand Each) (regions ""Home"" P1 (expand (sites Bottom))) (regions ""Home"" P2 (expand (sites Top))) (regions ""Inner"" P1 (sites Row 1)) (regions ""Inner"" P2 (sites Row 2)) (regions ""SquaresHoles"" (sites {19 12})) (regions ""RightSquare"" (sites {18 13})) (map ""LeftMostInner"" {(pair P1 8) (pair P2 23)}) (map ""RightMostInner"" {(pair P1 15) (pair P2 16)}) (map ""AdjacentLeftMostInner"" {(pair P1 9) (pair P2 22)}) (map ""AdjacentRightMostInner"" {(pair P1 14) (pair P2 17)})}) (rules (start {(set Count 22 at:(handSite P1)) (set Count 22 at:(handSite P2)) (set Count 6 to:(sites ""SquaresHoles"")) (set Count 2 to:(sites ""RightSquare""))}) (play (if (is Prev Mover) (if (is Pending) (or (if (or (= 1 (var ""Side"")) (= 0 (var ""Side""))) (do (fromTo (from (if (is Mover P1) (+ (last To afterConsequence:True) 8) (- (last To afterConsequence:True) 8))) (to (mapEntry ""LeftMostInner"" Mover)) count:(count at:(if (is Mover P1) (+ (last To afterConsequence:True) 8) (- (last To afterConsequence:True) 8)))) next:(move Select (from (mapEntry ""LeftMostInner"" Mover)) (then (sow count:(if (!= (value Player Mover) 1) (if (is In (last From) (sites ""SquaresHoles"")) (if (<= (count at:(from)) 6) (count at:(last From)) (min 1 (count at:(last From)))) (count at:(last From))) (count at:(last From))) ""TrackCW"" owner:(mover) apply:(if (is In (to) (sites Mover ""Inner"")) (if (is Occupied (if (is Mover P1) (+ (to) 8) (- (to) 8))) (and {(moveAgain) (set Pending) (if (is In (to) (expand (sites Right))) (set Var ""Side"" 2) (if (is In (to) (expand (sites Left))) (set Var ""Side"" 1) (set Var ""Side"" 0)))}) (if (< 1 (count at:(to))) (if (or (= 1 (value Player Mover)) (and (!= 1 (value Player Mover)) (not (is In (to) (sites ""SquaresHoles""))))) (and {(moveAgain) (set Var ""Replay"" (to)) (set Var ""Direction"" 1)}) (set Var ""Direction"" 0)))) (if (< 1 (count at:(to))) (if (or (= 1 (value Player Mover)) (and (!= 1 (value Player Mover)) (not (is In (to) (sites ""SquaresHoles""))))) (and {(moveAgain) (set Var ""Replay"" (to)) (set Var ""Direction"" 1)}) (set Var ""Direction"" 0)))) (then (if (and {(!= 1 (value Player Mover)) (is In (last From) (sites ""SquaresHoles"")) (< (count at:(last From)) 6)}) (set Value Mover 1)))))))) (if (or (= 2 (var ""Side"")) (= 0 (var ""Side""))) (do (fromTo (from (if (is Mover P1) (+ (last To afterConsequence:True) 8) (- (last To afterConsequence:True) 8))) (to (mapEntry ""RightMostInner"" Mover)) count:(count at:(if (is Mover P1) (+ (last To afterConsequence:True) 8) (- (last To afterConsequence:True) 8)))) next:(move Select (from (mapEntry ""RightMostInner"" Mover)) (then (sow count:(if (!= (value Player Mover) 1) (if (is In (last From) (sites ""SquaresHoles"")) (if (<= (count at:(from)) 6) (count at:(last From)) (min 1 (count at:(last From)))) (count at:(last From))) (count at:(last From))) ""TrackCCW"" owner:(mover) apply:(if (is In (to) (sites Mover ""Inner"")) (if (is Occupied (if (is Mover P1) (+ (to) 8) (- (to) 8))) (and {(moveAgain) (set Pending) (if (is In (to) (expand (sites Right))) (set Var ""Side"" 2) (if (is In (to) (expand (sites Left))) (set Var ""Side"" 1) (set Var ""Side"" 0)))}) (if (< 1 (count at:(to))) (if (or (= 1 (value Player Mover)) (and (!= 1 (value Player Mover)) (not (is In (to) (sites ""SquaresHoles""))))) (and {(moveAgain) (set Var ""Replay"" (to)) (set Var ""Direction"" 2)}) (set Var ""Direction"" 0)))) (if (< 1 (count at:(to))) (if (or (= 1 (value Player Mover)) (and (!= 1 (value Player Mover)) (not (is In (to) (sites ""SquaresHoles""))))) (and {(moveAgain) (set Var ""Replay"" (to)) (set Var ""Direction"" 2)}) (set Var ""Direction"" 0)))) (then (if (and {(!= 1 (value Player Mover)) (is In (last From) (sites ""SquaresHoles"")) (< (count at:(last From)) 6)}) (set Value Mover 1))))))))) (or (if (and (if (!= (var ""Replay"") (mapEntry ""RightMostInner"" Mover)) True (all Sites (difference (sites Mover ""Inner"") (mapEntry ""RightMostInner"" Mover)) if:(is Empty (site)))) (or (= (var ""Direction"") 1) (= (var ""Direction"") 3))) (move Select (from (var ""Replay"")) (then (sow count:(if (!= (value Player Mover) 1) (if (is In (last From) (sites ""SquaresHoles"")) (if (<= (count at:(from)) 6) (count at:(last From)) (min 1 (count at:(last From)))) (count at:(last From))) (count at:(last From))) ""TrackCW"" owner:(mover) apply:(if (is In (to) (sites Mover ""Inner"")) (if (is Occupied (if (is Mover P1) (+ (to) 8) (- (to) 8))) (and {(moveAgain) (set Pending) (if (is In (to) (expand (sites Right))) (set Var ""Side"" 2) (if (is In (to) (expand (sites Left))) (set Var ""Side"" 1) (set Var ""Side"" 0)))}) (if (< 1 (count at:(to))) (if (or (= 1 (value Player Mover)) (and (!= 1 (value Player Mover)) (not (is In (to) (sites ""SquaresHoles""))))) (and {(moveAgain) (set Var ""Replay"" (to)) (set Var ""Direction"" 1)}) (set Var ""Direction"" 0)))) (if (< 1 (count at:(to))) (if (or (= 1 (value Player Mover)) (and (!= 1 (value Player Mover)) (not (is In (to) (sites ""SquaresHoles""))))) (and {(moveAgain) (set Var ""Replay"" (to)) (set Var ""Direction"" 1)}) (set Var ""Direction"" 0)))) (then (if (and {(!= 1 (value Player Mover)) (is In (last From) (sites ""SquaresHoles"")) (< (count at:(last From)) 6)}) (set Value Mover 1))))))) (if (and (if (!= (var ""Replay"") (mapEntry ""LeftMostInner"" Mover)) True (all Sites (difference (sites Mover ""Inner"") (mapEntry ""LeftMostInner"" Mover)) if:(is Empty (site)))) (or (= (var ""Direction"") 2) (= (var ""Direction"") 3))) (move Select (from (var ""Replay"")) (then (sow count:(if (!= (value Player Mover) 1) (if (is In (last From) (sites ""SquaresHoles"")) (if (<= (count at:(from)) 6) (count at:(last From)) (min 1 (count at:(last From)))) (count at:(last From))) (count at:(last From))) ""TrackCCW"" owner:(mover) apply:(if (is In (to) (sites Mover ""Inner"")) (if (is Occupied (if (is Mover P1) (+ (to) 8) (- (to) 8))) (and {(moveAgain) (set Pending) (if (is In (to) (expand (sites Right))) (set Var ""Side"" 2) (if (is In (to) (expand (sites Left))) (set Var ""Side"" 1) (set Var ""Side"" 0)))}) (if (< 1 (count at:(to))) (if (or (= 1 (value Player Mover)) (and (!= 1 (value Player Mover)) (not (is In (to) (sites ""SquaresHoles""))))) (and {(moveAgain) (set Var ""Replay"" (to)) (set Var ""Direction"" 2)}) (set Var ""Direction"" 0)))) (if (< 1 (count at:(to))) (if (or (= 1 (value Player Mover)) (and (!= 1 (value Player Mover)) (not (is In (to) (sites ""SquaresHoles""))))) (and {(moveAgain) (set Var ""Replay"" (to)) (set Var ""Direction"" 2)}) (set Var ""Direction"" 0)))) (then (if (and {(!= 1 (value Player Mover)) (is In (last From) (sites ""SquaresHoles"")) (< (count at:(last From)) 6)}) (set Value Mover 1))))))))) (if (is Occupied (handSite Mover)) (priority {(move (from (handSite Mover)) (to (sites Mover ""Inner"") if:(and (is Occupied (to)) (is Occupied (if (is Mover P1) (+ (to) 8) (- (to) 8))))) count:1 (then (and {(moveAgain) (set Pending) (if (is In (last To) (expand (sites Right))) (set Var ""Side"" 2) (if (is In (last To) (expand (sites Left))) (set Var ""Side"" 1) (set Var ""Side"" 0)))}))) (if (!= (value Player Mover) 1) (move (from (handSite Mover)) (to (difference (sites Mover ""Inner"") (sites ""SquaresHoles"")) if:(is Occupied (to))) count:1 (then (and {(moveAgain) (set Var ""Replay"" (last To)) (set Var ""Direction"" 3)}))) (move (from (handSite Mover)) (to (sites Mover ""Inner"") if:(is Occupied (to))) count:1 (then (and {(moveAgain) (set Var ""Replay"" (last To)) (set Var ""Direction"" 3)})))) (if (!= (value Player Mover) 1) (move (from (handSite Mover)) (to (intersection (sites ""SquaresHoles"") (sites Mover ""Inner"")) if:(is Occupied (to))) count:1 (then (and {(moveAgain) (set Var ""Replay"" (last To)) (set Var ""Direction"" 3)}))))}) (priority {(or (move Select (from (sites Mover) if:(and (or (< 1 (count at:(from))) (> 16 (count at:(from)))) (is Occupied (if (is Mover P1) (+ (trackSite Move from:(from) ""TrackCW"" steps:(count at:(from))) 8) (- (trackSite Move from:(from) ""TrackCW"" steps:(count at:(from))) 8))))) (then (sow ""TrackCW"" owner:(mover) apply:(if (is In (to) (sites Mover ""Inner"")) (if (is Occupied (if (is Mover P1) (+ (to) 8) (- (to) 8))) (and {(moveAgain) (set Pending) (if (is In (to) (expand (sites Right))) (set Var ""Side"" 2) (if (is In (to) (expand (sites Left))) (set Var ""Side"" 1) (set Var ""Side"" 0)))}) (if (< 1 (count at:(to))) (if (or (= 1 (value Player Mover)) (and (!= 1 (value Player Mover)) (not (is In (to) (sites ""SquaresHoles""))))) (and {(moveAgain) (set Var ""Replay"" (to)) (set Var ""Direction"" 1)}) (set Var ""Direction"" 0)))) (if (< 1 (count at:(to))) (if (or (= 1 (value Player Mover)) (and (!= 1 (value Player Mover)) (not (is In (to) (sites ""SquaresHoles""))))) (and {(moveAgain) (set Var ""Replay"" (to)) (set Var ""Direction"" 1)}) (set Var ""Direction"" 0))))))) (move Select (from (sites Mover) if:(and (or (< 1 (count at:(from))) (> 16 (count at:(from)))) (is Occupied (if (is Mover P1) (+ (trackSite Move from:(from) ""TrackCCW"" steps:(count at:(from))) 8) (- (trackSite Move from:(from) ""TrackCCW"" steps:(count at:(from))) 8))))) (then (sow ""TrackCCW"" owner:(mover) apply:(if (is In (to) (sites Mover ""Inner"")) (if (is Occupied (if (is Mover P1) (+ (to) 8) (- (to) 8))) (and {(moveAgain) (set Pending) (if (is In (to) (expand (sites Right))) (set Var ""Side"" 2) (if (is In (to) (expand (sites Left))) (set Var ""Side"" 1) (set Var ""Side"" 0)))}) (if (< 1 (count at:(to))) (if (or (= 1 (value Player Mover)) (and (!= 1 (value Player Mover)) (not (is In (to) (sites ""SquaresHoles""))))) (and {(moveAgain) (set Var ""Replay"" (to)) (set Var ""Direction"" 2)}) (set Var ""Direction"" 0)))) (if (< 1 (count at:(to))) (if (or (= 1 (value Player Mover)) (and (!= 1 (value Player Mover)) (not (is In (to) (sites ""SquaresHoles""))))) (and {(moveAgain) (set Var ""Replay"" (to)) (set Var ""Direction"" 2)}) (set Var ""Direction"" 0)))))))) (or (move Select (from (if (!= (value Player Mover) 1) (sites Mover) (difference (sites Mover) (sites ""SquaresHoles""))) if:(or (< 1 (count at:(from))) (> 16 (count at:(from))))) (then (sow ""TrackCW"" owner:(mover) apply:(if (is In (to) (sites Mover ""Inner"")) (if (is Occupied (if (is Mover P1) (+ (to) 8) (- (to) 8))) (and {(moveAgain) (set Pending) (if (is In (to) (expand (sites Right))) (set Var ""Side"" 2) (if (is In (to) (expand (sites Left))) (set Var ""Side"" 1) (set Var ""Side"" 0)))}) (if (< 1 (count at:(to))) (if (or (= 1 (value Player Mover)) (and (!= 1 (value Player Mover)) (not (is In (to) (sites ""SquaresHoles""))))) (and {(moveAgain) (set Var ""Replay"" (to)) (set Var ""Direction"" 1)}) (set Var ""Direction"" 0)))) (if (< 1 (count at:(to))) (if (or (= 1 (value Player Mover)) (and (!= 1 (value Player Mover)) (not (is In (to) (sites ""SquaresHoles""))))) (and {(moveAgain) (set Var ""Replay"" (to)) (set Var ""Direction"" 1)}) (set Var ""Direction"" 0))))))) (move Select (from (if (!= (value Player Mover) 1) (sites Mover) (difference (sites Mover) (sites ""SquaresHoles""))) if:(or (< 1 (count at:(from))) (> 16 (count at:(from))))) (then (sow ""TrackCCW"" owner:(mover) apply:(if (is In (to) (sites Mover ""Inner"")) (if (is Occupied (if (is Mover P1) (+ (to) 8) (- (to) 8))) (and {(moveAgain) (set Pending) (if (is In (to) (expand (sites Right))) (set Var ""Side"" 2) (if (is In (to) (expand (sites Left))) (set Var ""Side"" 1) (set Var ""Side"" 0)))}) (if (< 1 (count at:(to))) (if (or (= 1 (value Player Mover)) (and (!= 1 (value Player Mover)) (not (is In (to) (sites ""SquaresHoles""))))) (and {(moveAgain) (set Var ""Replay"" (to)) (set Var ""Direction"" 2)}) (set Var ""Direction"" 0)))) (if (< 1 (count at:(to))) (if (or (= 1 (value Player Mover)) (and (!= 1 (value Player Mover)) (not (is In (to) (sites ""SquaresHoles""))))) (and {(moveAgain) (set Var ""Replay"" (to)) (set Var ""Direction"" 2)}) (set Var ""Direction"" 0))))))))})))) (end (forEach Player if:(no Moves Player) (result Player Loss)))))","###Description -4x8 board. One hole, the Nyumba, is square, and is the hole immediately to the right of center in the player's inner row. The holes on both ends of both players' inner rows are Kichwa, and the next holes in from those are the Kimbi. Players sow from one of their holes in either direction on the board. When the final counter lands in an occupied hole, these counters are picked up and sowing continues, when a capture is not possible. When the final counter lands in an empty hole, the turn ends. Play begins with six counters in the Nyumba, two in each of the holes to its right, and 22 counters to be entered on the board. Namua is the stage of the game where there are still counters to be placed on the board. During Namua, the Nyumba is the house, as long as it has at least six counters in it and it has not been emptied. Players place counters into an occupied hole in their front row. If this hole is opposite one of the opponent's occupied holes, the opponent's counters in that hole are captured. Captures must be made if possible. If a capture is not possible, the counter is placed into a hole and the contents of that hole are sown. The house cannot be emptied, but if it is the only occupied hole, the counter placed into it, and only that one counter, can be sown to one of the adjacent holes. Sowing from a Kichwa in the direction of the back row is not allowed unless it is the only occupied hole in the front row. Players cannot place a counter in holes with single counters unless only holes in the front row with single counters exist or the house is still present. If the final counter of a sowing lands in the house, the turn ends. Once all of the counters are placed on the board for both players, Namua ends. The next stage begins. The rules for the house mentioned above during the Namua stage no longer apply, but the rules below remain in effect until the first capture in this phase of the game has been made. Players alternate turns taking the counters from one of their holes that has more than one and less than sixteen counters and sowing them. When the final counter lands in an occupied hole in the front row opposite one of the opponent's occupied holes, the opponent's counters are captured, unless the hole from which sowing began contained sixteen or more counters. Captures must be made if possible. Single counters cannot be sown. Sowing must occur from an inner row hole when possible. A Kichwa cannot be sown toward the back row if it is the only occupied hole in the front row. Capturing rules: The counters captured from the opponent's hole are captured and sown on the player's front row. If they were captured from a Kimbi or Kichwa, they must be sown from the nearest Kichwa. If they were not captured from one of these holes, they must be sown from the Kichwa in the direction toward which the sowing was proceeding when the capture was made. If the capture was not made from a Kimbi or Kichwa and it was not made while sowing, the player can choose which Kichwa to sow from. Further captures in the same turn must be made with this sowing if possible, and are made if the final counter lands in an occupied hole in the inner row which is opposite an occupied hole in the opponent's inner row. If a capture is not possible, the sowing must end in the house. When the final counter lands in the house, the player may choose to continue sowing from the house or to end their turn. If the player cannot capture and cannot drop the final counter in the house, they must sow into an occupied hole, and continue sowing from that hole. The player may sow such that the final counter lands in an empty hole only when none of the other options are possible. When a player sows in such a way that they do not capture and the opponent is unable to capture on their next turn but the player will be able to capture on their own following move, the opponent cannot sow from this hole. The opponent is able to sow from such a hole if they can capture from this hole; if the hole in question is the house (this remains true for all phases of the game); if it is the only occupied hole in the front row; or if it is the only hole in the front row with greater than one counter. This rule does not apply during the Namua phase. A player wins when their opponent's inner row holes are empty. This includes in the middle of sowing (e.g., sowing into the outer row directly from a Kichwa when it is the only occupied hole in the front row). A player may also lose if they only have single counters in their holes. - -###Ludii -(game ""Bao"" (players 2) (equipment {(mancalaBoard 4 8 store:None {(track ""TrackCCW1"" ""0,E,N1,W"" loop:True P1) (track ""TrackCCW2"" ""16,E,N1,W"" loop:True P2) (track ""TrackCW1"" ""7,W,N1,E"" loop:True P1) (track ""TrackCW2"" ""23,W,N1,E"" loop:True P2)}) (piece ""Seed"" Shared) (hand Each) (regions ""Home"" P1 (expand (sites Bottom))) (regions ""Home"" P2 (expand (sites Top))) (regions ""Inner"" P1 (sites Row 1)) (regions ""Inner"" P2 (sites Row 2)) (regions ""SquaresHoles"" (sites {19 12})) (regions ""RightSquare"" (sites {18 13})) (map ""LeftMostInner"" {(pair P1 8) (pair P2 23)}) (map ""RightMostInner"" {(pair P1 15) (pair P2 16)}) (map ""AdjacentLeftMostInner"" {(pair P1 9) (pair P2 22)}) (map ""AdjacentRightMostInner"" {(pair P1 14) (pair P2 17)})}) (rules (start {(set Count 22 at:(handSite P1)) (set Count 22 at:(handSite P2)) (set Count 6 to:(sites ""SquaresHoles"")) (set Count 2 to:(sites ""RightSquare""))}) (play (if (is Prev Mover) (if (is Pending) (or (if (or (= 1 (var ""Side"")) (= 0 (var ""Side""))) (do (fromTo (from (if (is Mover P1) (+ (last To afterConsequence:True) 8) (- (last To afterConsequence:True) 8))) (to (mapEntry ""LeftMostInner"" Mover)) count:(count at:(if (is Mover P1) (+ (last To afterConsequence:True) 8) (- (last To afterConsequence:True) 8)))) next:(move Select (from (mapEntry ""LeftMostInner"" Mover)) (then (sow count:(if (!= (value Player Mover) 1) (if (is In (last From) (sites ""SquaresHoles"")) (if (<= (count at:(from)) 6) (count at:(last From)) (min 1 (count at:(last From)))) (count at:(last From))) (count at:(last From))) ""TrackCW"" owner:(mover) apply:(if (is In (to) (sites Mover ""Inner"")) (if (is Occupied (if (is Mover P1) (+ (to) 8) (- (to) 8))) (and {(moveAgain) (set Pending) (if (is In (to) (expand (sites Right))) (set Var ""Side"" 2) (if (is In (to) (expand (sites Left))) (set Var ""Side"" 1) (set Var ""Side"" 0)))}) (if (< 1 (count at:(to))) (if (or (= 1 (value Player Mover)) (and (!= 1 (value Player Mover)) (not (is In (to) (sites ""SquaresHoles""))))) (and {(moveAgain) (set Var ""Replay"" (to)) (set Var ""Direction"" 1)}) (set Var ""Direction"" 0)))) (if (< 1 (count at:(to))) (if (or (= 1 (value Player Mover)) (and (!= 1 (value Player Mover)) (not (is In (to) (sites ""SquaresHoles""))))) (and {(moveAgain) (set Var ""Replay"" (to)) (set Var ""Direction"" 1)}) (set Var ""Direction"" 0)))) (then (if (and {(!= 1 (value Player Mover)) (is In (last From) (sites ""SquaresHoles"")) (< (count at:(last From)) 6)}) (set Value Mover 1)))))))) (if (or (= 2 (var ""Side"")) (= 0 (var ""Side""))) (do (fromTo (from (if (is Mover P1) (+ (last To afterConsequence:True) 8) (- (last To afterConsequence:True) 8))) (to (mapEntry ""RightMostInner"" Mover)) count:(count at:(if (is Mover P1) (+ (last To afterConsequence:True) 8) (- (last To afterConsequence:True) 8)))) next:(move Select (from (mapEntry ""RightMostInner"" Mover)) (then (sow count:(if (!= (value Player Mover) 1) (if (is In (last From) (sites ""SquaresHoles"")) (if (<= (count at:(from)) 6) (count at:(last From)) (min 1 (count at:(last From)))) (count at:(last From))) (count at:(last From))) ""TrackCCW"" owner:(mover) apply:(if (is In (to) (sites Mover ""Inner"")) (if (is Occupied (if (is Mover P1) (+ (to) 8) (- (to) 8))) (and {(moveAgain) (set Pending) (if (is In (to) (expand (sites Right))) (set Var ""Side"" 2) (if (is In (to) (expand (sites Left))) (set Var ""Side"" 1) (set Var ""Side"" 0)))}) (if (< 1 (count at:(to))) (if (or (= 1 (value Player Mover)) (and (!= 1 (value Player Mover)) (not (is In (to) (sites ""SquaresHoles""))))) (and {(moveAgain) (set Var ""Replay"" (to)) (set Var ""Direction"" 2)}) (set Var ""Direction"" 0)))) (if (< 1 (count at:(to))) (if (or (= 1 (value Player Mover)) (and (!= 1 (value Player Mover)) (not (is In (to) (sites ""SquaresHoles""))))) (and {(moveAgain) (set Var ""Replay"" (to)) (set Var ""Direction"" 2)}) (set Var ""Direction"" 0)))) (then (if (and {(!= 1 (value Player Mover)) (is In (last From) (sites ""SquaresHoles"")) (< (count at:(last From)) 6)}) (set Value Mover 1))))))))) (or (if (and (if (!= (var ""Replay"") (mapEntry ""RightMostInner"" Mover)) True (all Sites (difference (sites Mover ""Inner"") (mapEntry ""RightMostInner"" Mover)) if:(is Empty (site)))) (or (= (var ""Direction"") 1) (= (var ""Direction"") 3))) (move Select (from (var ""Replay"")) (then (sow count:(if (!= (value Player Mover) 1) (if (is In (last From) (sites ""SquaresHoles"")) (if (<= (count at:(from)) 6) (count at:(last From)) (min 1 (count at:(last From)))) (count at:(last From))) (count at:(last From))) ""TrackCW"" owner:(mover) apply:(if (is In (to) (sites Mover ""Inner"")) (if (is Occupied (if (is Mover P1) (+ (to) 8) (- (to) 8))) (and {(moveAgain) (set Pending) (if (is In (to) (expand (sites Right))) (set Var ""Side"" 2) (if (is In (to) (expand (sites Left))) (set Var ""Side"" 1) (set Var ""Side"" 0)))}) (if (< 1 (count at:(to))) (if (or (= 1 (value Player Mover)) (and (!= 1 (value Player Mover)) (not (is In (to) (sites ""SquaresHoles""))))) (and {(moveAgain) (set Var ""Replay"" (to)) (set Var ""Direction"" 1)}) (set Var ""Direction"" 0)))) (if (< 1 (count at:(to))) (if (or (= 1 (value Player Mover)) (and (!= 1 (value Player Mover)) (not (is In (to) (sites ""SquaresHoles""))))) (and {(moveAgain) (set Var ""Replay"" (to)) (set Var ""Direction"" 1)}) (set Var ""Direction"" 0)))) (then (if (and {(!= 1 (value Player Mover)) (is In (last From) (sites ""SquaresHoles"")) (< (count at:(last From)) 6)}) (set Value Mover 1))))))) (if (and (if (!= (var ""Replay"") (mapEntry ""LeftMostInner"" Mover)) True (all Sites (difference (sites Mover ""Inner"") (mapEntry ""LeftMostInner"" Mover)) if:(is Empty (site)))) (or (= (var ""Direction"") 2) (= (var ""Direction"") 3))) (move Select (from (var ""Replay"")) (then (sow count:(if (!= (value Player Mover) 1) (if (is In (last From) (sites ""SquaresHoles"")) (if (<= (count at:(from)) 6) (count at:(last From)) (min 1 (count at:(last From)))) (count at:(last From))) (count at:(last From))) ""TrackCCW"" owner:(mover) apply:(if (is In (to) (sites Mover ""Inner"")) (if (is Occupied (if (is Mover P1) (+ (to) 8) (- (to) 8))) (and {(moveAgain) (set Pending) (if (is In (to) (expand (sites Right))) (set Var ""Side"" 2) (if (is In (to) (expand (sites Left))) (set Var ""Side"" 1) (set Var ""Side"" 0)))}) (if (< 1 (count at:(to))) (if (or (= 1 (value Player Mover)) (and (!= 1 (value Player Mover)) (not (is In (to) (sites ""SquaresHoles""))))) (and {(moveAgain) (set Var ""Replay"" (to)) (set Var ""Direction"" 2)}) (set Var ""Direction"" 0)))) (if (< 1 (count at:(to))) (if (or (= 1 (value Player Mover)) (and (!= 1 (value Player Mover)) (not (is In (to) (sites ""SquaresHoles""))))) (and {(moveAgain) (set Var ""Replay"" (to)) (set Var ""Direction"" 2)}) (set Var ""Direction"" 0)))) (then (if (and {(!= 1 (value Player Mover)) (is In (last From) (sites ""SquaresHoles"")) (< (count at:(last From)) 6)}) (set Value Mover 1))))))))) (if (is Occupied (handSite Mover)) (priority {(move (from (handSite Mover)) (to (sites Mover ""Inner"") if:(and (is Occupied (to)) (is Occupied (if (is Mover P1) (+ (to) 8) (- (to) 8))))) count:1 (then (and {(moveAgain) (set Pending) (if (is In (last To) (expand (sites Right))) (set Var ""Side"" 2) (if (is In (last To) (expand (sites Left))) (set Var ""Side"" 1) (set Var ""Side"" 0)))}))) (if (!= (value Player Mover) 1) (move (from (handSite Mover)) (to (difference (sites Mover ""Inner"") (sites ""SquaresHoles"")) if:(is Occupied (to))) count:1 (then (and {(moveAgain) (set Var ""Replay"" (last To)) (set Var ""Direction"" 3)}))) (move (from (handSite Mover)) (to (sites Mover ""Inner"") if:(is Occupied (to))) count:1 (then (and {(moveAgain) (set Var ""Replay"" (last To)) (set Var ""Direction"" 3)})))) (if (!= (value Player Mover) 1) (move (from (handSite Mover)) (to (intersection (sites ""SquaresHoles"") (sites Mover ""Inner"")) if:(is Occupied (to))) count:1 (then (and {(moveAgain) (set Var ""Replay"" (last To)) (set Var ""Direction"" 3)}))))}) (priority {(or (move Select (from (sites Mover) if:(and (or (< 1 (count at:(from))) (> 16 (count at:(from)))) (is Occupied (if (is Mover P1) (+ (trackSite Move from:(from) ""TrackCW"" steps:(count at:(from))) 8) (- (trackSite Move from:(from) ""TrackCW"" steps:(count at:(from))) 8))))) (then (sow ""TrackCW"" owner:(mover) apply:(if (is In (to) (sites Mover ""Inner"")) (if (is Occupied (if (is Mover P1) (+ (to) 8) (- (to) 8))) (and {(moveAgain) (set Pending) (if (is In (to) (expand (sites Right))) (set Var ""Side"" 2) (if (is In (to) (expand (sites Left))) (set Var ""Side"" 1) (set Var ""Side"" 0)))}) (if (< 1 (count at:(to))) (if (or (= 1 (value Player Mover)) (and (!= 1 (value Player Mover)) (not (is In (to) (sites ""SquaresHoles""))))) (and {(moveAgain) (set Var ""Replay"" (to)) (set Var ""Direction"" 1)}) (set Var ""Direction"" 0)))) (if (< 1 (count at:(to))) (if (or (= 1 (value Player Mover)) (and (!= 1 (value Player Mover)) (not (is In (to) (sites ""SquaresHoles""))))) (and {(moveAgain) (set Var ""Replay"" (to)) (set Var ""Direction"" 1)}) (set Var ""Direction"" 0))))))) (move Select (from (sites Mover) if:(and (or (< 1 (count at:(from))) (> 16 (count at:(from)))) (is Occupied (if (is Mover P1) (+ (trackSite Move from:(from) ""TrackCCW"" steps:(count at:(from))) 8) (- (trackSite Move from:(from) ""TrackCCW"" steps:(count at:(from))) 8))))) (then (sow ""TrackCCW"" owner:(mover) apply:(if (is In (to) (sites Mover ""Inner"")) (if (is Occupied (if (is Mover P1) (+ (to) 8) (- (to) 8))) (and {(moveAgain) (set Pending) (if (is In (to) (expand (sites Right))) (set Var ""Side"" 2) (if (is In (to) (expand (sites Left))) (set Var ""Side"" 1) (set Var ""Side"" 0)))}) (if (< 1 (count at:(to))) (if (or (= 1 (value Player Mover)) (and (!= 1 (value Player Mover)) (not (is In (to) (sites ""SquaresHoles""))))) (and {(moveAgain) (set Var ""Replay"" (to)) (set Var ""Direction"" 2)}) (set Var ""Direction"" 0)))) (if (< 1 (count at:(to))) (if (or (= 1 (value Player Mover)) (and (!= 1 (value Player Mover)) (not (is In (to) (sites ""SquaresHoles""))))) (and {(moveAgain) (set Var ""Replay"" (to)) (set Var ""Direction"" 2)}) (set Var ""Direction"" 0)))))))) (or (move Select (from (if (!= (value Player Mover) 1) (sites Mover) (difference (sites Mover) (sites ""SquaresHoles""))) if:(or (< 1 (count at:(from))) (> 16 (count at:(from))))) (then (sow ""TrackCW"" owner:(mover) apply:(if (is In (to) (sites Mover ""Inner"")) (if (is Occupied (if (is Mover P1) (+ (to) 8) (- (to) 8))) (and {(moveAgain) (set Pending) (if (is In (to) (expand (sites Right))) (set Var ""Side"" 2) (if (is In (to) (expand (sites Left))) (set Var ""Side"" 1) (set Var ""Side"" 0)))}) (if (< 1 (count at:(to))) (if (or (= 1 (value Player Mover)) (and (!= 1 (value Player Mover)) (not (is In (to) (sites ""SquaresHoles""))))) (and {(moveAgain) (set Var ""Replay"" (to)) (set Var ""Direction"" 1)}) (set Var ""Direction"" 0)))) (if (< 1 (count at:(to))) (if (or (= 1 (value Player Mover)) (and (!= 1 (value Player Mover)) (not (is In (to) (sites ""SquaresHoles""))))) (and {(moveAgain) (set Var ""Replay"" (to)) (set Var ""Direction"" 1)}) (set Var ""Direction"" 0))))))) (move Select (from (if (!= (value Player Mover) 1) (sites Mover) (difference (sites Mover) (sites ""SquaresHoles""))) if:(or (< 1 (count at:(from))) (> 16 (count at:(from))))) (then (sow ""TrackCCW"" owner:(mover) apply:(if (is In (to) (sites Mover ""Inner"")) (if (is Occupied (if (is Mover P1) (+ (to) 8) (- (to) 8))) (and {(moveAgain) (set Pending) (if (is In (to) (expand (sites Right))) (set Var ""Side"" 2) (if (is In (to) (expand (sites Left))) (set Var ""Side"" 1) (set Var ""Side"" 0)))}) (if (< 1 (count at:(to))) (if (or (= 1 (value Player Mover)) (and (!= 1 (value Player Mover)) (not (is In (to) (sites ""SquaresHoles""))))) (and {(moveAgain) (set Var ""Replay"" (to)) (set Var ""Direction"" 2)}) (set Var ""Direction"" 0)))) (if (< 1 (count at:(to))) (if (or (= 1 (value Player Mover)) (and (!= 1 (value Player Mover)) (not (is In (to) (sites ""SquaresHoles""))))) (and {(moveAgain) (set Var ""Replay"" (to)) (set Var ""Direction"" 2)}) (set Var ""Direction"" 0))))))))})))) (end (forEach Player if:(no Moves Player) (result Player Loss)))))" "4 row board, of any number of holes. Four counters in each player's outer row. Sowing occurs from the player's rearmost hole and in an anti-clockwise direction. When the final counter lands in an empty hole in the inner row, any counters in the opposite hole in the opponent's inner row are captured. The player who captures all of the opponent's counters wins. Each player has 16 holes per row.","(game ""Chiana wa Bwalo"" (players 2) (equipment {(mancalaBoard 4 16 store:None {(track ""Track1"" ""0,E,N1,W"" loop:True P1) (track ""Track2"" ""32,E,N1,W"" loop:True P2)}) (regions ""Home"" P1 (sites Track ""Track1"")) (regions ""Home"" P2 (sites Track ""Track2"")) (regions ""Inner"" P1 (difference (sites Track ""Track1"") (sites Bottom))) (regions ""Inner"" P2 (difference (sites Track ""Track2"") (sites Top))) (piece ""Seed"" Shared) (hand Each)}) (rules (start (set Count 4 to:(union (sites Top) (sites Bottom)))) (play (move Select (from (sites Mover ""Home"") if:(> (count at:(from)) 0)) (then (sow ""Track"" owner:(mover) apply:(if (and (= (count at:(to)) 1) (> (count at:(if (is Mover P1) (+ (to) 16) (- (to) 16))) 0)) (fromTo (from (if (is Mover P1) (+ (to) 16) (- (to) 16))) (to (handSite Mover)) count:(count at:(if (is Mover P1) (+ (to) 16) (- (to) 16))))))))) (end (if (no Moves Next) (byScore {(score P1 (+ (count Cell at:(handSite P1)) (count in:(sites P1 ""Home"")))) (score P2 (+ (count Cell at:(handSite P2)) (count in:(sites P2 ""Home""))))})))))","###Description 4 row board, of any number of holes. Four counters in each player's outer row. Sowing occurs from the player's rearmost hole and in an anti-clockwise direction. When the final counter lands in an empty hole in the inner row, any counters in the opposite hole in the opponent's inner row are captured. The player who captures all of the opponent's counters wins. Each player has 16 holes per row. @@ -1649,11 +1594,6 @@ Play begins with four counters in each hole. Players move by picking up all of t ###Ludii (game ""Buqruru"" (players 2) (equipment {(mancalaBoard 2 4 store:None (track ""Track"" ""0,E,N,W"" loop:True)) (piece ""Seed"" Shared) (hand Each) (regions P1 (sites Bottom)) (regions P2 (sites Top))}) (rules (start {(set Count 6 to:(sites Track)) (set RememberValue ""Playable"" (sites Board))}) phases:{(phase ""SelectingHole"" (play (move Select (from (sites Mover) if:(is In (from) (sites (values Remembered ""Playable"")))) (then (set Value Mover (last To))))) (nextPhase Mover ""Sowing"")) (phase ""Sowing"" (play (if (is Occupied (value Player Mover)) (or {(move Select (from (value Player Mover) if:(is In (from) (sites (values Remembered ""Playable"")))) (then (sow numPerHole:1 sowEffect:(if (and (is In (to) (sites Next)) (or {(= 1 (count at:(to))) (= 3 (count at:(to))) (= 5 (count at:(to))) (= 7 (count at:(to)))})) (fromTo (from (to)) (to (handSite Mover)) count:(count at:(to)))) apply:(if (or {(= 2 (count at:(to))) (= 4 (count at:(to))) (= 6 (count at:(to))) (= 8 (count at:(to)))}) (fromTo (from (to)) (to (handSite Mover)) count:(count at:(to)))) skipIf:(not (is In (to) (sites (values Remembered ""Playable"")))) backtracking:True))) (if (= 0 (% (count at:(value Player Mover)) 2)) (move Select (from (value Player Mover)) (then (sow numPerHole:2 sowEffect:(if (and (is In (to) (sites Next)) (or {(= 0 (count at:(to))) (= 2 (count at:(to))) (= 4 (count at:(to))) (= 6 (count at:(to)))})) (fromTo (from (to)) (to (handSite Mover)) count:(count at:(to)))) apply:(if (or {(= 2 (count at:(to))) (= 4 (count at:(to))) (= 6 (count at:(to))) (= 8 (count at:(to)))}) (fromTo (from (to)) (to (handSite Mover)) count:(count at:(to)))) skipIf:(not (is In (to) (sites (values Remembered ""Playable"")))) backtracking:True)))) (if (= 0 (% (count at:(value Player Mover)) 3)) (move Select (from (value Player Mover)) (then (sow numPerHole:3 sowEffect:(if (and (is In (to) (sites Next)) (or {(= 1 (count at:(to))) (= 3 (count at:(to))) (= 5 (count at:(to)))})) (fromTo (from (to)) (to (handSite Mover)) count:(count at:(to)))) apply:(if (or {(= 2 (count at:(to))) (= 4 (count at:(to))) (= 6 (count at:(to))) (= 8 (count at:(to)))}) (fromTo (from (to)) (to (handSite Mover)) count:(count at:(to)))) skipIf:(not (is In (to) (sites (values Remembered ""Playable"")))) backtracking:True)))) (if (= 0 (% (count at:(value Player Mover)) 4)) (move Select (from (value Player Mover)) (then (sow numPerHole:4 sowEffect:(if (and (is In (to) (sites Next)) (or {(= 0 (count at:(to))) (= 2 (count at:(to))) (= 4 (count at:(to)))})) (fromTo (from (to)) (to (handSite Mover)) count:(count at:(to)))) apply:(if (or {(= 2 (count at:(to))) (= 4 (count at:(to))) (= 6 (count at:(to))) (= 8 (count at:(to)))}) (fromTo (from (to)) (to (handSite Mover)) count:(count at:(to)))) skipIf:(not (is In (to) (sites (values Remembered ""Playable"")))) backtracking:True))))}) (then (if (> 2 (count in:(union (sites Top) (sites Bottom)))) (and {(forEach Site (sites P1) (if (is Occupied (site)) (fromTo (from (site)) (to (handSite P1)) count:(count at:(site))))) (forEach Site (sites P2) (if (is Occupied (site)) (fromTo (from (site)) (to (handSite P2)) count:(count at:(site))))) (forget Value ""Playable"" All)}))))) (end {(if (and (= 0 (count at:(value Player P1))) (= 0 (count at:(value Player P2)))) (result Mover Draw)) (if (> 2 (count in:(union (sites Top) (sites Bottom)))) {(if (= 0 (count Cell at:(handSite P1))) (result P2 Win)) (if (= 0 (count Cell at:(handSite P2))) (result P1 Win))})}) (nextPhase (> 2 (count in:(union (sites Top) (sites Bottom)))) ""BetweenRounds"")) (phase ""BetweenRounds"" (play (if (not (all Sites (sites Mover) if:(is Occupied (site)))) (if (<= 6 (count at:(handSite Mover))) (move (from (handSite Mover)) (to (sites Mover)) count:6 (then (remember Value ""Playable"" (last To)))) (move (from (handSite Mover)) (to (sites Mover)) count:(count at:(handSite Mover)) (then (remember Value ""Playable"" (last To))))))) (nextPhase (all Passed) ""SelectingHole""))}))" -"2x5 board with one store on either end. The store to the right of the player belongs to the player. Play begins with five counters in each regular hole, with one larger stone in each store, but one is slightly smaller than the other. Game can be played with two or four players. With four players, two players control the larger stones, but cannot move the regular counters. Players throw out a finger (index, little, or thumb) to determine who plays first. Index beats thumb, thumb beats little finger, little finger beats index. This happens at the start of each round. Counters are taken from any of the holes in the player's row, sowing them in either direction, including the stores. When the last counter of a sowing is dropped in a hole, sowing continues by picking up the counters in the next hole and continuing to sow in that direction. If the hole following the last seed of a sowing is empty, the counters in the hole following this empty hole are captured. If there is an empty hole following the captured hole, and then an occupied hole immediately after it, the counters in the occupied hole are also captured, and so forth until there are two occupied or two empty holes in a row. Moves may not begin from stores. Both stores are sown into normally by both players. Stores are considered to be empty, except when its large stone remains in it, then the large stone only can be sown or captured and not any other counters that may have accumulated there. Large stones can be sown in any order a player chooses during a sowing. If a player has no counters in their holes, they may opt to place one counter in each of their holes, taking counters from their store and continue play (called huelshe). If they opt not to, the opponent takes all the remaining stones on the board. If one of the large stones remains in its original store, the player cannot opt out. If the player doesn't have enough stones for all of the holes, they may choose which holes in their row to place the counters, but they must form a continuous sequence of holes with counters. When the round ends, players must buy back their large stones if they no longer have them, at a price determined in the beginning of the game (usually seven for the larger stone and six for the smaller). Players then attempt to refill their holes with the original number of counters. The player that has fewer than the original number of counters must borrow counters from the opponent. Debt accumulates over subsequent rounds. When the debt reaches five, the player must sell one of their holes to the opponent. The selling player can choose which holes to sell. The seller then receives five counters to either repay debt or fill holes as long as debt does not exceed four. Each row has 5 holes. The price of the largest stone is 7.","(game ""Ceelkoqyuqkoqiji"" (players 2) (equipment {(mancalaBoard 2 5 largeStack:True {(track ""TrackCCW"" ""0,1,E,11,10,W"" loop:True) (track ""TrackCW"" ""0,6,E,11,5,W"" loop:True)}) (piece ""Seed"" Shared) (piece ""Ball"" P1) (piece ""Ball"" P2) (hand Each size:2) (regions P1 (sites Bottom)) (regions P2 (sites Top)) (map {(pair P1 LastSite) (pair P2 FirstSite)}) (regions ""EndHoles"" (sites {0 (+ 1 (* 2 5))}))}) (rules (start {(place Stack ""Seed"" (union (sites Bottom) (sites Top)) count:5) (place Stack ""Ball1"" (mapEntry P1)) (place Stack ""Ball2"" (mapEntry P2)) (set RememberValue ""OwnedP1"" (sites Bottom)) (set RememberValue ""OwnedP2"" (sites Top))}) phases:{(phase ""Sowing"" (play (or {(if (!= (var ""Direction"") 2) (move Select (from (if (is Prev Mover) (sites {(var ""Replay"")}) (if (is Mover P1) (sites (values Remembered ""OwnedP1"")) (sites (values Remembered ""OwnedP2"")))) if:(!= 0 (size Stack at:(from)))) (then (and {(forEach Value min:1 max:(size Stack at:(last From)) (fromTo (from (last From) level:(- (size Stack at:(last From)) (value))) (to (trackSite Move from:(last From) ""TrackCCW"" steps:(value))) stack:True)) (if (or (is In (trackSite Move from:(last From) ""TrackCCW"" steps:(+ 1 (size Stack at:(last From)))) (sites ""EndHoles"")) (>= (size Stack at:(last From)) (* 2 5))) (set Var ""Direction"" 0) (if (!= 0 (size Stack at:(trackSite Move from:(last From) ""TrackCCW"" steps:(+ 1 (size Stack at:(last From)))))) (and {(set Var ""Direction"" 1) (moveAgain) (set Var ""Replay"" (trackSite Move from:(last From) ""TrackCCW"" steps:(+ 1 (size Stack at:(last From)))))}) (and (set Var ""Direction"" 0) (if (is Occupied (trackSite Move from:(last From) ""TrackCCW"" steps:(+ 2 (size Stack at:(last From))))) (forEach Level (trackSite Move from:(last From) ""TrackCCW"" steps:(+ 2 (size Stack at:(last From)))) FromTop (if (= (id ""Seed"" Shared) (what at:(trackSite Move from:(last From) ""TrackCCW"" steps:(+ 2 (size Stack at:(last From)))) level:(level))) (fromTo (from (trackSite Move from:(last From) ""TrackCCW"" steps:(+ 2 (size Stack at:(last From)))) level:(level)) (to (handSite Mover))) (fromTo (from (trackSite Move from:(last From) ""TrackCCW"" steps:(+ 2 (size Stack at:(last From)))) level:(level)) (to (handSite Mover 1)))))))))})))) (if (!= (var ""Direction"") 1) (move Select (from (if (is Prev Mover) (sites {(var ""Replay"")}) (if (is Mover P1) (sites (values Remembered ""OwnedP1"")) (sites (values Remembered ""OwnedP2"")))) if:(!= 0 (size Stack at:(from)))) (then (and (forEach Value min:1 max:(size Stack at:(last From)) (fromTo (from (last From) level:(- (size Stack at:(last From)) (value))) (to (trackSite Move from:(last From) ""TrackCW"" steps:(value))) stack:True)) (if (or (is In (trackSite Move from:(last From) ""TrackCW"" steps:(+ 1 (size Stack at:(last From)))) (sites ""EndHoles"")) (>= (size Stack at:(last From)) (* 5 2))) (set Var ""Direction"" 0) (if (!= 0 (size Stack at:(trackSite Move from:(last From) ""TrackCW"" steps:(+ 1 (size Stack at:(last From)))))) (and {(set Var ""Direction"" 2) (moveAgain) (set Var ""Replay"" (trackSite Move from:(last From) ""TrackCW"" steps:(+ 1 (size Stack at:(last From)))))}) (and (set Var ""Direction"" 0) (if (is Occupied (trackSite Move from:(last From) ""TrackCW"" steps:(+ 2 (size Stack at:(last From))))) (forEach Level (trackSite Move from:(last From) ""TrackCW"" steps:(+ 2 (size Stack at:(last From)))) FromTop (if (= (id ""Seed"" Shared) (what at:(trackSite Move from:(last From) ""TrackCW"" steps:(+ 2 (size Stack at:(last From)))) level:(level))) (fromTo (from (trackSite Move from:(last From) ""TrackCW"" steps:(+ 2 (size Stack at:(last From)))) level:(level)) (to (handSite Mover))) (fromTo (from (trackSite Move from:(last From) ""TrackCW"" steps:(+ 2 (size Stack at:(last From)))) level:(level)) (to (handSite Mover 1)))))))))))))} (then (if (= 2 (count Cell in:(sites {(handSite P1 1) (handSite P2 1)}))) (and {(forEach Site (intersection (sites (values Remembered ""OwnedP1"")) (sites (values Remembered ""OwnedP2""))) (if (is Occupied (site)) (and (forEach Level (site) FromTop (if (>= (level) (/ (size Stack at:(site)) 2)) (fromTo (from (site) level:(level)) (to (handSite P1)) stack:True))) (forEach Level (site) FromTop (if (< (level) (/ (size Stack at:(site)) 2)) (fromTo (from (site) level:(level)) (to (handSite P2)) stack:True)))))) (forEach Site (union (difference (sites (values Remembered ""OwnedP1"")) (sites (values Remembered ""OwnedP2""))) (sites {(mapEntry P1)})) (if (is Occupied (site)) (forEach Level (site) FromTop (fromTo (from (site) level:(level)) (to (handSite P1)) stack:True)))) (forEach Site (union (difference (sites (values Remembered ""OwnedP2"")) (sites (values Remembered ""OwnedP1""))) (sites {(mapEntry P2)})) (if (is Occupied (site)) (forEach Level (site) FromTop (fromTo (from (site) level:(level)) (to (handSite P2)) stack:True)))) (forget Value ""OwnedP1"" All) (forget Value ""OwnedP2"" All)}) (and (if (and (if (= 1 P1) (no Pieces All in:(sites (values Remembered ""OwnedP1""))) (no Pieces All in:(sites (values Remembered ""OwnedP2"")))) (>= (size Stack Cell at:(handSite P1)) (if (= 1 P1) (count Sites in:(sites (values Remembered ""OwnedP1""))) (count Sites in:(sites (values Remembered ""OwnedP2"")))))) (forEach Value min:1 max:(if (= 1 P1) (count Sites in:(sites (values Remembered ""OwnedP1""))) (count Sites in:(sites (values Remembered ""OwnedP2"")))) (fromTo (from Cell (handSite P1) level:(- (size Stack Cell at:(handSite P1)) (value))) (to (regionSite (sites (values Remembered ""OwnedP1"")) index:(- (value) 1))) stack:True))) (if (and (if (= 1 P2) (no Pieces All in:(sites (values Remembered ""OwnedP1""))) (no Pieces All in:(sites (values Remembered ""OwnedP2"")))) (>= (size Stack Cell at:(handSite P2)) (if (= 1 P2) (count Sites in:(sites (values Remembered ""OwnedP1""))) (count Sites in:(sites (values Remembered ""OwnedP2"")))))) (forEach Value min:1 max:(if (= 1 P2) (count Sites in:(sites (values Remembered ""OwnedP1""))) (count Sites in:(sites (values Remembered ""OwnedP2"")))) (fromTo (from Cell (handSite P2) level:(- (size Stack Cell at:(handSite P2)) (value))) (to (regionSite (sites (values Remembered ""OwnedP2"")) index:(- (value) 1))) stack:True)))))))) (end (if (all Sites (sites Board) if:(= 0 (count at:(site)))) {(if (>= 4 (size Stack Cell at:(handSite P1))) (result P2 Win)) (if (>= 4 (size Stack Cell at:(handSite P2))) (result P1 Win))})) (nextPhase (all Sites (sites Board) if:(= 0 (count at:(site)))) ""BetweenRounds"")) (phase ""BetweenRounds"" (play (if (<= 5 (size Stack Cell at:(handSite Mover))) (move Select (from Cell (handSite Mover)) (to (trackSite FirstSite ""TrackCCW"" from:(mapEntry Mover) if:(and (not (is In (to) (sites ""EndHoles""))) (is Empty (to))))) (then (and {(forEach Value min:1 max:5 (fromTo (from Cell (last From) level:(- (size Stack Cell at:(last From)) (value))) (to (last To)) stack:True)) (if (is Mover P1) (remember Value ""OwnedP1"" (last To)) (remember Value ""OwnedP2"" (last To))) (if (<= (* 2 5) (count Cell at:(handSite Mover))) (moveAgain) (if (or (= 8 (count Cell at:(handSite Mover))) (= 9 (count Cell at:(handSite Mover)))) (and {(forEach Value min:1 max:(- (count Cell at:(handSite Mover)) 5) (fromTo (from Cell (handSite Mover) level:(- (- (size Stack Cell at:(handSite Mover)) 5) (value))) (to (trackSite FirstSite ""TrackCCW"" from:(trackSite FirstSite ""TrackCCW"" from:(mapEntry Mover) if:(and (not (is In (to) (sites ""EndHoles""))) (is Empty (to)))) if:(and {(not (is In (to) (sites ""EndHoles""))) (is Empty (to)) (!= (trackSite FirstSite ""TrackCCW"" from:(mapEntry Mover) if:(and (not (is In (to) (sites ""EndHoles""))) (is Empty (to)))) (to))}))) stack:True)) (forEach Value min:1 max:(- 5 (- (count Cell at:(handSite Mover)) 5)) (fromTo (from Cell (handSite Next) level:(- (size Stack Cell at:(handSite Next)) (value))) (to (trackSite FirstSite ""TrackCCW"" from:(trackSite FirstSite ""TrackCCW"" from:(mapEntry Mover) if:(and (not (is In (to) (sites ""EndHoles""))) (is Empty (to)))) if:(and {(not (is In (to) (sites ""EndHoles""))) (is Empty (to)) (!= (trackSite FirstSite ""TrackCCW"" from:(mapEntry Mover) if:(and (not (is In (to) (sites ""EndHoles""))) (is Empty (to)))) (to))}))) stack:True)) (if (is Mover P1) (remember Value ""OwnedP1"" (trackSite FirstSite ""TrackCCW"" from:(trackSite FirstSite ""TrackCCW"" from:(mapEntry Mover) if:(and (not (is In (to) (sites ""EndHoles""))) (is Empty (to)))) if:(and {(not (is In (to) (sites ""EndHoles""))) (is Empty (to)) (!= (trackSite FirstSite ""TrackCCW"" from:(mapEntry Mover) if:(and (not (is In (to) (sites ""EndHoles""))) (is Empty (to)))) (to))}))) (remember Value ""OwnedP2"" (trackSite FirstSite ""TrackCCW"" from:(trackSite FirstSite ""TrackCCW"" from:(mapEntry Mover) if:(and (not (is In (to) (sites ""EndHoles""))) (is Empty (to)))) if:(and {(not (is In (to) (sites ""EndHoles""))) (is Empty (to)) (!= (trackSite FirstSite ""TrackCCW"" from:(mapEntry Mover) if:(and (not (is In (to) (sites ""EndHoles""))) (is Empty (to)))) (to))})))) (if (is Mover P2) (remember Value ""OwnedP1"" (trackSite FirstSite ""TrackCCW"" from:(trackSite FirstSite ""TrackCCW"" from:(mapEntry Mover) if:(and (not (is In (to) (sites ""EndHoles""))) (is Empty (to)))) if:(and {(not (is In (to) (sites ""EndHoles""))) (is Empty (to)) (!= (trackSite FirstSite ""TrackCCW"" from:(mapEntry Mover) if:(and (not (is In (to) (sites ""EndHoles""))) (is Empty (to)))) (to))}))) (remember Value ""OwnedP2"" (trackSite FirstSite ""TrackCCW"" from:(trackSite FirstSite ""TrackCCW"" from:(mapEntry Mover) if:(and (not (is In (to) (sites ""EndHoles""))) (is Empty (to)))) if:(and {(not (is In (to) (sites ""EndHoles""))) (is Empty (to)) (!= (trackSite FirstSite ""TrackCCW"" from:(mapEntry Mover) if:(and (not (is In (to) (sites ""EndHoles""))) (is Empty (to)))) (to))}))))})))}))) (then (if (and (is Empty Cell (handSite P1)) (is Empty Cell (handSite P2))) (and (if (= (size Stack Cell at:(handSite P1 1)) 2) (and (fromTo (from Cell (handSite P1 1) level:1) (to (mapEntry P1)) stack:True) (fromTo (from Cell (handSite P1 1) level:0) (to (mapEntry P2)) stack:True)) (if (= (size Stack Cell at:(handSite P2 1)) 2) (and (fromTo (from Cell (handSite P2 1) level:1) (to (mapEntry P1)) stack:True) (fromTo (from Cell (handSite P2 1) level:0) (to (mapEntry P2)) stack:True)) (and (fromTo (from Cell (handSite P1 1) level:0) (to (mapEntry P1)) stack:True) (fromTo (from Cell (handSite P2 1) level:0) (to (mapEntry P2)) stack:True)))) (if (< 50 (value Random (range 1 100))) (set NextPlayer (player 1)) (set NextPlayer (player 2)))))))) (nextPhase (and (is Empty Cell (handSite P1)) (is Empty Cell (handSite P2))) ""Sowing""))}))","###Description -2x5 board with one store on either end. The store to the right of the player belongs to the player. Play begins with five counters in each regular hole, with one larger stone in each store, but one is slightly smaller than the other. Game can be played with two or four players. With four players, two players control the larger stones, but cannot move the regular counters. Players throw out a finger (index, little, or thumb) to determine who plays first. Index beats thumb, thumb beats little finger, little finger beats index. This happens at the start of each round. Counters are taken from any of the holes in the player's row, sowing them in either direction, including the stores. When the last counter of a sowing is dropped in a hole, sowing continues by picking up the counters in the next hole and continuing to sow in that direction. If the hole following the last seed of a sowing is empty, the counters in the hole following this empty hole are captured. If there is an empty hole following the captured hole, and then an occupied hole immediately after it, the counters in the occupied hole are also captured, and so forth until there are two occupied or two empty holes in a row. Moves may not begin from stores. Both stores are sown into normally by both players. Stores are considered to be empty, except when its large stone remains in it, then the large stone only can be sown or captured and not any other counters that may have accumulated there. Large stones can be sown in any order a player chooses during a sowing. If a player has no counters in their holes, they may opt to place one counter in each of their holes, taking counters from their store and continue play (called huelshe). If they opt not to, the opponent takes all the remaining stones on the board. If one of the large stones remains in its original store, the player cannot opt out. If the player doesn't have enough stones for all of the holes, they may choose which holes in their row to place the counters, but they must form a continuous sequence of holes with counters. When the round ends, players must buy back their large stones if they no longer have them, at a price determined in the beginning of the game (usually seven for the larger stone and six for the smaller). Players then attempt to refill their holes with the original number of counters. The player that has fewer than the original number of counters must borrow counters from the opponent. Debt accumulates over subsequent rounds. When the debt reaches five, the player must sell one of their holes to the opponent. The selling player can choose which holes to sell. The seller then receives five counters to either repay debt or fill holes as long as debt does not exceed four. Each row has 5 holes. The price of the largest stone is 7. - -###Ludii -(game ""Ceelkoqyuqkoqiji"" (players 2) (equipment {(mancalaBoard 2 5 largeStack:True {(track ""TrackCCW"" ""0,1,E,11,10,W"" loop:True) (track ""TrackCW"" ""0,6,E,11,5,W"" loop:True)}) (piece ""Seed"" Shared) (piece ""Ball"" P1) (piece ""Ball"" P2) (hand Each size:2) (regions P1 (sites Bottom)) (regions P2 (sites Top)) (map {(pair P1 LastSite) (pair P2 FirstSite)}) (regions ""EndHoles"" (sites {0 (+ 1 (* 2 5))}))}) (rules (start {(place Stack ""Seed"" (union (sites Bottom) (sites Top)) count:5) (place Stack ""Ball1"" (mapEntry P1)) (place Stack ""Ball2"" (mapEntry P2)) (set RememberValue ""OwnedP1"" (sites Bottom)) (set RememberValue ""OwnedP2"" (sites Top))}) phases:{(phase ""Sowing"" (play (or {(if (!= (var ""Direction"") 2) (move Select (from (if (is Prev Mover) (sites {(var ""Replay"")}) (if (is Mover P1) (sites (values Remembered ""OwnedP1"")) (sites (values Remembered ""OwnedP2"")))) if:(!= 0 (size Stack at:(from)))) (then (and {(forEach Value min:1 max:(size Stack at:(last From)) (fromTo (from (last From) level:(- (size Stack at:(last From)) (value))) (to (trackSite Move from:(last From) ""TrackCCW"" steps:(value))) stack:True)) (if (or (is In (trackSite Move from:(last From) ""TrackCCW"" steps:(+ 1 (size Stack at:(last From)))) (sites ""EndHoles"")) (>= (size Stack at:(last From)) (* 2 5))) (set Var ""Direction"" 0) (if (!= 0 (size Stack at:(trackSite Move from:(last From) ""TrackCCW"" steps:(+ 1 (size Stack at:(last From)))))) (and {(set Var ""Direction"" 1) (moveAgain) (set Var ""Replay"" (trackSite Move from:(last From) ""TrackCCW"" steps:(+ 1 (size Stack at:(last From)))))}) (and (set Var ""Direction"" 0) (if (is Occupied (trackSite Move from:(last From) ""TrackCCW"" steps:(+ 2 (size Stack at:(last From))))) (forEach Level (trackSite Move from:(last From) ""TrackCCW"" steps:(+ 2 (size Stack at:(last From)))) FromTop (if (= (id ""Seed"" Shared) (what at:(trackSite Move from:(last From) ""TrackCCW"" steps:(+ 2 (size Stack at:(last From)))) level:(level))) (fromTo (from (trackSite Move from:(last From) ""TrackCCW"" steps:(+ 2 (size Stack at:(last From)))) level:(level)) (to (handSite Mover))) (fromTo (from (trackSite Move from:(last From) ""TrackCCW"" steps:(+ 2 (size Stack at:(last From)))) level:(level)) (to (handSite Mover 1)))))))))})))) (if (!= (var ""Direction"") 1) (move Select (from (if (is Prev Mover) (sites {(var ""Replay"")}) (if (is Mover P1) (sites (values Remembered ""OwnedP1"")) (sites (values Remembered ""OwnedP2"")))) if:(!= 0 (size Stack at:(from)))) (then (and (forEach Value min:1 max:(size Stack at:(last From)) (fromTo (from (last From) level:(- (size Stack at:(last From)) (value))) (to (trackSite Move from:(last From) ""TrackCW"" steps:(value))) stack:True)) (if (or (is In (trackSite Move from:(last From) ""TrackCW"" steps:(+ 1 (size Stack at:(last From)))) (sites ""EndHoles"")) (>= (size Stack at:(last From)) (* 5 2))) (set Var ""Direction"" 0) (if (!= 0 (size Stack at:(trackSite Move from:(last From) ""TrackCW"" steps:(+ 1 (size Stack at:(last From)))))) (and {(set Var ""Direction"" 2) (moveAgain) (set Var ""Replay"" (trackSite Move from:(last From) ""TrackCW"" steps:(+ 1 (size Stack at:(last From)))))}) (and (set Var ""Direction"" 0) (if (is Occupied (trackSite Move from:(last From) ""TrackCW"" steps:(+ 2 (size Stack at:(last From))))) (forEach Level (trackSite Move from:(last From) ""TrackCW"" steps:(+ 2 (size Stack at:(last From)))) FromTop (if (= (id ""Seed"" Shared) (what at:(trackSite Move from:(last From) ""TrackCW"" steps:(+ 2 (size Stack at:(last From)))) level:(level))) (fromTo (from (trackSite Move from:(last From) ""TrackCW"" steps:(+ 2 (size Stack at:(last From)))) level:(level)) (to (handSite Mover))) (fromTo (from (trackSite Move from:(last From) ""TrackCW"" steps:(+ 2 (size Stack at:(last From)))) level:(level)) (to (handSite Mover 1)))))))))))))} (then (if (= 2 (count Cell in:(sites {(handSite P1 1) (handSite P2 1)}))) (and {(forEach Site (intersection (sites (values Remembered ""OwnedP1"")) (sites (values Remembered ""OwnedP2""))) (if (is Occupied (site)) (and (forEach Level (site) FromTop (if (>= (level) (/ (size Stack at:(site)) 2)) (fromTo (from (site) level:(level)) (to (handSite P1)) stack:True))) (forEach Level (site) FromTop (if (< (level) (/ (size Stack at:(site)) 2)) (fromTo (from (site) level:(level)) (to (handSite P2)) stack:True)))))) (forEach Site (union (difference (sites (values Remembered ""OwnedP1"")) (sites (values Remembered ""OwnedP2""))) (sites {(mapEntry P1)})) (if (is Occupied (site)) (forEach Level (site) FromTop (fromTo (from (site) level:(level)) (to (handSite P1)) stack:True)))) (forEach Site (union (difference (sites (values Remembered ""OwnedP2"")) (sites (values Remembered ""OwnedP1""))) (sites {(mapEntry P2)})) (if (is Occupied (site)) (forEach Level (site) FromTop (fromTo (from (site) level:(level)) (to (handSite P2)) stack:True)))) (forget Value ""OwnedP1"" All) (forget Value ""OwnedP2"" All)}) (and (if (and (if (= 1 P1) (no Pieces All in:(sites (values Remembered ""OwnedP1""))) (no Pieces All in:(sites (values Remembered ""OwnedP2"")))) (>= (size Stack Cell at:(handSite P1)) (if (= 1 P1) (count Sites in:(sites (values Remembered ""OwnedP1""))) (count Sites in:(sites (values Remembered ""OwnedP2"")))))) (forEach Value min:1 max:(if (= 1 P1) (count Sites in:(sites (values Remembered ""OwnedP1""))) (count Sites in:(sites (values Remembered ""OwnedP2"")))) (fromTo (from Cell (handSite P1) level:(- (size Stack Cell at:(handSite P1)) (value))) (to (regionSite (sites (values Remembered ""OwnedP1"")) index:(- (value) 1))) stack:True))) (if (and (if (= 1 P2) (no Pieces All in:(sites (values Remembered ""OwnedP1""))) (no Pieces All in:(sites (values Remembered ""OwnedP2"")))) (>= (size Stack Cell at:(handSite P2)) (if (= 1 P2) (count Sites in:(sites (values Remembered ""OwnedP1""))) (count Sites in:(sites (values Remembered ""OwnedP2"")))))) (forEach Value min:1 max:(if (= 1 P2) (count Sites in:(sites (values Remembered ""OwnedP1""))) (count Sites in:(sites (values Remembered ""OwnedP2"")))) (fromTo (from Cell (handSite P2) level:(- (size Stack Cell at:(handSite P2)) (value))) (to (regionSite (sites (values Remembered ""OwnedP2"")) index:(- (value) 1))) stack:True)))))))) (end (if (all Sites (sites Board) if:(= 0 (count at:(site)))) {(if (>= 4 (size Stack Cell at:(handSite P1))) (result P2 Win)) (if (>= 4 (size Stack Cell at:(handSite P2))) (result P1 Win))})) (nextPhase (all Sites (sites Board) if:(= 0 (count at:(site)))) ""BetweenRounds"")) (phase ""BetweenRounds"" (play (if (<= 5 (size Stack Cell at:(handSite Mover))) (move Select (from Cell (handSite Mover)) (to (trackSite FirstSite ""TrackCCW"" from:(mapEntry Mover) if:(and (not (is In (to) (sites ""EndHoles""))) (is Empty (to))))) (then (and {(forEach Value min:1 max:5 (fromTo (from Cell (last From) level:(- (size Stack Cell at:(last From)) (value))) (to (last To)) stack:True)) (if (is Mover P1) (remember Value ""OwnedP1"" (last To)) (remember Value ""OwnedP2"" (last To))) (if (<= (* 2 5) (count Cell at:(handSite Mover))) (moveAgain) (if (or (= 8 (count Cell at:(handSite Mover))) (= 9 (count Cell at:(handSite Mover)))) (and {(forEach Value min:1 max:(- (count Cell at:(handSite Mover)) 5) (fromTo (from Cell (handSite Mover) level:(- (- (size Stack Cell at:(handSite Mover)) 5) (value))) (to (trackSite FirstSite ""TrackCCW"" from:(trackSite FirstSite ""TrackCCW"" from:(mapEntry Mover) if:(and (not (is In (to) (sites ""EndHoles""))) (is Empty (to)))) if:(and {(not (is In (to) (sites ""EndHoles""))) (is Empty (to)) (!= (trackSite FirstSite ""TrackCCW"" from:(mapEntry Mover) if:(and (not (is In (to) (sites ""EndHoles""))) (is Empty (to)))) (to))}))) stack:True)) (forEach Value min:1 max:(- 5 (- (count Cell at:(handSite Mover)) 5)) (fromTo (from Cell (handSite Next) level:(- (size Stack Cell at:(handSite Next)) (value))) (to (trackSite FirstSite ""TrackCCW"" from:(trackSite FirstSite ""TrackCCW"" from:(mapEntry Mover) if:(and (not (is In (to) (sites ""EndHoles""))) (is Empty (to)))) if:(and {(not (is In (to) (sites ""EndHoles""))) (is Empty (to)) (!= (trackSite FirstSite ""TrackCCW"" from:(mapEntry Mover) if:(and (not (is In (to) (sites ""EndHoles""))) (is Empty (to)))) (to))}))) stack:True)) (if (is Mover P1) (remember Value ""OwnedP1"" (trackSite FirstSite ""TrackCCW"" from:(trackSite FirstSite ""TrackCCW"" from:(mapEntry Mover) if:(and (not (is In (to) (sites ""EndHoles""))) (is Empty (to)))) if:(and {(not (is In (to) (sites ""EndHoles""))) (is Empty (to)) (!= (trackSite FirstSite ""TrackCCW"" from:(mapEntry Mover) if:(and (not (is In (to) (sites ""EndHoles""))) (is Empty (to)))) (to))}))) (remember Value ""OwnedP2"" (trackSite FirstSite ""TrackCCW"" from:(trackSite FirstSite ""TrackCCW"" from:(mapEntry Mover) if:(and (not (is In (to) (sites ""EndHoles""))) (is Empty (to)))) if:(and {(not (is In (to) (sites ""EndHoles""))) (is Empty (to)) (!= (trackSite FirstSite ""TrackCCW"" from:(mapEntry Mover) if:(and (not (is In (to) (sites ""EndHoles""))) (is Empty (to)))) (to))})))) (if (is Mover P2) (remember Value ""OwnedP1"" (trackSite FirstSite ""TrackCCW"" from:(trackSite FirstSite ""TrackCCW"" from:(mapEntry Mover) if:(and (not (is In (to) (sites ""EndHoles""))) (is Empty (to)))) if:(and {(not (is In (to) (sites ""EndHoles""))) (is Empty (to)) (!= (trackSite FirstSite ""TrackCCW"" from:(mapEntry Mover) if:(and (not (is In (to) (sites ""EndHoles""))) (is Empty (to)))) (to))}))) (remember Value ""OwnedP2"" (trackSite FirstSite ""TrackCCW"" from:(trackSite FirstSite ""TrackCCW"" from:(mapEntry Mover) if:(and (not (is In (to) (sites ""EndHoles""))) (is Empty (to)))) if:(and {(not (is In (to) (sites ""EndHoles""))) (is Empty (to)) (!= (trackSite FirstSite ""TrackCCW"" from:(mapEntry Mover) if:(and (not (is In (to) (sites ""EndHoles""))) (is Empty (to)))) (to))}))))})))}))) (then (if (and (is Empty Cell (handSite P1)) (is Empty Cell (handSite P2))) (and (if (= (size Stack Cell at:(handSite P1 1)) 2) (and (fromTo (from Cell (handSite P1 1) level:1) (to (mapEntry P1)) stack:True) (fromTo (from Cell (handSite P1 1) level:0) (to (mapEntry P2)) stack:True)) (if (= (size Stack Cell at:(handSite P2 1)) 2) (and (fromTo (from Cell (handSite P2 1) level:1) (to (mapEntry P1)) stack:True) (fromTo (from Cell (handSite P2 1) level:0) (to (mapEntry P2)) stack:True)) (and (fromTo (from Cell (handSite P1 1) level:0) (to (mapEntry P1)) stack:True) (fromTo (from Cell (handSite P2 1) level:0) (to (mapEntry P2)) stack:True)))) (if (< 50 (value Random (range 1 100))) (set NextPlayer (player 1)) (set NextPlayer (player 2)))))))) (nextPhase (and (is Empty Cell (handSite P1)) (is Empty Cell (handSite P2))) ""Sowing""))}))" "2x7 board with two stores. Seven counters in each hole. Players move from one of the holes in their row, sowing in a clockwise direction, and including the player's store, which is to the left, but not the opponent's store. If the final counter of a sowing lands in an occupied hole (not a store), sowing continues. If it lands into an empty hole, the turn is over. If the empty hole is in the player's own row, the contents of the hole opposite in the opponent's row are captured and placed in the store. The person who captures the most counters wins.","(game ""Chongka'"" (players 2) (equipment {(mancalaBoard 2 7 {(track ""Track1"" ""7,W,WNW,ENE,E"" loop:True P1) (track ""Track2"" ""7,W,N,E,ESE"" loop:True P2)}) (piece ""Seed"" Shared) (regions P1 (sites Bottom)) (regions P2 (sites Top)) (map {(pair P1 FirstSite) (pair P2 LastSite)})}) (rules (start (set Count 7 to:(union (sites P1) (sites P2)))) (play (move Select (from (if (is Prev Mover) (sites {(last To afterConsequence:True)}) (sites Mover)) if:(> (count at:(from)) 0)) (then (sow ""Track"" owner:(mover) apply:(if (and {(> (count at:(to)) 1) (is In (to) (union (sites P1) (sites P2)))}) (moveAgain) (if (and (is In (to) (sites Mover)) (> (count at:(if (is Mover P1) (+ (to) 7) (- (to) 7))) 0)) (fromTo (from (if (is Mover P1) (+ (to) 7) (- (to) 7))) (to (mapEntry Mover)) count:(count at:(if (is Mover P1) (+ (to) 7) (- (to) 7)))))))))) (end (if (and (no Moves Mover) (no Moves Next)) (byScore {(score P1 (count at:(mapEntry P1))) (score P2 (count at:(mapEntry P2)))})))))","###Description 2x7 board with two stores. Seven counters in each hole. Players move from one of the holes in their row, sowing in a clockwise direction, and including the player's store, which is to the left, but not the opponent's store. If the final counter of a sowing lands in an occupied hole (not a store), sowing continues. If it lands into an empty hole, the turn is over. If the empty hole is in the player's own row, the contents of the hole opposite in the opponent's row are captured and placed in the store. The person who captures the most counters wins. @@ -1884,11 +1824,6 @@ Play begins with seven counters in each hole. Players begin by picking up the co ###Ludii (game ""Khutka Boia"" (players 2) (equipment {(mancalaBoard 2 5 store:None (track ""Track"" ""0,E,N,W"" loop:True)) (piece ""Seed"" Shared) (regions P1 (sites Bottom)) (regions P2 (sites Top)) (hand Each)}) (rules (start {(set Count 5 to:(sites Track)) (set RememberValue ""Playable"" (union (sites Top) (sites Bottom)))}) phases:{(phase ""Sowing"" (play (or {(or {(move Select (from (if (is Prev Mover) (sites {(trackSite Move from:(last To afterConsequence:True) ""Track"" steps:1)}) (sites Mover)) if:(and (is Occupied (from)) (is In (from) (sites (values Remembered ""Playable""))))) (then (do (if (= 1 (value Player Next)) (fromTo (from (last From)) (to (handSite Mover)) count:1)) next:(sow (last From) apply:(if (is Occupied (trackSite Move from:(to) ""Track"" steps:1)) (moveAgain) (if (is Occupied (trackSite Move from:(to) ""Track"" steps:2)) (fromTo (from (trackSite Move from:(to) ""Track"" steps:2)) (to (handSite Mover)) count:(count at:(trackSite Move from:(to) ""Track"" steps:2))))) skipIf:(not (is In (to) (sites (values Remembered ""Playable""))))))))} (then (and {(forEach Player (forEach Site (sites Player) (if (= 4 (count at:(site))) (fromTo (from (site)) (to (handSite Player)) count:4)))) (forEach Site (sites P1) (if (and (is Occupied (site)) (= 1 (state at:(site)))) (and (fromTo (from (site)) (to (handSite Player)) count:(count at:(site))) (set State at:(site) 1)))) (forEach Site (sites P2) (if (and (is Occupied (site)) (= 2 (state at:(site)))) (and (fromTo (from (site)) (to (handSite Player)) count:(count at:(site))) (set State at:(site) 2))))})))} (then (if (= 1 (count Pieces All in:(union (sites Top) (sites Bottom)))) (and {(forEach Site (sites P1) (fromTo (from (site)) (to (handSite P1)) count:(count at:(site)))) (forEach Site (sites P2) (fromTo (from (site)) (to (handSite P2)) count:(count at:(site)))) (forEach Site (sites Board) (if (!= 0 (state at:(site))) (set State at:(site) 0))) (set Value P1 0) (set Value P2 0) (forget Value ""Playable"" All)}))))) (end (if (all Sites (sites Board) if:(= 0 (count at:(site)))) {(if (= 0 (count Cell at:(handSite P1))) (result P2 Win)) (if (= 0 (count Cell at:(handSite P2))) (result P1 Win))})) (nextPhase (all Sites (sites Board) if:(= 0 (count at:(site)))) ""BetweenRounds"")) (phase ""BetweenRounds"" (play (if (not (all Sites (sites Mover) if:(is Occupied (site)))) (if (<= 5 (count Cell at:(handSite Mover))) (move (from (handSite Mover)) (to (sites Mover) if:(is Empty (to))) count:5 (then (remember Value ""Playable"" (last To))))))) (nextPhase (all Passed) ""DecisionForNextRound"")) (phase ""DecisionForNextRound"" (play (if (> 5 (abs (- (count Cell at:(handSite P1)) (count Cell at:(handSite P2))))) (do (if (= 1 (count Cell at:(handSite P1))) (and (set Value P1 1) (fromTo (from (handSite P1)) (to (handSite P2)) count:1)) (if (= 1 (count Cell at:(handSite P2))) (and (set Value P2 1) (fromTo (from (handSite P2)) (to (handSite P1)) count:1)) (if (= 2 (count Cell at:(handSite P2))) (set Var ""Bha"" 1) (if (= 2 (count Cell at:(handSite P1))) (set Var ""Bha"" 2))))) next:(if (= (var ""Bha"") P1) (move Select (from (intersection (union (sites Left) (sites Right)) (sites P1))) (then (and (set State at:(last To) 1) (set Var ""Bha"" 0)))) (if (= (var ""Bha"") P2) (move Select (from (intersection (union (sites Left) (sites Right)) (sites P2))) (then (and (set State at:(last To) 2) (set Var ""Bha"" 0)))) (move Pass)))) (move Pass))) (nextPhase ""Sowing""))}))" -"2x5-10 holes (six is the most common), two stores on either end six counters in each hole. Play begins from any hole in a player's row, and counters can be sown in either direction. If sowing fails to reach a hole in the opponent's row, the player makes a second move from a loaded hole in the opposite direction, continuing to do so until they can sow in the opponent's row. If the last counter is sown in a loaded hole, the contents are lifted and sowing continues in the opposite direction. Play continues like this until the last counter lands in an empty hole. If the empty hole is in the opponent's row, play ends. If it lands in an empty hole in the player's row, the counters in the opponent's hole opposite it are placed in the store. If the next hole in the direction of sowing in the player's row is empty, the counters in the opponent's hole opposite that hole are also placed in the store. Single counters cannot be sown. Play continues until both players have only single counters in holes or all of the counters have been captured. These are then collected and placed in the store. If each player has the same number of counters, the game is a draw. If the number of counters is unequal, the player with fewer counters arranges them in their row however they wish. The opponent then matches this arrangement, placing any extras in the store. If the player has fewer than half of the original number of counters, the board is decreased in size by one hole. If less than a quarter, it is decreased by two holes, and if less than one eight, decreased by three holes. If in subsequent rounds a player regains more than one half/one quarter/one eighth of the original total, the board size is increased appropriately. Play continues until one player has all the counters. Each player has 6 holes.","(game ""Kiuthi"" (players 2) (equipment {(mancalaBoard 2 6 {(track ""TrackCCW"" ""1,E,N,W"" loop:True) (track ""TrackCW"" ""6,W,N,E"" loop:True)}) (piece ""Seed"" Shared) (regions P1 (sites Bottom)) (regions P2 (sites Top)) (map {(pair P1 FirstSite) (pair P2 LastSite)})}) (rules (start {(set Count 6 to:(sites Track)) (set RememberValue ""Playable"" (union (sites Top) (sites Bottom)))}) phases:{(phase ""Sowing"" (play (or (if (!= 2 (var ""Direction"")) (move Select (from (if (is Prev Mover) (if (= 1 (var ""ReachOpponent"")) (sites {(var ""Replay"")}) (sites Mover)) (sites Mover)) if:(and (< 1 (count at:(from))) (is In (from) (sites (values Remembered ""Playable""))))) (then (if (!= 1 (var ""OppositeDirection"")) (sow ""TrackCCW"" apply:(if (!= 1 (var ""ReachOpponent"")) (if (is In (to) (sites Next)) (if (< 1 (count at:(to))) (and {(moveAgain) (set Var ""Replay"" (to)) (set Var ""ReachOpponent"" 1) (if (= 1 (var ""OppositeDirection"")) (set Var ""OppositeDirection"" 0) (set Var ""OppositeDirection"" 1)) (set Var ""Direction"" 1)}) (and (set Var ""ReachOpponent"" 0) (set Var ""Direction"" 0))) (moveAgain)) (if (< 1 (count at:(to))) (and {(moveAgain) (set Var ""Replay"" (to)) (if (= 1 (var ""OppositeDirection"")) (set Var ""OppositeDirection"" 0) (set Var ""OppositeDirection"" 1)) (set Var ""Direction"" 1)}) (and {(set Var ""ReachOpponent"" 0) (set Var ""OppositeDirection"" 0) (set Var ""Direction"" 0) (if (is In (to) (sites Mover)) (if (is Occupied (if (is Mover P1) (+ (to) 6) (- (to) 6))) (and (fromTo (from (if (is Mover P1) (+ (to) 6) (- (to) 6))) (to (mapEntry Mover)) count:(count at:(if (is Mover P1) (+ (to) 6) (- (to) 6)))) (if (and (is Empty (trackSite Move from:(to) ""TrackCCW"" steps:1)) (is In (trackSite Move from:(to) ""TrackCCW"" steps:1) (sites Mover))) (if (is Occupied (if (is Mover P1) (+ (trackSite Move from:(to) ""TrackCCW"" steps:1) 6) (- (trackSite Move from:(to) ""TrackCCW"" steps:1) 6))) (fromTo (from (if (is Mover P1) (+ (trackSite Move from:(to) ""TrackCCW"" steps:1) 6) (- (trackSite Move from:(to) ""TrackCCW"" steps:1) 6))) (to (mapEntry Mover)) count:(count at:(if (is Mover P1) (+ (trackSite Move from:(to) ""TrackCCW"" steps:1) 6) (- (trackSite Move from:(to) ""TrackCCW"" steps:1) 6)))))))))}))) skipIf:(not (is In (to) (sites (values Remembered ""Playable""))))) (sow ""TrackCW"" apply:(if (!= 1 (var ""ReachOpponent"")) (if (is In (to) (sites Next)) (if (< 1 (count at:(to))) (and {(moveAgain) (set Var ""Replay"" (to)) (set Var ""ReachOpponent"" 1) (if (= 1 (var ""OppositeDirection"")) (set Var ""OppositeDirection"" 0) (set Var ""OppositeDirection"" 1)) (set Var ""Direction"" 1)}) (and (set Var ""ReachOpponent"" 0) (set Var ""Direction"" 0))) (moveAgain)) (if (< 1 (count at:(to))) (and {(moveAgain) (set Var ""Replay"" (to)) (if (= 1 (var ""OppositeDirection"")) (set Var ""OppositeDirection"" 0) (set Var ""OppositeDirection"" 1)) (set Var ""Direction"" 1)}) (and {(set Var ""ReachOpponent"" 0) (set Var ""OppositeDirection"" 0) (set Var ""Direction"" 0) (if (is In (to) (sites Mover)) (if (is Occupied (if (is Mover P1) (+ (to) 6) (- (to) 6))) (and (fromTo (from (if (is Mover P1) (+ (to) 6) (- (to) 6))) (to (mapEntry Mover)) count:(count at:(if (is Mover P1) (+ (to) 6) (- (to) 6)))) (if (and (is Empty (trackSite Move from:(to) ""TrackCW"" steps:1)) (is In (trackSite Move from:(to) ""TrackCW"" steps:1) (sites Mover))) (if (is Occupied (if (is Mover P1) (+ (trackSite Move from:(to) ""TrackCW"" steps:1) 6) (- (trackSite Move from:(to) ""TrackCW"" steps:1) 6))) (fromTo (from (if (is Mover P1) (+ (trackSite Move from:(to) ""TrackCW"" steps:1) 6) (- (trackSite Move from:(to) ""TrackCW"" steps:1) 6))) (to (mapEntry Mover)) count:(count at:(if (is Mover P1) (+ (trackSite Move from:(to) ""TrackCW"" steps:1) 6) (- (trackSite Move from:(to) ""TrackCW"" steps:1) 6)))))))))}))) skipIf:(not (is In (to) (sites (values Remembered ""Playable""))))))))) (if (!= 1 (var ""Direction"")) (move Select (from (if (is Prev Mover) (if (= 1 (var ""ReachOpponent"")) (sites {(var ""Replay"")}) (sites Mover)) (sites Mover)) if:(and (< 1 (count at:(from))) (is In (from) (sites (values Remembered ""Playable""))))) (then (if (!= 1 (var ""OppositeDirection"")) (sow ""TrackCW"" apply:(if (!= 1 (var ""ReachOpponent"")) (if (is In (to) (sites Next)) (if (< 1 (count at:(to))) (and {(moveAgain) (set Var ""Replay"" (to)) (set Var ""ReachOpponent"" 1) (if (= 1 (var ""OppositeDirection"")) (set Var ""OppositeDirection"" 0) (set Var ""OppositeDirection"" 1)) (set Var ""Direction"" 2)}) (and (set Var ""ReachOpponent"" 0) (set Var ""Direction"" 0))) (moveAgain)) (if (< 1 (count at:(to))) (and {(moveAgain) (set Var ""Replay"" (to)) (if (= 1 (var ""OppositeDirection"")) (set Var ""OppositeDirection"" 0) (set Var ""OppositeDirection"" 1)) (set Var ""Direction"" 2)}) (and {(set Var ""ReachOpponent"" 0) (set Var ""OppositeDirection"" 0) (set Var ""Direction"" 0) (if (is In (to) (sites Mover)) (if (is Occupied (if (is Mover P1) (+ (to) 6) (- (to) 6))) (and (fromTo (from (if (is Mover P1) (+ (to) 6) (- (to) 6))) (to (mapEntry Mover)) count:(count at:(if (is Mover P1) (+ (to) 6) (- (to) 6)))) (if (and (is Empty (trackSite Move from:(to) ""TrackCW"" steps:1)) (is In (trackSite Move from:(to) ""TrackCW"" steps:1) (sites Mover))) (if (is Occupied (if (is Mover P1) (+ (trackSite Move from:(to) ""TrackCW"" steps:1) 6) (- (trackSite Move from:(to) ""TrackCW"" steps:1) 6))) (fromTo (from (if (is Mover P1) (+ (trackSite Move from:(to) ""TrackCW"" steps:1) 6) (- (trackSite Move from:(to) ""TrackCW"" steps:1) 6))) (to (mapEntry Mover)) count:(count at:(if (is Mover P1) (+ (trackSite Move from:(to) ""TrackCW"" steps:1) 6) (- (trackSite Move from:(to) ""TrackCW"" steps:1) 6)))))))))}))) skipIf:(not (is In (to) (sites (values Remembered ""Playable""))))) (sow ""TrackCCW"" apply:(if (!= 1 (var ""ReachOpponent"")) (if (is In (to) (sites Next)) (if (< 1 (count at:(to))) (and {(moveAgain) (set Var ""Replay"" (to)) (set Var ""ReachOpponent"" 1) (if (= 1 (var ""OppositeDirection"")) (set Var ""OppositeDirection"" 0) (set Var ""OppositeDirection"" 1)) (set Var ""Direction"" 2)}) (and (set Var ""ReachOpponent"" 0) (set Var ""Direction"" 0))) (moveAgain)) (if (< 1 (count at:(to))) (and {(moveAgain) (set Var ""Replay"" (to)) (if (= 1 (var ""OppositeDirection"")) (set Var ""OppositeDirection"" 0) (set Var ""OppositeDirection"" 1)) (set Var ""Direction"" 2)}) (and {(set Var ""ReachOpponent"" 0) (set Var ""OppositeDirection"" 0) (set Var ""Direction"" 0) (if (is In (to) (sites Mover)) (if (is Occupied (if (is Mover P1) (+ (to) 6) (- (to) 6))) (and (fromTo (from (if (is Mover P1) (+ (to) 6) (- (to) 6))) (to (mapEntry Mover)) count:(count at:(if (is Mover P1) (+ (to) 6) (- (to) 6)))) (if (and (is Empty (trackSite Move from:(to) ""TrackCCW"" steps:1)) (is In (trackSite Move from:(to) ""TrackCCW"" steps:1) (sites Mover))) (if (is Occupied (if (is Mover P1) (+ (trackSite Move from:(to) ""TrackCCW"" steps:1) 6) (- (trackSite Move from:(to) ""TrackCCW"" steps:1) 6))) (fromTo (from (if (is Mover P1) (+ (trackSite Move from:(to) ""TrackCCW"" steps:1) 6) (- (trackSite Move from:(to) ""TrackCCW"" steps:1) 6))) (to (mapEntry Mover)) count:(count at:(if (is Mover P1) (+ (trackSite Move from:(to) ""TrackCCW"" steps:1) 6) (- (trackSite Move from:(to) ""TrackCCW"" steps:1) 6)))))))))}))) skipIf:(not (is In (to) (sites (values Remembered ""Playable""))))))))) (then (if (all Sites (union (sites Top) (sites Bottom)) if:(>= 1 (count at:(site)))) (and {(forEach Site (sites P1) (fromTo (from (site)) (to (mapEntry P1)) count:(count at:(site)))) (forEach Site (sites P2) (fromTo (from (site)) (to (mapEntry P2)) count:(count at:(site)))) (forget Value ""Playable"" All) (if (< (+ (count at:(mapEntry P1)) (count in:(sites P1))) (+ (count at:(mapEntry P2)) (count in:(sites P2)))) (and (set NextPlayer (player 1)) (if (< (+ (count at:(mapEntry P1)) (count in:(sites P1))) (/ (* 6 (count Sites in:(union (sites Top) (sites Bottom)))) 8)) (forEach Site (difference (union (sites Top) (sites Bottom)) (expand (sites Right) steps:3)) (remember Value ""Playable"" (site))) (if (< (+ (count at:(mapEntry P1)) (count in:(sites P1))) (/ (* 6 (count Sites in:(union (sites Top) (sites Bottom)))) 4)) (forEach Site (difference (union (sites Top) (sites Bottom)) (expand (sites Right) steps:2)) (remember Value ""Playable"" (site))) (if (< (+ (count at:(mapEntry P1)) (count in:(sites P1))) (/ (* 6 (count Sites in:(union (sites Top) (sites Bottom)))) 2)) (forEach Site (difference (union (sites Top) (sites Bottom)) (expand (sites Right))) (remember Value ""Playable"" (site))) (forEach Site (union (sites Top) (sites Bottom)) (remember Value ""Playable"" (site))))))) (and (set NextPlayer (player 2)) (if (< (+ (count at:(mapEntry P2)) (count in:(sites P2))) (/ (* 6 (count Sites in:(union (sites Top) (sites Bottom)))) 8)) (forEach Site (difference (union (sites Top) (sites Bottom)) (expand (sites Right) steps:3)) (remember Value ""Playable"" (site))) (if (< (+ (count at:(mapEntry P2)) (count in:(sites P2))) (/ (* 6 (count Sites in:(union (sites Top) (sites Bottom)))) 4)) (forEach Site (difference (union (sites Top) (sites Bottom)) (expand (sites Right) steps:2)) (remember Value ""Playable"" (site))) (if (< (+ (count at:(mapEntry P2)) (count in:(sites P2))) (/ (* 6 (count Sites in:(union (sites Top) (sites Bottom)))) 2)) (forEach Site (difference (union (sites Top) (sites Bottom)) (expand (sites Right))) (remember Value ""Playable"" (site))) (forEach Site (union (sites Top) (sites Bottom)) (remember Value ""Playable"" (site))))))))}))))) (end (if (no Pieces All in:(union (sites Top) (sites Bottom))) {(if (= 0 (count at:(mapEntry P1))) (result P2 Win)) (if (= 0 (count at:(mapEntry P2))) (result P1 Win)) (if (= (count at:(mapEntry P1)) (count at:(mapEntry P2))) (result Mover Draw))})) (nextPhase (no Pieces All in:(union (sites Top) (sites Bottom))) ""BetweenRounds"")) (phase ""BetweenRounds"" (play (if (is Occupied (mapEntry Mover)) (forEach Value min:1 max:(count at:(mapEntry Mover)) (move (from (mapEntry Mover)) (to (sites Mover) if:(is In (to) (sites (values Remembered ""Playable"")))) count:(value))) (then (if (is Occupied (mapEntry Mover)) (moveAgain) (forEach Site (sites Mover) (if (is Occupied (site)) (fromTo (from (mapEntry Next)) (to (if (is Mover P1) (+ (site) 6) (- (site) 6))) count:(count at:(site))))))))) (nextPhase (is Empty (mapEntry Mover)) ""Sowing""))}))","###Description -2x5-10 holes (six is the most common), two stores on either end six counters in each hole. Play begins from any hole in a player's row, and counters can be sown in either direction. If sowing fails to reach a hole in the opponent's row, the player makes a second move from a loaded hole in the opposite direction, continuing to do so until they can sow in the opponent's row. If the last counter is sown in a loaded hole, the contents are lifted and sowing continues in the opposite direction. Play continues like this until the last counter lands in an empty hole. If the empty hole is in the opponent's row, play ends. If it lands in an empty hole in the player's row, the counters in the opponent's hole opposite it are placed in the store. If the next hole in the direction of sowing in the player's row is empty, the counters in the opponent's hole opposite that hole are also placed in the store. Single counters cannot be sown. Play continues until both players have only single counters in holes or all of the counters have been captured. These are then collected and placed in the store. If each player has the same number of counters, the game is a draw. If the number of counters is unequal, the player with fewer counters arranges them in their row however they wish. The opponent then matches this arrangement, placing any extras in the store. If the player has fewer than half of the original number of counters, the board is decreased in size by one hole. If less than a quarter, it is decreased by two holes, and if less than one eight, decreased by three holes. If in subsequent rounds a player regains more than one half/one quarter/one eighth of the original total, the board size is increased appropriately. Play continues until one player has all the counters. Each player has 6 holes. - -###Ludii -(game ""Kiuthi"" (players 2) (equipment {(mancalaBoard 2 6 {(track ""TrackCCW"" ""1,E,N,W"" loop:True) (track ""TrackCW"" ""6,W,N,E"" loop:True)}) (piece ""Seed"" Shared) (regions P1 (sites Bottom)) (regions P2 (sites Top)) (map {(pair P1 FirstSite) (pair P2 LastSite)})}) (rules (start {(set Count 6 to:(sites Track)) (set RememberValue ""Playable"" (union (sites Top) (sites Bottom)))}) phases:{(phase ""Sowing"" (play (or (if (!= 2 (var ""Direction"")) (move Select (from (if (is Prev Mover) (if (= 1 (var ""ReachOpponent"")) (sites {(var ""Replay"")}) (sites Mover)) (sites Mover)) if:(and (< 1 (count at:(from))) (is In (from) (sites (values Remembered ""Playable""))))) (then (if (!= 1 (var ""OppositeDirection"")) (sow ""TrackCCW"" apply:(if (!= 1 (var ""ReachOpponent"")) (if (is In (to) (sites Next)) (if (< 1 (count at:(to))) (and {(moveAgain) (set Var ""Replay"" (to)) (set Var ""ReachOpponent"" 1) (if (= 1 (var ""OppositeDirection"")) (set Var ""OppositeDirection"" 0) (set Var ""OppositeDirection"" 1)) (set Var ""Direction"" 1)}) (and (set Var ""ReachOpponent"" 0) (set Var ""Direction"" 0))) (moveAgain)) (if (< 1 (count at:(to))) (and {(moveAgain) (set Var ""Replay"" (to)) (if (= 1 (var ""OppositeDirection"")) (set Var ""OppositeDirection"" 0) (set Var ""OppositeDirection"" 1)) (set Var ""Direction"" 1)}) (and {(set Var ""ReachOpponent"" 0) (set Var ""OppositeDirection"" 0) (set Var ""Direction"" 0) (if (is In (to) (sites Mover)) (if (is Occupied (if (is Mover P1) (+ (to) 6) (- (to) 6))) (and (fromTo (from (if (is Mover P1) (+ (to) 6) (- (to) 6))) (to (mapEntry Mover)) count:(count at:(if (is Mover P1) (+ (to) 6) (- (to) 6)))) (if (and (is Empty (trackSite Move from:(to) ""TrackCCW"" steps:1)) (is In (trackSite Move from:(to) ""TrackCCW"" steps:1) (sites Mover))) (if (is Occupied (if (is Mover P1) (+ (trackSite Move from:(to) ""TrackCCW"" steps:1) 6) (- (trackSite Move from:(to) ""TrackCCW"" steps:1) 6))) (fromTo (from (if (is Mover P1) (+ (trackSite Move from:(to) ""TrackCCW"" steps:1) 6) (- (trackSite Move from:(to) ""TrackCCW"" steps:1) 6))) (to (mapEntry Mover)) count:(count at:(if (is Mover P1) (+ (trackSite Move from:(to) ""TrackCCW"" steps:1) 6) (- (trackSite Move from:(to) ""TrackCCW"" steps:1) 6)))))))))}))) skipIf:(not (is In (to) (sites (values Remembered ""Playable""))))) (sow ""TrackCW"" apply:(if (!= 1 (var ""ReachOpponent"")) (if (is In (to) (sites Next)) (if (< 1 (count at:(to))) (and {(moveAgain) (set Var ""Replay"" (to)) (set Var ""ReachOpponent"" 1) (if (= 1 (var ""OppositeDirection"")) (set Var ""OppositeDirection"" 0) (set Var ""OppositeDirection"" 1)) (set Var ""Direction"" 1)}) (and (set Var ""ReachOpponent"" 0) (set Var ""Direction"" 0))) (moveAgain)) (if (< 1 (count at:(to))) (and {(moveAgain) (set Var ""Replay"" (to)) (if (= 1 (var ""OppositeDirection"")) (set Var ""OppositeDirection"" 0) (set Var ""OppositeDirection"" 1)) (set Var ""Direction"" 1)}) (and {(set Var ""ReachOpponent"" 0) (set Var ""OppositeDirection"" 0) (set Var ""Direction"" 0) (if (is In (to) (sites Mover)) (if (is Occupied (if (is Mover P1) (+ (to) 6) (- (to) 6))) (and (fromTo (from (if (is Mover P1) (+ (to) 6) (- (to) 6))) (to (mapEntry Mover)) count:(count at:(if (is Mover P1) (+ (to) 6) (- (to) 6)))) (if (and (is Empty (trackSite Move from:(to) ""TrackCW"" steps:1)) (is In (trackSite Move from:(to) ""TrackCW"" steps:1) (sites Mover))) (if (is Occupied (if (is Mover P1) (+ (trackSite Move from:(to) ""TrackCW"" steps:1) 6) (- (trackSite Move from:(to) ""TrackCW"" steps:1) 6))) (fromTo (from (if (is Mover P1) (+ (trackSite Move from:(to) ""TrackCW"" steps:1) 6) (- (trackSite Move from:(to) ""TrackCW"" steps:1) 6))) (to (mapEntry Mover)) count:(count at:(if (is Mover P1) (+ (trackSite Move from:(to) ""TrackCW"" steps:1) 6) (- (trackSite Move from:(to) ""TrackCW"" steps:1) 6)))))))))}))) skipIf:(not (is In (to) (sites (values Remembered ""Playable""))))))))) (if (!= 1 (var ""Direction"")) (move Select (from (if (is Prev Mover) (if (= 1 (var ""ReachOpponent"")) (sites {(var ""Replay"")}) (sites Mover)) (sites Mover)) if:(and (< 1 (count at:(from))) (is In (from) (sites (values Remembered ""Playable""))))) (then (if (!= 1 (var ""OppositeDirection"")) (sow ""TrackCW"" apply:(if (!= 1 (var ""ReachOpponent"")) (if (is In (to) (sites Next)) (if (< 1 (count at:(to))) (and {(moveAgain) (set Var ""Replay"" (to)) (set Var ""ReachOpponent"" 1) (if (= 1 (var ""OppositeDirection"")) (set Var ""OppositeDirection"" 0) (set Var ""OppositeDirection"" 1)) (set Var ""Direction"" 2)}) (and (set Var ""ReachOpponent"" 0) (set Var ""Direction"" 0))) (moveAgain)) (if (< 1 (count at:(to))) (and {(moveAgain) (set Var ""Replay"" (to)) (if (= 1 (var ""OppositeDirection"")) (set Var ""OppositeDirection"" 0) (set Var ""OppositeDirection"" 1)) (set Var ""Direction"" 2)}) (and {(set Var ""ReachOpponent"" 0) (set Var ""OppositeDirection"" 0) (set Var ""Direction"" 0) (if (is In (to) (sites Mover)) (if (is Occupied (if (is Mover P1) (+ (to) 6) (- (to) 6))) (and (fromTo (from (if (is Mover P1) (+ (to) 6) (- (to) 6))) (to (mapEntry Mover)) count:(count at:(if (is Mover P1) (+ (to) 6) (- (to) 6)))) (if (and (is Empty (trackSite Move from:(to) ""TrackCW"" steps:1)) (is In (trackSite Move from:(to) ""TrackCW"" steps:1) (sites Mover))) (if (is Occupied (if (is Mover P1) (+ (trackSite Move from:(to) ""TrackCW"" steps:1) 6) (- (trackSite Move from:(to) ""TrackCW"" steps:1) 6))) (fromTo (from (if (is Mover P1) (+ (trackSite Move from:(to) ""TrackCW"" steps:1) 6) (- (trackSite Move from:(to) ""TrackCW"" steps:1) 6))) (to (mapEntry Mover)) count:(count at:(if (is Mover P1) (+ (trackSite Move from:(to) ""TrackCW"" steps:1) 6) (- (trackSite Move from:(to) ""TrackCW"" steps:1) 6)))))))))}))) skipIf:(not (is In (to) (sites (values Remembered ""Playable""))))) (sow ""TrackCCW"" apply:(if (!= 1 (var ""ReachOpponent"")) (if (is In (to) (sites Next)) (if (< 1 (count at:(to))) (and {(moveAgain) (set Var ""Replay"" (to)) (set Var ""ReachOpponent"" 1) (if (= 1 (var ""OppositeDirection"")) (set Var ""OppositeDirection"" 0) (set Var ""OppositeDirection"" 1)) (set Var ""Direction"" 2)}) (and (set Var ""ReachOpponent"" 0) (set Var ""Direction"" 0))) (moveAgain)) (if (< 1 (count at:(to))) (and {(moveAgain) (set Var ""Replay"" (to)) (if (= 1 (var ""OppositeDirection"")) (set Var ""OppositeDirection"" 0) (set Var ""OppositeDirection"" 1)) (set Var ""Direction"" 2)}) (and {(set Var ""ReachOpponent"" 0) (set Var ""OppositeDirection"" 0) (set Var ""Direction"" 0) (if (is In (to) (sites Mover)) (if (is Occupied (if (is Mover P1) (+ (to) 6) (- (to) 6))) (and (fromTo (from (if (is Mover P1) (+ (to) 6) (- (to) 6))) (to (mapEntry Mover)) count:(count at:(if (is Mover P1) (+ (to) 6) (- (to) 6)))) (if (and (is Empty (trackSite Move from:(to) ""TrackCCW"" steps:1)) (is In (trackSite Move from:(to) ""TrackCCW"" steps:1) (sites Mover))) (if (is Occupied (if (is Mover P1) (+ (trackSite Move from:(to) ""TrackCCW"" steps:1) 6) (- (trackSite Move from:(to) ""TrackCCW"" steps:1) 6))) (fromTo (from (if (is Mover P1) (+ (trackSite Move from:(to) ""TrackCCW"" steps:1) 6) (- (trackSite Move from:(to) ""TrackCCW"" steps:1) 6))) (to (mapEntry Mover)) count:(count at:(if (is Mover P1) (+ (trackSite Move from:(to) ""TrackCCW"" steps:1) 6) (- (trackSite Move from:(to) ""TrackCCW"" steps:1) 6)))))))))}))) skipIf:(not (is In (to) (sites (values Remembered ""Playable""))))))))) (then (if (all Sites (union (sites Top) (sites Bottom)) if:(>= 1 (count at:(site)))) (and {(forEach Site (sites P1) (fromTo (from (site)) (to (mapEntry P1)) count:(count at:(site)))) (forEach Site (sites P2) (fromTo (from (site)) (to (mapEntry P2)) count:(count at:(site)))) (forget Value ""Playable"" All) (if (< (+ (count at:(mapEntry P1)) (count in:(sites P1))) (+ (count at:(mapEntry P2)) (count in:(sites P2)))) (and (set NextPlayer (player 1)) (if (< (+ (count at:(mapEntry P1)) (count in:(sites P1))) (/ (* 6 (count Sites in:(union (sites Top) (sites Bottom)))) 8)) (forEach Site (difference (union (sites Top) (sites Bottom)) (expand (sites Right) steps:3)) (remember Value ""Playable"" (site))) (if (< (+ (count at:(mapEntry P1)) (count in:(sites P1))) (/ (* 6 (count Sites in:(union (sites Top) (sites Bottom)))) 4)) (forEach Site (difference (union (sites Top) (sites Bottom)) (expand (sites Right) steps:2)) (remember Value ""Playable"" (site))) (if (< (+ (count at:(mapEntry P1)) (count in:(sites P1))) (/ (* 6 (count Sites in:(union (sites Top) (sites Bottom)))) 2)) (forEach Site (difference (union (sites Top) (sites Bottom)) (expand (sites Right))) (remember Value ""Playable"" (site))) (forEach Site (union (sites Top) (sites Bottom)) (remember Value ""Playable"" (site))))))) (and (set NextPlayer (player 2)) (if (< (+ (count at:(mapEntry P2)) (count in:(sites P2))) (/ (* 6 (count Sites in:(union (sites Top) (sites Bottom)))) 8)) (forEach Site (difference (union (sites Top) (sites Bottom)) (expand (sites Right) steps:3)) (remember Value ""Playable"" (site))) (if (< (+ (count at:(mapEntry P2)) (count in:(sites P2))) (/ (* 6 (count Sites in:(union (sites Top) (sites Bottom)))) 4)) (forEach Site (difference (union (sites Top) (sites Bottom)) (expand (sites Right) steps:2)) (remember Value ""Playable"" (site))) (if (< (+ (count at:(mapEntry P2)) (count in:(sites P2))) (/ (* 6 (count Sites in:(union (sites Top) (sites Bottom)))) 2)) (forEach Site (difference (union (sites Top) (sites Bottom)) (expand (sites Right))) (remember Value ""Playable"" (site))) (forEach Site (union (sites Top) (sites Bottom)) (remember Value ""Playable"" (site))))))))}))))) (end (if (no Pieces All in:(union (sites Top) (sites Bottom))) {(if (= 0 (count at:(mapEntry P1))) (result P2 Win)) (if (= 0 (count at:(mapEntry P2))) (result P1 Win)) (if (= (count at:(mapEntry P1)) (count at:(mapEntry P2))) (result Mover Draw))})) (nextPhase (no Pieces All in:(union (sites Top) (sites Bottom))) ""BetweenRounds"")) (phase ""BetweenRounds"" (play (if (is Occupied (mapEntry Mover)) (forEach Value min:1 max:(count at:(mapEntry Mover)) (move (from (mapEntry Mover)) (to (sites Mover) if:(is In (to) (sites (values Remembered ""Playable"")))) count:(value))) (then (if (is Occupied (mapEntry Mover)) (moveAgain) (forEach Site (sites Mover) (if (is Occupied (site)) (fromTo (from (mapEntry Next)) (to (if (is Mover P1) (+ (site) 6) (- (site) 6))) count:(count at:(site))))))))) (nextPhase (is Empty (mapEntry Mover)) ""Sowing""))}))" "2x6 board. Four counters per hole. Each player's rightmost hole is their ""hogon,"" from which they cannot sow, except they must when it reaches fourteen counters. Sowing occurs in an anti-clockwise direction. Sowing from a hole with a single counter is forbidden. When the older player has only single counters in their regular holes, they pass. When the younger player has only single counters in their regular holes, they sow from their hogon. When a player must sow from their hogon and the opponent's holes only contain single counters, the player picks these up and sows them along with the contents of the hogon. When one player only has single counters in their row, the opponent wins. Each row has 6 holes. Each hole has initially 4 seeds.","(game ""Koro"" (players 2) (equipment {(mancalaBoard 2 6 store:None (track ""Track"" ""0,E,N,W"" loop:True)) (piece ""Seed"" Shared) (hand Each) (map ""Hogon"" {(pair P1 5) (pair P2 6)}) (regions P1 (sites Bottom)) (regions P2 (sites Top))}) (rules (start (set Count 4 to:(sites Track))) (play (if (<= 14 (count at:(mapEntry ""Hogon"" Mover))) (move Select (from (mapEntry ""Hogon"" Mover)) (then (sow))) (if (all Sites (difference (sites Mover) (mapEntry ""Hogon"" Mover)) if:(>= 1 (count at:(site)))) (if (is Mover P1) (move Pass) (do (if (all Sites (difference (sites Next) (mapEntry ""Hogon"" Next)) if:(>= 1 (count at:(site)))) (forEach Site (difference (sites Next) (mapEntry ""Hogon"" Next)) (if (is Occupied (site)) (fromTo (from (site)) (to (mapEntry ""Hogon"" Mover)))))) next:(move Select (from (mapEntry ""Hogon"" Mover) if:(< 1 (count at:(from)))) (then (sow))))) (move Select (from (difference (sites Mover) (mapEntry ""Hogon"" Mover)) if:(< 1 (count at:(from)))) (then (sow)))))) (end (forEach Player if:(all Sites (sites Player) if:(>= 1 (count at:(site)))) (result Player Loss)))))","###Description 2x6 board. Four counters per hole. Each player's rightmost hole is their ""hogon,"" from which they cannot sow, except they must when it reaches fourteen counters. Sowing occurs in an anti-clockwise direction. Sowing from a hole with a single counter is forbidden. When the older player has only single counters in their regular holes, they pass. When the younger player has only single counters in their regular holes, they sow from their hogon. When a player must sow from their hogon and the opponent's holes only contain single counters, the player picks these up and sows them along with the contents of the hogon. When one player only has single counters in their row, the opponent wins. Each row has 6 holes. Each hole has initially 4 seeds. @@ -2014,11 +1949,6 @@ Two rows of six holes with stores on either end. Four counters in each hole. Pla ###Ludii (game ""Ntyenge"" (players 2) (equipment {(mancalaBoard 2 8 store:None (track ""Track"" ""0,E,N,W"" loop:True)) (piece ""Seed"" Shared) (regions P1 (sites Bottom)) (regions P2 (sites Top)) (hand Each)}) (rules (start (set Count 4 to:(sites Track))) (play (move Select (from (sites Mover) if:(> (count at:(from)) 0)) (then (sow apply:(if (or (= 2 (count at:(to))) (= 4 (count at:(to)))) (fromTo (from (to)) (to (handSite Mover)) count:(count at:(to)))))))) (end (if (all Sites (sites Board) if:(= 0 (count at:(site)))) (byScore {(score P1 (+ (count Cell at:(handSite P1)) (count in:(sites P1)))) (score P2 (+ (count Cell at:(handSite P2)) (count in:(sites P2))))})))))" -"Oval board. Two semi-circles on the ends are stores, the middle section divided into two rows of five squares. Five counters in each of the rows of squares and one large stone in each end space. Sowing begins in any of the squares on the player's side of the board, and proceeds in either direction. Sowing also includes both end spaces. When the final counter is sown, the contents of the next square are picked up and sowing continues. If the end space is the next space, the turn ends. When the space after the one in which the final counter fell is empty, the contents of the hole after the empty hole are captured, including the end spaces. If there is an unbroken sequence of alternating empty and occupied squares, the contents of the occupied squares are captured. If there are two or more empty squares, the turn ends. If at any time the squares in a player's rows are empty, the player must place one of their captured counters into each of their squares. The game ends when both of the large stones in the end spaces are captured. The remaining counters belong to the player on whose row they are placed. The player with the most counters wins, with the large stones counting as ten. A new game begins. Players fill their holes with their captured stones. The player with fewer counters must then ""sell"" holes on their side to the opponent to have enough counters to fill the holes. If the difference in the number of captured counters is less than ten, the opponent is given half-ownership of a space, and the contents of it at the end of the game are split between the two players. If the difference is ten, the opponent then may take all of the stones from a sold space at the end of the game. The player may regain sold spaces on subsequent rounds by capturing ten counters more than their opponent. The game is then played as before. Games are played until three or four squares in the same row have been sold. The rules come from the Mancala World.","(game ""O An Quan"" (players 2) (equipment {(mancalaBoard 2 5 largeStack:True {(track ""TrackCCW"" ""0,1,E,11,10,W"" loop:True) (track ""TrackCW"" ""0,6,E,11,5,W"" loop:True)}) (piece ""Seed"" Shared) (piece ""Ball"" Shared) (hand Each size:2) (regions P1 (sites Bottom)) (regions P2 (sites Top)) (map {(pair P1 FirstSite) (pair P2 LastSite)}) (regions ""EndHoles"" (sites {""A1"" ""G1""}))}) (rules (start {(place Stack ""Seed"" (union (sites Bottom) (sites Top)) count:5) (place Stack ""Ball"" (sites {""A1"" ""G1""})) (set RememberValue ""OwnedP1"" (sites Bottom)) (set RememberValue ""OwnedP2"" (sites Top))}) phases:{(phase ""Sowing"" (play (or {(if (!= (var ""Direction"") 2) (move Select (from (if (is Prev Mover) (sites {(var ""Replay"")}) (if (is Mover P1) (sites (values Remembered ""OwnedP1"")) (sites (values Remembered ""OwnedP2"")))) if:(!= 0 (size Stack at:(from)))) (then (and {(forEach Value min:1 max:(size Stack at:(last From)) (fromTo (from (last From) level:(- (size Stack at:(last From)) (value))) (to (trackSite Move from:(last From) ""TrackCCW"" steps:(value))) stack:True)) (if (or (is In (trackSite Move from:(last From) ""TrackCCW"" steps:(+ 1 (size Stack at:(last From)))) (sites ""EndHoles"")) (>= (size Stack at:(last From)) 10)) (set Var ""Direction"" 0) (if (!= 0 (size Stack at:(trackSite Move from:(last From) ""TrackCCW"" steps:(+ 1 (size Stack at:(last From)))))) (and {(set Var ""Direction"" 1) (moveAgain) (set Var ""Replay"" (trackSite Move from:(last From) ""TrackCCW"" steps:(+ 1 (size Stack at:(last From)))))}) (and (set Var ""Direction"" 0) (if (is Occupied (trackSite Move from:(last From) ""TrackCCW"" steps:(+ 2 (size Stack at:(last From))))) (forEach Level (trackSite Move from:(last From) ""TrackCCW"" steps:(+ 2 (size Stack at:(last From)))) FromTop (if (= (id ""Seed"" Shared) (what at:(trackSite Move from:(last From) ""TrackCCW"" steps:(+ 2 (size Stack at:(last From)))) level:(level))) (fromTo (from (trackSite Move from:(last From) ""TrackCCW"" steps:(+ 2 (size Stack at:(last From)))) level:(level)) (to (handSite Mover))) (fromTo (from (trackSite Move from:(last From) ""TrackCCW"" steps:(+ 2 (size Stack at:(last From)))) level:(level)) (to (handSite Mover 1)))))))))})))) (if (!= (var ""Direction"") 1) (move Select (from (if (is Prev Mover) (sites {(var ""Replay"")}) (if (is Mover P1) (sites (values Remembered ""OwnedP1"")) (sites (values Remembered ""OwnedP2"")))) if:(!= 0 (size Stack at:(from)))) (then (and (forEach Value min:1 max:(size Stack at:(last From)) (fromTo (from (last From) level:(- (size Stack at:(last From)) (value))) (to (trackSite Move from:(last From) ""TrackCW"" steps:(value))) stack:True)) (if (or (is In (trackSite Move from:(last From) ""TrackCW"" steps:(+ 1 (size Stack at:(last From)))) (sites ""EndHoles"")) (>= (size Stack at:(last From)) 10)) (set Var ""Direction"" 0) (if (!= 0 (size Stack at:(trackSite Move from:(last From) ""TrackCW"" steps:(+ 1 (size Stack at:(last From)))))) (and {(set Var ""Direction"" 2) (moveAgain) (set Var ""Replay"" (trackSite Move from:(last From) ""TrackCW"" steps:(+ 1 (size Stack at:(last From)))))}) (and (set Var ""Direction"" 0) (if (is Occupied (trackSite Move from:(last From) ""TrackCW"" steps:(+ 2 (size Stack at:(last From))))) (forEach Level (trackSite Move from:(last From) ""TrackCW"" steps:(+ 2 (size Stack at:(last From)))) FromTop (if (= (id ""Seed"" Shared) (what at:(trackSite Move from:(last From) ""TrackCW"" steps:(+ 2 (size Stack at:(last From)))) level:(level))) (fromTo (from (trackSite Move from:(last From) ""TrackCW"" steps:(+ 2 (size Stack at:(last From)))) level:(level)) (to (handSite Mover))) (fromTo (from (trackSite Move from:(last From) ""TrackCW"" steps:(+ 2 (size Stack at:(last From)))) level:(level)) (to (handSite Mover 1)))))))))))))} (then (if (= 2 (count Cell in:(sites {(handSite P1 1) (handSite P2 1)}))) (and {(forEach Site (intersection (sites (values Remembered ""OwnedP1"")) (sites (values Remembered ""OwnedP2""))) (if (is Occupied (site)) (and (forEach Level (site) FromTop (if (>= (level) (/ (size Stack at:(site)) 2)) (fromTo (from (site) level:(level)) (to (handSite P1)) stack:True))) (forEach Level (site) FromTop (if (< (level) (/ (size Stack at:(site)) 2)) (fromTo (from (site) level:(level)) (to (handSite P2)) stack:True)))))) (forEach Site (union (difference (sites (values Remembered ""OwnedP1"")) (sites (values Remembered ""OwnedP2""))) (sites {(mapEntry P1)})) (if (is Occupied (site)) (forEach Level (site) FromTop (fromTo (from (site) level:(level)) (to (handSite P1)) stack:True)))) (forEach Site (union (difference (sites (values Remembered ""OwnedP2"")) (sites (values Remembered ""OwnedP1""))) (sites {(mapEntry P2)})) (if (is Occupied (site)) (forEach Level (site) FromTop (fromTo (from (site) level:(level)) (to (handSite P2)) stack:True)))) (forget Value ""OwnedP1"" All) (forget Value ""OwnedP2"" All)}) (and (if (and (if (= 1 P1) (no Pieces All in:(sites (values Remembered ""OwnedP1""))) (no Pieces All in:(sites (values Remembered ""OwnedP2"")))) (>= (size Stack Cell at:(handSite P1)) (if (= 1 P1) (count Sites in:(sites (values Remembered ""OwnedP1""))) (count Sites in:(sites (values Remembered ""OwnedP2"")))))) (forEach Value min:1 max:(if (= 1 P1) (count Sites in:(sites (values Remembered ""OwnedP1""))) (count Sites in:(sites (values Remembered ""OwnedP2"")))) (fromTo (from Cell (handSite P1) level:(- (size Stack Cell at:(handSite P1)) (value))) (to (regionSite (sites (values Remembered ""OwnedP1"")) index:(- (value) 1))) stack:True))) (if (and (if (= 1 P2) (no Pieces All in:(sites (values Remembered ""OwnedP1""))) (no Pieces All in:(sites (values Remembered ""OwnedP2"")))) (>= (size Stack Cell at:(handSite P2)) (if (= 1 P2) (count Sites in:(sites (values Remembered ""OwnedP1""))) (count Sites in:(sites (values Remembered ""OwnedP2"")))))) (forEach Value min:1 max:(if (= 1 P2) (count Sites in:(sites (values Remembered ""OwnedP1""))) (count Sites in:(sites (values Remembered ""OwnedP2"")))) (fromTo (from Cell (handSite P2) level:(- (size Stack Cell at:(handSite P2)) (value))) (to (regionSite (sites (values Remembered ""OwnedP2"")) index:(- (value) 1))) stack:True)))))))) (end (if (all Sites (sites Board) if:(= 0 (count at:(site)))) {(if (>= 9 (size Stack Cell at:(handSite P1))) (result P2 Win)) (if (>= 9 (size Stack Cell at:(handSite P2))) (result P1 Win))})) (nextPhase (all Sites (sites Board) if:(= 0 (count at:(site)))) ""BetweenRounds"")) (phase ""BetweenRounds"" (play (if (<= 5 (size Stack Cell at:(handSite Mover))) (move Select (from Cell (handSite Mover)) (to (trackSite FirstSite ""TrackCCW"" from:(mapEntry Mover) if:(and (not (is In (to) (sites ""EndHoles""))) (is Empty (to))))) (then (and {(forEach Value min:1 max:5 (fromTo (from Cell (last From) level:(- (size Stack Cell at:(last From)) (value))) (to (last To)) stack:True)) (if (is Mover P1) (remember Value ""OwnedP1"" (last To)) (remember Value ""OwnedP2"" (last To))) (if (<= 10 (count Cell at:(handSite Mover))) (moveAgain) (if (or (= 8 (count Cell at:(handSite Mover))) (= 9 (count Cell at:(handSite Mover)))) (and {(forEach Value min:1 max:(- (count Cell at:(handSite Mover)) 5) (fromTo (from Cell (handSite Mover) level:(- (- (size Stack Cell at:(handSite Mover)) 5) (value))) (to (trackSite FirstSite ""TrackCCW"" from:(trackSite FirstSite ""TrackCCW"" from:(mapEntry Mover) if:(and (not (is In (to) (sites ""EndHoles""))) (is Empty (to)))) if:(and {(not (is In (to) (sites ""EndHoles""))) (is Empty (to)) (!= (trackSite FirstSite ""TrackCCW"" from:(mapEntry Mover) if:(and (not (is In (to) (sites ""EndHoles""))) (is Empty (to)))) (to))}))) stack:True)) (forEach Value min:1 max:(- 5 (- (count Cell at:(handSite Mover)) 5)) (fromTo (from Cell (handSite Next) level:(- (size Stack Cell at:(handSite Next)) (value))) (to (trackSite FirstSite ""TrackCCW"" from:(trackSite FirstSite ""TrackCCW"" from:(mapEntry Mover) if:(and (not (is In (to) (sites ""EndHoles""))) (is Empty (to)))) if:(and {(not (is In (to) (sites ""EndHoles""))) (is Empty (to)) (!= (trackSite FirstSite ""TrackCCW"" from:(mapEntry Mover) if:(and (not (is In (to) (sites ""EndHoles""))) (is Empty (to)))) (to))}))) stack:True)) (if (is Mover P1) (remember Value ""OwnedP1"" (trackSite FirstSite ""TrackCCW"" from:(trackSite FirstSite ""TrackCCW"" from:(mapEntry Mover) if:(and (not (is In (to) (sites ""EndHoles""))) (is Empty (to)))) if:(and {(not (is In (to) (sites ""EndHoles""))) (is Empty (to)) (!= (trackSite FirstSite ""TrackCCW"" from:(mapEntry Mover) if:(and (not (is In (to) (sites ""EndHoles""))) (is Empty (to)))) (to))}))) (remember Value ""OwnedP2"" (trackSite FirstSite ""TrackCCW"" from:(trackSite FirstSite ""TrackCCW"" from:(mapEntry Mover) if:(and (not (is In (to) (sites ""EndHoles""))) (is Empty (to)))) if:(and {(not (is In (to) (sites ""EndHoles""))) (is Empty (to)) (!= (trackSite FirstSite ""TrackCCW"" from:(mapEntry Mover) if:(and (not (is In (to) (sites ""EndHoles""))) (is Empty (to)))) (to))})))) (if (is Mover P2) (remember Value ""OwnedP1"" (trackSite FirstSite ""TrackCCW"" from:(trackSite FirstSite ""TrackCCW"" from:(mapEntry Mover) if:(and (not (is In (to) (sites ""EndHoles""))) (is Empty (to)))) if:(and {(not (is In (to) (sites ""EndHoles""))) (is Empty (to)) (!= (trackSite FirstSite ""TrackCCW"" from:(mapEntry Mover) if:(and (not (is In (to) (sites ""EndHoles""))) (is Empty (to)))) (to))}))) (remember Value ""OwnedP2"" (trackSite FirstSite ""TrackCCW"" from:(trackSite FirstSite ""TrackCCW"" from:(mapEntry Mover) if:(and (not (is In (to) (sites ""EndHoles""))) (is Empty (to)))) if:(and {(not (is In (to) (sites ""EndHoles""))) (is Empty (to)) (!= (trackSite FirstSite ""TrackCCW"" from:(mapEntry Mover) if:(and (not (is In (to) (sites ""EndHoles""))) (is Empty (to)))) (to))}))))})))}))) (then (if (and (is Empty Cell (handSite P1)) (is Empty Cell (handSite P2))) (if (= (size Stack Cell at:(handSite P1 1)) 2) (and (fromTo (from Cell (handSite P1 1) level:1) (to (mapEntry P1)) stack:True) (fromTo (from Cell (handSite P1 1) level:0) (to (mapEntry P2)) stack:True)) (if (= (size Stack Cell at:(handSite P2 1)) 2) (and (fromTo (from Cell (handSite P2 1) level:1) (to (mapEntry P1)) stack:True) (fromTo (from Cell (handSite P2 1) level:0) (to (mapEntry P2)) stack:True)) (and (fromTo (from Cell (handSite P1 1) level:0) (to (mapEntry P1)) stack:True) (fromTo (from Cell (handSite P2 1) level:0) (to (mapEntry P2)) stack:True)))))))) (nextPhase (and (is Empty Cell (handSite P1)) (is Empty Cell (handSite P2))) ""Sowing""))}))","###Description -Oval board. Two semi-circles on the ends are stores, the middle section divided into two rows of five squares. Five counters in each of the rows of squares and one large stone in each end space. Sowing begins in any of the squares on the player's side of the board, and proceeds in either direction. Sowing also includes both end spaces. When the final counter is sown, the contents of the next square are picked up and sowing continues. If the end space is the next space, the turn ends. When the space after the one in which the final counter fell is empty, the contents of the hole after the empty hole are captured, including the end spaces. If there is an unbroken sequence of alternating empty and occupied squares, the contents of the occupied squares are captured. If there are two or more empty squares, the turn ends. If at any time the squares in a player's rows are empty, the player must place one of their captured counters into each of their squares. The game ends when both of the large stones in the end spaces are captured. The remaining counters belong to the player on whose row they are placed. The player with the most counters wins, with the large stones counting as ten. A new game begins. Players fill their holes with their captured stones. The player with fewer counters must then ""sell"" holes on their side to the opponent to have enough counters to fill the holes. If the difference in the number of captured counters is less than ten, the opponent is given half-ownership of a space, and the contents of it at the end of the game are split between the two players. If the difference is ten, the opponent then may take all of the stones from a sold space at the end of the game. The player may regain sold spaces on subsequent rounds by capturing ten counters more than their opponent. The game is then played as before. Games are played until three or four squares in the same row have been sold. The rules come from the Mancala World. - -###Ludii -(game ""O An Quan"" (players 2) (equipment {(mancalaBoard 2 5 largeStack:True {(track ""TrackCCW"" ""0,1,E,11,10,W"" loop:True) (track ""TrackCW"" ""0,6,E,11,5,W"" loop:True)}) (piece ""Seed"" Shared) (piece ""Ball"" Shared) (hand Each size:2) (regions P1 (sites Bottom)) (regions P2 (sites Top)) (map {(pair P1 FirstSite) (pair P2 LastSite)}) (regions ""EndHoles"" (sites {""A1"" ""G1""}))}) (rules (start {(place Stack ""Seed"" (union (sites Bottom) (sites Top)) count:5) (place Stack ""Ball"" (sites {""A1"" ""G1""})) (set RememberValue ""OwnedP1"" (sites Bottom)) (set RememberValue ""OwnedP2"" (sites Top))}) phases:{(phase ""Sowing"" (play (or {(if (!= (var ""Direction"") 2) (move Select (from (if (is Prev Mover) (sites {(var ""Replay"")}) (if (is Mover P1) (sites (values Remembered ""OwnedP1"")) (sites (values Remembered ""OwnedP2"")))) if:(!= 0 (size Stack at:(from)))) (then (and {(forEach Value min:1 max:(size Stack at:(last From)) (fromTo (from (last From) level:(- (size Stack at:(last From)) (value))) (to (trackSite Move from:(last From) ""TrackCCW"" steps:(value))) stack:True)) (if (or (is In (trackSite Move from:(last From) ""TrackCCW"" steps:(+ 1 (size Stack at:(last From)))) (sites ""EndHoles"")) (>= (size Stack at:(last From)) 10)) (set Var ""Direction"" 0) (if (!= 0 (size Stack at:(trackSite Move from:(last From) ""TrackCCW"" steps:(+ 1 (size Stack at:(last From)))))) (and {(set Var ""Direction"" 1) (moveAgain) (set Var ""Replay"" (trackSite Move from:(last From) ""TrackCCW"" steps:(+ 1 (size Stack at:(last From)))))}) (and (set Var ""Direction"" 0) (if (is Occupied (trackSite Move from:(last From) ""TrackCCW"" steps:(+ 2 (size Stack at:(last From))))) (forEach Level (trackSite Move from:(last From) ""TrackCCW"" steps:(+ 2 (size Stack at:(last From)))) FromTop (if (= (id ""Seed"" Shared) (what at:(trackSite Move from:(last From) ""TrackCCW"" steps:(+ 2 (size Stack at:(last From)))) level:(level))) (fromTo (from (trackSite Move from:(last From) ""TrackCCW"" steps:(+ 2 (size Stack at:(last From)))) level:(level)) (to (handSite Mover))) (fromTo (from (trackSite Move from:(last From) ""TrackCCW"" steps:(+ 2 (size Stack at:(last From)))) level:(level)) (to (handSite Mover 1)))))))))})))) (if (!= (var ""Direction"") 1) (move Select (from (if (is Prev Mover) (sites {(var ""Replay"")}) (if (is Mover P1) (sites (values Remembered ""OwnedP1"")) (sites (values Remembered ""OwnedP2"")))) if:(!= 0 (size Stack at:(from)))) (then (and (forEach Value min:1 max:(size Stack at:(last From)) (fromTo (from (last From) level:(- (size Stack at:(last From)) (value))) (to (trackSite Move from:(last From) ""TrackCW"" steps:(value))) stack:True)) (if (or (is In (trackSite Move from:(last From) ""TrackCW"" steps:(+ 1 (size Stack at:(last From)))) (sites ""EndHoles"")) (>= (size Stack at:(last From)) 10)) (set Var ""Direction"" 0) (if (!= 0 (size Stack at:(trackSite Move from:(last From) ""TrackCW"" steps:(+ 1 (size Stack at:(last From)))))) (and {(set Var ""Direction"" 2) (moveAgain) (set Var ""Replay"" (trackSite Move from:(last From) ""TrackCW"" steps:(+ 1 (size Stack at:(last From)))))}) (and (set Var ""Direction"" 0) (if (is Occupied (trackSite Move from:(last From) ""TrackCW"" steps:(+ 2 (size Stack at:(last From))))) (forEach Level (trackSite Move from:(last From) ""TrackCW"" steps:(+ 2 (size Stack at:(last From)))) FromTop (if (= (id ""Seed"" Shared) (what at:(trackSite Move from:(last From) ""TrackCW"" steps:(+ 2 (size Stack at:(last From)))) level:(level))) (fromTo (from (trackSite Move from:(last From) ""TrackCW"" steps:(+ 2 (size Stack at:(last From)))) level:(level)) (to (handSite Mover))) (fromTo (from (trackSite Move from:(last From) ""TrackCW"" steps:(+ 2 (size Stack at:(last From)))) level:(level)) (to (handSite Mover 1)))))))))))))} (then (if (= 2 (count Cell in:(sites {(handSite P1 1) (handSite P2 1)}))) (and {(forEach Site (intersection (sites (values Remembered ""OwnedP1"")) (sites (values Remembered ""OwnedP2""))) (if (is Occupied (site)) (and (forEach Level (site) FromTop (if (>= (level) (/ (size Stack at:(site)) 2)) (fromTo (from (site) level:(level)) (to (handSite P1)) stack:True))) (forEach Level (site) FromTop (if (< (level) (/ (size Stack at:(site)) 2)) (fromTo (from (site) level:(level)) (to (handSite P2)) stack:True)))))) (forEach Site (union (difference (sites (values Remembered ""OwnedP1"")) (sites (values Remembered ""OwnedP2""))) (sites {(mapEntry P1)})) (if (is Occupied (site)) (forEach Level (site) FromTop (fromTo (from (site) level:(level)) (to (handSite P1)) stack:True)))) (forEach Site (union (difference (sites (values Remembered ""OwnedP2"")) (sites (values Remembered ""OwnedP1""))) (sites {(mapEntry P2)})) (if (is Occupied (site)) (forEach Level (site) FromTop (fromTo (from (site) level:(level)) (to (handSite P2)) stack:True)))) (forget Value ""OwnedP1"" All) (forget Value ""OwnedP2"" All)}) (and (if (and (if (= 1 P1) (no Pieces All in:(sites (values Remembered ""OwnedP1""))) (no Pieces All in:(sites (values Remembered ""OwnedP2"")))) (>= (size Stack Cell at:(handSite P1)) (if (= 1 P1) (count Sites in:(sites (values Remembered ""OwnedP1""))) (count Sites in:(sites (values Remembered ""OwnedP2"")))))) (forEach Value min:1 max:(if (= 1 P1) (count Sites in:(sites (values Remembered ""OwnedP1""))) (count Sites in:(sites (values Remembered ""OwnedP2"")))) (fromTo (from Cell (handSite P1) level:(- (size Stack Cell at:(handSite P1)) (value))) (to (regionSite (sites (values Remembered ""OwnedP1"")) index:(- (value) 1))) stack:True))) (if (and (if (= 1 P2) (no Pieces All in:(sites (values Remembered ""OwnedP1""))) (no Pieces All in:(sites (values Remembered ""OwnedP2"")))) (>= (size Stack Cell at:(handSite P2)) (if (= 1 P2) (count Sites in:(sites (values Remembered ""OwnedP1""))) (count Sites in:(sites (values Remembered ""OwnedP2"")))))) (forEach Value min:1 max:(if (= 1 P2) (count Sites in:(sites (values Remembered ""OwnedP1""))) (count Sites in:(sites (values Remembered ""OwnedP2"")))) (fromTo (from Cell (handSite P2) level:(- (size Stack Cell at:(handSite P2)) (value))) (to (regionSite (sites (values Remembered ""OwnedP2"")) index:(- (value) 1))) stack:True)))))))) (end (if (all Sites (sites Board) if:(= 0 (count at:(site)))) {(if (>= 9 (size Stack Cell at:(handSite P1))) (result P2 Win)) (if (>= 9 (size Stack Cell at:(handSite P2))) (result P1 Win))})) (nextPhase (all Sites (sites Board) if:(= 0 (count at:(site)))) ""BetweenRounds"")) (phase ""BetweenRounds"" (play (if (<= 5 (size Stack Cell at:(handSite Mover))) (move Select (from Cell (handSite Mover)) (to (trackSite FirstSite ""TrackCCW"" from:(mapEntry Mover) if:(and (not (is In (to) (sites ""EndHoles""))) (is Empty (to))))) (then (and {(forEach Value min:1 max:5 (fromTo (from Cell (last From) level:(- (size Stack Cell at:(last From)) (value))) (to (last To)) stack:True)) (if (is Mover P1) (remember Value ""OwnedP1"" (last To)) (remember Value ""OwnedP2"" (last To))) (if (<= 10 (count Cell at:(handSite Mover))) (moveAgain) (if (or (= 8 (count Cell at:(handSite Mover))) (= 9 (count Cell at:(handSite Mover)))) (and {(forEach Value min:1 max:(- (count Cell at:(handSite Mover)) 5) (fromTo (from Cell (handSite Mover) level:(- (- (size Stack Cell at:(handSite Mover)) 5) (value))) (to (trackSite FirstSite ""TrackCCW"" from:(trackSite FirstSite ""TrackCCW"" from:(mapEntry Mover) if:(and (not (is In (to) (sites ""EndHoles""))) (is Empty (to)))) if:(and {(not (is In (to) (sites ""EndHoles""))) (is Empty (to)) (!= (trackSite FirstSite ""TrackCCW"" from:(mapEntry Mover) if:(and (not (is In (to) (sites ""EndHoles""))) (is Empty (to)))) (to))}))) stack:True)) (forEach Value min:1 max:(- 5 (- (count Cell at:(handSite Mover)) 5)) (fromTo (from Cell (handSite Next) level:(- (size Stack Cell at:(handSite Next)) (value))) (to (trackSite FirstSite ""TrackCCW"" from:(trackSite FirstSite ""TrackCCW"" from:(mapEntry Mover) if:(and (not (is In (to) (sites ""EndHoles""))) (is Empty (to)))) if:(and {(not (is In (to) (sites ""EndHoles""))) (is Empty (to)) (!= (trackSite FirstSite ""TrackCCW"" from:(mapEntry Mover) if:(and (not (is In (to) (sites ""EndHoles""))) (is Empty (to)))) (to))}))) stack:True)) (if (is Mover P1) (remember Value ""OwnedP1"" (trackSite FirstSite ""TrackCCW"" from:(trackSite FirstSite ""TrackCCW"" from:(mapEntry Mover) if:(and (not (is In (to) (sites ""EndHoles""))) (is Empty (to)))) if:(and {(not (is In (to) (sites ""EndHoles""))) (is Empty (to)) (!= (trackSite FirstSite ""TrackCCW"" from:(mapEntry Mover) if:(and (not (is In (to) (sites ""EndHoles""))) (is Empty (to)))) (to))}))) (remember Value ""OwnedP2"" (trackSite FirstSite ""TrackCCW"" from:(trackSite FirstSite ""TrackCCW"" from:(mapEntry Mover) if:(and (not (is In (to) (sites ""EndHoles""))) (is Empty (to)))) if:(and {(not (is In (to) (sites ""EndHoles""))) (is Empty (to)) (!= (trackSite FirstSite ""TrackCCW"" from:(mapEntry Mover) if:(and (not (is In (to) (sites ""EndHoles""))) (is Empty (to)))) (to))})))) (if (is Mover P2) (remember Value ""OwnedP1"" (trackSite FirstSite ""TrackCCW"" from:(trackSite FirstSite ""TrackCCW"" from:(mapEntry Mover) if:(and (not (is In (to) (sites ""EndHoles""))) (is Empty (to)))) if:(and {(not (is In (to) (sites ""EndHoles""))) (is Empty (to)) (!= (trackSite FirstSite ""TrackCCW"" from:(mapEntry Mover) if:(and (not (is In (to) (sites ""EndHoles""))) (is Empty (to)))) (to))}))) (remember Value ""OwnedP2"" (trackSite FirstSite ""TrackCCW"" from:(trackSite FirstSite ""TrackCCW"" from:(mapEntry Mover) if:(and (not (is In (to) (sites ""EndHoles""))) (is Empty (to)))) if:(and {(not (is In (to) (sites ""EndHoles""))) (is Empty (to)) (!= (trackSite FirstSite ""TrackCCW"" from:(mapEntry Mover) if:(and (not (is In (to) (sites ""EndHoles""))) (is Empty (to)))) (to))}))))})))}))) (then (if (and (is Empty Cell (handSite P1)) (is Empty Cell (handSite P2))) (if (= (size Stack Cell at:(handSite P1 1)) 2) (and (fromTo (from Cell (handSite P1 1) level:1) (to (mapEntry P1)) stack:True) (fromTo (from Cell (handSite P1 1) level:0) (to (mapEntry P2)) stack:True)) (if (= (size Stack Cell at:(handSite P2 1)) 2) (and (fromTo (from Cell (handSite P2 1) level:1) (to (mapEntry P1)) stack:True) (fromTo (from Cell (handSite P2 1) level:0) (to (mapEntry P2)) stack:True)) (and (fromTo (from Cell (handSite P1 1) level:0) (to (mapEntry P1)) stack:True) (fromTo (from Cell (handSite P2 1) level:0) (to (mapEntry P2)) stack:True)))))))) (nextPhase (and (is Empty Cell (handSite P1)) (is Empty Cell (handSite P2))) ""Sowing""))}))" "2x6 board with two stores. Four counters in each hole. Play may begin from any of the player's holes. Counters are sown anti-clockwise. If the last counter falls into an empty hole or a hole in either row, making that hole contain four counters, play ends, and the four counters are taken. Also, if at any time during the sowing a hole contains four counters, the player on whose row this occurs takes those counters. Otherwise, the player lifts the counters in the hole in which the final counter lands and continues sowing. Play ends when one player can no longer move. The player with the most counters wins.","(game ""Obridje"" (players 2) (equipment {(mancalaBoard 2 6 (track ""Track"" ""1,E,N,W"" loop:True)) (piece ""Seed"" Shared) (regions P1 (sites Bottom)) (regions P2 (sites Top)) (map {(pair P1 FirstSite) (pair P2 LastSite)})}) (rules (start (set Count 4 to:(sites Track))) (play (move Select (from (if (is Prev Mover) (sites {(var ""Replay"")}) (sites Mover)) if:(> (count at:(from)) 0)) (then (do (set Var ""NumSowed"" (count at:(last To))) next:(sow apply:(if (and (!= 4 (count at:(to))) (< 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""))) (if (= 4 (count at:(site))) (fromTo (from (site)) (to (if (is In (to) (sites P1)) (mapEntry P1) (mapEntry P2))) count:4))) (set Var ""NumSowed"" 0))))))) (end (if (no Moves Next) (byScore {(score P1 (+ (count at:(mapEntry P1)) (count in:(sites P1)))) (score P2 (+ (count at:(mapEntry P2)) (count in:(sites P2))))})))))","###Description 2x6 board with two stores. Four counters in each hole. Play may begin from any of the player's holes. Counters are sown anti-clockwise. If the last counter falls into an empty hole or a hole in either row, making that hole contain four counters, play ends, and the four counters are taken. Also, if at any time during the sowing a hole contains four counters, the player on whose row this occurs takes those counters. Otherwise, the player lifts the counters in the hole in which the final counter lands and continues sowing. Play ends when one player can no longer move. The player with the most counters wins. @@ -2224,11 +2154,6 @@ Counters are placed in piles: two rows of four piles. Six counters in each pile. ###Ludii (game ""Yucebao"" (players 2) (equipment {(mancalaBoard 2 5 largeStack:True {(track ""TrackCCW"" ""0,1,E,11,10,W"" loop:True) (track ""TrackCW"" ""11,5,W,0,6,E"" loop:True)}) (piece ""Seed"" Shared) (piece ""Ball"" P1) (piece ""Ball"" P2) (hand Each size:2) (regions P1 (sites Bottom)) (regions P2 (sites Top)) (map {(pair P1 LastSite) (pair P2 FirstSite)}) (map ""LeftMost"" {(pair P1 1) (pair P2 10)}) (regions ""EndHoles"" (sites {""A1"" ""G1""}))}) (rules (start {(place Stack ""Seed"" (union (sites Bottom) (sites Top)) count:5) (place Stack ""Ball1"" (mapEntry P1)) (place Stack ""Ball2"" (mapEntry P2))}) phases:{(phase ""Sowing"" (play (or {(if (!= (var ""Direction"") 2) (move Select (from (if (is Prev Mover) (sites {(var ""Replay"")}) (sites Mover)) if:(!= 0 (size Stack at:(from)))) (then (and {(forEach Value min:1 max:(size Stack at:(last From)) (if (= (id ""Seed"" Shared) (what at:(last From) level:(- (size Stack at:(last From)) (value)))) (fromTo (from (last From) level:(- (size Stack at:(last From)) (value))) (to (trackSite Move from:(last From) ""TrackCCW"" steps:(value))) stack:True) (and (if (and (is Occupied (trackSite Move from:(last From) ""TrackCCW"" steps:(value))) (!= (trackSite Move from:(last From) ""TrackCCW"" steps:(value)) (last From))) (if (= (who at:(last From) level:(- (size Stack at:(last From)) (value))) P1) (forEach Level (trackSite Move from:(last From) ""TrackCCW"" steps:(value)) FromTop (if (= (id ""Seed"" Shared) (what at:(trackSite Move from:(last From) ""TrackCCW"" steps:(value)) level:(level))) (fromTo (from (trackSite Move from:(last From) ""TrackCCW"" steps:(value)) level:(level)) (to (handSite P1))) (fromTo (from (trackSite Move from:(last From) ""TrackCCW"" steps:(value)) level:(level)) (to (handSite P1 1))))) (forEach Level (trackSite Move from:(last From) ""TrackCCW"" steps:(value)) FromTop (if (= (id ""Seed"" Shared) (what at:(trackSite Move from:(last From) ""TrackCCW"" steps:(value)) level:(level))) (fromTo (from (trackSite Move from:(last From) ""TrackCCW"" steps:(value)) level:(level)) (to (handSite P2))) (fromTo (from (trackSite Move from:(last From) ""TrackCCW"" steps:(value)) level:(level)) (to (handSite P2 1))))))) (fromTo (from (last From) level:(- (size Stack at:(last From)) (value))) (to (trackSite Move from:(last From) ""TrackCCW"" steps:(value))) stack:True)))) (if (< (var ""Direction"") 1) (set Var ""Direction"" 1)) (if (< (size Stack at:(last From)) 8) (if (!= 0 (size Stack at:(trackSite Move from:(last From) ""TrackCCW"" steps:(+ 1 (size Stack at:(last From)))))) (and (moveAgain) (set Var ""Replay"" (trackSite Move from:(last From) ""TrackCCW"" steps:(+ 1 (size Stack at:(last From)))))) (if (is Occupied (trackSite Move from:(last From) ""TrackCCW"" steps:(+ 2 (size Stack at:(last From))))) (forEach Level (trackSite Move from:(last From) ""TrackCCW"" steps:(+ 2 (size Stack at:(last From)))) FromTop (if (= (id ""Seed"" Shared) (what at:(trackSite Move from:(last From) ""TrackCCW"" steps:(+ 2 (size Stack at:(last From)))) level:(level))) (fromTo (from (trackSite Move from:(last From) ""TrackCCW"" steps:(+ 2 (size Stack at:(last From)))) level:(level)) (to (handSite Mover))) (fromTo (from (trackSite Move from:(last From) ""TrackCCW"" steps:(+ 2 (size Stack at:(last From)))) level:(level)) (to (handSite Mover 1))))))))})))) (if (!= (var ""Direction"") 1) (move Select (from (if (is Prev Mover) (sites {(var ""Replay"")}) (sites Mover)) if:(!= 0 (size Stack at:(from)))) (then (and {(forEach Value min:1 max:(size Stack at:(last From)) (if (= (id ""Seed"" Shared) (what at:(last From) level:(- (size Stack at:(last From)) (value)))) (fromTo (from (last From) level:(- (size Stack at:(last From)) (value))) (to (trackSite Move from:(last From) ""TrackCW"" steps:(value))) stack:True) (and (if (and (is Occupied (trackSite Move from:(last From) ""TrackCW"" steps:(value))) (!= (trackSite Move from:(last From) ""TrackCW"" steps:(value)) (last From))) (if (= (who at:(last From) level:(- (size Stack at:(last From)) (value))) P1) (forEach Level (trackSite Move from:(last From) ""TrackCW"" steps:(value)) FromTop (if (= (id ""Seed"" Shared) (what at:(trackSite Move from:(last From) ""TrackCW"" steps:(value)) level:(level))) (fromTo (from (trackSite Move from:(last From) ""TrackCW"" steps:(value)) level:(level)) (to (handSite P1))) (fromTo (from (trackSite Move from:(last From) ""TrackCW"" steps:(value)) level:(level)) (to (handSite P1 1))))) (forEach Level (trackSite Move from:(last From) ""TrackCW"" steps:(value)) FromTop (if (= (id ""Seed"" Shared) (what at:(trackSite Move from:(last From) ""TrackCW"" steps:(value)) level:(level))) (fromTo (from (trackSite Move from:(last From) ""TrackCW"" steps:(value)) level:(level)) (to (handSite P2))) (fromTo (from (trackSite Move from:(last From) ""TrackCW"" steps:(value)) level:(level)) (to (handSite P2 1))))))) (fromTo (from (last From) level:(- (size Stack at:(last From)) (value))) (to (trackSite Move from:(last From) ""TrackCW"" steps:(value))) stack:True)))) (if (< (var ""Direction"") 1) (set Var ""Direction"" 2)) (if (< (size Stack at:(last From)) 8) (if (!= 0 (size Stack at:(trackSite Move from:(last From) ""TrackCW"" steps:(+ 1 (size Stack at:(last From)))))) (and (moveAgain) (set Var ""Replay"" (trackSite Move from:(last From) ""TrackCW"" steps:(+ 1 (size Stack at:(last From)))))) (if (is Occupied (trackSite Move from:(last From) ""TrackCW"" steps:(+ 2 (size Stack at:(last From))))) (forEach Level (trackSite Move from:(last From) ""TrackCW"" steps:(+ 2 (size Stack at:(last From)))) FromTop (if (= (id ""Seed"" Shared) (what at:(trackSite Move from:(last From) ""TrackCW"" steps:(+ 2 (size Stack at:(last From)))) level:(level))) (fromTo (from (trackSite Move from:(last From) ""TrackCW"" steps:(+ 2 (size Stack at:(last From)))) level:(level)) (to (handSite Mover))) (fromTo (from (trackSite Move from:(last From) ""TrackCW"" steps:(+ 2 (size Stack at:(last From)))) level:(level)) (to (handSite Mover 1))))))))}))))} (then (if (no Pieces All in:(sites P1)) (forEach Site (sites Board) (if (is Occupied (site)) (forEach Level (site) FromTop (if (= (id ""Seed"" Shared) (what at:(site) level:(level))) (fromTo (from (site) level:(level)) (to (handSite P1)) stack:True) (fromTo (from (site) level:(level)) (to (handSite P1 1)) stack:True))))) (if (no Pieces All in:(sites P2)) (forEach Site (sites Board) (if (is Occupied (site)) (forEach Level (site) FromTop (if (= (id ""Seed"" Shared) (what at:(site) level:(level))) (fromTo (from (site) level:(level)) (to (handSite P2)) stack:True) (fromTo (from (site) level:(level)) (to (handSite P2 1)) stack:True)))))))))) (end (if (no Pieces All in:(sites Board)) {(if (> 5 (size Stack Cell at:(handSite P1))) (result P2 Win)) (if (> 5 (size Stack Cell at:(handSite P2))) (result P1 Win))})) (nextPhase (no Pieces All in:(sites Board)) ""BetweenRounds"")) (phase ""BetweenRounds"" (play (or (if (<= 5 (size Stack Cell at:(handSite Mover))) (move Select (from Cell (handSite Mover)) (to (trackSite FirstSite ""TrackCCW"" from:(mapEntry ""LeftMost"" Mover) if:(is Empty (to)))) (then (forEach Value min:1 max:5 (fromTo (from Cell (last From) level:(- (size Stack Cell at:(last From)) (value))) (to (last To)) stack:True))))) (if (!= 0 (size Stack Cell at:(handSite Mover 1))) (move Select (from Cell (handSite Mover 1)) (to (sites Mover)) (then (fromTo (from Cell (last From) level:(topLevel Cell at:(last From))) (to (last To)) stack:True)))))) (nextPhase (all Passed) ""Sowing""))}))" -"- BOARDS: The stones in each board are responsible for the moving possibilities of the stones in the next board (clockwise direction). E.g., board NW position determines the moves for board NE. - MOVE: Every stone allows the stones in the next board to move according to its position (using the red point as a reference point). E.g., A stone on b3, allows that player to move any stone in the next board one step to the left. A stone on e5 allows any stone in the next board to move two steps diagonally to the top right. A stone on a red point is useless for the moves in the next board . - TURN: On his turn a player must do one of two actions: Drop: The player drops a friendly stone on an empty cell. If there are no more offboard stones, he cannot choose this action. Move: The player moves a stone according to the moving rules. To move a stone there must be a friendly stone in the previous board. The move is only allowed if the moving stone stays in the same board. Stones jump. So if a stone moves from a5 to c5 (only possible if there is a friendly stone on e3 at the previous board) the status of b5 is irrelevant. The destination cell must be empty or occupied with an opponent stone, which is captured and removed from play. - GOAL: A player with no legal moves loses.","(game ""4 Squared"" (players 2) (equipment {(board (merge {(square 5) (shift 5 0 (square 5)) (shift 0 5 (square 5)) (shift 5 5 (square 5))}) use:Vertex) (piece ""Ball"" Each (if (is In (from) (sites ""SW"")) (or {(move Step S (to if:(and (not (is Friend (who at:(to)))) (is Friend (who at:(ahead (coord ""H3"") S)))) (apply (if (is Enemy (who at:(to))) (remove (to)))))) (move Step SE (to if:(and (not (is Friend (who at:(to)))) (is Friend (who at:(ahead (coord ""H3"") SE)))) (apply (if (is Enemy (who at:(to))) (remove (to)))))) (move Step SW (to if:(and (not (is Friend (who at:(to)))) (is Friend (who at:(ahead (coord ""H3"") SW)))) (apply (if (is Enemy (who at:(to))) (remove (to)))))) (move Step E (to if:(and (not (is Friend (who at:(to)))) (is Friend (who at:(ahead (coord ""H3"") E)))) (apply (if (is Enemy (who at:(to))) (remove (to)))))) (move Step W (to if:(and (not (is Friend (who at:(to)))) (is Friend (who at:(ahead (coord ""H3"") W)))) (apply (if (is Enemy (who at:(to))) (remove (to)))))) (move Step NE (to if:(and (not (is Friend (who at:(to)))) (is Friend (who at:(ahead (coord ""H3"") NE)))) (apply (if (is Enemy (who at:(to))) (remove (to)))))) (move Step NW (to if:(and (not (is Friend (who at:(to)))) (is Friend (who at:(ahead (coord ""H3"") NW)))) (apply (if (is Enemy (who at:(to))) (remove (to)))))) (move Step N (to if:(and (not (is Friend (who at:(to)))) (is Friend (who at:(ahead (coord ""H3"") N)))) (apply (if (is Enemy (who at:(to))) (remove (to)))))) (move Hop S (between if:True) (to if:(and (not (is Friend (who at:(to)))) (is Friend (who at:(ahead (coord ""H3"") steps:2 S)))) (apply (if (is Enemy (who at:(to))) (remove (to)))))) (move Hop SE (between if:True) (to if:(and (not (is Friend (who at:(to)))) (is Friend (who at:(ahead (coord ""H3"") steps:2 SE)))) (apply (if (is Enemy (who at:(to))) (remove (to)))))) (move Hop SW (between if:True) (to if:(and (not (is Friend (who at:(to)))) (is Friend (who at:(ahead (coord ""H3"") steps:2 SW)))) (apply (if (is Enemy (who at:(to))) (remove (to)))))) (move Hop E (between if:True) (to if:(and (not (is Friend (who at:(to)))) (is Friend (who at:(ahead (coord ""H3"") steps:2 E)))) (apply (if (is Enemy (who at:(to))) (remove (to)))))) (move Hop W (between if:True) (to if:(and (not (is Friend (who at:(to)))) (is Friend (who at:(ahead (coord ""H3"") steps:2 W)))) (apply (if (is Enemy (who at:(to))) (remove (to)))))) (move Hop NE (between if:True) (to if:(and (not (is Friend (who at:(to)))) (is Friend (who at:(ahead (coord ""H3"") steps:2 NE)))) (apply (if (is Enemy (who at:(to))) (remove (to)))))) (move Hop NW (between if:True) (to if:(and (not (is Friend (who at:(to)))) (is Friend (who at:(ahead (coord ""H3"") steps:2 NW)))) (apply (if (is Enemy (who at:(to))) (remove (to)))))) (move Hop N (between if:True) (to if:(and (not (is Friend (who at:(to)))) (is Friend (who at:(ahead (coord ""H3"") steps:2 N)))) (apply (if (is Enemy (who at:(to))) (remove (to))))))}) (if (is In (from) (sites ""NW"")) (or {(move Step S (to if:(and (not (is Friend (who at:(to)))) (is Friend (who at:(ahead (coord ""C3"") S)))) (apply (if (is Enemy (who at:(to))) (remove (to)))))) (move Step SE (to if:(and (not (is Friend (who at:(to)))) (is Friend (who at:(ahead (coord ""C3"") SE)))) (apply (if (is Enemy (who at:(to))) (remove (to)))))) (move Step SW (to if:(and (not (is Friend (who at:(to)))) (is Friend (who at:(ahead (coord ""C3"") SW)))) (apply (if (is Enemy (who at:(to))) (remove (to)))))) (move Step E (to if:(and (not (is Friend (who at:(to)))) (is Friend (who at:(ahead (coord ""C3"") E)))) (apply (if (is Enemy (who at:(to))) (remove (to)))))) (move Step W (to if:(and (not (is Friend (who at:(to)))) (is Friend (who at:(ahead (coord ""C3"") W)))) (apply (if (is Enemy (who at:(to))) (remove (to)))))) (move Step NE (to if:(and (not (is Friend (who at:(to)))) (is Friend (who at:(ahead (coord ""C3"") NE)))) (apply (if (is Enemy (who at:(to))) (remove (to)))))) (move Step NW (to if:(and (not (is Friend (who at:(to)))) (is Friend (who at:(ahead (coord ""C3"") NW)))) (apply (if (is Enemy (who at:(to))) (remove (to)))))) (move Step N (to if:(and (not (is Friend (who at:(to)))) (is Friend (who at:(ahead (coord ""C3"") N)))) (apply (if (is Enemy (who at:(to))) (remove (to)))))) (move Hop S (between if:True) (to if:(and (not (is Friend (who at:(to)))) (is Friend (who at:(ahead (coord ""C3"") steps:2 S)))) (apply (if (is Enemy (who at:(to))) (remove (to)))))) (move Hop SE (between if:True) (to if:(and (not (is Friend (who at:(to)))) (is Friend (who at:(ahead (coord ""C3"") steps:2 SE)))) (apply (if (is Enemy (who at:(to))) (remove (to)))))) (move Hop SW (between if:True) (to if:(and (not (is Friend (who at:(to)))) (is Friend (who at:(ahead (coord ""C3"") steps:2 SW)))) (apply (if (is Enemy (who at:(to))) (remove (to)))))) (move Hop E (between if:True) (to if:(and (not (is Friend (who at:(to)))) (is Friend (who at:(ahead (coord ""C3"") steps:2 E)))) (apply (if (is Enemy (who at:(to))) (remove (to)))))) (move Hop W (between if:True) (to if:(and (not (is Friend (who at:(to)))) (is Friend (who at:(ahead (coord ""C3"") steps:2 W)))) (apply (if (is Enemy (who at:(to))) (remove (to)))))) (move Hop NE (between if:True) (to if:(and (not (is Friend (who at:(to)))) (is Friend (who at:(ahead (coord ""C3"") steps:2 NE)))) (apply (if (is Enemy (who at:(to))) (remove (to)))))) (move Hop NW (between if:True) (to if:(and (not (is Friend (who at:(to)))) (is Friend (who at:(ahead (coord ""C3"") steps:2 NW)))) (apply (if (is Enemy (who at:(to))) (remove (to)))))) (move Hop N (between if:True) (to if:(and (not (is Friend (who at:(to)))) (is Friend (who at:(ahead (coord ""C3"") steps:2 N)))) (apply (if (is Enemy (who at:(to))) (remove (to))))))}) (if (is In (from) (sites ""NE"")) (or {(move Step S (to if:(and (not (is Friend (who at:(to)))) (is Friend (who at:(ahead (coord ""C8"") S)))) (apply (if (is Enemy (who at:(to))) (remove (to)))))) (move Step SE (to if:(and (not (is Friend (who at:(to)))) (is Friend (who at:(ahead (coord ""C8"") SE)))) (apply (if (is Enemy (who at:(to))) (remove (to)))))) (move Step SW (to if:(and (not (is Friend (who at:(to)))) (is Friend (who at:(ahead (coord ""C8"") SW)))) (apply (if (is Enemy (who at:(to))) (remove (to)))))) (move Step E (to if:(and (not (is Friend (who at:(to)))) (is Friend (who at:(ahead (coord ""C8"") E)))) (apply (if (is Enemy (who at:(to))) (remove (to)))))) (move Step W (to if:(and (not (is Friend (who at:(to)))) (is Friend (who at:(ahead (coord ""C8"") W)))) (apply (if (is Enemy (who at:(to))) (remove (to)))))) (move Step NE (to if:(and (not (is Friend (who at:(to)))) (is Friend (who at:(ahead (coord ""C8"") NE)))) (apply (if (is Enemy (who at:(to))) (remove (to)))))) (move Step NW (to if:(and (not (is Friend (who at:(to)))) (is Friend (who at:(ahead (coord ""C8"") NW)))) (apply (if (is Enemy (who at:(to))) (remove (to)))))) (move Step N (to if:(and (not (is Friend (who at:(to)))) (is Friend (who at:(ahead (coord ""C8"") N)))) (apply (if (is Enemy (who at:(to))) (remove (to)))))) (move Hop S (between if:True) (to if:(and (not (is Friend (who at:(to)))) (is Friend (who at:(ahead (coord ""C8"") steps:2 S)))) (apply (if (is Enemy (who at:(to))) (remove (to)))))) (move Hop SE (between if:True) (to if:(and (not (is Friend (who at:(to)))) (is Friend (who at:(ahead (coord ""C8"") steps:2 SE)))) (apply (if (is Enemy (who at:(to))) (remove (to)))))) (move Hop SW (between if:True) (to if:(and (not (is Friend (who at:(to)))) (is Friend (who at:(ahead (coord ""C8"") steps:2 SW)))) (apply (if (is Enemy (who at:(to))) (remove (to)))))) (move Hop E (between if:True) (to if:(and (not (is Friend (who at:(to)))) (is Friend (who at:(ahead (coord ""C8"") steps:2 E)))) (apply (if (is Enemy (who at:(to))) (remove (to)))))) (move Hop W (between if:True) (to if:(and (not (is Friend (who at:(to)))) (is Friend (who at:(ahead (coord ""C8"") steps:2 W)))) (apply (if (is Enemy (who at:(to))) (remove (to)))))) (move Hop NE (between if:True) (to if:(and (not (is Friend (who at:(to)))) (is Friend (who at:(ahead (coord ""C8"") steps:2 NE)))) (apply (if (is Enemy (who at:(to))) (remove (to)))))) (move Hop NW (between if:True) (to if:(and (not (is Friend (who at:(to)))) (is Friend (who at:(ahead (coord ""C8"") steps:2 NW)))) (apply (if (is Enemy (who at:(to))) (remove (to)))))) (move Hop N (between if:True) (to if:(and (not (is Friend (who at:(to)))) (is Friend (who at:(ahead (coord ""C8"") steps:2 N)))) (apply (if (is Enemy (who at:(to))) (remove (to))))))}) (if (is In (from) (sites ""SE"")) (or {(move Step S (to if:(and (not (is Friend (who at:(to)))) (is Friend (who at:(ahead (coord ""H8"") S)))) (apply (if (is Enemy (who at:(to))) (remove (to)))))) (move Step SE (to if:(and (not (is Friend (who at:(to)))) (is Friend (who at:(ahead (coord ""H8"") SE)))) (apply (if (is Enemy (who at:(to))) (remove (to)))))) (move Step SW (to if:(and (not (is Friend (who at:(to)))) (is Friend (who at:(ahead (coord ""H8"") SW)))) (apply (if (is Enemy (who at:(to))) (remove (to)))))) (move Step E (to if:(and (not (is Friend (who at:(to)))) (is Friend (who at:(ahead (coord ""H8"") E)))) (apply (if (is Enemy (who at:(to))) (remove (to)))))) (move Step W (to if:(and (not (is Friend (who at:(to)))) (is Friend (who at:(ahead (coord ""H8"") W)))) (apply (if (is Enemy (who at:(to))) (remove (to)))))) (move Step NE (to if:(and (not (is Friend (who at:(to)))) (is Friend (who at:(ahead (coord ""H8"") NE)))) (apply (if (is Enemy (who at:(to))) (remove (to)))))) (move Step NW (to if:(and (not (is Friend (who at:(to)))) (is Friend (who at:(ahead (coord ""H8"") NW)))) (apply (if (is Enemy (who at:(to))) (remove (to)))))) (move Step N (to if:(and (not (is Friend (who at:(to)))) (is Friend (who at:(ahead (coord ""H8"") N)))) (apply (if (is Enemy (who at:(to))) (remove (to)))))) (move Hop S (between if:True) (to if:(and (not (is Friend (who at:(to)))) (is Friend (who at:(ahead (coord ""H8"") steps:2 S)))) (apply (if (is Enemy (who at:(to))) (remove (to)))))) (move Hop SE (between if:True) (to if:(and (not (is Friend (who at:(to)))) (is Friend (who at:(ahead (coord ""H8"") steps:2 SE)))) (apply (if (is Enemy (who at:(to))) (remove (to)))))) (move Hop SW (between if:True) (to if:(and (not (is Friend (who at:(to)))) (is Friend (who at:(ahead (coord ""H8"") steps:2 SW)))) (apply (if (is Enemy (who at:(to))) (remove (to)))))) (move Hop E (between if:True) (to if:(and (not (is Friend (who at:(to)))) (is Friend (who at:(ahead (coord ""H8"") steps:2 E)))) (apply (if (is Enemy (who at:(to))) (remove (to)))))) (move Hop W (between if:True) (to if:(and (not (is Friend (who at:(to)))) (is Friend (who at:(ahead (coord ""H8"") steps:2 W)))) (apply (if (is Enemy (who at:(to))) (remove (to)))))) (move Hop NE (between if:True) (to if:(and (not (is Friend (who at:(to)))) (is Friend (who at:(ahead (coord ""H8"") steps:2 NE)))) (apply (if (is Enemy (who at:(to))) (remove (to)))))) (move Hop NW (between if:True) (to if:(and (not (is Friend (who at:(to)))) (is Friend (who at:(ahead (coord ""H8"") steps:2 NW)))) (apply (if (is Enemy (who at:(to))) (remove (to)))))) (move Hop N (between if:True) (to if:(and (not (is Friend (who at:(to)))) (is Friend (who at:(ahead (coord ""H8"") steps:2 N)))) (apply (if (is Enemy (who at:(to))) (remove (to))))))})))))) (hand Each) (regions ""SW"" (expand origin:(coord ""C3"") steps:2 All)) (regions ""SE"" (expand origin:(coord ""H3"") steps:2 All)) (regions ""NW"" (expand origin:(coord ""C8"") steps:2 All)) (regions ""NE"" (expand origin:(coord ""H8"") steps:2 All))}) (rules (start (place ""Ball"" ""Hand"" count:15)) (play (or (forEach Piece) (if (is Occupied (handSite Mover)) (move (from (handSite Mover)) (to (sites Empty)))))) (end (if (no Moves Next) (result Mover Win)))))","###Description -- BOARDS: The stones in each board are responsible for the moving possibilities of the stones in the next board (clockwise direction). E.g., board NW position determines the moves for board NE. - MOVE: Every stone allows the stones in the next board to move according to its position (using the red point as a reference point). E.g., A stone on b3, allows that player to move any stone in the next board one step to the left. A stone on e5 allows any stone in the next board to move two steps diagonally to the top right. A stone on a red point is useless for the moves in the next board . - TURN: On his turn a player must do one of two actions: Drop: The player drops a friendly stone on an empty cell. If there are no more offboard stones, he cannot choose this action. Move: The player moves a stone according to the moving rules. To move a stone there must be a friendly stone in the previous board. The move is only allowed if the moving stone stays in the same board. Stones jump. So if a stone moves from a5 to c5 (only possible if there is a friendly stone on e3 at the previous board) the status of b5 is irrelevant. The destination cell must be empty or occupied with an opponent stone, which is captured and removed from play. - GOAL: A player with no legal moves loses. - -###Ludii -(game ""4 Squared"" (players 2) (equipment {(board (merge {(square 5) (shift 5 0 (square 5)) (shift 0 5 (square 5)) (shift 5 5 (square 5))}) use:Vertex) (piece ""Ball"" Each (if (is In (from) (sites ""SW"")) (or {(move Step S (to if:(and (not (is Friend (who at:(to)))) (is Friend (who at:(ahead (coord ""H3"") S)))) (apply (if (is Enemy (who at:(to))) (remove (to)))))) (move Step SE (to if:(and (not (is Friend (who at:(to)))) (is Friend (who at:(ahead (coord ""H3"") SE)))) (apply (if (is Enemy (who at:(to))) (remove (to)))))) (move Step SW (to if:(and (not (is Friend (who at:(to)))) (is Friend (who at:(ahead (coord ""H3"") SW)))) (apply (if (is Enemy (who at:(to))) (remove (to)))))) (move Step E (to if:(and (not (is Friend (who at:(to)))) (is Friend (who at:(ahead (coord ""H3"") E)))) (apply (if (is Enemy (who at:(to))) (remove (to)))))) (move Step W (to if:(and (not (is Friend (who at:(to)))) (is Friend (who at:(ahead (coord ""H3"") W)))) (apply (if (is Enemy (who at:(to))) (remove (to)))))) (move Step NE (to if:(and (not (is Friend (who at:(to)))) (is Friend (who at:(ahead (coord ""H3"") NE)))) (apply (if (is Enemy (who at:(to))) (remove (to)))))) (move Step NW (to if:(and (not (is Friend (who at:(to)))) (is Friend (who at:(ahead (coord ""H3"") NW)))) (apply (if (is Enemy (who at:(to))) (remove (to)))))) (move Step N (to if:(and (not (is Friend (who at:(to)))) (is Friend (who at:(ahead (coord ""H3"") N)))) (apply (if (is Enemy (who at:(to))) (remove (to)))))) (move Hop S (between if:True) (to if:(and (not (is Friend (who at:(to)))) (is Friend (who at:(ahead (coord ""H3"") steps:2 S)))) (apply (if (is Enemy (who at:(to))) (remove (to)))))) (move Hop SE (between if:True) (to if:(and (not (is Friend (who at:(to)))) (is Friend (who at:(ahead (coord ""H3"") steps:2 SE)))) (apply (if (is Enemy (who at:(to))) (remove (to)))))) (move Hop SW (between if:True) (to if:(and (not (is Friend (who at:(to)))) (is Friend (who at:(ahead (coord ""H3"") steps:2 SW)))) (apply (if (is Enemy (who at:(to))) (remove (to)))))) (move Hop E (between if:True) (to if:(and (not (is Friend (who at:(to)))) (is Friend (who at:(ahead (coord ""H3"") steps:2 E)))) (apply (if (is Enemy (who at:(to))) (remove (to)))))) (move Hop W (between if:True) (to if:(and (not (is Friend (who at:(to)))) (is Friend (who at:(ahead (coord ""H3"") steps:2 W)))) (apply (if (is Enemy (who at:(to))) (remove (to)))))) (move Hop NE (between if:True) (to if:(and (not (is Friend (who at:(to)))) (is Friend (who at:(ahead (coord ""H3"") steps:2 NE)))) (apply (if (is Enemy (who at:(to))) (remove (to)))))) (move Hop NW (between if:True) (to if:(and (not (is Friend (who at:(to)))) (is Friend (who at:(ahead (coord ""H3"") steps:2 NW)))) (apply (if (is Enemy (who at:(to))) (remove (to)))))) (move Hop N (between if:True) (to if:(and (not (is Friend (who at:(to)))) (is Friend (who at:(ahead (coord ""H3"") steps:2 N)))) (apply (if (is Enemy (who at:(to))) (remove (to))))))}) (if (is In (from) (sites ""NW"")) (or {(move Step S (to if:(and (not (is Friend (who at:(to)))) (is Friend (who at:(ahead (coord ""C3"") S)))) (apply (if (is Enemy (who at:(to))) (remove (to)))))) (move Step SE (to if:(and (not (is Friend (who at:(to)))) (is Friend (who at:(ahead (coord ""C3"") SE)))) (apply (if (is Enemy (who at:(to))) (remove (to)))))) (move Step SW (to if:(and (not (is Friend (who at:(to)))) (is Friend (who at:(ahead (coord ""C3"") SW)))) (apply (if (is Enemy (who at:(to))) (remove (to)))))) (move Step E (to if:(and (not (is Friend (who at:(to)))) (is Friend (who at:(ahead (coord ""C3"") E)))) (apply (if (is Enemy (who at:(to))) (remove (to)))))) (move Step W (to if:(and (not (is Friend (who at:(to)))) (is Friend (who at:(ahead (coord ""C3"") W)))) (apply (if (is Enemy (who at:(to))) (remove (to)))))) (move Step NE (to if:(and (not (is Friend (who at:(to)))) (is Friend (who at:(ahead (coord ""C3"") NE)))) (apply (if (is Enemy (who at:(to))) (remove (to)))))) (move Step NW (to if:(and (not (is Friend (who at:(to)))) (is Friend (who at:(ahead (coord ""C3"") NW)))) (apply (if (is Enemy (who at:(to))) (remove (to)))))) (move Step N (to if:(and (not (is Friend (who at:(to)))) (is Friend (who at:(ahead (coord ""C3"") N)))) (apply (if (is Enemy (who at:(to))) (remove (to)))))) (move Hop S (between if:True) (to if:(and (not (is Friend (who at:(to)))) (is Friend (who at:(ahead (coord ""C3"") steps:2 S)))) (apply (if (is Enemy (who at:(to))) (remove (to)))))) (move Hop SE (between if:True) (to if:(and (not (is Friend (who at:(to)))) (is Friend (who at:(ahead (coord ""C3"") steps:2 SE)))) (apply (if (is Enemy (who at:(to))) (remove (to)))))) (move Hop SW (between if:True) (to if:(and (not (is Friend (who at:(to)))) (is Friend (who at:(ahead (coord ""C3"") steps:2 SW)))) (apply (if (is Enemy (who at:(to))) (remove (to)))))) (move Hop E (between if:True) (to if:(and (not (is Friend (who at:(to)))) (is Friend (who at:(ahead (coord ""C3"") steps:2 E)))) (apply (if (is Enemy (who at:(to))) (remove (to)))))) (move Hop W (between if:True) (to if:(and (not (is Friend (who at:(to)))) (is Friend (who at:(ahead (coord ""C3"") steps:2 W)))) (apply (if (is Enemy (who at:(to))) (remove (to)))))) (move Hop NE (between if:True) (to if:(and (not (is Friend (who at:(to)))) (is Friend (who at:(ahead (coord ""C3"") steps:2 NE)))) (apply (if (is Enemy (who at:(to))) (remove (to)))))) (move Hop NW (between if:True) (to if:(and (not (is Friend (who at:(to)))) (is Friend (who at:(ahead (coord ""C3"") steps:2 NW)))) (apply (if (is Enemy (who at:(to))) (remove (to)))))) (move Hop N (between if:True) (to if:(and (not (is Friend (who at:(to)))) (is Friend (who at:(ahead (coord ""C3"") steps:2 N)))) (apply (if (is Enemy (who at:(to))) (remove (to))))))}) (if (is In (from) (sites ""NE"")) (or {(move Step S (to if:(and (not (is Friend (who at:(to)))) (is Friend (who at:(ahead (coord ""C8"") S)))) (apply (if (is Enemy (who at:(to))) (remove (to)))))) (move Step SE (to if:(and (not (is Friend (who at:(to)))) (is Friend (who at:(ahead (coord ""C8"") SE)))) (apply (if (is Enemy (who at:(to))) (remove (to)))))) (move Step SW (to if:(and (not (is Friend (who at:(to)))) (is Friend (who at:(ahead (coord ""C8"") SW)))) (apply (if (is Enemy (who at:(to))) (remove (to)))))) (move Step E (to if:(and (not (is Friend (who at:(to)))) (is Friend (who at:(ahead (coord ""C8"") E)))) (apply (if (is Enemy (who at:(to))) (remove (to)))))) (move Step W (to if:(and (not (is Friend (who at:(to)))) (is Friend (who at:(ahead (coord ""C8"") W)))) (apply (if (is Enemy (who at:(to))) (remove (to)))))) (move Step NE (to if:(and (not (is Friend (who at:(to)))) (is Friend (who at:(ahead (coord ""C8"") NE)))) (apply (if (is Enemy (who at:(to))) (remove (to)))))) (move Step NW (to if:(and (not (is Friend (who at:(to)))) (is Friend (who at:(ahead (coord ""C8"") NW)))) (apply (if (is Enemy (who at:(to))) (remove (to)))))) (move Step N (to if:(and (not (is Friend (who at:(to)))) (is Friend (who at:(ahead (coord ""C8"") N)))) (apply (if (is Enemy (who at:(to))) (remove (to)))))) (move Hop S (between if:True) (to if:(and (not (is Friend (who at:(to)))) (is Friend (who at:(ahead (coord ""C8"") steps:2 S)))) (apply (if (is Enemy (who at:(to))) (remove (to)))))) (move Hop SE (between if:True) (to if:(and (not (is Friend (who at:(to)))) (is Friend (who at:(ahead (coord ""C8"") steps:2 SE)))) (apply (if (is Enemy (who at:(to))) (remove (to)))))) (move Hop SW (between if:True) (to if:(and (not (is Friend (who at:(to)))) (is Friend (who at:(ahead (coord ""C8"") steps:2 SW)))) (apply (if (is Enemy (who at:(to))) (remove (to)))))) (move Hop E (between if:True) (to if:(and (not (is Friend (who at:(to)))) (is Friend (who at:(ahead (coord ""C8"") steps:2 E)))) (apply (if (is Enemy (who at:(to))) (remove (to)))))) (move Hop W (between if:True) (to if:(and (not (is Friend (who at:(to)))) (is Friend (who at:(ahead (coord ""C8"") steps:2 W)))) (apply (if (is Enemy (who at:(to))) (remove (to)))))) (move Hop NE (between if:True) (to if:(and (not (is Friend (who at:(to)))) (is Friend (who at:(ahead (coord ""C8"") steps:2 NE)))) (apply (if (is Enemy (who at:(to))) (remove (to)))))) (move Hop NW (between if:True) (to if:(and (not (is Friend (who at:(to)))) (is Friend (who at:(ahead (coord ""C8"") steps:2 NW)))) (apply (if (is Enemy (who at:(to))) (remove (to)))))) (move Hop N (between if:True) (to if:(and (not (is Friend (who at:(to)))) (is Friend (who at:(ahead (coord ""C8"") steps:2 N)))) (apply (if (is Enemy (who at:(to))) (remove (to))))))}) (if (is In (from) (sites ""SE"")) (or {(move Step S (to if:(and (not (is Friend (who at:(to)))) (is Friend (who at:(ahead (coord ""H8"") S)))) (apply (if (is Enemy (who at:(to))) (remove (to)))))) (move Step SE (to if:(and (not (is Friend (who at:(to)))) (is Friend (who at:(ahead (coord ""H8"") SE)))) (apply (if (is Enemy (who at:(to))) (remove (to)))))) (move Step SW (to if:(and (not (is Friend (who at:(to)))) (is Friend (who at:(ahead (coord ""H8"") SW)))) (apply (if (is Enemy (who at:(to))) (remove (to)))))) (move Step E (to if:(and (not (is Friend (who at:(to)))) (is Friend (who at:(ahead (coord ""H8"") E)))) (apply (if (is Enemy (who at:(to))) (remove (to)))))) (move Step W (to if:(and (not (is Friend (who at:(to)))) (is Friend (who at:(ahead (coord ""H8"") W)))) (apply (if (is Enemy (who at:(to))) (remove (to)))))) (move Step NE (to if:(and (not (is Friend (who at:(to)))) (is Friend (who at:(ahead (coord ""H8"") NE)))) (apply (if (is Enemy (who at:(to))) (remove (to)))))) (move Step NW (to if:(and (not (is Friend (who at:(to)))) (is Friend (who at:(ahead (coord ""H8"") NW)))) (apply (if (is Enemy (who at:(to))) (remove (to)))))) (move Step N (to if:(and (not (is Friend (who at:(to)))) (is Friend (who at:(ahead (coord ""H8"") N)))) (apply (if (is Enemy (who at:(to))) (remove (to)))))) (move Hop S (between if:True) (to if:(and (not (is Friend (who at:(to)))) (is Friend (who at:(ahead (coord ""H8"") steps:2 S)))) (apply (if (is Enemy (who at:(to))) (remove (to)))))) (move Hop SE (between if:True) (to if:(and (not (is Friend (who at:(to)))) (is Friend (who at:(ahead (coord ""H8"") steps:2 SE)))) (apply (if (is Enemy (who at:(to))) (remove (to)))))) (move Hop SW (between if:True) (to if:(and (not (is Friend (who at:(to)))) (is Friend (who at:(ahead (coord ""H8"") steps:2 SW)))) (apply (if (is Enemy (who at:(to))) (remove (to)))))) (move Hop E (between if:True) (to if:(and (not (is Friend (who at:(to)))) (is Friend (who at:(ahead (coord ""H8"") steps:2 E)))) (apply (if (is Enemy (who at:(to))) (remove (to)))))) (move Hop W (between if:True) (to if:(and (not (is Friend (who at:(to)))) (is Friend (who at:(ahead (coord ""H8"") steps:2 W)))) (apply (if (is Enemy (who at:(to))) (remove (to)))))) (move Hop NE (between if:True) (to if:(and (not (is Friend (who at:(to)))) (is Friend (who at:(ahead (coord ""H8"") steps:2 NE)))) (apply (if (is Enemy (who at:(to))) (remove (to)))))) (move Hop NW (between if:True) (to if:(and (not (is Friend (who at:(to)))) (is Friend (who at:(ahead (coord ""H8"") steps:2 NW)))) (apply (if (is Enemy (who at:(to))) (remove (to)))))) (move Hop N (between if:True) (to if:(and (not (is Friend (who at:(to)))) (is Friend (who at:(ahead (coord ""H8"") steps:2 N)))) (apply (if (is Enemy (who at:(to))) (remove (to))))))})))))) (hand Each) (regions ""SW"" (expand origin:(coord ""C3"") steps:2 All)) (regions ""SE"" (expand origin:(coord ""H3"") steps:2 All)) (regions ""NW"" (expand origin:(coord ""C8"") steps:2 All)) (regions ""NE"" (expand origin:(coord ""H8"") steps:2 All))}) (rules (start (place ""Ball"" ""Hand"" count:15)) (play (or (forEach Piece) (if (is Occupied (handSite Mover)) (move (from (handSite Mover)) (to (sites Empty)))))) (end (if (no Moves Next) (result Mover Win)))))" "Played on a 10x10 board. Each player has four Amazons (chess queens), with other pieces used as arrows. Two things happen on a turn: an amazon moves like a Chess queen, but cannot cross or enter a space occupied by another amazon or arrow. Then, it shoots an arrow to any space on the board that is along the path of a queen's move from that place. The last player able to make a move wins.","(game ""Amazons"" (players 2) (equipment {(board (square 10)) (piece ""Queen"" Each (move Slide (then (moveAgain)))) (piece ""Dot"" Neutral)}) (rules (start {(place ""Queen1"" {""A4"" ""D1"" ""G1"" ""J4""}) (place ""Queen2"" {""A7"" ""D10"" ""G10"" ""J7""})}) (play (if (is Even (count Moves)) (forEach Piece) (move Shoot (piece ""Dot0"")))) (end (if (no Moves Next) (result Mover Win)))))","###Description Played on a 10x10 board. Each player has four Amazons (chess queens), with other pieces used as arrows. Two things happen on a turn: an amazon moves like a Chess queen, but cannot cross or enter a space occupied by another amazon or arrow. Then, it shoots an arrow to any space on the board that is along the path of a queen's move from that place. The last player able to make a move wins. @@ -2284,21 +2209,11 @@ A circle, with four points equally spaced along the circumference, as well as a ###Ludii (game ""Dorvon Cag"" (players 2) (equipment {(board (remove (concentric {1 4}) edges:{{1 0} {0 3}}) use:Vertex) (hand Each) (piece ""Disc"" Each (move Step (to if:(is Empty (to)))))}) (rules (start (place ""Disc"" ""Hand"" count:2)) phases:{(phase ""Placement"" (play (move (from (handSite Mover)) (to (sites Empty)))) (nextPhase Mover (all Sites (sites Hand Mover) if:(= 0 (count Cell at:(site)))) ""Movement"")) (phase ""Movement"" (play (forEach Piece)))} (end (if (no Moves Next) (result Mover Win)))))" -"The player to play the last possible legal move wins the game. The other player loses. Unless, that is, the board is completely full, in which case the game is a tie.","(game ""Duidoku"" (players 2) (equipment {(board (square 9)) (piece ""1"" Neutral) (piece ""2"" Neutral) (piece ""3"" Neutral) (piece ""4"" Neutral) (piece ""5"" Neutral) (piece ""6"" Neutral) (piece ""7"" Neutral) (piece ""8"" Neutral) (piece ""9"" Neutral) (regions ""Square0"" (sites {0 1 2 9 10 11 18 19 20})) (regions ""Square1"" (sites {3 4 5 12 13 14 21 22 23})) (regions ""Square2"" (sites {6 7 8 15 16 17 24 25 26})) (regions ""Square3"" (sites {27 28 29 36 37 38 45 46 47})) (regions ""Square4"" (sites {30 31 32 39 40 41 48 49 50})) (regions ""Square5"" (sites {33 34 35 42 43 44 51 52 53})) (regions ""Square6"" (sites {54 55 56 63 64 65 72 73 74})) (regions ""Square7"" (sites {57 58 59 66 67 68 75 76 77})) (regions ""Square8"" (sites {60 61 62 69 70 71 78 79 80}))}) (rules (play (or {(move Add (piece (id ""1"" Neutral)) (to (sites Empty) if:(and {(all Sites (sites Row (row of:(to))) if:(!= (id ""1"" Neutral) (what at:(site)))) (all Sites (sites Column (column of:(to))) if:(!= (id ""1"" Neutral) (what at:(site)))) (if (is In (to) (sites ""Square0"")) (all Sites (sites ""Square0"") if:(!= (id ""1"" Neutral) (what at:(site)))) (if (is In (to) (sites ""Square1"")) (all Sites (sites ""Square1"") if:(!= (id ""1"" Neutral) (what at:(site)))) (if (is In (to) (sites ""Square2"")) (all Sites (sites ""Square2"") if:(!= (id ""1"" Neutral) (what at:(site)))) (if (is In (to) (sites ""Square3"")) (all Sites (sites ""Square3"") if:(!= (id ""1"" Neutral) (what at:(site)))) (if (is In (to) (sites ""Square4"")) (all Sites (sites ""Square4"") if:(!= (id ""1"" Neutral) (what at:(site)))) (if (is In (to) (sites ""Square5"")) (all Sites (sites ""Square5"") if:(!= (id ""1"" Neutral) (what at:(site)))) (if (is In (to) (sites ""Square6"")) (all Sites (sites ""Square6"") if:(!= (id ""1"" Neutral) (what at:(site)))) (if (is In (to) (sites ""Square7"")) (all Sites (sites ""Square7"") if:(!= (id ""1"" Neutral) (what at:(site)))) (all Sites (sites ""Square8"") if:(!= (id ""1"" Neutral) (what at:(site))))))))))))}))) (move Add (piece (id ""2"" Neutral)) (to (sites Empty) if:(and {(all Sites (sites Row (row of:(to))) if:(!= (id ""2"" Neutral) (what at:(site)))) (all Sites (sites Column (column of:(to))) if:(!= (id ""2"" Neutral) (what at:(site)))) (if (is In (to) (sites ""Square0"")) (all Sites (sites ""Square0"") if:(!= (id ""2"" Neutral) (what at:(site)))) (if (is In (to) (sites ""Square1"")) (all Sites (sites ""Square1"") if:(!= (id ""2"" Neutral) (what at:(site)))) (if (is In (to) (sites ""Square2"")) (all Sites (sites ""Square2"") if:(!= (id ""2"" Neutral) (what at:(site)))) (if (is In (to) (sites ""Square3"")) (all Sites (sites ""Square3"") if:(!= (id ""2"" Neutral) (what at:(site)))) (if (is In (to) (sites ""Square4"")) (all Sites (sites ""Square4"") if:(!= (id ""2"" Neutral) (what at:(site)))) (if (is In (to) (sites ""Square5"")) (all Sites (sites ""Square5"") if:(!= (id ""2"" Neutral) (what at:(site)))) (if (is In (to) (sites ""Square6"")) (all Sites (sites ""Square6"") if:(!= (id ""2"" Neutral) (what at:(site)))) (if (is In (to) (sites ""Square7"")) (all Sites (sites ""Square7"") if:(!= (id ""2"" Neutral) (what at:(site)))) (all Sites (sites ""Square8"") if:(!= (id ""2"" Neutral) (what at:(site))))))))))))}))) (move Add (piece (id ""3"" Neutral)) (to (sites Empty) if:(and {(all Sites (sites Row (row of:(to))) if:(!= (id ""3"" Neutral) (what at:(site)))) (all Sites (sites Column (column of:(to))) if:(!= (id ""3"" Neutral) (what at:(site)))) (if (is In (to) (sites ""Square0"")) (all Sites (sites ""Square0"") if:(!= (id ""3"" Neutral) (what at:(site)))) (if (is In (to) (sites ""Square1"")) (all Sites (sites ""Square1"") if:(!= (id ""3"" Neutral) (what at:(site)))) (if (is In (to) (sites ""Square2"")) (all Sites (sites ""Square2"") if:(!= (id ""3"" Neutral) (what at:(site)))) (if (is In (to) (sites ""Square3"")) (all Sites (sites ""Square3"") if:(!= (id ""3"" Neutral) (what at:(site)))) (if (is In (to) (sites ""Square4"")) (all Sites (sites ""Square4"") if:(!= (id ""3"" Neutral) (what at:(site)))) (if (is In (to) (sites ""Square5"")) (all Sites (sites ""Square5"") if:(!= (id ""3"" Neutral) (what at:(site)))) (if (is In (to) (sites ""Square6"")) (all Sites (sites ""Square6"") if:(!= (id ""3"" Neutral) (what at:(site)))) (if (is In (to) (sites ""Square7"")) (all Sites (sites ""Square7"") if:(!= (id ""3"" Neutral) (what at:(site)))) (all Sites (sites ""Square8"") if:(!= (id ""3"" Neutral) (what at:(site))))))))))))}))) (move Add (piece (id ""4"" Neutral)) (to (sites Empty) if:(and {(all Sites (sites Row (row of:(to))) if:(!= (id ""4"" Neutral) (what at:(site)))) (all Sites (sites Column (column of:(to))) if:(!= (id ""4"" Neutral) (what at:(site)))) (if (is In (to) (sites ""Square0"")) (all Sites (sites ""Square0"") if:(!= (id ""4"" Neutral) (what at:(site)))) (if (is In (to) (sites ""Square1"")) (all Sites (sites ""Square1"") if:(!= (id ""4"" Neutral) (what at:(site)))) (if (is In (to) (sites ""Square2"")) (all Sites (sites ""Square2"") if:(!= (id ""4"" Neutral) (what at:(site)))) (if (is In (to) (sites ""Square3"")) (all Sites (sites ""Square3"") if:(!= (id ""4"" Neutral) (what at:(site)))) (if (is In (to) (sites ""Square4"")) (all Sites (sites ""Square4"") if:(!= (id ""4"" Neutral) (what at:(site)))) (if (is In (to) (sites ""Square5"")) (all Sites (sites ""Square5"") if:(!= (id ""4"" Neutral) (what at:(site)))) (if (is In (to) (sites ""Square6"")) (all Sites (sites ""Square6"") if:(!= (id ""4"" Neutral) (what at:(site)))) (if (is In (to) (sites ""Square7"")) (all Sites (sites ""Square7"") if:(!= (id ""4"" Neutral) (what at:(site)))) (all Sites (sites ""Square8"") if:(!= (id ""4"" Neutral) (what at:(site))))))))))))}))) (move Add (piece (id ""5"" Neutral)) (to (sites Empty) if:(and {(all Sites (sites Row (row of:(to))) if:(!= (id ""5"" Neutral) (what at:(site)))) (all Sites (sites Column (column of:(to))) if:(!= (id ""5"" Neutral) (what at:(site)))) (if (is In (to) (sites ""Square0"")) (all Sites (sites ""Square0"") if:(!= (id ""5"" Neutral) (what at:(site)))) (if (is In (to) (sites ""Square1"")) (all Sites (sites ""Square1"") if:(!= (id ""5"" Neutral) (what at:(site)))) (if (is In (to) (sites ""Square2"")) (all Sites (sites ""Square2"") if:(!= (id ""5"" Neutral) (what at:(site)))) (if (is In (to) (sites ""Square3"")) (all Sites (sites ""Square3"") if:(!= (id ""5"" Neutral) (what at:(site)))) (if (is In (to) (sites ""Square4"")) (all Sites (sites ""Square4"") if:(!= (id ""5"" Neutral) (what at:(site)))) (if (is In (to) (sites ""Square5"")) (all Sites (sites ""Square5"") if:(!= (id ""5"" Neutral) (what at:(site)))) (if (is In (to) (sites ""Square6"")) (all Sites (sites ""Square6"") if:(!= (id ""5"" Neutral) (what at:(site)))) (if (is In (to) (sites ""Square7"")) (all Sites (sites ""Square7"") if:(!= (id ""5"" Neutral) (what at:(site)))) (all Sites (sites ""Square8"") if:(!= (id ""5"" Neutral) (what at:(site))))))))))))}))) (move Add (piece (id ""6"" Neutral)) (to (sites Empty) if:(and {(all Sites (sites Row (row of:(to))) if:(!= (id ""6"" Neutral) (what at:(site)))) (all Sites (sites Column (column of:(to))) if:(!= (id ""6"" Neutral) (what at:(site)))) (if (is In (to) (sites ""Square0"")) (all Sites (sites ""Square0"") if:(!= (id ""6"" Neutral) (what at:(site)))) (if (is In (to) (sites ""Square1"")) (all Sites (sites ""Square1"") if:(!= (id ""6"" Neutral) (what at:(site)))) (if (is In (to) (sites ""Square2"")) (all Sites (sites ""Square2"") if:(!= (id ""6"" Neutral) (what at:(site)))) (if (is In (to) (sites ""Square3"")) (all Sites (sites ""Square3"") if:(!= (id ""6"" Neutral) (what at:(site)))) (if (is In (to) (sites ""Square4"")) (all Sites (sites ""Square4"") if:(!= (id ""6"" Neutral) (what at:(site)))) (if (is In (to) (sites ""Square5"")) (all Sites (sites ""Square5"") if:(!= (id ""6"" Neutral) (what at:(site)))) (if (is In (to) (sites ""Square6"")) (all Sites (sites ""Square6"") if:(!= (id ""6"" Neutral) (what at:(site)))) (if (is In (to) (sites ""Square7"")) (all Sites (sites ""Square7"") if:(!= (id ""6"" Neutral) (what at:(site)))) (all Sites (sites ""Square8"") if:(!= (id ""6"" Neutral) (what at:(site))))))))))))}))) (move Add (piece (id ""7"" Neutral)) (to (sites Empty) if:(and {(all Sites (sites Row (row of:(to))) if:(!= (id ""7"" Neutral) (what at:(site)))) (all Sites (sites Column (column of:(to))) if:(!= (id ""7"" Neutral) (what at:(site)))) (if (is In (to) (sites ""Square0"")) (all Sites (sites ""Square0"") if:(!= (id ""7"" Neutral) (what at:(site)))) (if (is In (to) (sites ""Square1"")) (all Sites (sites ""Square1"") if:(!= (id ""7"" Neutral) (what at:(site)))) (if (is In (to) (sites ""Square2"")) (all Sites (sites ""Square2"") if:(!= (id ""7"" Neutral) (what at:(site)))) (if (is In (to) (sites ""Square3"")) (all Sites (sites ""Square3"") if:(!= (id ""7"" Neutral) (what at:(site)))) (if (is In (to) (sites ""Square4"")) (all Sites (sites ""Square4"") if:(!= (id ""7"" Neutral) (what at:(site)))) (if (is In (to) (sites ""Square5"")) (all Sites (sites ""Square5"") if:(!= (id ""7"" Neutral) (what at:(site)))) (if (is In (to) (sites ""Square6"")) (all Sites (sites ""Square6"") if:(!= (id ""7"" Neutral) (what at:(site)))) (if (is In (to) (sites ""Square7"")) (all Sites (sites ""Square7"") if:(!= (id ""7"" Neutral) (what at:(site)))) (all Sites (sites ""Square8"") if:(!= (id ""7"" Neutral) (what at:(site))))))))))))}))) (move Add (piece (id ""8"" Neutral)) (to (sites Empty) if:(and {(all Sites (sites Row (row of:(to))) if:(!= (id ""8"" Neutral) (what at:(site)))) (all Sites (sites Column (column of:(to))) if:(!= (id ""8"" Neutral) (what at:(site)))) (if (is In (to) (sites ""Square0"")) (all Sites (sites ""Square0"") if:(!= (id ""8"" Neutral) (what at:(site)))) (if (is In (to) (sites ""Square1"")) (all Sites (sites ""Square1"") if:(!= (id ""8"" Neutral) (what at:(site)))) (if (is In (to) (sites ""Square2"")) (all Sites (sites ""Square2"") if:(!= (id ""8"" Neutral) (what at:(site)))) (if (is In (to) (sites ""Square3"")) (all Sites (sites ""Square3"") if:(!= (id ""8"" Neutral) (what at:(site)))) (if (is In (to) (sites ""Square4"")) (all Sites (sites ""Square4"") if:(!= (id ""8"" Neutral) (what at:(site)))) (if (is In (to) (sites ""Square5"")) (all Sites (sites ""Square5"") if:(!= (id ""8"" Neutral) (what at:(site)))) (if (is In (to) (sites ""Square6"")) (all Sites (sites ""Square6"") if:(!= (id ""8"" Neutral) (what at:(site)))) (if (is In (to) (sites ""Square7"")) (all Sites (sites ""Square7"") if:(!= (id ""8"" Neutral) (what at:(site)))) (all Sites (sites ""Square8"") if:(!= (id ""8"" Neutral) (what at:(site))))))))))))}))) (move Add (piece (id ""9"" Neutral)) (to (sites Empty) if:(and {(all Sites (sites Row (row of:(to))) if:(!= (id ""9"" Neutral) (what at:(site)))) (all Sites (sites Column (column of:(to))) if:(!= (id ""9"" Neutral) (what at:(site)))) (if (is In (to) (sites ""Square0"")) (all Sites (sites ""Square0"") if:(!= (id ""9"" Neutral) (what at:(site)))) (if (is In (to) (sites ""Square1"")) (all Sites (sites ""Square1"") if:(!= (id ""9"" Neutral) (what at:(site)))) (if (is In (to) (sites ""Square2"")) (all Sites (sites ""Square2"") if:(!= (id ""9"" Neutral) (what at:(site)))) (if (is In (to) (sites ""Square3"")) (all Sites (sites ""Square3"") if:(!= (id ""9"" Neutral) (what at:(site)))) (if (is In (to) (sites ""Square4"")) (all Sites (sites ""Square4"") if:(!= (id ""9"" Neutral) (what at:(site)))) (if (is In (to) (sites ""Square5"")) (all Sites (sites ""Square5"") if:(!= (id ""9"" Neutral) (what at:(site)))) (if (is In (to) (sites ""Square6"")) (all Sites (sites ""Square6"") if:(!= (id ""9"" Neutral) (what at:(site)))) (if (is In (to) (sites ""Square7"")) (all Sites (sites ""Square7"") if:(!= (id ""9"" Neutral) (what at:(site)))) (all Sites (sites ""Square8"") if:(!= (id ""9"" Neutral) (what at:(site))))))))))))})))})) (end {(if (all Sites (sites Board) if:(is Occupied (site))) (result Mover Draw)) (if (no Moves Next) (result Mover Win))})))","###Description -The player to play the last possible legal move wins the game. The other player loses. Unless, that is, the board is completely full, in which case the game is a tie. - -###Ludii -(game ""Duidoku"" (players 2) (equipment {(board (square 9)) (piece ""1"" Neutral) (piece ""2"" Neutral) (piece ""3"" Neutral) (piece ""4"" Neutral) (piece ""5"" Neutral) (piece ""6"" Neutral) (piece ""7"" Neutral) (piece ""8"" Neutral) (piece ""9"" Neutral) (regions ""Square0"" (sites {0 1 2 9 10 11 18 19 20})) (regions ""Square1"" (sites {3 4 5 12 13 14 21 22 23})) (regions ""Square2"" (sites {6 7 8 15 16 17 24 25 26})) (regions ""Square3"" (sites {27 28 29 36 37 38 45 46 47})) (regions ""Square4"" (sites {30 31 32 39 40 41 48 49 50})) (regions ""Square5"" (sites {33 34 35 42 43 44 51 52 53})) (regions ""Square6"" (sites {54 55 56 63 64 65 72 73 74})) (regions ""Square7"" (sites {57 58 59 66 67 68 75 76 77})) (regions ""Square8"" (sites {60 61 62 69 70 71 78 79 80}))}) (rules (play (or {(move Add (piece (id ""1"" Neutral)) (to (sites Empty) if:(and {(all Sites (sites Row (row of:(to))) if:(!= (id ""1"" Neutral) (what at:(site)))) (all Sites (sites Column (column of:(to))) if:(!= (id ""1"" Neutral) (what at:(site)))) (if (is In (to) (sites ""Square0"")) (all Sites (sites ""Square0"") if:(!= (id ""1"" Neutral) (what at:(site)))) (if (is In (to) (sites ""Square1"")) (all Sites (sites ""Square1"") if:(!= (id ""1"" Neutral) (what at:(site)))) (if (is In (to) (sites ""Square2"")) (all Sites (sites ""Square2"") if:(!= (id ""1"" Neutral) (what at:(site)))) (if (is In (to) (sites ""Square3"")) (all Sites (sites ""Square3"") if:(!= (id ""1"" Neutral) (what at:(site)))) (if (is In (to) (sites ""Square4"")) (all Sites (sites ""Square4"") if:(!= (id ""1"" Neutral) (what at:(site)))) (if (is In (to) (sites ""Square5"")) (all Sites (sites ""Square5"") if:(!= (id ""1"" Neutral) (what at:(site)))) (if (is In (to) (sites ""Square6"")) (all Sites (sites ""Square6"") if:(!= (id ""1"" Neutral) (what at:(site)))) (if (is In (to) (sites ""Square7"")) (all Sites (sites ""Square7"") if:(!= (id ""1"" Neutral) (what at:(site)))) (all Sites (sites ""Square8"") if:(!= (id ""1"" Neutral) (what at:(site))))))))))))}))) (move Add (piece (id ""2"" Neutral)) (to (sites Empty) if:(and {(all Sites (sites Row (row of:(to))) if:(!= (id ""2"" Neutral) (what at:(site)))) (all Sites (sites Column (column of:(to))) if:(!= (id ""2"" Neutral) (what at:(site)))) (if (is In (to) (sites ""Square0"")) (all Sites (sites ""Square0"") if:(!= (id ""2"" Neutral) (what at:(site)))) (if (is In (to) (sites ""Square1"")) (all Sites (sites ""Square1"") if:(!= (id ""2"" Neutral) (what at:(site)))) (if (is In (to) (sites ""Square2"")) (all Sites (sites ""Square2"") if:(!= (id ""2"" Neutral) (what at:(site)))) (if (is In (to) (sites ""Square3"")) (all Sites (sites ""Square3"") if:(!= (id ""2"" Neutral) (what at:(site)))) (if (is In (to) (sites ""Square4"")) (all Sites (sites ""Square4"") if:(!= (id ""2"" Neutral) (what at:(site)))) (if (is In (to) (sites ""Square5"")) (all Sites (sites ""Square5"") if:(!= (id ""2"" Neutral) (what at:(site)))) (if (is In (to) (sites ""Square6"")) (all Sites (sites ""Square6"") if:(!= (id ""2"" Neutral) (what at:(site)))) (if (is In (to) (sites ""Square7"")) (all Sites (sites ""Square7"") if:(!= (id ""2"" Neutral) (what at:(site)))) (all Sites (sites ""Square8"") if:(!= (id ""2"" Neutral) (what at:(site))))))))))))}))) (move Add (piece (id ""3"" Neutral)) (to (sites Empty) if:(and {(all Sites (sites Row (row of:(to))) if:(!= (id ""3"" Neutral) (what at:(site)))) (all Sites (sites Column (column of:(to))) if:(!= (id ""3"" Neutral) (what at:(site)))) (if (is In (to) (sites ""Square0"")) (all Sites (sites ""Square0"") if:(!= (id ""3"" Neutral) (what at:(site)))) (if (is In (to) (sites ""Square1"")) (all Sites (sites ""Square1"") if:(!= (id ""3"" Neutral) (what at:(site)))) (if (is In (to) (sites ""Square2"")) (all Sites (sites ""Square2"") if:(!= (id ""3"" Neutral) (what at:(site)))) (if (is In (to) (sites ""Square3"")) (all Sites (sites ""Square3"") if:(!= (id ""3"" Neutral) (what at:(site)))) (if (is In (to) (sites ""Square4"")) (all Sites (sites ""Square4"") if:(!= (id ""3"" Neutral) (what at:(site)))) (if (is In (to) (sites ""Square5"")) (all Sites (sites ""Square5"") if:(!= (id ""3"" Neutral) (what at:(site)))) (if (is In (to) (sites ""Square6"")) (all Sites (sites ""Square6"") if:(!= (id ""3"" Neutral) (what at:(site)))) (if (is In (to) (sites ""Square7"")) (all Sites (sites ""Square7"") if:(!= (id ""3"" Neutral) (what at:(site)))) (all Sites (sites ""Square8"") if:(!= (id ""3"" Neutral) (what at:(site))))))))))))}))) (move Add (piece (id ""4"" Neutral)) (to (sites Empty) if:(and {(all Sites (sites Row (row of:(to))) if:(!= (id ""4"" Neutral) (what at:(site)))) (all Sites (sites Column (column of:(to))) if:(!= (id ""4"" Neutral) (what at:(site)))) (if (is In (to) (sites ""Square0"")) (all Sites (sites ""Square0"") if:(!= (id ""4"" Neutral) (what at:(site)))) (if (is In (to) (sites ""Square1"")) (all Sites (sites ""Square1"") if:(!= (id ""4"" Neutral) (what at:(site)))) (if (is In (to) (sites ""Square2"")) (all Sites (sites ""Square2"") if:(!= (id ""4"" Neutral) (what at:(site)))) (if (is In (to) (sites ""Square3"")) (all Sites (sites ""Square3"") if:(!= (id ""4"" Neutral) (what at:(site)))) (if (is In (to) (sites ""Square4"")) (all Sites (sites ""Square4"") if:(!= (id ""4"" Neutral) (what at:(site)))) (if (is In (to) (sites ""Square5"")) (all Sites (sites ""Square5"") if:(!= (id ""4"" Neutral) (what at:(site)))) (if (is In (to) (sites ""Square6"")) (all Sites (sites ""Square6"") if:(!= (id ""4"" Neutral) (what at:(site)))) (if (is In (to) (sites ""Square7"")) (all Sites (sites ""Square7"") if:(!= (id ""4"" Neutral) (what at:(site)))) (all Sites (sites ""Square8"") if:(!= (id ""4"" Neutral) (what at:(site))))))))))))}))) (move Add (piece (id ""5"" Neutral)) (to (sites Empty) if:(and {(all Sites (sites Row (row of:(to))) if:(!= (id ""5"" Neutral) (what at:(site)))) (all Sites (sites Column (column of:(to))) if:(!= (id ""5"" Neutral) (what at:(site)))) (if (is In (to) (sites ""Square0"")) (all Sites (sites ""Square0"") if:(!= (id ""5"" Neutral) (what at:(site)))) (if (is In (to) (sites ""Square1"")) (all Sites (sites ""Square1"") if:(!= (id ""5"" Neutral) (what at:(site)))) (if (is In (to) (sites ""Square2"")) (all Sites (sites ""Square2"") if:(!= (id ""5"" Neutral) (what at:(site)))) (if (is In (to) (sites ""Square3"")) (all Sites (sites ""Square3"") if:(!= (id ""5"" Neutral) (what at:(site)))) (if (is In (to) (sites ""Square4"")) (all Sites (sites ""Square4"") if:(!= (id ""5"" Neutral) (what at:(site)))) (if (is In (to) (sites ""Square5"")) (all Sites (sites ""Square5"") if:(!= (id ""5"" Neutral) (what at:(site)))) (if (is In (to) (sites ""Square6"")) (all Sites (sites ""Square6"") if:(!= (id ""5"" Neutral) (what at:(site)))) (if (is In (to) (sites ""Square7"")) (all Sites (sites ""Square7"") if:(!= (id ""5"" Neutral) (what at:(site)))) (all Sites (sites ""Square8"") if:(!= (id ""5"" Neutral) (what at:(site))))))))))))}))) (move Add (piece (id ""6"" Neutral)) (to (sites Empty) if:(and {(all Sites (sites Row (row of:(to))) if:(!= (id ""6"" Neutral) (what at:(site)))) (all Sites (sites Column (column of:(to))) if:(!= (id ""6"" Neutral) (what at:(site)))) (if (is In (to) (sites ""Square0"")) (all Sites (sites ""Square0"") if:(!= (id ""6"" Neutral) (what at:(site)))) (if (is In (to) (sites ""Square1"")) (all Sites (sites ""Square1"") if:(!= (id ""6"" Neutral) (what at:(site)))) (if (is In (to) (sites ""Square2"")) (all Sites (sites ""Square2"") if:(!= (id ""6"" Neutral) (what at:(site)))) (if (is In (to) (sites ""Square3"")) (all Sites (sites ""Square3"") if:(!= (id ""6"" Neutral) (what at:(site)))) (if (is In (to) (sites ""Square4"")) (all Sites (sites ""Square4"") if:(!= (id ""6"" Neutral) (what at:(site)))) (if (is In (to) (sites ""Square5"")) (all Sites (sites ""Square5"") if:(!= (id ""6"" Neutral) (what at:(site)))) (if (is In (to) (sites ""Square6"")) (all Sites (sites ""Square6"") if:(!= (id ""6"" Neutral) (what at:(site)))) (if (is In (to) (sites ""Square7"")) (all Sites (sites ""Square7"") if:(!= (id ""6"" Neutral) (what at:(site)))) (all Sites (sites ""Square8"") if:(!= (id ""6"" Neutral) (what at:(site))))))))))))}))) (move Add (piece (id ""7"" Neutral)) (to (sites Empty) if:(and {(all Sites (sites Row (row of:(to))) if:(!= (id ""7"" Neutral) (what at:(site)))) (all Sites (sites Column (column of:(to))) if:(!= (id ""7"" Neutral) (what at:(site)))) (if (is In (to) (sites ""Square0"")) (all Sites (sites ""Square0"") if:(!= (id ""7"" Neutral) (what at:(site)))) (if (is In (to) (sites ""Square1"")) (all Sites (sites ""Square1"") if:(!= (id ""7"" Neutral) (what at:(site)))) (if (is In (to) (sites ""Square2"")) (all Sites (sites ""Square2"") if:(!= (id ""7"" Neutral) (what at:(site)))) (if (is In (to) (sites ""Square3"")) (all Sites (sites ""Square3"") if:(!= (id ""7"" Neutral) (what at:(site)))) (if (is In (to) (sites ""Square4"")) (all Sites (sites ""Square4"") if:(!= (id ""7"" Neutral) (what at:(site)))) (if (is In (to) (sites ""Square5"")) (all Sites (sites ""Square5"") if:(!= (id ""7"" Neutral) (what at:(site)))) (if (is In (to) (sites ""Square6"")) (all Sites (sites ""Square6"") if:(!= (id ""7"" Neutral) (what at:(site)))) (if (is In (to) (sites ""Square7"")) (all Sites (sites ""Square7"") if:(!= (id ""7"" Neutral) (what at:(site)))) (all Sites (sites ""Square8"") if:(!= (id ""7"" Neutral) (what at:(site))))))))))))}))) (move Add (piece (id ""8"" Neutral)) (to (sites Empty) if:(and {(all Sites (sites Row (row of:(to))) if:(!= (id ""8"" Neutral) (what at:(site)))) (all Sites (sites Column (column of:(to))) if:(!= (id ""8"" Neutral) (what at:(site)))) (if (is In (to) (sites ""Square0"")) (all Sites (sites ""Square0"") if:(!= (id ""8"" Neutral) (what at:(site)))) (if (is In (to) (sites ""Square1"")) (all Sites (sites ""Square1"") if:(!= (id ""8"" Neutral) (what at:(site)))) (if (is In (to) (sites ""Square2"")) (all Sites (sites ""Square2"") if:(!= (id ""8"" Neutral) (what at:(site)))) (if (is In (to) (sites ""Square3"")) (all Sites (sites ""Square3"") if:(!= (id ""8"" Neutral) (what at:(site)))) (if (is In (to) (sites ""Square4"")) (all Sites (sites ""Square4"") if:(!= (id ""8"" Neutral) (what at:(site)))) (if (is In (to) (sites ""Square5"")) (all Sites (sites ""Square5"") if:(!= (id ""8"" Neutral) (what at:(site)))) (if (is In (to) (sites ""Square6"")) (all Sites (sites ""Square6"") if:(!= (id ""8"" Neutral) (what at:(site)))) (if (is In (to) (sites ""Square7"")) (all Sites (sites ""Square7"") if:(!= (id ""8"" Neutral) (what at:(site)))) (all Sites (sites ""Square8"") if:(!= (id ""8"" Neutral) (what at:(site))))))))))))}))) (move Add (piece (id ""9"" Neutral)) (to (sites Empty) if:(and {(all Sites (sites Row (row of:(to))) if:(!= (id ""9"" Neutral) (what at:(site)))) (all Sites (sites Column (column of:(to))) if:(!= (id ""9"" Neutral) (what at:(site)))) (if (is In (to) (sites ""Square0"")) (all Sites (sites ""Square0"") if:(!= (id ""9"" Neutral) (what at:(site)))) (if (is In (to) (sites ""Square1"")) (all Sites (sites ""Square1"") if:(!= (id ""9"" Neutral) (what at:(site)))) (if (is In (to) (sites ""Square2"")) (all Sites (sites ""Square2"") if:(!= (id ""9"" Neutral) (what at:(site)))) (if (is In (to) (sites ""Square3"")) (all Sites (sites ""Square3"") if:(!= (id ""9"" Neutral) (what at:(site)))) (if (is In (to) (sites ""Square4"")) (all Sites (sites ""Square4"") if:(!= (id ""9"" Neutral) (what at:(site)))) (if (is In (to) (sites ""Square5"")) (all Sites (sites ""Square5"") if:(!= (id ""9"" Neutral) (what at:(site)))) (if (is In (to) (sites ""Square6"")) (all Sites (sites ""Square6"") if:(!= (id ""9"" Neutral) (what at:(site)))) (if (is In (to) (sites ""Square7"")) (all Sites (sites ""Square7"") if:(!= (id ""9"" Neutral) (what at:(site)))) (all Sites (sites ""Square8"") if:(!= (id ""9"" Neutral) (what at:(site))))))))))))})))})) (end {(if (all Sites (sites Board) if:(is Occupied (site))) (result Mover Draw)) (if (no Moves Next) (result Mover Win))})))" "Use Options to select a board size. Goal: Be the last to play. Then the first player (Maroon) places a stone, after which the players alternate, taking up to two moves per turn. To move, either: 1. Add a stone to an empty space that is not in line-of-sight of any opponent's stone. -Or, 2. Slide a stone along a straight line to a new position, with the following restriction: Either -- A. The new location must have a greater number of opponent's stones adjacent to it, or -- B. The new location must have more sight-lines to opponent's stones than the old location, while keeping number of adjacent opponent's stones the same. To avoid forfeiting the game, a player must move at least once on a turn. The second move can be voluntarily skipped. The winner is last to play. The score shown is a count of the available moves at the beginning of a player's turn for use by the AI. Extra small board (39 nodes) as a filler game and for learning how to play","(game ""Epoxy"" (players 2) (equipment {(board (dual (remove (hex 4 5) cells:{0 1 15 20 25 32 36 39 44})) use:Vertex) (piece ""Ball"" Each (move Slide))}) (rules (start (set Score Each 0)) (play (or {(move Add (piece (mover)) (to (difference (sites Empty) (sites (results from:(sites Occupied by:Next) to:(sites LineOfSight Empty at:(from) Orthogonal) (to)))))) (forEach Piece (do (and (set Var ""LoSFrom"" (count Pieces Next in:(sites LineOfSight Piece at:(from) Orthogonal))) (set Var ""QtyAroundFrom"" (count Pieces Next in:(sites Around (from) Orthogonal)))) next:(move Slide Orthogonal) ifAfterwards:(or (> (count Pieces Next in:(sites Around (last To) Orthogonal)) (var ""QtyAroundFrom"")) (and (= (count Pieces Next in:(sites Around (last To) Orthogonal)) (var ""QtyAroundFrom"")) (> (count Pieces Next in:(sites LineOfSight Piece at:(last To) Orthogonal)) (var ""LoSFrom""))))) Mover) (if (and (not (is Prev Next)) (< 0 (counter))) (move Pass))} (then (if (is Prev Next) (moveAgain) (and (set Score Mover (+ (size Array (array (sites From (forEach Piece (do (and (set Var ""LoSFrom"" (count Pieces Next in:(sites LineOfSight Piece at:(from) Orthogonal))) (set Var ""QtyAroundFrom"" (count Pieces Next in:(sites Around (from) Orthogonal)))) next:(move Slide Orthogonal) ifAfterwards:(or (> (count Pieces Next in:(sites Around (last To) Orthogonal)) (var ""QtyAroundFrom"")) (and (= (count Pieces Next in:(sites Around (last To) Orthogonal)) (var ""QtyAroundFrom"")) (> (count Pieces Next in:(sites LineOfSight Piece at:(last To) Orthogonal)) (var ""LoSFrom""))))) Mover)))) (count Sites in:(difference (sites (results from:(sites Occupied by:Mover) to:(sites LineOfSight Empty at:(from) Orthogonal) (to))) (sites (results from:(sites Occupied by:Next) to:(sites LineOfSight Empty at:(from) Orthogonal) (to))))))) (set Score Next (+ (size Array (array (sites From (forEach Piece (do (and (set Var ""LoSFrom"" (count Pieces Next in:(sites LineOfSight Piece at:(from) Orthogonal))) (set Var ""QtyAroundFrom"" (count Pieces Next in:(sites Around (from) Orthogonal)))) next:(move Slide Orthogonal) ifAfterwards:(or (> (count Pieces Next in:(sites Around (last To) Orthogonal)) (var ""QtyAroundFrom"")) (and (= (count Pieces Next in:(sites Around (last To) Orthogonal)) (var ""QtyAroundFrom"")) (> (count Pieces Next in:(sites LineOfSight Piece at:(last To) Orthogonal)) (var ""LoSFrom""))))) Next)))) (count Sites in:(difference (sites (results from:(sites Occupied by:Next) to:(sites LineOfSight Empty at:(from) Orthogonal) (to))) (sites (results from:(sites Occupied by:Mover) to:(sites LineOfSight Empty at:(from) Orthogonal) (to)))))))))))) (end (if (and (is Prev Mover) (no Moves Next)) (result Mover Win)))))","###Description Use Options to select a board size. Goal: Be the last to play. Then the first player (Maroon) places a stone, after which the players alternate, taking up to two moves per turn. To move, either: 1. Add a stone to an empty space that is not in line-of-sight of any opponent's stone. -Or, 2. Slide a stone along a straight line to a new position, with the following restriction: Either -- A. The new location must have a greater number of opponent's stones adjacent to it, or -- B. The new location must have more sight-lines to opponent's stones than the old location, while keeping number of adjacent opponent's stones the same. To avoid forfeiting the game, a player must move at least once on a turn. The second move can be voluntarily skipped. The winner is last to play. The score shown is a count of the available moves at the beginning of a player's turn for use by the AI. Extra small board (39 nodes) as a filler game and for learning how to play ###Ludii (game ""Epoxy"" (players 2) (equipment {(board (dual (remove (hex 4 5) cells:{0 1 15 20 25 32 36 39 44})) use:Vertex) (piece ""Ball"" Each (move Slide))}) (rules (start (set Score Each 0)) (play (or {(move Add (piece (mover)) (to (difference (sites Empty) (sites (results from:(sites Occupied by:Next) to:(sites LineOfSight Empty at:(from) Orthogonal) (to)))))) (forEach Piece (do (and (set Var ""LoSFrom"" (count Pieces Next in:(sites LineOfSight Piece at:(from) Orthogonal))) (set Var ""QtyAroundFrom"" (count Pieces Next in:(sites Around (from) Orthogonal)))) next:(move Slide Orthogonal) ifAfterwards:(or (> (count Pieces Next in:(sites Around (last To) Orthogonal)) (var ""QtyAroundFrom"")) (and (= (count Pieces Next in:(sites Around (last To) Orthogonal)) (var ""QtyAroundFrom"")) (> (count Pieces Next in:(sites LineOfSight Piece at:(last To) Orthogonal)) (var ""LoSFrom""))))) Mover) (if (and (not (is Prev Next)) (< 0 (counter))) (move Pass))} (then (if (is Prev Next) (moveAgain) (and (set Score Mover (+ (size Array (array (sites From (forEach Piece (do (and (set Var ""LoSFrom"" (count Pieces Next in:(sites LineOfSight Piece at:(from) Orthogonal))) (set Var ""QtyAroundFrom"" (count Pieces Next in:(sites Around (from) Orthogonal)))) next:(move Slide Orthogonal) ifAfterwards:(or (> (count Pieces Next in:(sites Around (last To) Orthogonal)) (var ""QtyAroundFrom"")) (and (= (count Pieces Next in:(sites Around (last To) Orthogonal)) (var ""QtyAroundFrom"")) (> (count Pieces Next in:(sites LineOfSight Piece at:(last To) Orthogonal)) (var ""LoSFrom""))))) Mover)))) (count Sites in:(difference (sites (results from:(sites Occupied by:Mover) to:(sites LineOfSight Empty at:(from) Orthogonal) (to))) (sites (results from:(sites Occupied by:Next) to:(sites LineOfSight Empty at:(from) Orthogonal) (to))))))) (set Score Next (+ (size Array (array (sites From (forEach Piece (do (and (set Var ""LoSFrom"" (count Pieces Next in:(sites LineOfSight Piece at:(from) Orthogonal))) (set Var ""QtyAroundFrom"" (count Pieces Next in:(sites Around (from) Orthogonal)))) next:(move Slide Orthogonal) ifAfterwards:(or (> (count Pieces Next in:(sites Around (last To) Orthogonal)) (var ""QtyAroundFrom"")) (and (= (count Pieces Next in:(sites Around (last To) Orthogonal)) (var ""QtyAroundFrom"")) (> (count Pieces Next in:(sites LineOfSight Piece at:(last To) Orthogonal)) (var ""LoSFrom""))))) Next)))) (count Sites in:(difference (sites (results from:(sites Occupied by:Next) to:(sites LineOfSight Empty at:(from) Orthogonal) (to))) (sites (results from:(sites Occupied by:Mover) to:(sites LineOfSight Empty at:(from) Orthogonal) (to)))))))))))) (end (if (and (is Prev Mover) (no Moves Next)) (result Mover Win)))))" -"Ex nihilo is a game for 2 players played with stackable pieces of two colors on the cells of a hexagonal arrangement of hexagons (a hexhex board). The board starts out empty. The game is over as soon as one player is unable to make a move. The other player is then the winner. Even though the goal is technically stalemate, out of the interlocking mechanics emerges a territorial goal with a constant threat of a clever check mate turning the tide or ending the game before territory is settled. The novelty of this game lies in its central gimmick: Every move consists in moving a stack. In this sense it is a pure movement game. Yet, the game features both placement and captures. Movement – overview: Stacks move along straight open lines and grow when they move away from the center cell. This game is unusual in allowing movement of stacks containing 0 pieces. It is by growing these that pieces get onto the board in the first place. Movement – details: On your turn, you must move a stack not topped by an enemy piece to an empty cell reachable through an unbroken line of empty cells. By convention, a single piece is considered a stack of size 1 and an empty cell is considered to contain a stack of size 0. If, after you have moved a stack, it is farther away from the center cell than before it was moved (measured in number of steps), its size is increased by 1 per step further away from the center it now is. This happens automatically in Ludii. You may move a proper part of a stack by splitting it. To move a part of a stack, drag the piece that will be the bottom piece of the new stack to its destination, or click it, then the destination. You may also move a whole stack, but only on the condition that you move it farther away from the center cell. A consequence is that moving a whole stack always results in its size increasing. Together with the convention that empty cells contain stacks of size 0, this also has the consequence that you can effectively place a new stack on the board by moving a stack of size 0. In Ludii a 0-stack is represented by a grey disc. You move it by dragging it to where you want to go, or click it, then the destination. Note that nothing special happens to the cell you moved the 0-stack from – it still contains a 0-stack. Capturing - overview: Flanked enemy stacks are captured by being taken hostage for a move. Capturing is obligatory: If a capturing move is available, a capturing move must be made. Capturing - details: If (and only if) the top piece of a stack is of your color, it is said to partake in flanking an enemy stack if (i) this enemy stack is exactly in the middle of a line of otherwise empty cells going from the flanking stack to another one of your stacks, and (ii) all three of these stacks are of the same size. If, after you have moved a stack, it partakes in flanking one or more enemy stacks, you must immediately move one of these enemy stacks. Except for the obvious difference that you are moving an enemy stack, all normal rules apply to this move. For example: If the captured stack grows (if you move it farther away from the center cell, that is), it grows by the addition of pieces of your color, so situations where this hostage move must itself be a capturing move are possible. Such chaining of captures must continue until you capture a stack that is not in a position to continue the chain. Growing captured stacks is the only way to take ownership of them more permanently. A base 5 board is currently selected","(game ""Ex Nihilo"" (players 2) (equipment {(board (hex 5)) (piece ""Disc"" Each) (piece ""Disc"" Neutral)}) (rules (start (place ""Disc0"" (sites Board))) (play (priority (do (if (= 1 (var)) (and (set Var 0) (or {(forEach Piece (move (from if:(is In (from) (sites (values Remembered)))) (to (sites Direction from:(from) stop:(< 0 (who at:(to)))) if:(< (count Steps (from) (centrePoint)) (count Steps (to) (centrePoint))) (apply (remove (to)))) count:(size Stack at:(from)) stack:True (then (and (add (to (last To)) count:(- (count Steps (last To) (centrePoint)) (count Steps (last From) (centrePoint))) stack:True) (add (piece ""Disc0"") (to (last From)))))) Next top:True) (forEach Piece (forEach Value min:1 max:(- (size Stack at:(from)) 1) (move (from if:(is In (from) (sites (values Remembered)))) (to (sites Direction from:(from) stop:(< 0 (who at:(to)))) (apply (remove (to)))) count:(value) stack:True (then (if (< (count Steps (last From) (centrePoint)) (count Steps (last To) (centrePoint))) (add (to (last To)) count:(- (count Steps (last To) (centrePoint)) (count Steps (last From) (centrePoint))) stack:True))))) Next top:True)})) (or {(forEach Piece (move (from) (to (sites Direction from:(from) stop:(< 0 (who at:(to)))) if:(< (count Steps (from) (centrePoint)) (count Steps (to) (centrePoint)))) copy:True (then (do (remove (last To) count:(size Stack at:(last To))) next:(add (to (last To)) count:(- (count Steps (last To) (centrePoint)) (count Steps (last From) (centrePoint))) stack:True)))) Neutral top:True) (forEach Piece (or (move (from if:True) (to (sites Direction from:(from) stop:(< 0 (who at:(to)))) if:(< (count Steps (from) (centrePoint)) (count Steps (to) (centrePoint))) (apply (remove (to)))) count:(size Stack at:(from)) stack:True (then (and (add (to (last To)) count:(- (count Steps (last To) (centrePoint)) (count Steps (last From) (centrePoint))) stack:True) (add (piece ""Disc0"") (to (last From)))))) (forEach Value min:1 max:(- (size Stack at:(from)) 1) (move (from if:(< 1 (size Stack at:(from)))) (to (sites Direction from:(from) stop:(< 0 (who at:(to)))) (apply (remove (to)))) count:(value) stack:True (then (if (< (count Steps (last From) (centrePoint)) (count Steps (last To) (centrePoint))) (add (to (last To)) count:(- (count Steps (last To) (centrePoint)) (count Steps (last From) (centrePoint))) stack:True)))))) Mover top:True)})) ifAfterwards:(or {(and {(= 1 (count Sites in:(intersection (sites Direction from:(last To) NNW stop:(= (mover) (who at:(to))) stopIncluded:True) (sites Occupied by:Mover)))) (= 1 (count Sites in:(intersection (sites Direction from:(last To) NNW stop:(= (mover) (who at:(to))) stopIncluded:True) (sites Occupied by:Next)))) (= (next) (who at:(ahead (last To) steps:(/ (count Sites in:(sites Direction from:(last To) NNW stop:(= (mover) (who at:(to))) stopIncluded:True)) 2) NNW))) (is Even (count Sites in:(sites Direction from:(last To) NNW stop:(= (mover) (who at:(to))) stopIncluded:True))) (= (mover) (who at:(last To))) (= (size Stack at:(last To)) (size Stack at:(ahead (last To) steps:(/ (count Sites in:(sites Direction from:(last To) NNW stop:(= (mover) (who at:(to))) stopIncluded:True)) 2) NNW))) (= (size Stack at:(ahead (last To) steps:(count Sites in:(sites Direction from:(last To) NNW stop:(= (mover) (who at:(to))) stopIncluded:True)) NNW)) (size Stack at:(ahead (last To) steps:(/ (count Sites in:(sites Direction from:(last To) NNW stop:(= (mover) (who at:(to))) stopIncluded:True)) 2) NNW)))}) (and {(= 1 (count Sites in:(intersection (sites Direction from:(last To) W stop:(= (mover) (who at:(to))) stopIncluded:True) (sites Occupied by:Mover)))) (= 1 (count Sites in:(intersection (sites Direction from:(last To) W stop:(= (mover) (who at:(to))) stopIncluded:True) (sites Occupied by:Next)))) (= (next) (who at:(ahead (last To) steps:(/ (count Sites in:(sites Direction from:(last To) W stop:(= (mover) (who at:(to))) stopIncluded:True)) 2) W))) (is Even (count Sites in:(sites Direction from:(last To) W stop:(= (mover) (who at:(to))) stopIncluded:True))) (= (mover) (who at:(last To))) (= (size Stack at:(last To)) (size Stack at:(ahead (last To) steps:(/ (count Sites in:(sites Direction from:(last To) W stop:(= (mover) (who at:(to))) stopIncluded:True)) 2) W))) (= (size Stack at:(ahead (last To) steps:(count Sites in:(sites Direction from:(last To) W stop:(= (mover) (who at:(to))) stopIncluded:True)) W)) (size Stack at:(ahead (last To) steps:(/ (count Sites in:(sites Direction from:(last To) W stop:(= (mover) (who at:(to))) stopIncluded:True)) 2) W)))}) (and {(= 1 (count Sites in:(intersection (sites Direction from:(last To) SSW stop:(= (mover) (who at:(to))) stopIncluded:True) (sites Occupied by:Mover)))) (= 1 (count Sites in:(intersection (sites Direction from:(last To) SSW stop:(= (mover) (who at:(to))) stopIncluded:True) (sites Occupied by:Next)))) (= (next) (who at:(ahead (last To) steps:(/ (count Sites in:(sites Direction from:(last To) SSW stop:(= (mover) (who at:(to))) stopIncluded:True)) 2) SSW))) (is Even (count Sites in:(sites Direction from:(last To) SSW stop:(= (mover) (who at:(to))) stopIncluded:True))) (= (mover) (who at:(last To))) (= (size Stack at:(last To)) (size Stack at:(ahead (last To) steps:(/ (count Sites in:(sites Direction from:(last To) SSW stop:(= (mover) (who at:(to))) stopIncluded:True)) 2) SSW))) (= (size Stack at:(ahead (last To) steps:(count Sites in:(sites Direction from:(last To) SSW stop:(= (mover) (who at:(to))) stopIncluded:True)) SSW)) (size Stack at:(ahead (last To) steps:(/ (count Sites in:(sites Direction from:(last To) SSW stop:(= (mover) (who at:(to))) stopIncluded:True)) 2) SSW)))}) (and {(= 1 (count Sites in:(intersection (sites Direction from:(last To) SSE stop:(= (mover) (who at:(to))) stopIncluded:True) (sites Occupied by:Mover)))) (= 1 (count Sites in:(intersection (sites Direction from:(last To) SSE stop:(= (mover) (who at:(to))) stopIncluded:True) (sites Occupied by:Next)))) (= (next) (who at:(ahead (last To) steps:(/ (count Sites in:(sites Direction from:(last To) SSE stop:(= (mover) (who at:(to))) stopIncluded:True)) 2) SSE))) (is Even (count Sites in:(sites Direction from:(last To) SSE stop:(= (mover) (who at:(to))) stopIncluded:True))) (= (mover) (who at:(last To))) (= (size Stack at:(last To)) (size Stack at:(ahead (last To) steps:(/ (count Sites in:(sites Direction from:(last To) SSE stop:(= (mover) (who at:(to))) stopIncluded:True)) 2) SSE))) (= (size Stack at:(ahead (last To) steps:(count Sites in:(sites Direction from:(last To) SSE stop:(= (mover) (who at:(to))) stopIncluded:True)) SSE)) (size Stack at:(ahead (last To) steps:(/ (count Sites in:(sites Direction from:(last To) SSE stop:(= (mover) (who at:(to))) stopIncluded:True)) 2) SSE)))}) (and {(= 1 (count Sites in:(intersection (sites Direction from:(last To) E stop:(= (mover) (who at:(to))) stopIncluded:True) (sites Occupied by:Mover)))) (= 1 (count Sites in:(intersection (sites Direction from:(last To) E stop:(= (mover) (who at:(to))) stopIncluded:True) (sites Occupied by:Next)))) (= (next) (who at:(ahead (last To) steps:(/ (count Sites in:(sites Direction from:(last To) E stop:(= (mover) (who at:(to))) stopIncluded:True)) 2) E))) (is Even (count Sites in:(sites Direction from:(last To) E stop:(= (mover) (who at:(to))) stopIncluded:True))) (= (mover) (who at:(last To))) (= (size Stack at:(last To)) (size Stack at:(ahead (last To) steps:(/ (count Sites in:(sites Direction from:(last To) E stop:(= (mover) (who at:(to))) stopIncluded:True)) 2) E))) (= (size Stack at:(ahead (last To) steps:(count Sites in:(sites Direction from:(last To) E stop:(= (mover) (who at:(to))) stopIncluded:True)) E)) (size Stack at:(ahead (last To) steps:(/ (count Sites in:(sites Direction from:(last To) E stop:(= (mover) (who at:(to))) stopIncluded:True)) 2) E)))}) (and {(= 1 (count Sites in:(intersection (sites Direction from:(last To) NNE stop:(= (mover) (who at:(to))) stopIncluded:True) (sites Occupied by:Mover)))) (= 1 (count Sites in:(intersection (sites Direction from:(last To) NNE stop:(= (mover) (who at:(to))) stopIncluded:True) (sites Occupied by:Next)))) (= (next) (who at:(ahead (last To) steps:(/ (count Sites in:(sites Direction from:(last To) NNE stop:(= (mover) (who at:(to))) stopIncluded:True)) 2) NNE))) (is Even (count Sites in:(sites Direction from:(last To) NNE stop:(= (mover) (who at:(to))) stopIncluded:True))) (= (mover) (who at:(last To))) (= (size Stack at:(last To)) (size Stack at:(ahead (last To) steps:(/ (count Sites in:(sites Direction from:(last To) NNE stop:(= (mover) (who at:(to))) stopIncluded:True)) 2) NNE))) (= (size Stack at:(ahead (last To) steps:(count Sites in:(sites Direction from:(last To) NNE stop:(= (mover) (who at:(to))) stopIncluded:True)) NNE)) (size Stack at:(ahead (last To) steps:(/ (count Sites in:(sites Direction from:(last To) NNE stop:(= (mover) (who at:(to))) stopIncluded:True)) 2) NNE)))})})) (if (= 1 (var)) (do (set Var 0) next:(or {(forEach Piece (move (from if:(is In (from) (sites (values Remembered)))) (to (sites Direction from:(from) stop:(< 0 (who at:(to)))) if:(< (count Steps (from) (centrePoint)) (count Steps (to) (centrePoint))) (apply (remove (to)))) count:(size Stack at:(from)) stack:True (then (and (add (to (last To)) count:(- (count Steps (last To) (centrePoint)) (count Steps (last From) (centrePoint))) stack:True) (add (piece ""Disc0"") (to (last From)))))) Next top:True) (forEach Piece (forEach Value min:1 max:(- (size Stack at:(from)) 1) (move (from if:(is In (from) (sites (values Remembered)))) (to (sites Direction from:(from) stop:(< 0 (who at:(to)))) (apply (remove (to)))) count:(value) stack:True (then (if (< (count Steps (last From) (centrePoint)) (count Steps (last To) (centrePoint))) (add (to (last To)) count:(- (count Steps (last To) (centrePoint)) (count Steps (last From) (centrePoint))) stack:True))))) Next top:True)})) (or {(forEach Piece (move (from) (to (sites Direction from:(from) stop:(< 0 (who at:(to)))) if:(< (count Steps (from) (centrePoint)) (count Steps (to) (centrePoint)))) copy:True (then (do (remove (last To) count:(size Stack at:(last To))) next:(add (to (last To)) count:(- (count Steps (last To) (centrePoint)) (count Steps (last From) (centrePoint))) stack:True)))) Neutral top:True) (forEach Piece (or (move (from if:True) (to (sites Direction from:(from) stop:(< 0 (who at:(to)))) if:(< (count Steps (from) (centrePoint)) (count Steps (to) (centrePoint))) (apply (remove (to)))) count:(size Stack at:(from)) stack:True (then (and (add (to (last To)) count:(- (count Steps (last To) (centrePoint)) (count Steps (last From) (centrePoint))) stack:True) (add (piece ""Disc0"") (to (last From)))))) (forEach Value min:1 max:(- (size Stack at:(from)) 1) (move (from if:(< 1 (size Stack at:(from)))) (to (sites Direction from:(from) stop:(< 0 (who at:(to)))) (apply (remove (to)))) count:(value) stack:True (then (if (< (count Steps (last From) (centrePoint)) (count Steps (last To) (centrePoint))) (add (to (last To)) count:(- (count Steps (last To) (centrePoint)) (count Steps (last From) (centrePoint))) stack:True)))))) Mover top:True)})) (then (and (forget Value All) (and {(if (and {(= 1 (count Sites in:(intersection (sites Direction from:(last To) NNW stop:(= (mover) (who at:(to))) stopIncluded:True) (sites Occupied by:Mover)))) (= 1 (count Sites in:(intersection (sites Direction from:(last To) NNW stop:(= (mover) (who at:(to))) stopIncluded:True) (sites Occupied by:Next)))) (= (next) (who at:(ahead (last To) steps:(/ (count Sites in:(sites Direction from:(last To) NNW stop:(= (mover) (who at:(to))) stopIncluded:True)) 2) NNW))) (is Even (count Sites in:(sites Direction from:(last To) NNW stop:(= (mover) (who at:(to))) stopIncluded:True))) (= (mover) (who at:(last To))) (= (size Stack at:(last To)) (size Stack at:(ahead (last To) steps:(/ (count Sites in:(sites Direction from:(last To) NNW stop:(= (mover) (who at:(to))) stopIncluded:True)) 2) NNW))) (= (size Stack at:(ahead (last To) steps:(count Sites in:(sites Direction from:(last To) NNW stop:(= (mover) (who at:(to))) stopIncluded:True)) NNW)) (size Stack at:(ahead (last To) steps:(/ (count Sites in:(sites Direction from:(last To) NNW stop:(= (mover) (who at:(to))) stopIncluded:True)) 2) NNW)))}) (remember Value (ahead (last To) steps:(/ (count Sites in:(sites Direction from:(last To) NNW stop:(= (mover) (who at:(to))) stopIncluded:True)) 2) NNW))) (if (and {(= 1 (count Sites in:(intersection (sites Direction from:(last To) W stop:(= (mover) (who at:(to))) stopIncluded:True) (sites Occupied by:Mover)))) (= 1 (count Sites in:(intersection (sites Direction from:(last To) W stop:(= (mover) (who at:(to))) stopIncluded:True) (sites Occupied by:Next)))) (= (next) (who at:(ahead (last To) steps:(/ (count Sites in:(sites Direction from:(last To) W stop:(= (mover) (who at:(to))) stopIncluded:True)) 2) W))) (is Even (count Sites in:(sites Direction from:(last To) W stop:(= (mover) (who at:(to))) stopIncluded:True))) (= (mover) (who at:(last To))) (= (size Stack at:(last To)) (size Stack at:(ahead (last To) steps:(/ (count Sites in:(sites Direction from:(last To) W stop:(= (mover) (who at:(to))) stopIncluded:True)) 2) W))) (= (size Stack at:(ahead (last To) steps:(count Sites in:(sites Direction from:(last To) W stop:(= (mover) (who at:(to))) stopIncluded:True)) W)) (size Stack at:(ahead (last To) steps:(/ (count Sites in:(sites Direction from:(last To) W stop:(= (mover) (who at:(to))) stopIncluded:True)) 2) W)))}) (remember Value (ahead (last To) steps:(/ (count Sites in:(sites Direction from:(last To) W stop:(= (mover) (who at:(to))) stopIncluded:True)) 2) W))) (if (and {(= 1 (count Sites in:(intersection (sites Direction from:(last To) SSW stop:(= (mover) (who at:(to))) stopIncluded:True) (sites Occupied by:Mover)))) (= 1 (count Sites in:(intersection (sites Direction from:(last To) SSW stop:(= (mover) (who at:(to))) stopIncluded:True) (sites Occupied by:Next)))) (= (next) (who at:(ahead (last To) steps:(/ (count Sites in:(sites Direction from:(last To) SSW stop:(= (mover) (who at:(to))) stopIncluded:True)) 2) SSW))) (is Even (count Sites in:(sites Direction from:(last To) SSW stop:(= (mover) (who at:(to))) stopIncluded:True))) (= (mover) (who at:(last To))) (= (size Stack at:(last To)) (size Stack at:(ahead (last To) steps:(/ (count Sites in:(sites Direction from:(last To) SSW stop:(= (mover) (who at:(to))) stopIncluded:True)) 2) SSW))) (= (size Stack at:(ahead (last To) steps:(count Sites in:(sites Direction from:(last To) SSW stop:(= (mover) (who at:(to))) stopIncluded:True)) SSW)) (size Stack at:(ahead (last To) steps:(/ (count Sites in:(sites Direction from:(last To) SSW stop:(= (mover) (who at:(to))) stopIncluded:True)) 2) SSW)))}) (remember Value (ahead (last To) steps:(/ (count Sites in:(sites Direction from:(last To) SSW stop:(= (mover) (who at:(to))) stopIncluded:True)) 2) SSW))) (if (and {(= 1 (count Sites in:(intersection (sites Direction from:(last To) SSE stop:(= (mover) (who at:(to))) stopIncluded:True) (sites Occupied by:Mover)))) (= 1 (count Sites in:(intersection (sites Direction from:(last To) SSE stop:(= (mover) (who at:(to))) stopIncluded:True) (sites Occupied by:Next)))) (= (next) (who at:(ahead (last To) steps:(/ (count Sites in:(sites Direction from:(last To) SSE stop:(= (mover) (who at:(to))) stopIncluded:True)) 2) SSE))) (is Even (count Sites in:(sites Direction from:(last To) SSE stop:(= (mover) (who at:(to))) stopIncluded:True))) (= (mover) (who at:(last To))) (= (size Stack at:(last To)) (size Stack at:(ahead (last To) steps:(/ (count Sites in:(sites Direction from:(last To) SSE stop:(= (mover) (who at:(to))) stopIncluded:True)) 2) SSE))) (= (size Stack at:(ahead (last To) steps:(count Sites in:(sites Direction from:(last To) SSE stop:(= (mover) (who at:(to))) stopIncluded:True)) SSE)) (size Stack at:(ahead (last To) steps:(/ (count Sites in:(sites Direction from:(last To) SSE stop:(= (mover) (who at:(to))) stopIncluded:True)) 2) SSE)))}) (remember Value (ahead (last To) steps:(/ (count Sites in:(sites Direction from:(last To) SSE stop:(= (mover) (who at:(to))) stopIncluded:True)) 2) SSE))) (if (and {(= 1 (count Sites in:(intersection (sites Direction from:(last To) E stop:(= (mover) (who at:(to))) stopIncluded:True) (sites Occupied by:Mover)))) (= 1 (count Sites in:(intersection (sites Direction from:(last To) E stop:(= (mover) (who at:(to))) stopIncluded:True) (sites Occupied by:Next)))) (= (next) (who at:(ahead (last To) steps:(/ (count Sites in:(sites Direction from:(last To) E stop:(= (mover) (who at:(to))) stopIncluded:True)) 2) E))) (is Even (count Sites in:(sites Direction from:(last To) E stop:(= (mover) (who at:(to))) stopIncluded:True))) (= (mover) (who at:(last To))) (= (size Stack at:(last To)) (size Stack at:(ahead (last To) steps:(/ (count Sites in:(sites Direction from:(last To) E stop:(= (mover) (who at:(to))) stopIncluded:True)) 2) E))) (= (size Stack at:(ahead (last To) steps:(count Sites in:(sites Direction from:(last To) E stop:(= (mover) (who at:(to))) stopIncluded:True)) E)) (size Stack at:(ahead (last To) steps:(/ (count Sites in:(sites Direction from:(last To) E stop:(= (mover) (who at:(to))) stopIncluded:True)) 2) E)))}) (remember Value (ahead (last To) steps:(/ (count Sites in:(sites Direction from:(last To) E stop:(= (mover) (who at:(to))) stopIncluded:True)) 2) E))) (if (and {(= 1 (count Sites in:(intersection (sites Direction from:(last To) NNE stop:(= (mover) (who at:(to))) stopIncluded:True) (sites Occupied by:Mover)))) (= 1 (count Sites in:(intersection (sites Direction from:(last To) NNE stop:(= (mover) (who at:(to))) stopIncluded:True) (sites Occupied by:Next)))) (= (next) (who at:(ahead (last To) steps:(/ (count Sites in:(sites Direction from:(last To) NNE stop:(= (mover) (who at:(to))) stopIncluded:True)) 2) NNE))) (is Even (count Sites in:(sites Direction from:(last To) NNE stop:(= (mover) (who at:(to))) stopIncluded:True))) (= (mover) (who at:(last To))) (= (size Stack at:(last To)) (size Stack at:(ahead (last To) steps:(/ (count Sites in:(sites Direction from:(last To) NNE stop:(= (mover) (who at:(to))) stopIncluded:True)) 2) NNE))) (= (size Stack at:(ahead (last To) steps:(count Sites in:(sites Direction from:(last To) NNE stop:(= (mover) (who at:(to))) stopIncluded:True)) NNE)) (size Stack at:(ahead (last To) steps:(/ (count Sites in:(sites Direction from:(last To) NNE stop:(= (mover) (who at:(to))) stopIncluded:True)) 2) NNE)))}) (remember Value (ahead (last To) steps:(/ (count Sites in:(sites Direction from:(last To) NNE stop:(= (mover) (who at:(to))) stopIncluded:True)) 2) NNE)))}) (then (if (or {(and {(= 1 (count Sites in:(intersection (sites Direction from:(last To) NNW stop:(= (mover) (who at:(to))) stopIncluded:True) (sites Occupied by:Mover)))) (= 1 (count Sites in:(intersection (sites Direction from:(last To) NNW stop:(= (mover) (who at:(to))) stopIncluded:True) (sites Occupied by:Next)))) (= (next) (who at:(ahead (last To) steps:(/ (count Sites in:(sites Direction from:(last To) NNW stop:(= (mover) (who at:(to))) stopIncluded:True)) 2) NNW))) (is Even (count Sites in:(sites Direction from:(last To) NNW stop:(= (mover) (who at:(to))) stopIncluded:True))) (= (mover) (who at:(last To))) (= (size Stack at:(last To)) (size Stack at:(ahead (last To) steps:(/ (count Sites in:(sites Direction from:(last To) NNW stop:(= (mover) (who at:(to))) stopIncluded:True)) 2) NNW))) (= (size Stack at:(ahead (last To) steps:(count Sites in:(sites Direction from:(last To) NNW stop:(= (mover) (who at:(to))) stopIncluded:True)) NNW)) (size Stack at:(ahead (last To) steps:(/ (count Sites in:(sites Direction from:(last To) NNW stop:(= (mover) (who at:(to))) stopIncluded:True)) 2) NNW)))}) (and {(= 1 (count Sites in:(intersection (sites Direction from:(last To) W stop:(= (mover) (who at:(to))) stopIncluded:True) (sites Occupied by:Mover)))) (= 1 (count Sites in:(intersection (sites Direction from:(last To) W stop:(= (mover) (who at:(to))) stopIncluded:True) (sites Occupied by:Next)))) (= (next) (who at:(ahead (last To) steps:(/ (count Sites in:(sites Direction from:(last To) W stop:(= (mover) (who at:(to))) stopIncluded:True)) 2) W))) (is Even (count Sites in:(sites Direction from:(last To) W stop:(= (mover) (who at:(to))) stopIncluded:True))) (= (mover) (who at:(last To))) (= (size Stack at:(last To)) (size Stack at:(ahead (last To) steps:(/ (count Sites in:(sites Direction from:(last To) W stop:(= (mover) (who at:(to))) stopIncluded:True)) 2) W))) (= (size Stack at:(ahead (last To) steps:(count Sites in:(sites Direction from:(last To) W stop:(= (mover) (who at:(to))) stopIncluded:True)) W)) (size Stack at:(ahead (last To) steps:(/ (count Sites in:(sites Direction from:(last To) W stop:(= (mover) (who at:(to))) stopIncluded:True)) 2) W)))}) (and {(= 1 (count Sites in:(intersection (sites Direction from:(last To) SSW stop:(= (mover) (who at:(to))) stopIncluded:True) (sites Occupied by:Mover)))) (= 1 (count Sites in:(intersection (sites Direction from:(last To) SSW stop:(= (mover) (who at:(to))) stopIncluded:True) (sites Occupied by:Next)))) (= (next) (who at:(ahead (last To) steps:(/ (count Sites in:(sites Direction from:(last To) SSW stop:(= (mover) (who at:(to))) stopIncluded:True)) 2) SSW))) (is Even (count Sites in:(sites Direction from:(last To) SSW stop:(= (mover) (who at:(to))) stopIncluded:True))) (= (mover) (who at:(last To))) (= (size Stack at:(last To)) (size Stack at:(ahead (last To) steps:(/ (count Sites in:(sites Direction from:(last To) SSW stop:(= (mover) (who at:(to))) stopIncluded:True)) 2) SSW))) (= (size Stack at:(ahead (last To) steps:(count Sites in:(sites Direction from:(last To) SSW stop:(= (mover) (who at:(to))) stopIncluded:True)) SSW)) (size Stack at:(ahead (last To) steps:(/ (count Sites in:(sites Direction from:(last To) SSW stop:(= (mover) (who at:(to))) stopIncluded:True)) 2) SSW)))}) (and {(= 1 (count Sites in:(intersection (sites Direction from:(last To) SSE stop:(= (mover) (who at:(to))) stopIncluded:True) (sites Occupied by:Mover)))) (= 1 (count Sites in:(intersection (sites Direction from:(last To) SSE stop:(= (mover) (who at:(to))) stopIncluded:True) (sites Occupied by:Next)))) (= (next) (who at:(ahead (last To) steps:(/ (count Sites in:(sites Direction from:(last To) SSE stop:(= (mover) (who at:(to))) stopIncluded:True)) 2) SSE))) (is Even (count Sites in:(sites Direction from:(last To) SSE stop:(= (mover) (who at:(to))) stopIncluded:True))) (= (mover) (who at:(last To))) (= (size Stack at:(last To)) (size Stack at:(ahead (last To) steps:(/ (count Sites in:(sites Direction from:(last To) SSE stop:(= (mover) (who at:(to))) stopIncluded:True)) 2) SSE))) (= (size Stack at:(ahead (last To) steps:(count Sites in:(sites Direction from:(last To) SSE stop:(= (mover) (who at:(to))) stopIncluded:True)) SSE)) (size Stack at:(ahead (last To) steps:(/ (count Sites in:(sites Direction from:(last To) SSE stop:(= (mover) (who at:(to))) stopIncluded:True)) 2) SSE)))}) (and {(= 1 (count Sites in:(intersection (sites Direction from:(last To) E stop:(= (mover) (who at:(to))) stopIncluded:True) (sites Occupied by:Mover)))) (= 1 (count Sites in:(intersection (sites Direction from:(last To) E stop:(= (mover) (who at:(to))) stopIncluded:True) (sites Occupied by:Next)))) (= (next) (who at:(ahead (last To) steps:(/ (count Sites in:(sites Direction from:(last To) E stop:(= (mover) (who at:(to))) stopIncluded:True)) 2) E))) (is Even (count Sites in:(sites Direction from:(last To) E stop:(= (mover) (who at:(to))) stopIncluded:True))) (= (mover) (who at:(last To))) (= (size Stack at:(last To)) (size Stack at:(ahead (last To) steps:(/ (count Sites in:(sites Direction from:(last To) E stop:(= (mover) (who at:(to))) stopIncluded:True)) 2) E))) (= (size Stack at:(ahead (last To) steps:(count Sites in:(sites Direction from:(last To) E stop:(= (mover) (who at:(to))) stopIncluded:True)) E)) (size Stack at:(ahead (last To) steps:(/ (count Sites in:(sites Direction from:(last To) E stop:(= (mover) (who at:(to))) stopIncluded:True)) 2) E)))}) (and {(= 1 (count Sites in:(intersection (sites Direction from:(last To) NNE stop:(= (mover) (who at:(to))) stopIncluded:True) (sites Occupied by:Mover)))) (= 1 (count Sites in:(intersection (sites Direction from:(last To) NNE stop:(= (mover) (who at:(to))) stopIncluded:True) (sites Occupied by:Next)))) (= (next) (who at:(ahead (last To) steps:(/ (count Sites in:(sites Direction from:(last To) NNE stop:(= (mover) (who at:(to))) stopIncluded:True)) 2) NNE))) (is Even (count Sites in:(sites Direction from:(last To) NNE stop:(= (mover) (who at:(to))) stopIncluded:True))) (= (mover) (who at:(last To))) (= (size Stack at:(last To)) (size Stack at:(ahead (last To) steps:(/ (count Sites in:(sites Direction from:(last To) NNE stop:(= (mover) (who at:(to))) stopIncluded:True)) 2) NNE))) (= (size Stack at:(ahead (last To) steps:(count Sites in:(sites Direction from:(last To) NNE stop:(= (mover) (who at:(to))) stopIncluded:True)) NNE)) (size Stack at:(ahead (last To) steps:(/ (count Sites in:(sites Direction from:(last To) NNE stop:(= (mover) (who at:(to))) stopIncluded:True)) 2) NNE)))})}) (and (set Var 1) (moveAgain)))))))) (end (if (no Moves Next) (result Next Loss)))))","###Description -Ex nihilo is a game for 2 players played with stackable pieces of two colors on the cells of a hexagonal arrangement of hexagons (a hexhex board). The board starts out empty. The game is over as soon as one player is unable to make a move. The other player is then the winner. Even though the goal is technically stalemate, out of the interlocking mechanics emerges a territorial goal with a constant threat of a clever check mate turning the tide or ending the game before territory is settled. The novelty of this game lies in its central gimmick: Every move consists in moving a stack. In this sense it is a pure movement game. Yet, the game features both placement and captures. Movement – overview: Stacks move along straight open lines and grow when they move away from the center cell. This game is unusual in allowing movement of stacks containing 0 pieces. It is by growing these that pieces get onto the board in the first place. Movement – details: On your turn, you must move a stack not topped by an enemy piece to an empty cell reachable through an unbroken line of empty cells. By convention, a single piece is considered a stack of size 1 and an empty cell is considered to contain a stack of size 0. If, after you have moved a stack, it is farther away from the center cell than before it was moved (measured in number of steps), its size is increased by 1 per step further away from the center it now is. This happens automatically in Ludii. You may move a proper part of a stack by splitting it. To move a part of a stack, drag the piece that will be the bottom piece of the new stack to its destination, or click it, then the destination. You may also move a whole stack, but only on the condition that you move it farther away from the center cell. A consequence is that moving a whole stack always results in its size increasing. Together with the convention that empty cells contain stacks of size 0, this also has the consequence that you can effectively place a new stack on the board by moving a stack of size 0. In Ludii a 0-stack is represented by a grey disc. You move it by dragging it to where you want to go, or click it, then the destination. Note that nothing special happens to the cell you moved the 0-stack from – it still contains a 0-stack. Capturing - overview: Flanked enemy stacks are captured by being taken hostage for a move. Capturing is obligatory: If a capturing move is available, a capturing move must be made. Capturing - details: If (and only if) the top piece of a stack is of your color, it is said to partake in flanking an enemy stack if (i) this enemy stack is exactly in the middle of a line of otherwise empty cells going from the flanking stack to another one of your stacks, and (ii) all three of these stacks are of the same size. If, after you have moved a stack, it partakes in flanking one or more enemy stacks, you must immediately move one of these enemy stacks. Except for the obvious difference that you are moving an enemy stack, all normal rules apply to this move. For example: If the captured stack grows (if you move it farther away from the center cell, that is), it grows by the addition of pieces of your color, so situations where this hostage move must itself be a capturing move are possible. Such chaining of captures must continue until you capture a stack that is not in a position to continue the chain. Growing captured stacks is the only way to take ownership of them more permanently. A base 5 board is currently selected - -###Ludii -(game ""Ex Nihilo"" (players 2) (equipment {(board (hex 5)) (piece ""Disc"" Each) (piece ""Disc"" Neutral)}) (rules (start (place ""Disc0"" (sites Board))) (play (priority (do (if (= 1 (var)) (and (set Var 0) (or {(forEach Piece (move (from if:(is In (from) (sites (values Remembered)))) (to (sites Direction from:(from) stop:(< 0 (who at:(to)))) if:(< (count Steps (from) (centrePoint)) (count Steps (to) (centrePoint))) (apply (remove (to)))) count:(size Stack at:(from)) stack:True (then (and (add (to (last To)) count:(- (count Steps (last To) (centrePoint)) (count Steps (last From) (centrePoint))) stack:True) (add (piece ""Disc0"") (to (last From)))))) Next top:True) (forEach Piece (forEach Value min:1 max:(- (size Stack at:(from)) 1) (move (from if:(is In (from) (sites (values Remembered)))) (to (sites Direction from:(from) stop:(< 0 (who at:(to)))) (apply (remove (to)))) count:(value) stack:True (then (if (< (count Steps (last From) (centrePoint)) (count Steps (last To) (centrePoint))) (add (to (last To)) count:(- (count Steps (last To) (centrePoint)) (count Steps (last From) (centrePoint))) stack:True))))) Next top:True)})) (or {(forEach Piece (move (from) (to (sites Direction from:(from) stop:(< 0 (who at:(to)))) if:(< (count Steps (from) (centrePoint)) (count Steps (to) (centrePoint)))) copy:True (then (do (remove (last To) count:(size Stack at:(last To))) next:(add (to (last To)) count:(- (count Steps (last To) (centrePoint)) (count Steps (last From) (centrePoint))) stack:True)))) Neutral top:True) (forEach Piece (or (move (from if:True) (to (sites Direction from:(from) stop:(< 0 (who at:(to)))) if:(< (count Steps (from) (centrePoint)) (count Steps (to) (centrePoint))) (apply (remove (to)))) count:(size Stack at:(from)) stack:True (then (and (add (to (last To)) count:(- (count Steps (last To) (centrePoint)) (count Steps (last From) (centrePoint))) stack:True) (add (piece ""Disc0"") (to (last From)))))) (forEach Value min:1 max:(- (size Stack at:(from)) 1) (move (from if:(< 1 (size Stack at:(from)))) (to (sites Direction from:(from) stop:(< 0 (who at:(to)))) (apply (remove (to)))) count:(value) stack:True (then (if (< (count Steps (last From) (centrePoint)) (count Steps (last To) (centrePoint))) (add (to (last To)) count:(- (count Steps (last To) (centrePoint)) (count Steps (last From) (centrePoint))) stack:True)))))) Mover top:True)})) ifAfterwards:(or {(and {(= 1 (count Sites in:(intersection (sites Direction from:(last To) NNW stop:(= (mover) (who at:(to))) stopIncluded:True) (sites Occupied by:Mover)))) (= 1 (count Sites in:(intersection (sites Direction from:(last To) NNW stop:(= (mover) (who at:(to))) stopIncluded:True) (sites Occupied by:Next)))) (= (next) (who at:(ahead (last To) steps:(/ (count Sites in:(sites Direction from:(last To) NNW stop:(= (mover) (who at:(to))) stopIncluded:True)) 2) NNW))) (is Even (count Sites in:(sites Direction from:(last To) NNW stop:(= (mover) (who at:(to))) stopIncluded:True))) (= (mover) (who at:(last To))) (= (size Stack at:(last To)) (size Stack at:(ahead (last To) steps:(/ (count Sites in:(sites Direction from:(last To) NNW stop:(= (mover) (who at:(to))) stopIncluded:True)) 2) NNW))) (= (size Stack at:(ahead (last To) steps:(count Sites in:(sites Direction from:(last To) NNW stop:(= (mover) (who at:(to))) stopIncluded:True)) NNW)) (size Stack at:(ahead (last To) steps:(/ (count Sites in:(sites Direction from:(last To) NNW stop:(= (mover) (who at:(to))) stopIncluded:True)) 2) NNW)))}) (and {(= 1 (count Sites in:(intersection (sites Direction from:(last To) W stop:(= (mover) (who at:(to))) stopIncluded:True) (sites Occupied by:Mover)))) (= 1 (count Sites in:(intersection (sites Direction from:(last To) W stop:(= (mover) (who at:(to))) stopIncluded:True) (sites Occupied by:Next)))) (= (next) (who at:(ahead (last To) steps:(/ (count Sites in:(sites Direction from:(last To) W stop:(= (mover) (who at:(to))) stopIncluded:True)) 2) W))) (is Even (count Sites in:(sites Direction from:(last To) W stop:(= (mover) (who at:(to))) stopIncluded:True))) (= (mover) (who at:(last To))) (= (size Stack at:(last To)) (size Stack at:(ahead (last To) steps:(/ (count Sites in:(sites Direction from:(last To) W stop:(= (mover) (who at:(to))) stopIncluded:True)) 2) W))) (= (size Stack at:(ahead (last To) steps:(count Sites in:(sites Direction from:(last To) W stop:(= (mover) (who at:(to))) stopIncluded:True)) W)) (size Stack at:(ahead (last To) steps:(/ (count Sites in:(sites Direction from:(last To) W stop:(= (mover) (who at:(to))) stopIncluded:True)) 2) W)))}) (and {(= 1 (count Sites in:(intersection (sites Direction from:(last To) SSW stop:(= (mover) (who at:(to))) stopIncluded:True) (sites Occupied by:Mover)))) (= 1 (count Sites in:(intersection (sites Direction from:(last To) SSW stop:(= (mover) (who at:(to))) stopIncluded:True) (sites Occupied by:Next)))) (= (next) (who at:(ahead (last To) steps:(/ (count Sites in:(sites Direction from:(last To) SSW stop:(= (mover) (who at:(to))) stopIncluded:True)) 2) SSW))) (is Even (count Sites in:(sites Direction from:(last To) SSW stop:(= (mover) (who at:(to))) stopIncluded:True))) (= (mover) (who at:(last To))) (= (size Stack at:(last To)) (size Stack at:(ahead (last To) steps:(/ (count Sites in:(sites Direction from:(last To) SSW stop:(= (mover) (who at:(to))) stopIncluded:True)) 2) SSW))) (= (size Stack at:(ahead (last To) steps:(count Sites in:(sites Direction from:(last To) SSW stop:(= (mover) (who at:(to))) stopIncluded:True)) SSW)) (size Stack at:(ahead (last To) steps:(/ (count Sites in:(sites Direction from:(last To) SSW stop:(= (mover) (who at:(to))) stopIncluded:True)) 2) SSW)))}) (and {(= 1 (count Sites in:(intersection (sites Direction from:(last To) SSE stop:(= (mover) (who at:(to))) stopIncluded:True) (sites Occupied by:Mover)))) (= 1 (count Sites in:(intersection (sites Direction from:(last To) SSE stop:(= (mover) (who at:(to))) stopIncluded:True) (sites Occupied by:Next)))) (= (next) (who at:(ahead (last To) steps:(/ (count Sites in:(sites Direction from:(last To) SSE stop:(= (mover) (who at:(to))) stopIncluded:True)) 2) SSE))) (is Even (count Sites in:(sites Direction from:(last To) SSE stop:(= (mover) (who at:(to))) stopIncluded:True))) (= (mover) (who at:(last To))) (= (size Stack at:(last To)) (size Stack at:(ahead (last To) steps:(/ (count Sites in:(sites Direction from:(last To) SSE stop:(= (mover) (who at:(to))) stopIncluded:True)) 2) SSE))) (= (size Stack at:(ahead (last To) steps:(count Sites in:(sites Direction from:(last To) SSE stop:(= (mover) (who at:(to))) stopIncluded:True)) SSE)) (size Stack at:(ahead (last To) steps:(/ (count Sites in:(sites Direction from:(last To) SSE stop:(= (mover) (who at:(to))) stopIncluded:True)) 2) SSE)))}) (and {(= 1 (count Sites in:(intersection (sites Direction from:(last To) E stop:(= (mover) (who at:(to))) stopIncluded:True) (sites Occupied by:Mover)))) (= 1 (count Sites in:(intersection (sites Direction from:(last To) E stop:(= (mover) (who at:(to))) stopIncluded:True) (sites Occupied by:Next)))) (= (next) (who at:(ahead (last To) steps:(/ (count Sites in:(sites Direction from:(last To) E stop:(= (mover) (who at:(to))) stopIncluded:True)) 2) E))) (is Even (count Sites in:(sites Direction from:(last To) E stop:(= (mover) (who at:(to))) stopIncluded:True))) (= (mover) (who at:(last To))) (= (size Stack at:(last To)) (size Stack at:(ahead (last To) steps:(/ (count Sites in:(sites Direction from:(last To) E stop:(= (mover) (who at:(to))) stopIncluded:True)) 2) E))) (= (size Stack at:(ahead (last To) steps:(count Sites in:(sites Direction from:(last To) E stop:(= (mover) (who at:(to))) stopIncluded:True)) E)) (size Stack at:(ahead (last To) steps:(/ (count Sites in:(sites Direction from:(last To) E stop:(= (mover) (who at:(to))) stopIncluded:True)) 2) E)))}) (and {(= 1 (count Sites in:(intersection (sites Direction from:(last To) NNE stop:(= (mover) (who at:(to))) stopIncluded:True) (sites Occupied by:Mover)))) (= 1 (count Sites in:(intersection (sites Direction from:(last To) NNE stop:(= (mover) (who at:(to))) stopIncluded:True) (sites Occupied by:Next)))) (= (next) (who at:(ahead (last To) steps:(/ (count Sites in:(sites Direction from:(last To) NNE stop:(= (mover) (who at:(to))) stopIncluded:True)) 2) NNE))) (is Even (count Sites in:(sites Direction from:(last To) NNE stop:(= (mover) (who at:(to))) stopIncluded:True))) (= (mover) (who at:(last To))) (= (size Stack at:(last To)) (size Stack at:(ahead (last To) steps:(/ (count Sites in:(sites Direction from:(last To) NNE stop:(= (mover) (who at:(to))) stopIncluded:True)) 2) NNE))) (= (size Stack at:(ahead (last To) steps:(count Sites in:(sites Direction from:(last To) NNE stop:(= (mover) (who at:(to))) stopIncluded:True)) NNE)) (size Stack at:(ahead (last To) steps:(/ (count Sites in:(sites Direction from:(last To) NNE stop:(= (mover) (who at:(to))) stopIncluded:True)) 2) NNE)))})})) (if (= 1 (var)) (do (set Var 0) next:(or {(forEach Piece (move (from if:(is In (from) (sites (values Remembered)))) (to (sites Direction from:(from) stop:(< 0 (who at:(to)))) if:(< (count Steps (from) (centrePoint)) (count Steps (to) (centrePoint))) (apply (remove (to)))) count:(size Stack at:(from)) stack:True (then (and (add (to (last To)) count:(- (count Steps (last To) (centrePoint)) (count Steps (last From) (centrePoint))) stack:True) (add (piece ""Disc0"") (to (last From)))))) Next top:True) (forEach Piece (forEach Value min:1 max:(- (size Stack at:(from)) 1) (move (from if:(is In (from) (sites (values Remembered)))) (to (sites Direction from:(from) stop:(< 0 (who at:(to)))) (apply (remove (to)))) count:(value) stack:True (then (if (< (count Steps (last From) (centrePoint)) (count Steps (last To) (centrePoint))) (add (to (last To)) count:(- (count Steps (last To) (centrePoint)) (count Steps (last From) (centrePoint))) stack:True))))) Next top:True)})) (or {(forEach Piece (move (from) (to (sites Direction from:(from) stop:(< 0 (who at:(to)))) if:(< (count Steps (from) (centrePoint)) (count Steps (to) (centrePoint)))) copy:True (then (do (remove (last To) count:(size Stack at:(last To))) next:(add (to (last To)) count:(- (count Steps (last To) (centrePoint)) (count Steps (last From) (centrePoint))) stack:True)))) Neutral top:True) (forEach Piece (or (move (from if:True) (to (sites Direction from:(from) stop:(< 0 (who at:(to)))) if:(< (count Steps (from) (centrePoint)) (count Steps (to) (centrePoint))) (apply (remove (to)))) count:(size Stack at:(from)) stack:True (then (and (add (to (last To)) count:(- (count Steps (last To) (centrePoint)) (count Steps (last From) (centrePoint))) stack:True) (add (piece ""Disc0"") (to (last From)))))) (forEach Value min:1 max:(- (size Stack at:(from)) 1) (move (from if:(< 1 (size Stack at:(from)))) (to (sites Direction from:(from) stop:(< 0 (who at:(to)))) (apply (remove (to)))) count:(value) stack:True (then (if (< (count Steps (last From) (centrePoint)) (count Steps (last To) (centrePoint))) (add (to (last To)) count:(- (count Steps (last To) (centrePoint)) (count Steps (last From) (centrePoint))) stack:True)))))) Mover top:True)})) (then (and (forget Value All) (and {(if (and {(= 1 (count Sites in:(intersection (sites Direction from:(last To) NNW stop:(= (mover) (who at:(to))) stopIncluded:True) (sites Occupied by:Mover)))) (= 1 (count Sites in:(intersection (sites Direction from:(last To) NNW stop:(= (mover) (who at:(to))) stopIncluded:True) (sites Occupied by:Next)))) (= (next) (who at:(ahead (last To) steps:(/ (count Sites in:(sites Direction from:(last To) NNW stop:(= (mover) (who at:(to))) stopIncluded:True)) 2) NNW))) (is Even (count Sites in:(sites Direction from:(last To) NNW stop:(= (mover) (who at:(to))) stopIncluded:True))) (= (mover) (who at:(last To))) (= (size Stack at:(last To)) (size Stack at:(ahead (last To) steps:(/ (count Sites in:(sites Direction from:(last To) NNW stop:(= (mover) (who at:(to))) stopIncluded:True)) 2) NNW))) (= (size Stack at:(ahead (last To) steps:(count Sites in:(sites Direction from:(last To) NNW stop:(= (mover) (who at:(to))) stopIncluded:True)) NNW)) (size Stack at:(ahead (last To) steps:(/ (count Sites in:(sites Direction from:(last To) NNW stop:(= (mover) (who at:(to))) stopIncluded:True)) 2) NNW)))}) (remember Value (ahead (last To) steps:(/ (count Sites in:(sites Direction from:(last To) NNW stop:(= (mover) (who at:(to))) stopIncluded:True)) 2) NNW))) (if (and {(= 1 (count Sites in:(intersection (sites Direction from:(last To) W stop:(= (mover) (who at:(to))) stopIncluded:True) (sites Occupied by:Mover)))) (= 1 (count Sites in:(intersection (sites Direction from:(last To) W stop:(= (mover) (who at:(to))) stopIncluded:True) (sites Occupied by:Next)))) (= (next) (who at:(ahead (last To) steps:(/ (count Sites in:(sites Direction from:(last To) W stop:(= (mover) (who at:(to))) stopIncluded:True)) 2) W))) (is Even (count Sites in:(sites Direction from:(last To) W stop:(= (mover) (who at:(to))) stopIncluded:True))) (= (mover) (who at:(last To))) (= (size Stack at:(last To)) (size Stack at:(ahead (last To) steps:(/ (count Sites in:(sites Direction from:(last To) W stop:(= (mover) (who at:(to))) stopIncluded:True)) 2) W))) (= (size Stack at:(ahead (last To) steps:(count Sites in:(sites Direction from:(last To) W stop:(= (mover) (who at:(to))) stopIncluded:True)) W)) (size Stack at:(ahead (last To) steps:(/ (count Sites in:(sites Direction from:(last To) W stop:(= (mover) (who at:(to))) stopIncluded:True)) 2) W)))}) (remember Value (ahead (last To) steps:(/ (count Sites in:(sites Direction from:(last To) W stop:(= (mover) (who at:(to))) stopIncluded:True)) 2) W))) (if (and {(= 1 (count Sites in:(intersection (sites Direction from:(last To) SSW stop:(= (mover) (who at:(to))) stopIncluded:True) (sites Occupied by:Mover)))) (= 1 (count Sites in:(intersection (sites Direction from:(last To) SSW stop:(= (mover) (who at:(to))) stopIncluded:True) (sites Occupied by:Next)))) (= (next) (who at:(ahead (last To) steps:(/ (count Sites in:(sites Direction from:(last To) SSW stop:(= (mover) (who at:(to))) stopIncluded:True)) 2) SSW))) (is Even (count Sites in:(sites Direction from:(last To) SSW stop:(= (mover) (who at:(to))) stopIncluded:True))) (= (mover) (who at:(last To))) (= (size Stack at:(last To)) (size Stack at:(ahead (last To) steps:(/ (count Sites in:(sites Direction from:(last To) SSW stop:(= (mover) (who at:(to))) stopIncluded:True)) 2) SSW))) (= (size Stack at:(ahead (last To) steps:(count Sites in:(sites Direction from:(last To) SSW stop:(= (mover) (who at:(to))) stopIncluded:True)) SSW)) (size Stack at:(ahead (last To) steps:(/ (count Sites in:(sites Direction from:(last To) SSW stop:(= (mover) (who at:(to))) stopIncluded:True)) 2) SSW)))}) (remember Value (ahead (last To) steps:(/ (count Sites in:(sites Direction from:(last To) SSW stop:(= (mover) (who at:(to))) stopIncluded:True)) 2) SSW))) (if (and {(= 1 (count Sites in:(intersection (sites Direction from:(last To) SSE stop:(= (mover) (who at:(to))) stopIncluded:True) (sites Occupied by:Mover)))) (= 1 (count Sites in:(intersection (sites Direction from:(last To) SSE stop:(= (mover) (who at:(to))) stopIncluded:True) (sites Occupied by:Next)))) (= (next) (who at:(ahead (last To) steps:(/ (count Sites in:(sites Direction from:(last To) SSE stop:(= (mover) (who at:(to))) stopIncluded:True)) 2) SSE))) (is Even (count Sites in:(sites Direction from:(last To) SSE stop:(= (mover) (who at:(to))) stopIncluded:True))) (= (mover) (who at:(last To))) (= (size Stack at:(last To)) (size Stack at:(ahead (last To) steps:(/ (count Sites in:(sites Direction from:(last To) SSE stop:(= (mover) (who at:(to))) stopIncluded:True)) 2) SSE))) (= (size Stack at:(ahead (last To) steps:(count Sites in:(sites Direction from:(last To) SSE stop:(= (mover) (who at:(to))) stopIncluded:True)) SSE)) (size Stack at:(ahead (last To) steps:(/ (count Sites in:(sites Direction from:(last To) SSE stop:(= (mover) (who at:(to))) stopIncluded:True)) 2) SSE)))}) (remember Value (ahead (last To) steps:(/ (count Sites in:(sites Direction from:(last To) SSE stop:(= (mover) (who at:(to))) stopIncluded:True)) 2) SSE))) (if (and {(= 1 (count Sites in:(intersection (sites Direction from:(last To) E stop:(= (mover) (who at:(to))) stopIncluded:True) (sites Occupied by:Mover)))) (= 1 (count Sites in:(intersection (sites Direction from:(last To) E stop:(= (mover) (who at:(to))) stopIncluded:True) (sites Occupied by:Next)))) (= (next) (who at:(ahead (last To) steps:(/ (count Sites in:(sites Direction from:(last To) E stop:(= (mover) (who at:(to))) stopIncluded:True)) 2) E))) (is Even (count Sites in:(sites Direction from:(last To) E stop:(= (mover) (who at:(to))) stopIncluded:True))) (= (mover) (who at:(last To))) (= (size Stack at:(last To)) (size Stack at:(ahead (last To) steps:(/ (count Sites in:(sites Direction from:(last To) E stop:(= (mover) (who at:(to))) stopIncluded:True)) 2) E))) (= (size Stack at:(ahead (last To) steps:(count Sites in:(sites Direction from:(last To) E stop:(= (mover) (who at:(to))) stopIncluded:True)) E)) (size Stack at:(ahead (last To) steps:(/ (count Sites in:(sites Direction from:(last To) E stop:(= (mover) (who at:(to))) stopIncluded:True)) 2) E)))}) (remember Value (ahead (last To) steps:(/ (count Sites in:(sites Direction from:(last To) E stop:(= (mover) (who at:(to))) stopIncluded:True)) 2) E))) (if (and {(= 1 (count Sites in:(intersection (sites Direction from:(last To) NNE stop:(= (mover) (who at:(to))) stopIncluded:True) (sites Occupied by:Mover)))) (= 1 (count Sites in:(intersection (sites Direction from:(last To) NNE stop:(= (mover) (who at:(to))) stopIncluded:True) (sites Occupied by:Next)))) (= (next) (who at:(ahead (last To) steps:(/ (count Sites in:(sites Direction from:(last To) NNE stop:(= (mover) (who at:(to))) stopIncluded:True)) 2) NNE))) (is Even (count Sites in:(sites Direction from:(last To) NNE stop:(= (mover) (who at:(to))) stopIncluded:True))) (= (mover) (who at:(last To))) (= (size Stack at:(last To)) (size Stack at:(ahead (last To) steps:(/ (count Sites in:(sites Direction from:(last To) NNE stop:(= (mover) (who at:(to))) stopIncluded:True)) 2) NNE))) (= (size Stack at:(ahead (last To) steps:(count Sites in:(sites Direction from:(last To) NNE stop:(= (mover) (who at:(to))) stopIncluded:True)) NNE)) (size Stack at:(ahead (last To) steps:(/ (count Sites in:(sites Direction from:(last To) NNE stop:(= (mover) (who at:(to))) stopIncluded:True)) 2) NNE)))}) (remember Value (ahead (last To) steps:(/ (count Sites in:(sites Direction from:(last To) NNE stop:(= (mover) (who at:(to))) stopIncluded:True)) 2) NNE)))}) (then (if (or {(and {(= 1 (count Sites in:(intersection (sites Direction from:(last To) NNW stop:(= (mover) (who at:(to))) stopIncluded:True) (sites Occupied by:Mover)))) (= 1 (count Sites in:(intersection (sites Direction from:(last To) NNW stop:(= (mover) (who at:(to))) stopIncluded:True) (sites Occupied by:Next)))) (= (next) (who at:(ahead (last To) steps:(/ (count Sites in:(sites Direction from:(last To) NNW stop:(= (mover) (who at:(to))) stopIncluded:True)) 2) NNW))) (is Even (count Sites in:(sites Direction from:(last To) NNW stop:(= (mover) (who at:(to))) stopIncluded:True))) (= (mover) (who at:(last To))) (= (size Stack at:(last To)) (size Stack at:(ahead (last To) steps:(/ (count Sites in:(sites Direction from:(last To) NNW stop:(= (mover) (who at:(to))) stopIncluded:True)) 2) NNW))) (= (size Stack at:(ahead (last To) steps:(count Sites in:(sites Direction from:(last To) NNW stop:(= (mover) (who at:(to))) stopIncluded:True)) NNW)) (size Stack at:(ahead (last To) steps:(/ (count Sites in:(sites Direction from:(last To) NNW stop:(= (mover) (who at:(to))) stopIncluded:True)) 2) NNW)))}) (and {(= 1 (count Sites in:(intersection (sites Direction from:(last To) W stop:(= (mover) (who at:(to))) stopIncluded:True) (sites Occupied by:Mover)))) (= 1 (count Sites in:(intersection (sites Direction from:(last To) W stop:(= (mover) (who at:(to))) stopIncluded:True) (sites Occupied by:Next)))) (= (next) (who at:(ahead (last To) steps:(/ (count Sites in:(sites Direction from:(last To) W stop:(= (mover) (who at:(to))) stopIncluded:True)) 2) W))) (is Even (count Sites in:(sites Direction from:(last To) W stop:(= (mover) (who at:(to))) stopIncluded:True))) (= (mover) (who at:(last To))) (= (size Stack at:(last To)) (size Stack at:(ahead (last To) steps:(/ (count Sites in:(sites Direction from:(last To) W stop:(= (mover) (who at:(to))) stopIncluded:True)) 2) W))) (= (size Stack at:(ahead (last To) steps:(count Sites in:(sites Direction from:(last To) W stop:(= (mover) (who at:(to))) stopIncluded:True)) W)) (size Stack at:(ahead (last To) steps:(/ (count Sites in:(sites Direction from:(last To) W stop:(= (mover) (who at:(to))) stopIncluded:True)) 2) W)))}) (and {(= 1 (count Sites in:(intersection (sites Direction from:(last To) SSW stop:(= (mover) (who at:(to))) stopIncluded:True) (sites Occupied by:Mover)))) (= 1 (count Sites in:(intersection (sites Direction from:(last To) SSW stop:(= (mover) (who at:(to))) stopIncluded:True) (sites Occupied by:Next)))) (= (next) (who at:(ahead (last To) steps:(/ (count Sites in:(sites Direction from:(last To) SSW stop:(= (mover) (who at:(to))) stopIncluded:True)) 2) SSW))) (is Even (count Sites in:(sites Direction from:(last To) SSW stop:(= (mover) (who at:(to))) stopIncluded:True))) (= (mover) (who at:(last To))) (= (size Stack at:(last To)) (size Stack at:(ahead (last To) steps:(/ (count Sites in:(sites Direction from:(last To) SSW stop:(= (mover) (who at:(to))) stopIncluded:True)) 2) SSW))) (= (size Stack at:(ahead (last To) steps:(count Sites in:(sites Direction from:(last To) SSW stop:(= (mover) (who at:(to))) stopIncluded:True)) SSW)) (size Stack at:(ahead (last To) steps:(/ (count Sites in:(sites Direction from:(last To) SSW stop:(= (mover) (who at:(to))) stopIncluded:True)) 2) SSW)))}) (and {(= 1 (count Sites in:(intersection (sites Direction from:(last To) SSE stop:(= (mover) (who at:(to))) stopIncluded:True) (sites Occupied by:Mover)))) (= 1 (count Sites in:(intersection (sites Direction from:(last To) SSE stop:(= (mover) (who at:(to))) stopIncluded:True) (sites Occupied by:Next)))) (= (next) (who at:(ahead (last To) steps:(/ (count Sites in:(sites Direction from:(last To) SSE stop:(= (mover) (who at:(to))) stopIncluded:True)) 2) SSE))) (is Even (count Sites in:(sites Direction from:(last To) SSE stop:(= (mover) (who at:(to))) stopIncluded:True))) (= (mover) (who at:(last To))) (= (size Stack at:(last To)) (size Stack at:(ahead (last To) steps:(/ (count Sites in:(sites Direction from:(last To) SSE stop:(= (mover) (who at:(to))) stopIncluded:True)) 2) SSE))) (= (size Stack at:(ahead (last To) steps:(count Sites in:(sites Direction from:(last To) SSE stop:(= (mover) (who at:(to))) stopIncluded:True)) SSE)) (size Stack at:(ahead (last To) steps:(/ (count Sites in:(sites Direction from:(last To) SSE stop:(= (mover) (who at:(to))) stopIncluded:True)) 2) SSE)))}) (and {(= 1 (count Sites in:(intersection (sites Direction from:(last To) E stop:(= (mover) (who at:(to))) stopIncluded:True) (sites Occupied by:Mover)))) (= 1 (count Sites in:(intersection (sites Direction from:(last To) E stop:(= (mover) (who at:(to))) stopIncluded:True) (sites Occupied by:Next)))) (= (next) (who at:(ahead (last To) steps:(/ (count Sites in:(sites Direction from:(last To) E stop:(= (mover) (who at:(to))) stopIncluded:True)) 2) E))) (is Even (count Sites in:(sites Direction from:(last To) E stop:(= (mover) (who at:(to))) stopIncluded:True))) (= (mover) (who at:(last To))) (= (size Stack at:(last To)) (size Stack at:(ahead (last To) steps:(/ (count Sites in:(sites Direction from:(last To) E stop:(= (mover) (who at:(to))) stopIncluded:True)) 2) E))) (= (size Stack at:(ahead (last To) steps:(count Sites in:(sites Direction from:(last To) E stop:(= (mover) (who at:(to))) stopIncluded:True)) E)) (size Stack at:(ahead (last To) steps:(/ (count Sites in:(sites Direction from:(last To) E stop:(= (mover) (who at:(to))) stopIncluded:True)) 2) E)))}) (and {(= 1 (count Sites in:(intersection (sites Direction from:(last To) NNE stop:(= (mover) (who at:(to))) stopIncluded:True) (sites Occupied by:Mover)))) (= 1 (count Sites in:(intersection (sites Direction from:(last To) NNE stop:(= (mover) (who at:(to))) stopIncluded:True) (sites Occupied by:Next)))) (= (next) (who at:(ahead (last To) steps:(/ (count Sites in:(sites Direction from:(last To) NNE stop:(= (mover) (who at:(to))) stopIncluded:True)) 2) NNE))) (is Even (count Sites in:(sites Direction from:(last To) NNE stop:(= (mover) (who at:(to))) stopIncluded:True))) (= (mover) (who at:(last To))) (= (size Stack at:(last To)) (size Stack at:(ahead (last To) steps:(/ (count Sites in:(sites Direction from:(last To) NNE stop:(= (mover) (who at:(to))) stopIncluded:True)) 2) NNE))) (= (size Stack at:(ahead (last To) steps:(count Sites in:(sites Direction from:(last To) NNE stop:(= (mover) (who at:(to))) stopIncluded:True)) NNE)) (size Stack at:(ahead (last To) steps:(/ (count Sites in:(sites Direction from:(last To) NNE stop:(= (mover) (who at:(to))) stopIncluded:True)) 2) NNE)))})}) (and (set Var 1) (moveAgain)))))))) (end (if (no Moves Next) (result Next Loss)))))" "TURN - On each turn, each player drops a neutral stone on an empty cell provided that it does not share the same row, column or diagonal with all the stones already on board. GOAL - Wins the last player to move","(game ""First Attack"" (players 2) (equipment {(board (square 8)) (piece ""Ball"" Shared)}) (rules (play (move Add (piece ""Ball"") (to (sites Empty) if:(all Sites (sites Direction from:(to) Adjacent) if:(is Empty (site)))))) (end (if (no Moves Next) (result Mover Win)))))","###Description TURN - On each turn, each player drops a neutral stone on an empty cell provided that it does not share the same row, column or diagonal with all the stones already on board. GOAL - Wins the last player to move @@ -2474,11 +2389,6 @@ STONE PLACEMENT Players take turns adding their stones to the board, one stone p ###Ludii (game ""Atoll"" (players 2) (equipment {(board (remove (rotate 90 (hex Rectangle 13 12)) cells:{138 139 148 149 0 1 10 11 69 80})) (piece ""Marker"" Each)}) (rules (start {(place ""Marker1"" (sites {132 133 134 135 131 120 108 97 85 7 6 5 4 8 19 31 42 54})) (place ""Marker2"" (sites {136 137 138 139 64 53 41 30 18 3 2 1 0 121 109 98 86 75}))}) (play (move Add (to (sites Empty)))) (end (if (is Mover P1) {(if (or (is Connected {(sites {132 133 134 135}) (sites {4 5 6 7})}) (is Connected {(sites {131 120 108 97 85}) (sites {54 42 31 19 8})})) (result Mover Win)) (if (or (is Connected {(sites {121 109 98 86 75}) (sites {64 53 41 30 18})}) (is Connected {(sites {136 137 138 139}) (sites {0 1 2 3})})) (result Mover Win))}))))" -"Bide is a strategy game for 2 to 6 players on a hexhex-5 board that is initially empty. Players take turns by placing stones of their color on the hexagonal cells. At the beginning of your turn you are given a new stone. You can either play it, or bide. If you bide, set the stone aside and your turn ends immediately. The stone remains in your hand. If you play the new stone while having at least one stone in your hand, you may release, meaning you would play every stone in your hand in succession. If a player releases, all players must release on their next turn, including playing their stone for that turn. Stones when placed create shock waves, pushing all adjacent stones one space radially outward from the placement. If there are multiple connected stones adjacent to the placed stone, positioned directly in line of the shock wave, they all move one space. If this movement causes a stone to bump into another stone directly in line of the shock wave, that stone also gets pushed one space. Becoming adjacent along a different grid line than the shockwave does not count. However stones cannot be pushed past the edge of the board. Lines that are full between the edges and the placed stone cannot move. Players eventually score points when all cells are filled up with stones. Each stone is worth points equal to its distance from the edge, starting at zero. Groups consist of connected adjacent like colored stones. The player with the highest scoring group wins. If tied, remove the outermost ring of stones and rescore, repeating this process until there is a winner. Two Players Order 5, Hex Grid","(game ""Bide"" (players 2) (equipment {(board (tri Hexagon 5) use:Vertex) (hand Each size:1) (piece ""Disc"" Each) (regions ""R0x"" (sites Outer)) (regions ""R1x"" (sites Around (sites ""R0x"") Orthogonal includeSelf:True)) (regions ""R2x"" (sites Around (sites ""R1x"") Orthogonal includeSelf:True)) (regions ""R3x"" (sites Around (sites ""R2x"") Orthogonal includeSelf:True)) (regions ""R4x"" (sites Around (sites ""R3x"") Orthogonal includeSelf:True)) (regions ""R5x"" (sites Around (sites ""R4x"") Orthogonal includeSelf:True))}) (rules (meta (passEnd NoEnd)) (play (if (or (is Prev Mover) (and (< 0 (size Array (values Remembered ""Released""))) (> 2 (size Array (values Remembered ""Released""))))) (if (is Empty (handSite Mover)) (move Add (to (intersection (sites Board) (sites Empty)))) (move (from (handSite Mover)) (to (sites Empty)) (then (moveAgain))) (then (and {(remember Value ""Released"" (mover) unique:True) (set Var ""LF"" (last To) (then (and {(if (and (!= (var ""LF"") (ahead (var ""LF"") NNE)) (not (is Empty (ahead (var ""LF"") NNE)))) (set Var ""AnchorSite"" (regionSite (forEach (sites Direction from:(var ""LF"") (directions Vertex from:(var ""LF"") to:(ahead (var ""LF"") NNE)) stop:(and (is Empty (to)) (is Empty (ahead (to) (directions Vertex from:(var ""LF"") to:(ahead (var ""LF"") NNE))))) stopIncluded:True distance:Infinity) if:(= (site) (ahead (site) (directions Vertex from:(var ""LF"") to:(ahead (var ""LF"") NNE))))) index:0) (then (forEach Site (difference (sites Direction from:(var ""LF"") (directions Vertex from:(var ""LF"") to:(ahead (var ""LF"") NNE)) stop:(and (is Empty (to)) (is Empty (ahead (to) (directions Vertex from:(var ""LF"") to:(ahead (var ""LF"") NNE))))) stopIncluded:True distance:Infinity) (if (or {(= -1 (var ""AnchorSite"")) (is Empty (var ""AnchorSite"")) (= (var ""LF"") (var ""AnchorSite""))}) (sites {(var ""LF"")}) (sites Direction from:(var ""AnchorSite"") (directions Vertex from:(var ""AnchorSite"") to:(var ""LF"")) included:True stop:(is Empty (to)) stopIncluded:True distance:Infinity))) (if (is Empty (site)) (remove (ahead (site) (directions Vertex from:(var ""LF"") to:(ahead (var ""LF"") NNE)))) (add (piece (who at:(site))) (to (ahead (site) (directions Vertex from:(var ""LF"") to:(ahead (var ""LF"") NNE))) (apply (remove (to)))))) (then (remove (ahead (var ""LF"") NNE))))))) (if (and (!= (var ""LF"") (ahead (var ""LF"") E)) (not (is Empty (ahead (var ""LF"") E)))) (set Var ""AnchorSite"" (regionSite (forEach (sites Direction from:(var ""LF"") (directions Vertex from:(var ""LF"") to:(ahead (var ""LF"") E)) stop:(and (is Empty (to)) (is Empty (ahead (to) (directions Vertex from:(var ""LF"") to:(ahead (var ""LF"") E))))) stopIncluded:True distance:Infinity) if:(= (site) (ahead (site) (directions Vertex from:(var ""LF"") to:(ahead (var ""LF"") E))))) index:0) (then (forEach Site (difference (sites Direction from:(var ""LF"") (directions Vertex from:(var ""LF"") to:(ahead (var ""LF"") E)) stop:(and (is Empty (to)) (is Empty (ahead (to) (directions Vertex from:(var ""LF"") to:(ahead (var ""LF"") E))))) stopIncluded:True distance:Infinity) (if (or {(= -1 (var ""AnchorSite"")) (is Empty (var ""AnchorSite"")) (= (var ""LF"") (var ""AnchorSite""))}) (sites {(var ""LF"")}) (sites Direction from:(var ""AnchorSite"") (directions Vertex from:(var ""AnchorSite"") to:(var ""LF"")) included:True stop:(is Empty (to)) stopIncluded:True distance:Infinity))) (if (is Empty (site)) (remove (ahead (site) (directions Vertex from:(var ""LF"") to:(ahead (var ""LF"") E)))) (add (piece (who at:(site))) (to (ahead (site) (directions Vertex from:(var ""LF"") to:(ahead (var ""LF"") E))) (apply (remove (to)))))) (then (remove (ahead (var ""LF"") E))))))) (if (and (!= (var ""LF"") (ahead (var ""LF"") SSE)) (not (is Empty (ahead (var ""LF"") SSE)))) (set Var ""AnchorSite"" (regionSite (forEach (sites Direction from:(var ""LF"") (directions Vertex from:(var ""LF"") to:(ahead (var ""LF"") SSE)) stop:(and (is Empty (to)) (is Empty (ahead (to) (directions Vertex from:(var ""LF"") to:(ahead (var ""LF"") SSE))))) stopIncluded:True distance:Infinity) if:(= (site) (ahead (site) (directions Vertex from:(var ""LF"") to:(ahead (var ""LF"") SSE))))) index:0) (then (forEach Site (difference (sites Direction from:(var ""LF"") (directions Vertex from:(var ""LF"") to:(ahead (var ""LF"") SSE)) stop:(and (is Empty (to)) (is Empty (ahead (to) (directions Vertex from:(var ""LF"") to:(ahead (var ""LF"") SSE))))) stopIncluded:True distance:Infinity) (if (or {(= -1 (var ""AnchorSite"")) (is Empty (var ""AnchorSite"")) (= (var ""LF"") (var ""AnchorSite""))}) (sites {(var ""LF"")}) (sites Direction from:(var ""AnchorSite"") (directions Vertex from:(var ""AnchorSite"") to:(var ""LF"")) included:True stop:(is Empty (to)) stopIncluded:True distance:Infinity))) (if (is Empty (site)) (remove (ahead (site) (directions Vertex from:(var ""LF"") to:(ahead (var ""LF"") SSE)))) (add (piece (who at:(site))) (to (ahead (site) (directions Vertex from:(var ""LF"") to:(ahead (var ""LF"") SSE))) (apply (remove (to)))))) (then (remove (ahead (var ""LF"") SSE))))))) (if (and (!= (var ""LF"") (ahead (var ""LF"") SSW)) (not (is Empty (ahead (var ""LF"") SSW)))) (set Var ""AnchorSite"" (regionSite (forEach (sites Direction from:(var ""LF"") (directions Vertex from:(var ""LF"") to:(ahead (var ""LF"") SSW)) stop:(and (is Empty (to)) (is Empty (ahead (to) (directions Vertex from:(var ""LF"") to:(ahead (var ""LF"") SSW))))) stopIncluded:True distance:Infinity) if:(= (site) (ahead (site) (directions Vertex from:(var ""LF"") to:(ahead (var ""LF"") SSW))))) index:0) (then (forEach Site (difference (sites Direction from:(var ""LF"") (directions Vertex from:(var ""LF"") to:(ahead (var ""LF"") SSW)) stop:(and (is Empty (to)) (is Empty (ahead (to) (directions Vertex from:(var ""LF"") to:(ahead (var ""LF"") SSW))))) stopIncluded:True distance:Infinity) (if (or {(= -1 (var ""AnchorSite"")) (is Empty (var ""AnchorSite"")) (= (var ""LF"") (var ""AnchorSite""))}) (sites {(var ""LF"")}) (sites Direction from:(var ""AnchorSite"") (directions Vertex from:(var ""AnchorSite"") to:(var ""LF"")) included:True stop:(is Empty (to)) stopIncluded:True distance:Infinity))) (if (is Empty (site)) (remove (ahead (site) (directions Vertex from:(var ""LF"") to:(ahead (var ""LF"") SSW)))) (add (piece (who at:(site))) (to (ahead (site) (directions Vertex from:(var ""LF"") to:(ahead (var ""LF"") SSW))) (apply (remove (to)))))) (then (remove (ahead (var ""LF"") SSW))))))) (if (and (!= (var ""LF"") (ahead (var ""LF"") W)) (not (is Empty (ahead (var ""LF"") W)))) (set Var ""AnchorSite"" (regionSite (forEach (sites Direction from:(var ""LF"") (directions Vertex from:(var ""LF"") to:(ahead (var ""LF"") W)) stop:(and (is Empty (to)) (is Empty (ahead (to) (directions Vertex from:(var ""LF"") to:(ahead (var ""LF"") W))))) stopIncluded:True distance:Infinity) if:(= (site) (ahead (site) (directions Vertex from:(var ""LF"") to:(ahead (var ""LF"") W))))) index:0) (then (forEach Site (difference (sites Direction from:(var ""LF"") (directions Vertex from:(var ""LF"") to:(ahead (var ""LF"") W)) stop:(and (is Empty (to)) (is Empty (ahead (to) (directions Vertex from:(var ""LF"") to:(ahead (var ""LF"") W))))) stopIncluded:True distance:Infinity) (if (or {(= -1 (var ""AnchorSite"")) (is Empty (var ""AnchorSite"")) (= (var ""LF"") (var ""AnchorSite""))}) (sites {(var ""LF"")}) (sites Direction from:(var ""AnchorSite"") (directions Vertex from:(var ""AnchorSite"") to:(var ""LF"")) included:True stop:(is Empty (to)) stopIncluded:True distance:Infinity))) (if (is Empty (site)) (remove (ahead (site) (directions Vertex from:(var ""LF"") to:(ahead (var ""LF"") W)))) (add (piece (who at:(site))) (to (ahead (site) (directions Vertex from:(var ""LF"") to:(ahead (var ""LF"") W))) (apply (remove (to)))))) (then (remove (ahead (var ""LF"") W))))))) (if (and (!= (var ""LF"") (ahead (var ""LF"") NNW)) (not (is Empty (ahead (var ""LF"") NNW)))) (set Var ""AnchorSite"" (regionSite (forEach (sites Direction from:(var ""LF"") (directions Vertex from:(var ""LF"") to:(ahead (var ""LF"") NNW)) stop:(and (is Empty (to)) (is Empty (ahead (to) (directions Vertex from:(var ""LF"") to:(ahead (var ""LF"") NNW))))) stopIncluded:True distance:Infinity) if:(= (site) (ahead (site) (directions Vertex from:(var ""LF"") to:(ahead (var ""LF"") NNW))))) index:0) (then (forEach Site (difference (sites Direction from:(var ""LF"") (directions Vertex from:(var ""LF"") to:(ahead (var ""LF"") NNW)) stop:(and (is Empty (to)) (is Empty (ahead (to) (directions Vertex from:(var ""LF"") to:(ahead (var ""LF"") NNW))))) stopIncluded:True distance:Infinity) (if (or {(= -1 (var ""AnchorSite"")) (is Empty (var ""AnchorSite"")) (= (var ""LF"") (var ""AnchorSite""))}) (sites {(var ""LF"")}) (sites Direction from:(var ""AnchorSite"") (directions Vertex from:(var ""AnchorSite"") to:(var ""LF"")) included:True stop:(is Empty (to)) stopIncluded:True distance:Infinity))) (if (is Empty (site)) (remove (ahead (site) (directions Vertex from:(var ""LF"") to:(ahead (var ""LF"") NNW)))) (add (piece (who at:(site))) (to (ahead (site) (directions Vertex from:(var ""LF"") to:(ahead (var ""LF"") NNW))) (apply (remove (to)))))) (then (remove (ahead (var ""LF"") NNW)))))))})))}))) (or (do (add (to (handSite Mover)) stack:True) next:(move Pass)) (or (move (from (handSite Mover)) (to (sites Empty)) (then (moveAgain))) (move Add (to (intersection (sites Board) (sites Empty)))) (then (set Var ""LF"" (last To) (then (and {(if (and (!= (var ""LF"") (ahead (var ""LF"") NNE)) (not (is Empty (ahead (var ""LF"") NNE)))) (set Var ""AnchorSite"" (regionSite (forEach (sites Direction from:(var ""LF"") (directions Vertex from:(var ""LF"") to:(ahead (var ""LF"") NNE)) stop:(and (is Empty (to)) (is Empty (ahead (to) (directions Vertex from:(var ""LF"") to:(ahead (var ""LF"") NNE))))) stopIncluded:True distance:Infinity) if:(= (site) (ahead (site) (directions Vertex from:(var ""LF"") to:(ahead (var ""LF"") NNE))))) index:0) (then (forEach Site (difference (sites Direction from:(var ""LF"") (directions Vertex from:(var ""LF"") to:(ahead (var ""LF"") NNE)) stop:(and (is Empty (to)) (is Empty (ahead (to) (directions Vertex from:(var ""LF"") to:(ahead (var ""LF"") NNE))))) stopIncluded:True distance:Infinity) (if (or {(= -1 (var ""AnchorSite"")) (is Empty (var ""AnchorSite"")) (= (var ""LF"") (var ""AnchorSite""))}) (sites {(var ""LF"")}) (sites Direction from:(var ""AnchorSite"") (directions Vertex from:(var ""AnchorSite"") to:(var ""LF"")) included:True stop:(is Empty (to)) stopIncluded:True distance:Infinity))) (if (is Empty (site)) (remove (ahead (site) (directions Vertex from:(var ""LF"") to:(ahead (var ""LF"") NNE)))) (add (piece (who at:(site))) (to (ahead (site) (directions Vertex from:(var ""LF"") to:(ahead (var ""LF"") NNE))) (apply (remove (to)))))) (then (remove (ahead (var ""LF"") NNE))))))) (if (and (!= (var ""LF"") (ahead (var ""LF"") E)) (not (is Empty (ahead (var ""LF"") E)))) (set Var ""AnchorSite"" (regionSite (forEach (sites Direction from:(var ""LF"") (directions Vertex from:(var ""LF"") to:(ahead (var ""LF"") E)) stop:(and (is Empty (to)) (is Empty (ahead (to) (directions Vertex from:(var ""LF"") to:(ahead (var ""LF"") E))))) stopIncluded:True distance:Infinity) if:(= (site) (ahead (site) (directions Vertex from:(var ""LF"") to:(ahead (var ""LF"") E))))) index:0) (then (forEach Site (difference (sites Direction from:(var ""LF"") (directions Vertex from:(var ""LF"") to:(ahead (var ""LF"") E)) stop:(and (is Empty (to)) (is Empty (ahead (to) (directions Vertex from:(var ""LF"") to:(ahead (var ""LF"") E))))) stopIncluded:True distance:Infinity) (if (or {(= -1 (var ""AnchorSite"")) (is Empty (var ""AnchorSite"")) (= (var ""LF"") (var ""AnchorSite""))}) (sites {(var ""LF"")}) (sites Direction from:(var ""AnchorSite"") (directions Vertex from:(var ""AnchorSite"") to:(var ""LF"")) included:True stop:(is Empty (to)) stopIncluded:True distance:Infinity))) (if (is Empty (site)) (remove (ahead (site) (directions Vertex from:(var ""LF"") to:(ahead (var ""LF"") E)))) (add (piece (who at:(site))) (to (ahead (site) (directions Vertex from:(var ""LF"") to:(ahead (var ""LF"") E))) (apply (remove (to)))))) (then (remove (ahead (var ""LF"") E))))))) (if (and (!= (var ""LF"") (ahead (var ""LF"") SSE)) (not (is Empty (ahead (var ""LF"") SSE)))) (set Var ""AnchorSite"" (regionSite (forEach (sites Direction from:(var ""LF"") (directions Vertex from:(var ""LF"") to:(ahead (var ""LF"") SSE)) stop:(and (is Empty (to)) (is Empty (ahead (to) (directions Vertex from:(var ""LF"") to:(ahead (var ""LF"") SSE))))) stopIncluded:True distance:Infinity) if:(= (site) (ahead (site) (directions Vertex from:(var ""LF"") to:(ahead (var ""LF"") SSE))))) index:0) (then (forEach Site (difference (sites Direction from:(var ""LF"") (directions Vertex from:(var ""LF"") to:(ahead (var ""LF"") SSE)) stop:(and (is Empty (to)) (is Empty (ahead (to) (directions Vertex from:(var ""LF"") to:(ahead (var ""LF"") SSE))))) stopIncluded:True distance:Infinity) (if (or {(= -1 (var ""AnchorSite"")) (is Empty (var ""AnchorSite"")) (= (var ""LF"") (var ""AnchorSite""))}) (sites {(var ""LF"")}) (sites Direction from:(var ""AnchorSite"") (directions Vertex from:(var ""AnchorSite"") to:(var ""LF"")) included:True stop:(is Empty (to)) stopIncluded:True distance:Infinity))) (if (is Empty (site)) (remove (ahead (site) (directions Vertex from:(var ""LF"") to:(ahead (var ""LF"") SSE)))) (add (piece (who at:(site))) (to (ahead (site) (directions Vertex from:(var ""LF"") to:(ahead (var ""LF"") SSE))) (apply (remove (to)))))) (then (remove (ahead (var ""LF"") SSE))))))) (if (and (!= (var ""LF"") (ahead (var ""LF"") SSW)) (not (is Empty (ahead (var ""LF"") SSW)))) (set Var ""AnchorSite"" (regionSite (forEach (sites Direction from:(var ""LF"") (directions Vertex from:(var ""LF"") to:(ahead (var ""LF"") SSW)) stop:(and (is Empty (to)) (is Empty (ahead (to) (directions Vertex from:(var ""LF"") to:(ahead (var ""LF"") SSW))))) stopIncluded:True distance:Infinity) if:(= (site) (ahead (site) (directions Vertex from:(var ""LF"") to:(ahead (var ""LF"") SSW))))) index:0) (then (forEach Site (difference (sites Direction from:(var ""LF"") (directions Vertex from:(var ""LF"") to:(ahead (var ""LF"") SSW)) stop:(and (is Empty (to)) (is Empty (ahead (to) (directions Vertex from:(var ""LF"") to:(ahead (var ""LF"") SSW))))) stopIncluded:True distance:Infinity) (if (or {(= -1 (var ""AnchorSite"")) (is Empty (var ""AnchorSite"")) (= (var ""LF"") (var ""AnchorSite""))}) (sites {(var ""LF"")}) (sites Direction from:(var ""AnchorSite"") (directions Vertex from:(var ""AnchorSite"") to:(var ""LF"")) included:True stop:(is Empty (to)) stopIncluded:True distance:Infinity))) (if (is Empty (site)) (remove (ahead (site) (directions Vertex from:(var ""LF"") to:(ahead (var ""LF"") SSW)))) (add (piece (who at:(site))) (to (ahead (site) (directions Vertex from:(var ""LF"") to:(ahead (var ""LF"") SSW))) (apply (remove (to)))))) (then (remove (ahead (var ""LF"") SSW))))))) (if (and (!= (var ""LF"") (ahead (var ""LF"") W)) (not (is Empty (ahead (var ""LF"") W)))) (set Var ""AnchorSite"" (regionSite (forEach (sites Direction from:(var ""LF"") (directions Vertex from:(var ""LF"") to:(ahead (var ""LF"") W)) stop:(and (is Empty (to)) (is Empty (ahead (to) (directions Vertex from:(var ""LF"") to:(ahead (var ""LF"") W))))) stopIncluded:True distance:Infinity) if:(= (site) (ahead (site) (directions Vertex from:(var ""LF"") to:(ahead (var ""LF"") W))))) index:0) (then (forEach Site (difference (sites Direction from:(var ""LF"") (directions Vertex from:(var ""LF"") to:(ahead (var ""LF"") W)) stop:(and (is Empty (to)) (is Empty (ahead (to) (directions Vertex from:(var ""LF"") to:(ahead (var ""LF"") W))))) stopIncluded:True distance:Infinity) (if (or {(= -1 (var ""AnchorSite"")) (is Empty (var ""AnchorSite"")) (= (var ""LF"") (var ""AnchorSite""))}) (sites {(var ""LF"")}) (sites Direction from:(var ""AnchorSite"") (directions Vertex from:(var ""AnchorSite"") to:(var ""LF"")) included:True stop:(is Empty (to)) stopIncluded:True distance:Infinity))) (if (is Empty (site)) (remove (ahead (site) (directions Vertex from:(var ""LF"") to:(ahead (var ""LF"") W)))) (add (piece (who at:(site))) (to (ahead (site) (directions Vertex from:(var ""LF"") to:(ahead (var ""LF"") W))) (apply (remove (to)))))) (then (remove (ahead (var ""LF"") W))))))) (if (and (!= (var ""LF"") (ahead (var ""LF"") NNW)) (not (is Empty (ahead (var ""LF"") NNW)))) (set Var ""AnchorSite"" (regionSite (forEach (sites Direction from:(var ""LF"") (directions Vertex from:(var ""LF"") to:(ahead (var ""LF"") NNW)) stop:(and (is Empty (to)) (is Empty (ahead (to) (directions Vertex from:(var ""LF"") to:(ahead (var ""LF"") NNW))))) stopIncluded:True distance:Infinity) if:(= (site) (ahead (site) (directions Vertex from:(var ""LF"") to:(ahead (var ""LF"") NNW))))) index:0) (then (forEach Site (difference (sites Direction from:(var ""LF"") (directions Vertex from:(var ""LF"") to:(ahead (var ""LF"") NNW)) stop:(and (is Empty (to)) (is Empty (ahead (to) (directions Vertex from:(var ""LF"") to:(ahead (var ""LF"") NNW))))) stopIncluded:True distance:Infinity) (if (or {(= -1 (var ""AnchorSite"")) (is Empty (var ""AnchorSite"")) (= (var ""LF"") (var ""AnchorSite""))}) (sites {(var ""LF"")}) (sites Direction from:(var ""AnchorSite"") (directions Vertex from:(var ""AnchorSite"") to:(var ""LF"")) included:True stop:(is Empty (to)) stopIncluded:True distance:Infinity))) (if (is Empty (site)) (remove (ahead (site) (directions Vertex from:(var ""LF"") to:(ahead (var ""LF"") NNW)))) (add (piece (who at:(site))) (to (ahead (site) (directions Vertex from:(var ""LF"") to:(ahead (var ""LF"") NNW))) (apply (remove (to)))))) (then (remove (ahead (var ""LF"") NNW)))))))}))))) (then (forget Value ""Released"" All))) (then (and {(set Score All 0) (forEach Player (do (and {(forEach Site (sites Around (sites ""R0x"") Orthogonal if:(= (player) (who at:(to)))) (set Value at:(site) 1)) (forEach Site (sites Around (sites ""R1x"") Orthogonal if:(= (player) (who at:(to)))) (set Value at:(site) 2)) (forEach Site (sites Around (sites ""R2x"") Orthogonal if:(= (player) (who at:(to)))) (set Value at:(site) 3)) (forEach Site (sites Around (sites ""R3x"") Orthogonal if:(= (player) (who at:(to)))) (set Value at:(site) 4)) (forEach Site (sites Around (sites ""R4x"") Orthogonal if:(= (player) (who at:(to)))) (set Value at:(site) 5))}) next:(if (< 0 (count Sites in:(intersection (difference (sites Board) (sites Empty)) (sites Occupied by:(player (player)))))) (do (forEach Group Orthogonal if:(and {(is In (to) (intersection (difference (sites Board) (sites Empty)) (sites Occupied by:(player (player)))))}) (remember Value ""PlayerGroups"" (+ (results from:(sites) to:(from) (value Piece at:(from)))))) next:(addScore (player (player)) (* 10000000 (max (values Remembered ""PlayerGroups""))) (then (forget Value ""PlayerGroups"" All))))))) (forEach Player (do (and {(forEach Site (sites Around (sites ""R0x"") Orthogonal if:(= (player) (who at:(to)))) (set Value at:(site) 1)) (forEach Site (sites Around (sites ""R1x"") Orthogonal if:(= (player) (who at:(to)))) (set Value at:(site) 2)) (forEach Site (sites Around (sites ""R2x"") Orthogonal if:(= (player) (who at:(to)))) (set Value at:(site) 3)) (forEach Site (sites Around (sites ""R3x"") Orthogonal if:(= (player) (who at:(to)))) (set Value at:(site) 4)) (forEach Site (sites Around (sites ""R4x"") Orthogonal if:(= (player) (who at:(to)))) (set Value at:(site) 5))}) next:(if (< 0 (count Sites in:(intersection (difference (sites Board) (sites ""R0x"")) (sites Occupied by:(player (player)))))) (do (forEach Group Orthogonal if:(and {(is In (to) (intersection (difference (sites Board) (sites ""R0x"")) (sites Occupied by:(player (player)))))}) (remember Value ""PlayerGroups"" (+ (results from:(sites) to:(from) (value Piece at:(from)))))) next:(addScore (player (player)) (* 100000 (max (values Remembered ""PlayerGroups""))) (then (forget Value ""PlayerGroups"" All))))))) (forEach Player (do (and {(forEach Site (sites Around (sites ""R0x"") Orthogonal if:(= (player) (who at:(to)))) (set Value at:(site) 1)) (forEach Site (sites Around (sites ""R1x"") Orthogonal if:(= (player) (who at:(to)))) (set Value at:(site) 2)) (forEach Site (sites Around (sites ""R2x"") Orthogonal if:(= (player) (who at:(to)))) (set Value at:(site) 3)) (forEach Site (sites Around (sites ""R3x"") Orthogonal if:(= (player) (who at:(to)))) (set Value at:(site) 4)) (forEach Site (sites Around (sites ""R4x"") Orthogonal if:(= (player) (who at:(to)))) (set Value at:(site) 5))}) next:(if (< 0 (count Sites in:(intersection (difference (sites Board) (sites ""R1x"")) (sites Occupied by:(player (player)))))) (do (forEach Group Orthogonal if:(and {(is In (to) (intersection (difference (sites Board) (sites ""R1x"")) (sites Occupied by:(player (player)))))}) (remember Value ""PlayerGroups"" (+ (results from:(sites) to:(from) (value Piece at:(from)))))) next:(addScore (player (player)) (* 1000 (max (values Remembered ""PlayerGroups""))) (then (forget Value ""PlayerGroups"" All))))))) (forEach Player (do (and {(forEach Site (sites Around (sites ""R0x"") Orthogonal if:(= (player) (who at:(to)))) (set Value at:(site) 1)) (forEach Site (sites Around (sites ""R1x"") Orthogonal if:(= (player) (who at:(to)))) (set Value at:(site) 2)) (forEach Site (sites Around (sites ""R2x"") Orthogonal if:(= (player) (who at:(to)))) (set Value at:(site) 3)) (forEach Site (sites Around (sites ""R3x"") Orthogonal if:(= (player) (who at:(to)))) (set Value at:(site) 4)) (forEach Site (sites Around (sites ""R4x"") Orthogonal if:(= (player) (who at:(to)))) (set Value at:(site) 5))}) next:(if (< 0 (count Sites in:(intersection (difference (sites Board) (sites ""R2x"")) (sites Occupied by:(player (player)))))) (do (forEach Group Orthogonal if:(and {(is In (to) (intersection (difference (sites Board) (sites ""R2x"")) (sites Occupied by:(player (player)))))}) (remember Value ""PlayerGroups"" (+ (results from:(sites) to:(from) (value Piece at:(from)))))) next:(addScore (player (player)) (* 10 (max (values Remembered ""PlayerGroups""))) (then (forget Value ""PlayerGroups"" All))))))) (forEach Player (do (and {(forEach Site (sites Around (sites ""R0x"") Orthogonal if:(= (player) (who at:(to)))) (set Value at:(site) 1)) (forEach Site (sites Around (sites ""R1x"") Orthogonal if:(= (player) (who at:(to)))) (set Value at:(site) 2)) (forEach Site (sites Around (sites ""R2x"") Orthogonal if:(= (player) (who at:(to)))) (set Value at:(site) 3)) (forEach Site (sites Around (sites ""R3x"") Orthogonal if:(= (player) (who at:(to)))) (set Value at:(site) 4)) (forEach Site (sites Around (sites ""R4x"") Orthogonal if:(= (player) (who at:(to)))) (set Value at:(site) 5))}) next:(if (< 0 (count Sites in:(intersection (difference (sites Board) (sites ""R3x"")) (sites Occupied by:(player (player)))))) (do (forEach Group Orthogonal if:(and {(is In (to) (intersection (difference (sites Board) (sites ""R3x"")) (sites Occupied by:(player (player)))))}) (remember Value ""PlayerGroups"" (+ (results from:(sites) to:(from) (value Piece at:(from)))))) next:(addScore (player (player)) (* 1 (max (values Remembered ""PlayerGroups""))) (then (forget Value ""PlayerGroups"" All)))))))})))) (end (if (= 0 (count Sites in:(intersection (sites Board) (sites Empty)))) (byScore)))))","###Description -Bide is a strategy game for 2 to 6 players on a hexhex-5 board that is initially empty. Players take turns by placing stones of their color on the hexagonal cells. At the beginning of your turn you are given a new stone. You can either play it, or bide. If you bide, set the stone aside and your turn ends immediately. The stone remains in your hand. If you play the new stone while having at least one stone in your hand, you may release, meaning you would play every stone in your hand in succession. If a player releases, all players must release on their next turn, including playing their stone for that turn. Stones when placed create shock waves, pushing all adjacent stones one space radially outward from the placement. If there are multiple connected stones adjacent to the placed stone, positioned directly in line of the shock wave, they all move one space. If this movement causes a stone to bump into another stone directly in line of the shock wave, that stone also gets pushed one space. Becoming adjacent along a different grid line than the shockwave does not count. However stones cannot be pushed past the edge of the board. Lines that are full between the edges and the placed stone cannot move. Players eventually score points when all cells are filled up with stones. Each stone is worth points equal to its distance from the edge, starting at zero. Groups consist of connected adjacent like colored stones. The player with the highest scoring group wins. If tied, remove the outermost ring of stones and rescore, repeating this process until there is a winner. Two Players Order 5, Hex Grid - -###Ludii -(game ""Bide"" (players 2) (equipment {(board (tri Hexagon 5) use:Vertex) (hand Each size:1) (piece ""Disc"" Each) (regions ""R0x"" (sites Outer)) (regions ""R1x"" (sites Around (sites ""R0x"") Orthogonal includeSelf:True)) (regions ""R2x"" (sites Around (sites ""R1x"") Orthogonal includeSelf:True)) (regions ""R3x"" (sites Around (sites ""R2x"") Orthogonal includeSelf:True)) (regions ""R4x"" (sites Around (sites ""R3x"") Orthogonal includeSelf:True)) (regions ""R5x"" (sites Around (sites ""R4x"") Orthogonal includeSelf:True))}) (rules (meta (passEnd NoEnd)) (play (if (or (is Prev Mover) (and (< 0 (size Array (values Remembered ""Released""))) (> 2 (size Array (values Remembered ""Released""))))) (if (is Empty (handSite Mover)) (move Add (to (intersection (sites Board) (sites Empty)))) (move (from (handSite Mover)) (to (sites Empty)) (then (moveAgain))) (then (and {(remember Value ""Released"" (mover) unique:True) (set Var ""LF"" (last To) (then (and {(if (and (!= (var ""LF"") (ahead (var ""LF"") NNE)) (not (is Empty (ahead (var ""LF"") NNE)))) (set Var ""AnchorSite"" (regionSite (forEach (sites Direction from:(var ""LF"") (directions Vertex from:(var ""LF"") to:(ahead (var ""LF"") NNE)) stop:(and (is Empty (to)) (is Empty (ahead (to) (directions Vertex from:(var ""LF"") to:(ahead (var ""LF"") NNE))))) stopIncluded:True distance:Infinity) if:(= (site) (ahead (site) (directions Vertex from:(var ""LF"") to:(ahead (var ""LF"") NNE))))) index:0) (then (forEach Site (difference (sites Direction from:(var ""LF"") (directions Vertex from:(var ""LF"") to:(ahead (var ""LF"") NNE)) stop:(and (is Empty (to)) (is Empty (ahead (to) (directions Vertex from:(var ""LF"") to:(ahead (var ""LF"") NNE))))) stopIncluded:True distance:Infinity) (if (or {(= -1 (var ""AnchorSite"")) (is Empty (var ""AnchorSite"")) (= (var ""LF"") (var ""AnchorSite""))}) (sites {(var ""LF"")}) (sites Direction from:(var ""AnchorSite"") (directions Vertex from:(var ""AnchorSite"") to:(var ""LF"")) included:True stop:(is Empty (to)) stopIncluded:True distance:Infinity))) (if (is Empty (site)) (remove (ahead (site) (directions Vertex from:(var ""LF"") to:(ahead (var ""LF"") NNE)))) (add (piece (who at:(site))) (to (ahead (site) (directions Vertex from:(var ""LF"") to:(ahead (var ""LF"") NNE))) (apply (remove (to)))))) (then (remove (ahead (var ""LF"") NNE))))))) (if (and (!= (var ""LF"") (ahead (var ""LF"") E)) (not (is Empty (ahead (var ""LF"") E)))) (set Var ""AnchorSite"" (regionSite (forEach (sites Direction from:(var ""LF"") (directions Vertex from:(var ""LF"") to:(ahead (var ""LF"") E)) stop:(and (is Empty (to)) (is Empty (ahead (to) (directions Vertex from:(var ""LF"") to:(ahead (var ""LF"") E))))) stopIncluded:True distance:Infinity) if:(= (site) (ahead (site) (directions Vertex from:(var ""LF"") to:(ahead (var ""LF"") E))))) index:0) (then (forEach Site (difference (sites Direction from:(var ""LF"") (directions Vertex from:(var ""LF"") to:(ahead (var ""LF"") E)) stop:(and (is Empty (to)) (is Empty (ahead (to) (directions Vertex from:(var ""LF"") to:(ahead (var ""LF"") E))))) stopIncluded:True distance:Infinity) (if (or {(= -1 (var ""AnchorSite"")) (is Empty (var ""AnchorSite"")) (= (var ""LF"") (var ""AnchorSite""))}) (sites {(var ""LF"")}) (sites Direction from:(var ""AnchorSite"") (directions Vertex from:(var ""AnchorSite"") to:(var ""LF"")) included:True stop:(is Empty (to)) stopIncluded:True distance:Infinity))) (if (is Empty (site)) (remove (ahead (site) (directions Vertex from:(var ""LF"") to:(ahead (var ""LF"") E)))) (add (piece (who at:(site))) (to (ahead (site) (directions Vertex from:(var ""LF"") to:(ahead (var ""LF"") E))) (apply (remove (to)))))) (then (remove (ahead (var ""LF"") E))))))) (if (and (!= (var ""LF"") (ahead (var ""LF"") SSE)) (not (is Empty (ahead (var ""LF"") SSE)))) (set Var ""AnchorSite"" (regionSite (forEach (sites Direction from:(var ""LF"") (directions Vertex from:(var ""LF"") to:(ahead (var ""LF"") SSE)) stop:(and (is Empty (to)) (is Empty (ahead (to) (directions Vertex from:(var ""LF"") to:(ahead (var ""LF"") SSE))))) stopIncluded:True distance:Infinity) if:(= (site) (ahead (site) (directions Vertex from:(var ""LF"") to:(ahead (var ""LF"") SSE))))) index:0) (then (forEach Site (difference (sites Direction from:(var ""LF"") (directions Vertex from:(var ""LF"") to:(ahead (var ""LF"") SSE)) stop:(and (is Empty (to)) (is Empty (ahead (to) (directions Vertex from:(var ""LF"") to:(ahead (var ""LF"") SSE))))) stopIncluded:True distance:Infinity) (if (or {(= -1 (var ""AnchorSite"")) (is Empty (var ""AnchorSite"")) (= (var ""LF"") (var ""AnchorSite""))}) (sites {(var ""LF"")}) (sites Direction from:(var ""AnchorSite"") (directions Vertex from:(var ""AnchorSite"") to:(var ""LF"")) included:True stop:(is Empty (to)) stopIncluded:True distance:Infinity))) (if (is Empty (site)) (remove (ahead (site) (directions Vertex from:(var ""LF"") to:(ahead (var ""LF"") SSE)))) (add (piece (who at:(site))) (to (ahead (site) (directions Vertex from:(var ""LF"") to:(ahead (var ""LF"") SSE))) (apply (remove (to)))))) (then (remove (ahead (var ""LF"") SSE))))))) (if (and (!= (var ""LF"") (ahead (var ""LF"") SSW)) (not (is Empty (ahead (var ""LF"") SSW)))) (set Var ""AnchorSite"" (regionSite (forEach (sites Direction from:(var ""LF"") (directions Vertex from:(var ""LF"") to:(ahead (var ""LF"") SSW)) stop:(and (is Empty (to)) (is Empty (ahead (to) (directions Vertex from:(var ""LF"") to:(ahead (var ""LF"") SSW))))) stopIncluded:True distance:Infinity) if:(= (site) (ahead (site) (directions Vertex from:(var ""LF"") to:(ahead (var ""LF"") SSW))))) index:0) (then (forEach Site (difference (sites Direction from:(var ""LF"") (directions Vertex from:(var ""LF"") to:(ahead (var ""LF"") SSW)) stop:(and (is Empty (to)) (is Empty (ahead (to) (directions Vertex from:(var ""LF"") to:(ahead (var ""LF"") SSW))))) stopIncluded:True distance:Infinity) (if (or {(= -1 (var ""AnchorSite"")) (is Empty (var ""AnchorSite"")) (= (var ""LF"") (var ""AnchorSite""))}) (sites {(var ""LF"")}) (sites Direction from:(var ""AnchorSite"") (directions Vertex from:(var ""AnchorSite"") to:(var ""LF"")) included:True stop:(is Empty (to)) stopIncluded:True distance:Infinity))) (if (is Empty (site)) (remove (ahead (site) (directions Vertex from:(var ""LF"") to:(ahead (var ""LF"") SSW)))) (add (piece (who at:(site))) (to (ahead (site) (directions Vertex from:(var ""LF"") to:(ahead (var ""LF"") SSW))) (apply (remove (to)))))) (then (remove (ahead (var ""LF"") SSW))))))) (if (and (!= (var ""LF"") (ahead (var ""LF"") W)) (not (is Empty (ahead (var ""LF"") W)))) (set Var ""AnchorSite"" (regionSite (forEach (sites Direction from:(var ""LF"") (directions Vertex from:(var ""LF"") to:(ahead (var ""LF"") W)) stop:(and (is Empty (to)) (is Empty (ahead (to) (directions Vertex from:(var ""LF"") to:(ahead (var ""LF"") W))))) stopIncluded:True distance:Infinity) if:(= (site) (ahead (site) (directions Vertex from:(var ""LF"") to:(ahead (var ""LF"") W))))) index:0) (then (forEach Site (difference (sites Direction from:(var ""LF"") (directions Vertex from:(var ""LF"") to:(ahead (var ""LF"") W)) stop:(and (is Empty (to)) (is Empty (ahead (to) (directions Vertex from:(var ""LF"") to:(ahead (var ""LF"") W))))) stopIncluded:True distance:Infinity) (if (or {(= -1 (var ""AnchorSite"")) (is Empty (var ""AnchorSite"")) (= (var ""LF"") (var ""AnchorSite""))}) (sites {(var ""LF"")}) (sites Direction from:(var ""AnchorSite"") (directions Vertex from:(var ""AnchorSite"") to:(var ""LF"")) included:True stop:(is Empty (to)) stopIncluded:True distance:Infinity))) (if (is Empty (site)) (remove (ahead (site) (directions Vertex from:(var ""LF"") to:(ahead (var ""LF"") W)))) (add (piece (who at:(site))) (to (ahead (site) (directions Vertex from:(var ""LF"") to:(ahead (var ""LF"") W))) (apply (remove (to)))))) (then (remove (ahead (var ""LF"") W))))))) (if (and (!= (var ""LF"") (ahead (var ""LF"") NNW)) (not (is Empty (ahead (var ""LF"") NNW)))) (set Var ""AnchorSite"" (regionSite (forEach (sites Direction from:(var ""LF"") (directions Vertex from:(var ""LF"") to:(ahead (var ""LF"") NNW)) stop:(and (is Empty (to)) (is Empty (ahead (to) (directions Vertex from:(var ""LF"") to:(ahead (var ""LF"") NNW))))) stopIncluded:True distance:Infinity) if:(= (site) (ahead (site) (directions Vertex from:(var ""LF"") to:(ahead (var ""LF"") NNW))))) index:0) (then (forEach Site (difference (sites Direction from:(var ""LF"") (directions Vertex from:(var ""LF"") to:(ahead (var ""LF"") NNW)) stop:(and (is Empty (to)) (is Empty (ahead (to) (directions Vertex from:(var ""LF"") to:(ahead (var ""LF"") NNW))))) stopIncluded:True distance:Infinity) (if (or {(= -1 (var ""AnchorSite"")) (is Empty (var ""AnchorSite"")) (= (var ""LF"") (var ""AnchorSite""))}) (sites {(var ""LF"")}) (sites Direction from:(var ""AnchorSite"") (directions Vertex from:(var ""AnchorSite"") to:(var ""LF"")) included:True stop:(is Empty (to)) stopIncluded:True distance:Infinity))) (if (is Empty (site)) (remove (ahead (site) (directions Vertex from:(var ""LF"") to:(ahead (var ""LF"") NNW)))) (add (piece (who at:(site))) (to (ahead (site) (directions Vertex from:(var ""LF"") to:(ahead (var ""LF"") NNW))) (apply (remove (to)))))) (then (remove (ahead (var ""LF"") NNW)))))))})))}))) (or (do (add (to (handSite Mover)) stack:True) next:(move Pass)) (or (move (from (handSite Mover)) (to (sites Empty)) (then (moveAgain))) (move Add (to (intersection (sites Board) (sites Empty)))) (then (set Var ""LF"" (last To) (then (and {(if (and (!= (var ""LF"") (ahead (var ""LF"") NNE)) (not (is Empty (ahead (var ""LF"") NNE)))) (set Var ""AnchorSite"" (regionSite (forEach (sites Direction from:(var ""LF"") (directions Vertex from:(var ""LF"") to:(ahead (var ""LF"") NNE)) stop:(and (is Empty (to)) (is Empty (ahead (to) (directions Vertex from:(var ""LF"") to:(ahead (var ""LF"") NNE))))) stopIncluded:True distance:Infinity) if:(= (site) (ahead (site) (directions Vertex from:(var ""LF"") to:(ahead (var ""LF"") NNE))))) index:0) (then (forEach Site (difference (sites Direction from:(var ""LF"") (directions Vertex from:(var ""LF"") to:(ahead (var ""LF"") NNE)) stop:(and (is Empty (to)) (is Empty (ahead (to) (directions Vertex from:(var ""LF"") to:(ahead (var ""LF"") NNE))))) stopIncluded:True distance:Infinity) (if (or {(= -1 (var ""AnchorSite"")) (is Empty (var ""AnchorSite"")) (= (var ""LF"") (var ""AnchorSite""))}) (sites {(var ""LF"")}) (sites Direction from:(var ""AnchorSite"") (directions Vertex from:(var ""AnchorSite"") to:(var ""LF"")) included:True stop:(is Empty (to)) stopIncluded:True distance:Infinity))) (if (is Empty (site)) (remove (ahead (site) (directions Vertex from:(var ""LF"") to:(ahead (var ""LF"") NNE)))) (add (piece (who at:(site))) (to (ahead (site) (directions Vertex from:(var ""LF"") to:(ahead (var ""LF"") NNE))) (apply (remove (to)))))) (then (remove (ahead (var ""LF"") NNE))))))) (if (and (!= (var ""LF"") (ahead (var ""LF"") E)) (not (is Empty (ahead (var ""LF"") E)))) (set Var ""AnchorSite"" (regionSite (forEach (sites Direction from:(var ""LF"") (directions Vertex from:(var ""LF"") to:(ahead (var ""LF"") E)) stop:(and (is Empty (to)) (is Empty (ahead (to) (directions Vertex from:(var ""LF"") to:(ahead (var ""LF"") E))))) stopIncluded:True distance:Infinity) if:(= (site) (ahead (site) (directions Vertex from:(var ""LF"") to:(ahead (var ""LF"") E))))) index:0) (then (forEach Site (difference (sites Direction from:(var ""LF"") (directions Vertex from:(var ""LF"") to:(ahead (var ""LF"") E)) stop:(and (is Empty (to)) (is Empty (ahead (to) (directions Vertex from:(var ""LF"") to:(ahead (var ""LF"") E))))) stopIncluded:True distance:Infinity) (if (or {(= -1 (var ""AnchorSite"")) (is Empty (var ""AnchorSite"")) (= (var ""LF"") (var ""AnchorSite""))}) (sites {(var ""LF"")}) (sites Direction from:(var ""AnchorSite"") (directions Vertex from:(var ""AnchorSite"") to:(var ""LF"")) included:True stop:(is Empty (to)) stopIncluded:True distance:Infinity))) (if (is Empty (site)) (remove (ahead (site) (directions Vertex from:(var ""LF"") to:(ahead (var ""LF"") E)))) (add (piece (who at:(site))) (to (ahead (site) (directions Vertex from:(var ""LF"") to:(ahead (var ""LF"") E))) (apply (remove (to)))))) (then (remove (ahead (var ""LF"") E))))))) (if (and (!= (var ""LF"") (ahead (var ""LF"") SSE)) (not (is Empty (ahead (var ""LF"") SSE)))) (set Var ""AnchorSite"" (regionSite (forEach (sites Direction from:(var ""LF"") (directions Vertex from:(var ""LF"") to:(ahead (var ""LF"") SSE)) stop:(and (is Empty (to)) (is Empty (ahead (to) (directions Vertex from:(var ""LF"") to:(ahead (var ""LF"") SSE))))) stopIncluded:True distance:Infinity) if:(= (site) (ahead (site) (directions Vertex from:(var ""LF"") to:(ahead (var ""LF"") SSE))))) index:0) (then (forEach Site (difference (sites Direction from:(var ""LF"") (directions Vertex from:(var ""LF"") to:(ahead (var ""LF"") SSE)) stop:(and (is Empty (to)) (is Empty (ahead (to) (directions Vertex from:(var ""LF"") to:(ahead (var ""LF"") SSE))))) stopIncluded:True distance:Infinity) (if (or {(= -1 (var ""AnchorSite"")) (is Empty (var ""AnchorSite"")) (= (var ""LF"") (var ""AnchorSite""))}) (sites {(var ""LF"")}) (sites Direction from:(var ""AnchorSite"") (directions Vertex from:(var ""AnchorSite"") to:(var ""LF"")) included:True stop:(is Empty (to)) stopIncluded:True distance:Infinity))) (if (is Empty (site)) (remove (ahead (site) (directions Vertex from:(var ""LF"") to:(ahead (var ""LF"") SSE)))) (add (piece (who at:(site))) (to (ahead (site) (directions Vertex from:(var ""LF"") to:(ahead (var ""LF"") SSE))) (apply (remove (to)))))) (then (remove (ahead (var ""LF"") SSE))))))) (if (and (!= (var ""LF"") (ahead (var ""LF"") SSW)) (not (is Empty (ahead (var ""LF"") SSW)))) (set Var ""AnchorSite"" (regionSite (forEach (sites Direction from:(var ""LF"") (directions Vertex from:(var ""LF"") to:(ahead (var ""LF"") SSW)) stop:(and (is Empty (to)) (is Empty (ahead (to) (directions Vertex from:(var ""LF"") to:(ahead (var ""LF"") SSW))))) stopIncluded:True distance:Infinity) if:(= (site) (ahead (site) (directions Vertex from:(var ""LF"") to:(ahead (var ""LF"") SSW))))) index:0) (then (forEach Site (difference (sites Direction from:(var ""LF"") (directions Vertex from:(var ""LF"") to:(ahead (var ""LF"") SSW)) stop:(and (is Empty (to)) (is Empty (ahead (to) (directions Vertex from:(var ""LF"") to:(ahead (var ""LF"") SSW))))) stopIncluded:True distance:Infinity) (if (or {(= -1 (var ""AnchorSite"")) (is Empty (var ""AnchorSite"")) (= (var ""LF"") (var ""AnchorSite""))}) (sites {(var ""LF"")}) (sites Direction from:(var ""AnchorSite"") (directions Vertex from:(var ""AnchorSite"") to:(var ""LF"")) included:True stop:(is Empty (to)) stopIncluded:True distance:Infinity))) (if (is Empty (site)) (remove (ahead (site) (directions Vertex from:(var ""LF"") to:(ahead (var ""LF"") SSW)))) (add (piece (who at:(site))) (to (ahead (site) (directions Vertex from:(var ""LF"") to:(ahead (var ""LF"") SSW))) (apply (remove (to)))))) (then (remove (ahead (var ""LF"") SSW))))))) (if (and (!= (var ""LF"") (ahead (var ""LF"") W)) (not (is Empty (ahead (var ""LF"") W)))) (set Var ""AnchorSite"" (regionSite (forEach (sites Direction from:(var ""LF"") (directions Vertex from:(var ""LF"") to:(ahead (var ""LF"") W)) stop:(and (is Empty (to)) (is Empty (ahead (to) (directions Vertex from:(var ""LF"") to:(ahead (var ""LF"") W))))) stopIncluded:True distance:Infinity) if:(= (site) (ahead (site) (directions Vertex from:(var ""LF"") to:(ahead (var ""LF"") W))))) index:0) (then (forEach Site (difference (sites Direction from:(var ""LF"") (directions Vertex from:(var ""LF"") to:(ahead (var ""LF"") W)) stop:(and (is Empty (to)) (is Empty (ahead (to) (directions Vertex from:(var ""LF"") to:(ahead (var ""LF"") W))))) stopIncluded:True distance:Infinity) (if (or {(= -1 (var ""AnchorSite"")) (is Empty (var ""AnchorSite"")) (= (var ""LF"") (var ""AnchorSite""))}) (sites {(var ""LF"")}) (sites Direction from:(var ""AnchorSite"") (directions Vertex from:(var ""AnchorSite"") to:(var ""LF"")) included:True stop:(is Empty (to)) stopIncluded:True distance:Infinity))) (if (is Empty (site)) (remove (ahead (site) (directions Vertex from:(var ""LF"") to:(ahead (var ""LF"") W)))) (add (piece (who at:(site))) (to (ahead (site) (directions Vertex from:(var ""LF"") to:(ahead (var ""LF"") W))) (apply (remove (to)))))) (then (remove (ahead (var ""LF"") W))))))) (if (and (!= (var ""LF"") (ahead (var ""LF"") NNW)) (not (is Empty (ahead (var ""LF"") NNW)))) (set Var ""AnchorSite"" (regionSite (forEach (sites Direction from:(var ""LF"") (directions Vertex from:(var ""LF"") to:(ahead (var ""LF"") NNW)) stop:(and (is Empty (to)) (is Empty (ahead (to) (directions Vertex from:(var ""LF"") to:(ahead (var ""LF"") NNW))))) stopIncluded:True distance:Infinity) if:(= (site) (ahead (site) (directions Vertex from:(var ""LF"") to:(ahead (var ""LF"") NNW))))) index:0) (then (forEach Site (difference (sites Direction from:(var ""LF"") (directions Vertex from:(var ""LF"") to:(ahead (var ""LF"") NNW)) stop:(and (is Empty (to)) (is Empty (ahead (to) (directions Vertex from:(var ""LF"") to:(ahead (var ""LF"") NNW))))) stopIncluded:True distance:Infinity) (if (or {(= -1 (var ""AnchorSite"")) (is Empty (var ""AnchorSite"")) (= (var ""LF"") (var ""AnchorSite""))}) (sites {(var ""LF"")}) (sites Direction from:(var ""AnchorSite"") (directions Vertex from:(var ""AnchorSite"") to:(var ""LF"")) included:True stop:(is Empty (to)) stopIncluded:True distance:Infinity))) (if (is Empty (site)) (remove (ahead (site) (directions Vertex from:(var ""LF"") to:(ahead (var ""LF"") NNW)))) (add (piece (who at:(site))) (to (ahead (site) (directions Vertex from:(var ""LF"") to:(ahead (var ""LF"") NNW))) (apply (remove (to)))))) (then (remove (ahead (var ""LF"") NNW)))))))}))))) (then (forget Value ""Released"" All))) (then (and {(set Score All 0) (forEach Player (do (and {(forEach Site (sites Around (sites ""R0x"") Orthogonal if:(= (player) (who at:(to)))) (set Value at:(site) 1)) (forEach Site (sites Around (sites ""R1x"") Orthogonal if:(= (player) (who at:(to)))) (set Value at:(site) 2)) (forEach Site (sites Around (sites ""R2x"") Orthogonal if:(= (player) (who at:(to)))) (set Value at:(site) 3)) (forEach Site (sites Around (sites ""R3x"") Orthogonal if:(= (player) (who at:(to)))) (set Value at:(site) 4)) (forEach Site (sites Around (sites ""R4x"") Orthogonal if:(= (player) (who at:(to)))) (set Value at:(site) 5))}) next:(if (< 0 (count Sites in:(intersection (difference (sites Board) (sites Empty)) (sites Occupied by:(player (player)))))) (do (forEach Group Orthogonal if:(and {(is In (to) (intersection (difference (sites Board) (sites Empty)) (sites Occupied by:(player (player)))))}) (remember Value ""PlayerGroups"" (+ (results from:(sites) to:(from) (value Piece at:(from)))))) next:(addScore (player (player)) (* 10000000 (max (values Remembered ""PlayerGroups""))) (then (forget Value ""PlayerGroups"" All))))))) (forEach Player (do (and {(forEach Site (sites Around (sites ""R0x"") Orthogonal if:(= (player) (who at:(to)))) (set Value at:(site) 1)) (forEach Site (sites Around (sites ""R1x"") Orthogonal if:(= (player) (who at:(to)))) (set Value at:(site) 2)) (forEach Site (sites Around (sites ""R2x"") Orthogonal if:(= (player) (who at:(to)))) (set Value at:(site) 3)) (forEach Site (sites Around (sites ""R3x"") Orthogonal if:(= (player) (who at:(to)))) (set Value at:(site) 4)) (forEach Site (sites Around (sites ""R4x"") Orthogonal if:(= (player) (who at:(to)))) (set Value at:(site) 5))}) next:(if (< 0 (count Sites in:(intersection (difference (sites Board) (sites ""R0x"")) (sites Occupied by:(player (player)))))) (do (forEach Group Orthogonal if:(and {(is In (to) (intersection (difference (sites Board) (sites ""R0x"")) (sites Occupied by:(player (player)))))}) (remember Value ""PlayerGroups"" (+ (results from:(sites) to:(from) (value Piece at:(from)))))) next:(addScore (player (player)) (* 100000 (max (values Remembered ""PlayerGroups""))) (then (forget Value ""PlayerGroups"" All))))))) (forEach Player (do (and {(forEach Site (sites Around (sites ""R0x"") Orthogonal if:(= (player) (who at:(to)))) (set Value at:(site) 1)) (forEach Site (sites Around (sites ""R1x"") Orthogonal if:(= (player) (who at:(to)))) (set Value at:(site) 2)) (forEach Site (sites Around (sites ""R2x"") Orthogonal if:(= (player) (who at:(to)))) (set Value at:(site) 3)) (forEach Site (sites Around (sites ""R3x"") Orthogonal if:(= (player) (who at:(to)))) (set Value at:(site) 4)) (forEach Site (sites Around (sites ""R4x"") Orthogonal if:(= (player) (who at:(to)))) (set Value at:(site) 5))}) next:(if (< 0 (count Sites in:(intersection (difference (sites Board) (sites ""R1x"")) (sites Occupied by:(player (player)))))) (do (forEach Group Orthogonal if:(and {(is In (to) (intersection (difference (sites Board) (sites ""R1x"")) (sites Occupied by:(player (player)))))}) (remember Value ""PlayerGroups"" (+ (results from:(sites) to:(from) (value Piece at:(from)))))) next:(addScore (player (player)) (* 1000 (max (values Remembered ""PlayerGroups""))) (then (forget Value ""PlayerGroups"" All))))))) (forEach Player (do (and {(forEach Site (sites Around (sites ""R0x"") Orthogonal if:(= (player) (who at:(to)))) (set Value at:(site) 1)) (forEach Site (sites Around (sites ""R1x"") Orthogonal if:(= (player) (who at:(to)))) (set Value at:(site) 2)) (forEach Site (sites Around (sites ""R2x"") Orthogonal if:(= (player) (who at:(to)))) (set Value at:(site) 3)) (forEach Site (sites Around (sites ""R3x"") Orthogonal if:(= (player) (who at:(to)))) (set Value at:(site) 4)) (forEach Site (sites Around (sites ""R4x"") Orthogonal if:(= (player) (who at:(to)))) (set Value at:(site) 5))}) next:(if (< 0 (count Sites in:(intersection (difference (sites Board) (sites ""R2x"")) (sites Occupied by:(player (player)))))) (do (forEach Group Orthogonal if:(and {(is In (to) (intersection (difference (sites Board) (sites ""R2x"")) (sites Occupied by:(player (player)))))}) (remember Value ""PlayerGroups"" (+ (results from:(sites) to:(from) (value Piece at:(from)))))) next:(addScore (player (player)) (* 10 (max (values Remembered ""PlayerGroups""))) (then (forget Value ""PlayerGroups"" All))))))) (forEach Player (do (and {(forEach Site (sites Around (sites ""R0x"") Orthogonal if:(= (player) (who at:(to)))) (set Value at:(site) 1)) (forEach Site (sites Around (sites ""R1x"") Orthogonal if:(= (player) (who at:(to)))) (set Value at:(site) 2)) (forEach Site (sites Around (sites ""R2x"") Orthogonal if:(= (player) (who at:(to)))) (set Value at:(site) 3)) (forEach Site (sites Around (sites ""R3x"") Orthogonal if:(= (player) (who at:(to)))) (set Value at:(site) 4)) (forEach Site (sites Around (sites ""R4x"") Orthogonal if:(= (player) (who at:(to)))) (set Value at:(site) 5))}) next:(if (< 0 (count Sites in:(intersection (difference (sites Board) (sites ""R3x"")) (sites Occupied by:(player (player)))))) (do (forEach Group Orthogonal if:(and {(is In (to) (intersection (difference (sites Board) (sites ""R3x"")) (sites Occupied by:(player (player)))))}) (remember Value ""PlayerGroups"" (+ (results from:(sites) to:(from) (value Piece at:(from)))))) next:(addScore (player (player)) (* 1 (max (values Remembered ""PlayerGroups""))) (then (forget Value ""PlayerGroups"" All)))))))})))) (end (if (= 0 (count Sites in:(intersection (sites Board) (sites Empty)))) (byScore)))))" Played on a Hex board. Players may play a piece of any color piece. The goal is to form a line connecting the player's two sides with either color. The game is played on a 11x11 board The first player to connect his two sides wins.,"(game ""Chameleon"" (players 2) (equipment {(board (hex Diamond 11)) (piece ""Marker"" Each) (hand Shared size:2) (regions P1 {(sites Side NE) (sites Side SW)}) (regions P2 {(sites Side NW) (sites Side SE)})}) (rules (meta (swap)) (start {(place ""Marker1"" (handSite Shared)) (place ""Marker2"" (handSite Shared 1))}) (play (move (from (sites Hand Shared)) (to (sites Empty)) copy:True)) (end {(if (is Connected Mover) (result Mover Win)) (if (is Connected Next) (result Next Win))})))","###Description Played on a Hex board. Players may play a piece of any color piece. The goal is to form a line connecting the player's two sides with either color. The game is played on a 11x11 board The first player to connect his two sides wins. @@ -2629,11 +2539,6 @@ Goal: Score the most points: -- One point for each stone in one's largest group. ###Ludii (game ""Brain Coral"" (players 2) (equipment {(board (hex Limping (- 5 1)) use:Cell) (piece ""Ball"" Each) (piece ""Disc"" Each)}) (rules (start (set Score Each 0)) (play (do (move Add (to (sites Empty))) ifAfterwards:(all Sites (sites Around (last To) Orthogonal includeSelf:True) if:(or (and (is Empty (site)) (is In (site) (sites Outer))) (!= Infinity (count Steps (step Orthogonal (to if:(is Empty (to)))) (site) (difference (sites Outer) (site)))))) (then (set Var ""MoverScore"" (+ (max 0 (max (sizes Group Orthogonal Mover))) (count Groups Orthogonal if:(= (who at:(to)) (mover)))) (then (set Var ""NextScore"" (+ (max 0 (max (sizes Group Orthogonal Next))) (count Groups Orthogonal if:(= (who at:(to)) (next)))) (then (if (= (var ""MoverScore"") (var ""NextScore"")) (and (set Score Mover (* -1 (max 0 (max (difference (sizes Group Orthogonal Mover) (sizes Group Orthogonal Next)))))) (set Score Next (* -1 (max 0 (max (difference (sizes Group Orthogonal Next) (sizes Group Orthogonal Mover))))))) (and (set Score Mover (var ""MoverScore"")) (set Score Next (var ""NextScore""))))))))))) (end (if (no Moves Next) {(if (= (score Mover) (score Next)) (result Mover Win)) (if (!= (score Mover) (score Next)) (byScore))}))))" -"Definitions: 1 A group is a stone along with all stones one can reach from it through a series of steps onto adjacent stones of the same color. 1.1 The size of a group is the number of stones in it. 2 A brood is a group along with all other groups of identical color, size and shape. Shapes are considered identical across symmetries (just like in Bug). 2.1 The size of a brood is the number of groups in it. 2.2 The order of a brood is the size of the groups in it. 2.3 The mass of a brood is the number of stones in it (its size times its order). Play: On the very first turn of the game, Black places one stone of their colour on any hex. After, that – starting with White – take turns doing one of the following: - Pass. - Place two stones of your colour on empty hexes. When the players pass consecutively, the winner is the player with the higher score. Scoring: For each of your broods, you score its mass multiplied by the lesser of its size and its order. For example, if a brood consists of 2 groups of size 3, it is worth 12 points. Its order is 3, its size is 2 and its mass is 6. Since 2 is smaller than 3, the brood is worth 6*2 = 12. A boad of size 5 is currently selected. Nothing is currently printed on the pieces. The 12* placement protocol is currently in effect. This is the protocol described in the rules above.","(game ""Brood"" (players 2) (equipment {(board (hex Hexagon 5) use:Cell) (piece ""Hex"" Each maxState:7 maxValue:1023) (piece ""Disc"" Neutral) (hand Shared)}) (rules (play (if (or (= 0 (count Moves)) (!= 0 (count MovesThisTurn))) (do (forEach Site (sites Occupied by:Mover) (set State at:(site) 0)) next:(move Add (piece (id ""Hex"" Mover)) (to (sites Empty)) (then (set Var ""LastRow"" (row of:(max (array (sites Group at:(last To))))) (then (set Var ""LastCol"" (max (results from:(sites Group at:(last To)) to:(from) (column of:(from)))) (then (forEach Site (sites Group at:(last To)) (set Value at:(site) (+ (* 32 (- (var ""LastRow"") (row of:(site)))) (- (var ""LastCol"") (column of:(site)))))))))))) (then (forEach Group if:(= (mover) (who at:(to))) (remember Value (regionSite (sites) index:0) unique:True) (then (and {(forEach Value (values Remembered) (and {(set Var ""KeySite"" (value) (then (forEach Group if:(= (mover) (who at:(to))) (if (= (size Array (array (sites))) (size Array (array (sites Group at:(var ""KeySite""))))) (priority {(if (= 0 (size Array (difference (results from:(sites Group at:(var ""KeySite"")) to:(from) (+ (+ (* 32 (/ (value Piece at:(from)) 32)) (% (value Piece at:(from)) 32)) (+ (max (results from:(sites Group at:(var ""KeySite"")) to:(from) (- (* 32 (/ (value Piece at:(from)) 32))))) (max (results from:(sites Group at:(var ""KeySite"")) to:(from) (- (% (value Piece at:(from)) 32))))))) (results from:(sites) to:(from) (value Piece at:(from)))))) (remember Value ""ShapeCount"" (var ""KeySite""))) (if (= 0 (size Array (difference (results from:(sites Group at:(var ""KeySite"")) to:(from) (+ (+ (* 32 (/ (value Piece at:(from)) 32)) (- (/ (value Piece at:(from)) 32) (% (value Piece at:(from)) 32))) (+ (max (results from:(sites Group at:(var ""KeySite"")) to:(from) (- (* 32 (/ (value Piece at:(from)) 32))))) (max (results from:(sites Group at:(var ""KeySite"")) to:(from) (- (- (/ (value Piece at:(from)) 32) (% (value Piece at:(from)) 32)))))))) (results from:(sites) to:(from) (value Piece at:(from)))))) (remember Value ""ShapeCount"" (var ""KeySite""))) (if (= 0 (size Array (difference (results from:(sites Group at:(var ""KeySite"")) to:(from) (+ (+ (* 32 (- (/ (value Piece at:(from)) 32) (% (value Piece at:(from)) 32))) (/ (value Piece at:(from)) 32)) (+ (max (results from:(sites Group at:(var ""KeySite"")) to:(from) (- (* 32 (- (/ (value Piece at:(from)) 32) (% (value Piece at:(from)) 32)))))) (max (results from:(sites Group at:(var ""KeySite"")) to:(from) (- (/ (value Piece at:(from)) 32))))))) (results from:(sites) to:(from) (value Piece at:(from)))))) (remember Value ""ShapeCount"" (var ""KeySite""))) (if (= 0 (size Array (difference (results from:(sites Group at:(var ""KeySite"")) to:(from) (+ (+ (* 32 (% (value Piece at:(from)) 32)) (/ (value Piece at:(from)) 32)) (+ (max (results from:(sites Group at:(var ""KeySite"")) to:(from) (- (* 32 (% (value Piece at:(from)) 32))))) (max (results from:(sites Group at:(var ""KeySite"")) to:(from) (- (/ (value Piece at:(from)) 32))))))) (results from:(sites) to:(from) (value Piece at:(from)))))) (remember Value ""ShapeCount"" (var ""KeySite""))) (if (= 0 (size Array (difference (results from:(sites Group at:(var ""KeySite"")) to:(from) (+ (+ (* 32 (- (% (value Piece at:(from)) 32))) (- (/ (value Piece at:(from)) 32) (% (value Piece at:(from)) 32))) (+ (max (results from:(sites Group at:(var ""KeySite"")) to:(from) (- (* 32 (- (% (value Piece at:(from)) 32)))))) (max (results from:(sites Group at:(var ""KeySite"")) to:(from) (- (- (/ (value Piece at:(from)) 32) (% (value Piece at:(from)) 32)))))))) (results from:(sites) to:(from) (value Piece at:(from)))))) (remember Value ""ShapeCount"" (var ""KeySite""))) (if (= 0 (size Array (difference (results from:(sites Group at:(var ""KeySite"")) to:(from) (+ (+ (* 32 (- (% (value Piece at:(from)) 32) (/ (value Piece at:(from)) 32))) (% (value Piece at:(from)) 32)) (+ (max (results from:(sites Group at:(var ""KeySite"")) to:(from) (- (* 32 (- (% (value Piece at:(from)) 32) (/ (value Piece at:(from)) 32)))))) (max (results from:(sites Group at:(var ""KeySite"")) to:(from) (- (% (value Piece at:(from)) 32))))))) (results from:(sites) to:(from) (value Piece at:(from)))))) (remember Value ""ShapeCount"" (var ""KeySite""))) (if (= 0 (size Array (difference (results from:(sites Group at:(var ""KeySite"")) to:(from) (+ (+ (* 32 (- (/ (value Piece at:(from)) 32))) (- (% (value Piece at:(from)) 32))) (+ (max (results from:(sites Group at:(var ""KeySite"")) to:(from) (- (* 32 (- (/ (value Piece at:(from)) 32)))))) (max (results from:(sites Group at:(var ""KeySite"")) to:(from) (- (- (% (value Piece at:(from)) 32)))))))) (results from:(sites) to:(from) (value Piece at:(from)))))) (remember Value ""ShapeCount"" (var ""KeySite""))) (if (= 0 (size Array (difference (results from:(sites Group at:(var ""KeySite"")) to:(from) (+ (+ (* 32 (- (/ (value Piece at:(from)) 32))) (- (% (value Piece at:(from)) 32) (/ (value Piece at:(from)) 32))) (+ (max (results from:(sites Group at:(var ""KeySite"")) to:(from) (- (* 32 (- (/ (value Piece at:(from)) 32)))))) (max (results from:(sites Group at:(var ""KeySite"")) to:(from) (- (- (% (value Piece at:(from)) 32) (/ (value Piece at:(from)) 32)))))))) (results from:(sites) to:(from) (value Piece at:(from)))))) (remember Value ""ShapeCount"" (var ""KeySite""))) (if (= 0 (size Array (difference (results from:(sites Group at:(var ""KeySite"")) to:(from) (+ (+ (* 32 (- (% (value Piece at:(from)) 32) (/ (value Piece at:(from)) 32))) (- (/ (value Piece at:(from)) 32))) (+ (max (results from:(sites Group at:(var ""KeySite"")) to:(from) (- (* 32 (- (% (value Piece at:(from)) 32) (/ (value Piece at:(from)) 32)))))) (max (results from:(sites Group at:(var ""KeySite"")) to:(from) (- (- (/ (value Piece at:(from)) 32)))))))) (results from:(sites) to:(from) (value Piece at:(from)))))) (remember Value ""ShapeCount"" (var ""KeySite""))) (if (= 0 (size Array (difference (results from:(sites Group at:(var ""KeySite"")) to:(from) (+ (+ (* 32 (- (% (value Piece at:(from)) 32))) (- (/ (value Piece at:(from)) 32))) (+ (max (results from:(sites Group at:(var ""KeySite"")) to:(from) (- (* 32 (- (% (value Piece at:(from)) 32)))))) (max (results from:(sites Group at:(var ""KeySite"")) to:(from) (- (- (/ (value Piece at:(from)) 32)))))))) (results from:(sites) to:(from) (value Piece at:(from)))))) (remember Value ""ShapeCount"" (var ""KeySite""))) (if (= 0 (size Array (difference (results from:(sites Group at:(var ""KeySite"")) to:(from) (+ (+ (* 32 (% (value Piece at:(from)) 32)) (- (% (value Piece at:(from)) 32) (/ (value Piece at:(from)) 32))) (+ (max (results from:(sites Group at:(var ""KeySite"")) to:(from) (- (* 32 (% (value Piece at:(from)) 32))))) (max (results from:(sites Group at:(var ""KeySite"")) to:(from) (- (- (% (value Piece at:(from)) 32) (/ (value Piece at:(from)) 32)))))))) (results from:(sites) to:(from) (value Piece at:(from)))))) (remember Value ""ShapeCount"" (var ""KeySite""))) (if (= 0 (size Array (difference (results from:(sites Group at:(var ""KeySite"")) to:(from) (+ (+ (* 32 (- (/ (value Piece at:(from)) 32) (% (value Piece at:(from)) 32))) (- (% (value Piece at:(from)) 32))) (+ (max (results from:(sites Group at:(var ""KeySite"")) to:(from) (- (* 32 (- (/ (value Piece at:(from)) 32) (% (value Piece at:(from)) 32)))))) (max (results from:(sites Group at:(var ""KeySite"")) to:(from) (- (- (% (value Piece at:(from)) 32)))))))) (results from:(sites) to:(from) (value Piece at:(from)))))) (remember Value ""ShapeCount"" (var ""KeySite"")))})))))} (then (forEach Site (sites Group at:(var ""KeySite"")) (set State at:(site) (min (count Value (var ""KeySite"") in:(values Remembered ""ShapeCount"")) (size Group at:(var ""KeySite""))))))) (then (forget Value All))) (set Score Mover 0 (then (forEach Piece (addScore Mover (state at:(from))))))}))))) (or (move Pass) (and {(do (forEach Site (sites Occupied by:Mover) (set State at:(site) 0)) next:(move Add (piece (id ""Hex"" Mover)) (to (sites Empty)) (then (set Var ""LastRow"" (row of:(max (array (sites Group at:(last To))))) (then (set Var ""LastCol"" (max (results from:(sites Group at:(last To)) to:(from) (column of:(from)))) (then (forEach Site (sites Group at:(last To)) (set Value at:(site) (+ (* 32 (- (var ""LastRow"") (row of:(site)))) (- (var ""LastCol"") (column of:(site)))))))))))) (then (forEach Group if:(= (mover) (who at:(to))) (remember Value (regionSite (sites) index:0) unique:True) (then (and {(forEach Value (values Remembered) (and {(set Var ""KeySite"" (value) (then (forEach Group if:(= (mover) (who at:(to))) (if (= (size Array (array (sites))) (size Array (array (sites Group at:(var ""KeySite""))))) (priority {(if (= 0 (size Array (difference (results from:(sites Group at:(var ""KeySite"")) to:(from) (+ (+ (* 32 (/ (value Piece at:(from)) 32)) (% (value Piece at:(from)) 32)) (+ (max (results from:(sites Group at:(var ""KeySite"")) to:(from) (- (* 32 (/ (value Piece at:(from)) 32))))) (max (results from:(sites Group at:(var ""KeySite"")) to:(from) (- (% (value Piece at:(from)) 32))))))) (results from:(sites) to:(from) (value Piece at:(from)))))) (remember Value ""ShapeCount"" (var ""KeySite""))) (if (= 0 (size Array (difference (results from:(sites Group at:(var ""KeySite"")) to:(from) (+ (+ (* 32 (/ (value Piece at:(from)) 32)) (- (/ (value Piece at:(from)) 32) (% (value Piece at:(from)) 32))) (+ (max (results from:(sites Group at:(var ""KeySite"")) to:(from) (- (* 32 (/ (value Piece at:(from)) 32))))) (max (results from:(sites Group at:(var ""KeySite"")) to:(from) (- (- (/ (value Piece at:(from)) 32) (% (value Piece at:(from)) 32)))))))) (results from:(sites) to:(from) (value Piece at:(from)))))) (remember Value ""ShapeCount"" (var ""KeySite""))) (if (= 0 (size Array (difference (results from:(sites Group at:(var ""KeySite"")) to:(from) (+ (+ (* 32 (- (/ (value Piece at:(from)) 32) (% (value Piece at:(from)) 32))) (/ (value Piece at:(from)) 32)) (+ (max (results from:(sites Group at:(var ""KeySite"")) to:(from) (- (* 32 (- (/ (value Piece at:(from)) 32) (% (value Piece at:(from)) 32)))))) (max (results from:(sites Group at:(var ""KeySite"")) to:(from) (- (/ (value Piece at:(from)) 32))))))) (results from:(sites) to:(from) (value Piece at:(from)))))) (remember Value ""ShapeCount"" (var ""KeySite""))) (if (= 0 (size Array (difference (results from:(sites Group at:(var ""KeySite"")) to:(from) (+ (+ (* 32 (% (value Piece at:(from)) 32)) (/ (value Piece at:(from)) 32)) (+ (max (results from:(sites Group at:(var ""KeySite"")) to:(from) (- (* 32 (% (value Piece at:(from)) 32))))) (max (results from:(sites Group at:(var ""KeySite"")) to:(from) (- (/ (value Piece at:(from)) 32))))))) (results from:(sites) to:(from) (value Piece at:(from)))))) (remember Value ""ShapeCount"" (var ""KeySite""))) (if (= 0 (size Array (difference (results from:(sites Group at:(var ""KeySite"")) to:(from) (+ (+ (* 32 (- (% (value Piece at:(from)) 32))) (- (/ (value Piece at:(from)) 32) (% (value Piece at:(from)) 32))) (+ (max (results from:(sites Group at:(var ""KeySite"")) to:(from) (- (* 32 (- (% (value Piece at:(from)) 32)))))) (max (results from:(sites Group at:(var ""KeySite"")) to:(from) (- (- (/ (value Piece at:(from)) 32) (% (value Piece at:(from)) 32)))))))) (results from:(sites) to:(from) (value Piece at:(from)))))) (remember Value ""ShapeCount"" (var ""KeySite""))) (if (= 0 (size Array (difference (results from:(sites Group at:(var ""KeySite"")) to:(from) (+ (+ (* 32 (- (% (value Piece at:(from)) 32) (/ (value Piece at:(from)) 32))) (% (value Piece at:(from)) 32)) (+ (max (results from:(sites Group at:(var ""KeySite"")) to:(from) (- (* 32 (- (% (value Piece at:(from)) 32) (/ (value Piece at:(from)) 32)))))) (max (results from:(sites Group at:(var ""KeySite"")) to:(from) (- (% (value Piece at:(from)) 32))))))) (results from:(sites) to:(from) (value Piece at:(from)))))) (remember Value ""ShapeCount"" (var ""KeySite""))) (if (= 0 (size Array (difference (results from:(sites Group at:(var ""KeySite"")) to:(from) (+ (+ (* 32 (- (/ (value Piece at:(from)) 32))) (- (% (value Piece at:(from)) 32))) (+ (max (results from:(sites Group at:(var ""KeySite"")) to:(from) (- (* 32 (- (/ (value Piece at:(from)) 32)))))) (max (results from:(sites Group at:(var ""KeySite"")) to:(from) (- (- (% (value Piece at:(from)) 32)))))))) (results from:(sites) to:(from) (value Piece at:(from)))))) (remember Value ""ShapeCount"" (var ""KeySite""))) (if (= 0 (size Array (difference (results from:(sites Group at:(var ""KeySite"")) to:(from) (+ (+ (* 32 (- (/ (value Piece at:(from)) 32))) (- (% (value Piece at:(from)) 32) (/ (value Piece at:(from)) 32))) (+ (max (results from:(sites Group at:(var ""KeySite"")) to:(from) (- (* 32 (- (/ (value Piece at:(from)) 32)))))) (max (results from:(sites Group at:(var ""KeySite"")) to:(from) (- (- (% (value Piece at:(from)) 32) (/ (value Piece at:(from)) 32)))))))) (results from:(sites) to:(from) (value Piece at:(from)))))) (remember Value ""ShapeCount"" (var ""KeySite""))) (if (= 0 (size Array (difference (results from:(sites Group at:(var ""KeySite"")) to:(from) (+ (+ (* 32 (- (% (value Piece at:(from)) 32) (/ (value Piece at:(from)) 32))) (- (/ (value Piece at:(from)) 32))) (+ (max (results from:(sites Group at:(var ""KeySite"")) to:(from) (- (* 32 (- (% (value Piece at:(from)) 32) (/ (value Piece at:(from)) 32)))))) (max (results from:(sites Group at:(var ""KeySite"")) to:(from) (- (- (/ (value Piece at:(from)) 32)))))))) (results from:(sites) to:(from) (value Piece at:(from)))))) (remember Value ""ShapeCount"" (var ""KeySite""))) (if (= 0 (size Array (difference (results from:(sites Group at:(var ""KeySite"")) to:(from) (+ (+ (* 32 (- (% (value Piece at:(from)) 32))) (- (/ (value Piece at:(from)) 32))) (+ (max (results from:(sites Group at:(var ""KeySite"")) to:(from) (- (* 32 (- (% (value Piece at:(from)) 32)))))) (max (results from:(sites Group at:(var ""KeySite"")) to:(from) (- (- (/ (value Piece at:(from)) 32)))))))) (results from:(sites) to:(from) (value Piece at:(from)))))) (remember Value ""ShapeCount"" (var ""KeySite""))) (if (= 0 (size Array (difference (results from:(sites Group at:(var ""KeySite"")) to:(from) (+ (+ (* 32 (% (value Piece at:(from)) 32)) (- (% (value Piece at:(from)) 32) (/ (value Piece at:(from)) 32))) (+ (max (results from:(sites Group at:(var ""KeySite"")) to:(from) (- (* 32 (% (value Piece at:(from)) 32))))) (max (results from:(sites Group at:(var ""KeySite"")) to:(from) (- (- (% (value Piece at:(from)) 32) (/ (value Piece at:(from)) 32)))))))) (results from:(sites) to:(from) (value Piece at:(from)))))) (remember Value ""ShapeCount"" (var ""KeySite""))) (if (= 0 (size Array (difference (results from:(sites Group at:(var ""KeySite"")) to:(from) (+ (+ (* 32 (- (/ (value Piece at:(from)) 32) (% (value Piece at:(from)) 32))) (- (% (value Piece at:(from)) 32))) (+ (max (results from:(sites Group at:(var ""KeySite"")) to:(from) (- (* 32 (- (/ (value Piece at:(from)) 32) (% (value Piece at:(from)) 32)))))) (max (results from:(sites Group at:(var ""KeySite"")) to:(from) (- (- (% (value Piece at:(from)) 32)))))))) (results from:(sites) to:(from) (value Piece at:(from)))))) (remember Value ""ShapeCount"" (var ""KeySite"")))})))))} (then (forEach Site (sites Group at:(var ""KeySite"")) (set State at:(site) (min (count Value (var ""KeySite"") in:(values Remembered ""ShapeCount"")) (size Group at:(var ""KeySite""))))))) (then (forget Value All))) (set Score Mover 0 (then (forEach Piece (addScore Mover (state at:(from))))))})))))} (then (moveAgain)))) (then (forget Value All)))) (end (if (all Passed) (byScore)))))","###Description -Definitions: 1 A group is a stone along with all stones one can reach from it through a series of steps onto adjacent stones of the same color. 1.1 The size of a group is the number of stones in it. 2 A brood is a group along with all other groups of identical color, size and shape. Shapes are considered identical across symmetries (just like in Bug). 2.1 The size of a brood is the number of groups in it. 2.2 The order of a brood is the size of the groups in it. 2.3 The mass of a brood is the number of stones in it (its size times its order). Play: On the very first turn of the game, Black places one stone of their colour on any hex. After, that – starting with White – take turns doing one of the following: - Pass. - Place two stones of your colour on empty hexes. When the players pass consecutively, the winner is the player with the higher score. Scoring: For each of your broods, you score its mass multiplied by the lesser of its size and its order. For example, if a brood consists of 2 groups of size 3, it is worth 12 points. Its order is 3, its size is 2 and its mass is 6. Since 2 is smaller than 3, the brood is worth 6*2 = 12. A boad of size 5 is currently selected. Nothing is currently printed on the pieces. The 12* placement protocol is currently in effect. This is the protocol described in the rules above. - -###Ludii -(game ""Brood"" (players 2) (equipment {(board (hex Hexagon 5) use:Cell) (piece ""Hex"" Each maxState:7 maxValue:1023) (piece ""Disc"" Neutral) (hand Shared)}) (rules (play (if (or (= 0 (count Moves)) (!= 0 (count MovesThisTurn))) (do (forEach Site (sites Occupied by:Mover) (set State at:(site) 0)) next:(move Add (piece (id ""Hex"" Mover)) (to (sites Empty)) (then (set Var ""LastRow"" (row of:(max (array (sites Group at:(last To))))) (then (set Var ""LastCol"" (max (results from:(sites Group at:(last To)) to:(from) (column of:(from)))) (then (forEach Site (sites Group at:(last To)) (set Value at:(site) (+ (* 32 (- (var ""LastRow"") (row of:(site)))) (- (var ""LastCol"") (column of:(site)))))))))))) (then (forEach Group if:(= (mover) (who at:(to))) (remember Value (regionSite (sites) index:0) unique:True) (then (and {(forEach Value (values Remembered) (and {(set Var ""KeySite"" (value) (then (forEach Group if:(= (mover) (who at:(to))) (if (= (size Array (array (sites))) (size Array (array (sites Group at:(var ""KeySite""))))) (priority {(if (= 0 (size Array (difference (results from:(sites Group at:(var ""KeySite"")) to:(from) (+ (+ (* 32 (/ (value Piece at:(from)) 32)) (% (value Piece at:(from)) 32)) (+ (max (results from:(sites Group at:(var ""KeySite"")) to:(from) (- (* 32 (/ (value Piece at:(from)) 32))))) (max (results from:(sites Group at:(var ""KeySite"")) to:(from) (- (% (value Piece at:(from)) 32))))))) (results from:(sites) to:(from) (value Piece at:(from)))))) (remember Value ""ShapeCount"" (var ""KeySite""))) (if (= 0 (size Array (difference (results from:(sites Group at:(var ""KeySite"")) to:(from) (+ (+ (* 32 (/ (value Piece at:(from)) 32)) (- (/ (value Piece at:(from)) 32) (% (value Piece at:(from)) 32))) (+ (max (results from:(sites Group at:(var ""KeySite"")) to:(from) (- (* 32 (/ (value Piece at:(from)) 32))))) (max (results from:(sites Group at:(var ""KeySite"")) to:(from) (- (- (/ (value Piece at:(from)) 32) (% (value Piece at:(from)) 32)))))))) (results from:(sites) to:(from) (value Piece at:(from)))))) (remember Value ""ShapeCount"" (var ""KeySite""))) (if (= 0 (size Array (difference (results from:(sites Group at:(var ""KeySite"")) to:(from) (+ (+ (* 32 (- (/ (value Piece at:(from)) 32) (% (value Piece at:(from)) 32))) (/ (value Piece at:(from)) 32)) (+ (max (results from:(sites Group at:(var ""KeySite"")) to:(from) (- (* 32 (- (/ (value Piece at:(from)) 32) (% (value Piece at:(from)) 32)))))) (max (results from:(sites Group at:(var ""KeySite"")) to:(from) (- (/ (value Piece at:(from)) 32))))))) (results from:(sites) to:(from) (value Piece at:(from)))))) (remember Value ""ShapeCount"" (var ""KeySite""))) (if (= 0 (size Array (difference (results from:(sites Group at:(var ""KeySite"")) to:(from) (+ (+ (* 32 (% (value Piece at:(from)) 32)) (/ (value Piece at:(from)) 32)) (+ (max (results from:(sites Group at:(var ""KeySite"")) to:(from) (- (* 32 (% (value Piece at:(from)) 32))))) (max (results from:(sites Group at:(var ""KeySite"")) to:(from) (- (/ (value Piece at:(from)) 32))))))) (results from:(sites) to:(from) (value Piece at:(from)))))) (remember Value ""ShapeCount"" (var ""KeySite""))) (if (= 0 (size Array (difference (results from:(sites Group at:(var ""KeySite"")) to:(from) (+ (+ (* 32 (- (% (value Piece at:(from)) 32))) (- (/ (value Piece at:(from)) 32) (% (value Piece at:(from)) 32))) (+ (max (results from:(sites Group at:(var ""KeySite"")) to:(from) (- (* 32 (- (% (value Piece at:(from)) 32)))))) (max (results from:(sites Group at:(var ""KeySite"")) to:(from) (- (- (/ (value Piece at:(from)) 32) (% (value Piece at:(from)) 32)))))))) (results from:(sites) to:(from) (value Piece at:(from)))))) (remember Value ""ShapeCount"" (var ""KeySite""))) (if (= 0 (size Array (difference (results from:(sites Group at:(var ""KeySite"")) to:(from) (+ (+ (* 32 (- (% (value Piece at:(from)) 32) (/ (value Piece at:(from)) 32))) (% (value Piece at:(from)) 32)) (+ (max (results from:(sites Group at:(var ""KeySite"")) to:(from) (- (* 32 (- (% (value Piece at:(from)) 32) (/ (value Piece at:(from)) 32)))))) (max (results from:(sites Group at:(var ""KeySite"")) to:(from) (- (% (value Piece at:(from)) 32))))))) (results from:(sites) to:(from) (value Piece at:(from)))))) (remember Value ""ShapeCount"" (var ""KeySite""))) (if (= 0 (size Array (difference (results from:(sites Group at:(var ""KeySite"")) to:(from) (+ (+ (* 32 (- (/ (value Piece at:(from)) 32))) (- (% (value Piece at:(from)) 32))) (+ (max (results from:(sites Group at:(var ""KeySite"")) to:(from) (- (* 32 (- (/ (value Piece at:(from)) 32)))))) (max (results from:(sites Group at:(var ""KeySite"")) to:(from) (- (- (% (value Piece at:(from)) 32)))))))) (results from:(sites) to:(from) (value Piece at:(from)))))) (remember Value ""ShapeCount"" (var ""KeySite""))) (if (= 0 (size Array (difference (results from:(sites Group at:(var ""KeySite"")) to:(from) (+ (+ (* 32 (- (/ (value Piece at:(from)) 32))) (- (% (value Piece at:(from)) 32) (/ (value Piece at:(from)) 32))) (+ (max (results from:(sites Group at:(var ""KeySite"")) to:(from) (- (* 32 (- (/ (value Piece at:(from)) 32)))))) (max (results from:(sites Group at:(var ""KeySite"")) to:(from) (- (- (% (value Piece at:(from)) 32) (/ (value Piece at:(from)) 32)))))))) (results from:(sites) to:(from) (value Piece at:(from)))))) (remember Value ""ShapeCount"" (var ""KeySite""))) (if (= 0 (size Array (difference (results from:(sites Group at:(var ""KeySite"")) to:(from) (+ (+ (* 32 (- (% (value Piece at:(from)) 32) (/ (value Piece at:(from)) 32))) (- (/ (value Piece at:(from)) 32))) (+ (max (results from:(sites Group at:(var ""KeySite"")) to:(from) (- (* 32 (- (% (value Piece at:(from)) 32) (/ (value Piece at:(from)) 32)))))) (max (results from:(sites Group at:(var ""KeySite"")) to:(from) (- (- (/ (value Piece at:(from)) 32)))))))) (results from:(sites) to:(from) (value Piece at:(from)))))) (remember Value ""ShapeCount"" (var ""KeySite""))) (if (= 0 (size Array (difference (results from:(sites Group at:(var ""KeySite"")) to:(from) (+ (+ (* 32 (- (% (value Piece at:(from)) 32))) (- (/ (value Piece at:(from)) 32))) (+ (max (results from:(sites Group at:(var ""KeySite"")) to:(from) (- (* 32 (- (% (value Piece at:(from)) 32)))))) (max (results from:(sites Group at:(var ""KeySite"")) to:(from) (- (- (/ (value Piece at:(from)) 32)))))))) (results from:(sites) to:(from) (value Piece at:(from)))))) (remember Value ""ShapeCount"" (var ""KeySite""))) (if (= 0 (size Array (difference (results from:(sites Group at:(var ""KeySite"")) to:(from) (+ (+ (* 32 (% (value Piece at:(from)) 32)) (- (% (value Piece at:(from)) 32) (/ (value Piece at:(from)) 32))) (+ (max (results from:(sites Group at:(var ""KeySite"")) to:(from) (- (* 32 (% (value Piece at:(from)) 32))))) (max (results from:(sites Group at:(var ""KeySite"")) to:(from) (- (- (% (value Piece at:(from)) 32) (/ (value Piece at:(from)) 32)))))))) (results from:(sites) to:(from) (value Piece at:(from)))))) (remember Value ""ShapeCount"" (var ""KeySite""))) (if (= 0 (size Array (difference (results from:(sites Group at:(var ""KeySite"")) to:(from) (+ (+ (* 32 (- (/ (value Piece at:(from)) 32) (% (value Piece at:(from)) 32))) (- (% (value Piece at:(from)) 32))) (+ (max (results from:(sites Group at:(var ""KeySite"")) to:(from) (- (* 32 (- (/ (value Piece at:(from)) 32) (% (value Piece at:(from)) 32)))))) (max (results from:(sites Group at:(var ""KeySite"")) to:(from) (- (- (% (value Piece at:(from)) 32)))))))) (results from:(sites) to:(from) (value Piece at:(from)))))) (remember Value ""ShapeCount"" (var ""KeySite"")))})))))} (then (forEach Site (sites Group at:(var ""KeySite"")) (set State at:(site) (min (count Value (var ""KeySite"") in:(values Remembered ""ShapeCount"")) (size Group at:(var ""KeySite""))))))) (then (forget Value All))) (set Score Mover 0 (then (forEach Piece (addScore Mover (state at:(from))))))}))))) (or (move Pass) (and {(do (forEach Site (sites Occupied by:Mover) (set State at:(site) 0)) next:(move Add (piece (id ""Hex"" Mover)) (to (sites Empty)) (then (set Var ""LastRow"" (row of:(max (array (sites Group at:(last To))))) (then (set Var ""LastCol"" (max (results from:(sites Group at:(last To)) to:(from) (column of:(from)))) (then (forEach Site (sites Group at:(last To)) (set Value at:(site) (+ (* 32 (- (var ""LastRow"") (row of:(site)))) (- (var ""LastCol"") (column of:(site)))))))))))) (then (forEach Group if:(= (mover) (who at:(to))) (remember Value (regionSite (sites) index:0) unique:True) (then (and {(forEach Value (values Remembered) (and {(set Var ""KeySite"" (value) (then (forEach Group if:(= (mover) (who at:(to))) (if (= (size Array (array (sites))) (size Array (array (sites Group at:(var ""KeySite""))))) (priority {(if (= 0 (size Array (difference (results from:(sites Group at:(var ""KeySite"")) to:(from) (+ (+ (* 32 (/ (value Piece at:(from)) 32)) (% (value Piece at:(from)) 32)) (+ (max (results from:(sites Group at:(var ""KeySite"")) to:(from) (- (* 32 (/ (value Piece at:(from)) 32))))) (max (results from:(sites Group at:(var ""KeySite"")) to:(from) (- (% (value Piece at:(from)) 32))))))) (results from:(sites) to:(from) (value Piece at:(from)))))) (remember Value ""ShapeCount"" (var ""KeySite""))) (if (= 0 (size Array (difference (results from:(sites Group at:(var ""KeySite"")) to:(from) (+ (+ (* 32 (/ (value Piece at:(from)) 32)) (- (/ (value Piece at:(from)) 32) (% (value Piece at:(from)) 32))) (+ (max (results from:(sites Group at:(var ""KeySite"")) to:(from) (- (* 32 (/ (value Piece at:(from)) 32))))) (max (results from:(sites Group at:(var ""KeySite"")) to:(from) (- (- (/ (value Piece at:(from)) 32) (% (value Piece at:(from)) 32)))))))) (results from:(sites) to:(from) (value Piece at:(from)))))) (remember Value ""ShapeCount"" (var ""KeySite""))) (if (= 0 (size Array (difference (results from:(sites Group at:(var ""KeySite"")) to:(from) (+ (+ (* 32 (- (/ (value Piece at:(from)) 32) (% (value Piece at:(from)) 32))) (/ (value Piece at:(from)) 32)) (+ (max (results from:(sites Group at:(var ""KeySite"")) to:(from) (- (* 32 (- (/ (value Piece at:(from)) 32) (% (value Piece at:(from)) 32)))))) (max (results from:(sites Group at:(var ""KeySite"")) to:(from) (- (/ (value Piece at:(from)) 32))))))) (results from:(sites) to:(from) (value Piece at:(from)))))) (remember Value ""ShapeCount"" (var ""KeySite""))) (if (= 0 (size Array (difference (results from:(sites Group at:(var ""KeySite"")) to:(from) (+ (+ (* 32 (% (value Piece at:(from)) 32)) (/ (value Piece at:(from)) 32)) (+ (max (results from:(sites Group at:(var ""KeySite"")) to:(from) (- (* 32 (% (value Piece at:(from)) 32))))) (max (results from:(sites Group at:(var ""KeySite"")) to:(from) (- (/ (value Piece at:(from)) 32))))))) (results from:(sites) to:(from) (value Piece at:(from)))))) (remember Value ""ShapeCount"" (var ""KeySite""))) (if (= 0 (size Array (difference (results from:(sites Group at:(var ""KeySite"")) to:(from) (+ (+ (* 32 (- (% (value Piece at:(from)) 32))) (- (/ (value Piece at:(from)) 32) (% (value Piece at:(from)) 32))) (+ (max (results from:(sites Group at:(var ""KeySite"")) to:(from) (- (* 32 (- (% (value Piece at:(from)) 32)))))) (max (results from:(sites Group at:(var ""KeySite"")) to:(from) (- (- (/ (value Piece at:(from)) 32) (% (value Piece at:(from)) 32)))))))) (results from:(sites) to:(from) (value Piece at:(from)))))) (remember Value ""ShapeCount"" (var ""KeySite""))) (if (= 0 (size Array (difference (results from:(sites Group at:(var ""KeySite"")) to:(from) (+ (+ (* 32 (- (% (value Piece at:(from)) 32) (/ (value Piece at:(from)) 32))) (% (value Piece at:(from)) 32)) (+ (max (results from:(sites Group at:(var ""KeySite"")) to:(from) (- (* 32 (- (% (value Piece at:(from)) 32) (/ (value Piece at:(from)) 32)))))) (max (results from:(sites Group at:(var ""KeySite"")) to:(from) (- (% (value Piece at:(from)) 32))))))) (results from:(sites) to:(from) (value Piece at:(from)))))) (remember Value ""ShapeCount"" (var ""KeySite""))) (if (= 0 (size Array (difference (results from:(sites Group at:(var ""KeySite"")) to:(from) (+ (+ (* 32 (- (/ (value Piece at:(from)) 32))) (- (% (value Piece at:(from)) 32))) (+ (max (results from:(sites Group at:(var ""KeySite"")) to:(from) (- (* 32 (- (/ (value Piece at:(from)) 32)))))) (max (results from:(sites Group at:(var ""KeySite"")) to:(from) (- (- (% (value Piece at:(from)) 32)))))))) (results from:(sites) to:(from) (value Piece at:(from)))))) (remember Value ""ShapeCount"" (var ""KeySite""))) (if (= 0 (size Array (difference (results from:(sites Group at:(var ""KeySite"")) to:(from) (+ (+ (* 32 (- (/ (value Piece at:(from)) 32))) (- (% (value Piece at:(from)) 32) (/ (value Piece at:(from)) 32))) (+ (max (results from:(sites Group at:(var ""KeySite"")) to:(from) (- (* 32 (- (/ (value Piece at:(from)) 32)))))) (max (results from:(sites Group at:(var ""KeySite"")) to:(from) (- (- (% (value Piece at:(from)) 32) (/ (value Piece at:(from)) 32)))))))) (results from:(sites) to:(from) (value Piece at:(from)))))) (remember Value ""ShapeCount"" (var ""KeySite""))) (if (= 0 (size Array (difference (results from:(sites Group at:(var ""KeySite"")) to:(from) (+ (+ (* 32 (- (% (value Piece at:(from)) 32) (/ (value Piece at:(from)) 32))) (- (/ (value Piece at:(from)) 32))) (+ (max (results from:(sites Group at:(var ""KeySite"")) to:(from) (- (* 32 (- (% (value Piece at:(from)) 32) (/ (value Piece at:(from)) 32)))))) (max (results from:(sites Group at:(var ""KeySite"")) to:(from) (- (- (/ (value Piece at:(from)) 32)))))))) (results from:(sites) to:(from) (value Piece at:(from)))))) (remember Value ""ShapeCount"" (var ""KeySite""))) (if (= 0 (size Array (difference (results from:(sites Group at:(var ""KeySite"")) to:(from) (+ (+ (* 32 (- (% (value Piece at:(from)) 32))) (- (/ (value Piece at:(from)) 32))) (+ (max (results from:(sites Group at:(var ""KeySite"")) to:(from) (- (* 32 (- (% (value Piece at:(from)) 32)))))) (max (results from:(sites Group at:(var ""KeySite"")) to:(from) (- (- (/ (value Piece at:(from)) 32)))))))) (results from:(sites) to:(from) (value Piece at:(from)))))) (remember Value ""ShapeCount"" (var ""KeySite""))) (if (= 0 (size Array (difference (results from:(sites Group at:(var ""KeySite"")) to:(from) (+ (+ (* 32 (% (value Piece at:(from)) 32)) (- (% (value Piece at:(from)) 32) (/ (value Piece at:(from)) 32))) (+ (max (results from:(sites Group at:(var ""KeySite"")) to:(from) (- (* 32 (% (value Piece at:(from)) 32))))) (max (results from:(sites Group at:(var ""KeySite"")) to:(from) (- (- (% (value Piece at:(from)) 32) (/ (value Piece at:(from)) 32)))))))) (results from:(sites) to:(from) (value Piece at:(from)))))) (remember Value ""ShapeCount"" (var ""KeySite""))) (if (= 0 (size Array (difference (results from:(sites Group at:(var ""KeySite"")) to:(from) (+ (+ (* 32 (- (/ (value Piece at:(from)) 32) (% (value Piece at:(from)) 32))) (- (% (value Piece at:(from)) 32))) (+ (max (results from:(sites Group at:(var ""KeySite"")) to:(from) (- (* 32 (- (/ (value Piece at:(from)) 32) (% (value Piece at:(from)) 32)))))) (max (results from:(sites Group at:(var ""KeySite"")) to:(from) (- (- (% (value Piece at:(from)) 32)))))))) (results from:(sites) to:(from) (value Piece at:(from)))))) (remember Value ""ShapeCount"" (var ""KeySite"")))})))))} (then (forEach Site (sites Group at:(var ""KeySite"")) (set State at:(site) (min (count Value (var ""KeySite"") in:(values Remembered ""ShapeCount"")) (size Group at:(var ""KeySite""))))))) (then (forget Value All))) (set Score Mover 0 (then (forEach Piece (addScore Mover (state at:(from))))))})))))} (then (moveAgain)))) (then (forget Value All)))) (end (if (all Passed) (byScore)))))" "Players take turns placing a stone of their own color on any empty cell of a hexagonal grid of hexagons (a hexhex board). The game is over when the board is full, and the player with the lower score wins. Your score is 1 point per odd-sized group and 2 points even-sized group. In this implementation, you get -1 per odd-sized group and -2 per even-sized group, so the winner will be the player with the higher score. The score is currently updated after each move, and groups of even size are marked with a red outline. A size 5 board is currently selected","(game ""Elea"" (players 2) (equipment {(board (hex 5)) (piece ""Disc"" Each)}) (rules (meta (swap)) (play (move Add (to (sites Empty)) (then (and (set Score Mover 0) (forEach Group Orthogonal if:(is Mover (who at:(to))) (if (is Odd (count Sites in:(sites))) (and (addScore Mover -1) (forEach Site (sites) (set State at:(site) 0))) (and (addScore Mover -2) (forEach Site (sites) (set State at:(site) 1))))))))) (end (if (is Full) (byScore)))))","###Description Players take turns placing a stone of their own color on any empty cell of a hexagonal grid of hexagons (a hexhex board). The game is over when the board is full, and the player with the lower score wins. Your score is 1 point per odd-sized group and 2 points even-sized group. In this implementation, you get -1 per odd-sized group and -2 per even-sized group, so the winner will be the player with the higher score. The score is currently updated after each move, and groups of even size are marked with a red outline. A size 5 board is currently selected @@ -2674,11 +2579,6 @@ Players take turns placing pieces of any colour. They can't create groups of mor ###Ludii (game ""Manalath"" (players 2) (equipment {(board (rotate 90 (hex 5))) (piece ""Marker"" Each) (hand Shared size:2)}) (rules (start {(place ""Marker1"" (handSite Shared)) (place ""Marker2"" (handSite Shared 1))}) (play (do (move (from (sites Hand Shared)) (to (sites Empty)) copy:True) ifAfterwards:(< (size Group at:(last To)) 6) (then (forEach Site (sites Occupied by:Mover container:""Board"") (if (= (size Group at:(site)) 5) (set Var ""Group5"" 1) (if (= (size Group at:(site)) 4) (set Var ""Group4"" 1))))))) (end {(if (= (var ""Group4"") 1) (result Mover Loss)) (if (= (var ""Group5"") 1) (result Mover Win))})))" -"Definitions: 1 A group is a stone along with all stones one can reach from it through a series of steps onto adjacent stones of the same color. 1.1 The size of a group is the number of stones in it. 2 A brood is a group along with all other groups of identical color, size and shape. Shapes are considered identical across rotational and mirror-symmetries. 2.1 The size of a brood is the number of groups in it. 2.2 The order of a brood is the size of the groups in it. Play: On the very first turn of the game, Black places one stone of their color on any hex. After, that – starting with White – take turns doing one of the following: • Pass. • Place two stones of your color on empty hexes. When the players pass consecutively, the winner is the player with the higher score. Scoring: For each of your odd-sized broods, you score 1 point if its order is odd and 2 points if its order is even. A boad of size 5 is currently selected. Nothing is currently printed on the pieces.","(game ""Manifold"" (players 2) (equipment {(board (hex Hexagon 5) use:Cell) (piece ""Hex"" Each maxState:7 maxValue:1023) (piece ""Disc"" Neutral)}) (rules (play (if (or (= 0 (count Moves)) (!= 0 (count MovesThisTurn))) (do (forEach Site (sites Occupied by:Mover) (set State at:(site) 0)) next:(move Add (piece (id ""Hex"" Mover)) (to (sites Empty)) (then (set Var ""LastRow"" (row of:(max (array (sites Group at:(last To))))) (then (set Var ""LastCol"" (max (results from:(sites Group at:(last To)) to:(from) (column of:(from)))) (then (forEach Site (sites Group at:(last To)) (set Value at:(site) (+ (* 32 (- (var ""LastRow"") (row of:(site)))) (- (var ""LastCol"") (column of:(site)))))))))))) (then (forEach Group if:(= (mover) (who at:(to))) (remember Value (regionSite (sites) index:0) unique:True) (then (and {(forEach Value (values Remembered) (and {(set Var ""KeySite"" (value) (then (forEach Group if:(= (mover) (who at:(to))) (if (= (size Array (array (sites))) (size Array (array (sites Group at:(var ""KeySite""))))) (priority {(if (= 0 (size Array (difference (results from:(sites Group at:(var ""KeySite"")) to:(from) (+ (+ (* 32 (/ (value Piece at:(from)) 32)) (% (value Piece at:(from)) 32)) (+ (max (results from:(sites Group at:(var ""KeySite"")) to:(from) (- (* 32 (/ (value Piece at:(from)) 32))))) (max (results from:(sites Group at:(var ""KeySite"")) to:(from) (- (% (value Piece at:(from)) 32))))))) (results from:(sites) to:(from) (value Piece at:(from)))))) (remember Value ""ShapeCount"" (+ (if (> (var ""KeySite"") (regionSite (sites) index:0)) 0 1000) (var ""KeySite"")))) (if (= 0 (size Array (difference (results from:(sites Group at:(var ""KeySite"")) to:(from) (+ (+ (* 32 (/ (value Piece at:(from)) 32)) (- (/ (value Piece at:(from)) 32) (% (value Piece at:(from)) 32))) (+ (max (results from:(sites Group at:(var ""KeySite"")) to:(from) (- (* 32 (/ (value Piece at:(from)) 32))))) (max (results from:(sites Group at:(var ""KeySite"")) to:(from) (- (- (/ (value Piece at:(from)) 32) (% (value Piece at:(from)) 32)))))))) (results from:(sites) to:(from) (value Piece at:(from)))))) (remember Value ""ShapeCount"" (+ (if (> (var ""KeySite"") (regionSite (sites) index:0)) 0 1000) (var ""KeySite"")))) (if (= 0 (size Array (difference (results from:(sites Group at:(var ""KeySite"")) to:(from) (+ (+ (* 32 (- (/ (value Piece at:(from)) 32) (% (value Piece at:(from)) 32))) (/ (value Piece at:(from)) 32)) (+ (max (results from:(sites Group at:(var ""KeySite"")) to:(from) (- (* 32 (- (/ (value Piece at:(from)) 32) (% (value Piece at:(from)) 32)))))) (max (results from:(sites Group at:(var ""KeySite"")) to:(from) (- (/ (value Piece at:(from)) 32))))))) (results from:(sites) to:(from) (value Piece at:(from)))))) (remember Value ""ShapeCount"" (+ (if (> (var ""KeySite"") (regionSite (sites) index:0)) 0 1000) (var ""KeySite"")))) (if (= 0 (size Array (difference (results from:(sites Group at:(var ""KeySite"")) to:(from) (+ (+ (* 32 (% (value Piece at:(from)) 32)) (/ (value Piece at:(from)) 32)) (+ (max (results from:(sites Group at:(var ""KeySite"")) to:(from) (- (* 32 (% (value Piece at:(from)) 32))))) (max (results from:(sites Group at:(var ""KeySite"")) to:(from) (- (/ (value Piece at:(from)) 32))))))) (results from:(sites) to:(from) (value Piece at:(from)))))) (remember Value ""ShapeCount"" (+ (if (> (var ""KeySite"") (regionSite (sites) index:0)) 0 1000) (var ""KeySite"")))) (if (= 0 (size Array (difference (results from:(sites Group at:(var ""KeySite"")) to:(from) (+ (+ (* 32 (- (% (value Piece at:(from)) 32))) (- (/ (value Piece at:(from)) 32) (% (value Piece at:(from)) 32))) (+ (max (results from:(sites Group at:(var ""KeySite"")) to:(from) (- (* 32 (- (% (value Piece at:(from)) 32)))))) (max (results from:(sites Group at:(var ""KeySite"")) to:(from) (- (- (/ (value Piece at:(from)) 32) (% (value Piece at:(from)) 32)))))))) (results from:(sites) to:(from) (value Piece at:(from)))))) (remember Value ""ShapeCount"" (+ (if (> (var ""KeySite"") (regionSite (sites) index:0)) 0 1000) (var ""KeySite"")))) (if (= 0 (size Array (difference (results from:(sites Group at:(var ""KeySite"")) to:(from) (+ (+ (* 32 (- (% (value Piece at:(from)) 32) (/ (value Piece at:(from)) 32))) (% (value Piece at:(from)) 32)) (+ (max (results from:(sites Group at:(var ""KeySite"")) to:(from) (- (* 32 (- (% (value Piece at:(from)) 32) (/ (value Piece at:(from)) 32)))))) (max (results from:(sites Group at:(var ""KeySite"")) to:(from) (- (% (value Piece at:(from)) 32))))))) (results from:(sites) to:(from) (value Piece at:(from)))))) (remember Value ""ShapeCount"" (+ (if (> (var ""KeySite"") (regionSite (sites) index:0)) 0 1000) (var ""KeySite"")))) (if (= 0 (size Array (difference (results from:(sites Group at:(var ""KeySite"")) to:(from) (+ (+ (* 32 (- (/ (value Piece at:(from)) 32))) (- (% (value Piece at:(from)) 32))) (+ (max (results from:(sites Group at:(var ""KeySite"")) to:(from) (- (* 32 (- (/ (value Piece at:(from)) 32)))))) (max (results from:(sites Group at:(var ""KeySite"")) to:(from) (- (- (% (value Piece at:(from)) 32)))))))) (results from:(sites) to:(from) (value Piece at:(from)))))) (remember Value ""ShapeCount"" (+ (if (> (var ""KeySite"") (regionSite (sites) index:0)) 0 1000) (var ""KeySite"")))) (if (= 0 (size Array (difference (results from:(sites Group at:(var ""KeySite"")) to:(from) (+ (+ (* 32 (- (/ (value Piece at:(from)) 32))) (- (% (value Piece at:(from)) 32) (/ (value Piece at:(from)) 32))) (+ (max (results from:(sites Group at:(var ""KeySite"")) to:(from) (- (* 32 (- (/ (value Piece at:(from)) 32)))))) (max (results from:(sites Group at:(var ""KeySite"")) to:(from) (- (- (% (value Piece at:(from)) 32) (/ (value Piece at:(from)) 32)))))))) (results from:(sites) to:(from) (value Piece at:(from)))))) (remember Value ""ShapeCount"" (+ (if (> (var ""KeySite"") (regionSite (sites) index:0)) 0 1000) (var ""KeySite"")))) (if (= 0 (size Array (difference (results from:(sites Group at:(var ""KeySite"")) to:(from) (+ (+ (* 32 (- (% (value Piece at:(from)) 32) (/ (value Piece at:(from)) 32))) (- (/ (value Piece at:(from)) 32))) (+ (max (results from:(sites Group at:(var ""KeySite"")) to:(from) (- (* 32 (- (% (value Piece at:(from)) 32) (/ (value Piece at:(from)) 32)))))) (max (results from:(sites Group at:(var ""KeySite"")) to:(from) (- (- (/ (value Piece at:(from)) 32)))))))) (results from:(sites) to:(from) (value Piece at:(from)))))) (remember Value ""ShapeCount"" (+ (if (> (var ""KeySite"") (regionSite (sites) index:0)) 0 1000) (var ""KeySite"")))) (if (= 0 (size Array (difference (results from:(sites Group at:(var ""KeySite"")) to:(from) (+ (+ (* 32 (- (% (value Piece at:(from)) 32))) (- (/ (value Piece at:(from)) 32))) (+ (max (results from:(sites Group at:(var ""KeySite"")) to:(from) (- (* 32 (- (% (value Piece at:(from)) 32)))))) (max (results from:(sites Group at:(var ""KeySite"")) to:(from) (- (- (/ (value Piece at:(from)) 32)))))))) (results from:(sites) to:(from) (value Piece at:(from)))))) (remember Value ""ShapeCount"" (+ (if (> (var ""KeySite"") (regionSite (sites) index:0)) 0 1000) (var ""KeySite"")))) (if (= 0 (size Array (difference (results from:(sites Group at:(var ""KeySite"")) to:(from) (+ (+ (* 32 (% (value Piece at:(from)) 32)) (- (% (value Piece at:(from)) 32) (/ (value Piece at:(from)) 32))) (+ (max (results from:(sites Group at:(var ""KeySite"")) to:(from) (- (* 32 (% (value Piece at:(from)) 32))))) (max (results from:(sites Group at:(var ""KeySite"")) to:(from) (- (- (% (value Piece at:(from)) 32) (/ (value Piece at:(from)) 32)))))))) (results from:(sites) to:(from) (value Piece at:(from)))))) (remember Value ""ShapeCount"" (+ (if (> (var ""KeySite"") (regionSite (sites) index:0)) 0 1000) (var ""KeySite"")))) (if (= 0 (size Array (difference (results from:(sites Group at:(var ""KeySite"")) to:(from) (+ (+ (* 32 (- (/ (value Piece at:(from)) 32) (% (value Piece at:(from)) 32))) (- (% (value Piece at:(from)) 32))) (+ (max (results from:(sites Group at:(var ""KeySite"")) to:(from) (- (* 32 (- (/ (value Piece at:(from)) 32) (% (value Piece at:(from)) 32)))))) (max (results from:(sites Group at:(var ""KeySite"")) to:(from) (- (- (% (value Piece at:(from)) 32)))))))) (results from:(sites) to:(from) (value Piece at:(from)))))) (remember Value ""ShapeCount"" (+ (if (> (var ""KeySite"") (regionSite (sites) index:0)) 0 1000) (var ""KeySite""))))})))))} (then (if (= 0 (count Value (var ""KeySite"") in:(values Remembered ""ShapeCount""))) (set State at:(var ""KeySite"") (* (% (+ (count Value (var ""KeySite"") in:(values Remembered ""ShapeCount"")) (count Value (+ 1000 (var ""KeySite"")) in:(values Remembered ""ShapeCount""))) 2) (- 2 (% (size Group at:(var ""KeySite"")) 2)))) (set State at:(var ""KeySite"") 0)))) (then (forget Value All))) (set Score Mover 0 (then (forEach Piece (addScore Mover (state at:(from))))))}))))) (or (move Pass) (and {(do (forEach Site (sites Occupied by:Mover) (set State at:(site) 0)) next:(move Add (piece (id ""Hex"" Mover)) (to (sites Empty)) (then (set Var ""LastRow"" (row of:(max (array (sites Group at:(last To))))) (then (set Var ""LastCol"" (max (results from:(sites Group at:(last To)) to:(from) (column of:(from)))) (then (forEach Site (sites Group at:(last To)) (set Value at:(site) (+ (* 32 (- (var ""LastRow"") (row of:(site)))) (- (var ""LastCol"") (column of:(site)))))))))))) (then (forEach Group if:(= (mover) (who at:(to))) (remember Value (regionSite (sites) index:0) unique:True) (then (and {(forEach Value (values Remembered) (and {(set Var ""KeySite"" (value) (then (forEach Group if:(= (mover) (who at:(to))) (if (= (size Array (array (sites))) (size Array (array (sites Group at:(var ""KeySite""))))) (priority {(if (= 0 (size Array (difference (results from:(sites Group at:(var ""KeySite"")) to:(from) (+ (+ (* 32 (/ (value Piece at:(from)) 32)) (% (value Piece at:(from)) 32)) (+ (max (results from:(sites Group at:(var ""KeySite"")) to:(from) (- (* 32 (/ (value Piece at:(from)) 32))))) (max (results from:(sites Group at:(var ""KeySite"")) to:(from) (- (% (value Piece at:(from)) 32))))))) (results from:(sites) to:(from) (value Piece at:(from)))))) (remember Value ""ShapeCount"" (+ (if (> (var ""KeySite"") (regionSite (sites) index:0)) 0 1000) (var ""KeySite"")))) (if (= 0 (size Array (difference (results from:(sites Group at:(var ""KeySite"")) to:(from) (+ (+ (* 32 (/ (value Piece at:(from)) 32)) (- (/ (value Piece at:(from)) 32) (% (value Piece at:(from)) 32))) (+ (max (results from:(sites Group at:(var ""KeySite"")) to:(from) (- (* 32 (/ (value Piece at:(from)) 32))))) (max (results from:(sites Group at:(var ""KeySite"")) to:(from) (- (- (/ (value Piece at:(from)) 32) (% (value Piece at:(from)) 32)))))))) (results from:(sites) to:(from) (value Piece at:(from)))))) (remember Value ""ShapeCount"" (+ (if (> (var ""KeySite"") (regionSite (sites) index:0)) 0 1000) (var ""KeySite"")))) (if (= 0 (size Array (difference (results from:(sites Group at:(var ""KeySite"")) to:(from) (+ (+ (* 32 (- (/ (value Piece at:(from)) 32) (% (value Piece at:(from)) 32))) (/ (value Piece at:(from)) 32)) (+ (max (results from:(sites Group at:(var ""KeySite"")) to:(from) (- (* 32 (- (/ (value Piece at:(from)) 32) (% (value Piece at:(from)) 32)))))) (max (results from:(sites Group at:(var ""KeySite"")) to:(from) (- (/ (value Piece at:(from)) 32))))))) (results from:(sites) to:(from) (value Piece at:(from)))))) (remember Value ""ShapeCount"" (+ (if (> (var ""KeySite"") (regionSite (sites) index:0)) 0 1000) (var ""KeySite"")))) (if (= 0 (size Array (difference (results from:(sites Group at:(var ""KeySite"")) to:(from) (+ (+ (* 32 (% (value Piece at:(from)) 32)) (/ (value Piece at:(from)) 32)) (+ (max (results from:(sites Group at:(var ""KeySite"")) to:(from) (- (* 32 (% (value Piece at:(from)) 32))))) (max (results from:(sites Group at:(var ""KeySite"")) to:(from) (- (/ (value Piece at:(from)) 32))))))) (results from:(sites) to:(from) (value Piece at:(from)))))) (remember Value ""ShapeCount"" (+ (if (> (var ""KeySite"") (regionSite (sites) index:0)) 0 1000) (var ""KeySite"")))) (if (= 0 (size Array (difference (results from:(sites Group at:(var ""KeySite"")) to:(from) (+ (+ (* 32 (- (% (value Piece at:(from)) 32))) (- (/ (value Piece at:(from)) 32) (% (value Piece at:(from)) 32))) (+ (max (results from:(sites Group at:(var ""KeySite"")) to:(from) (- (* 32 (- (% (value Piece at:(from)) 32)))))) (max (results from:(sites Group at:(var ""KeySite"")) to:(from) (- (- (/ (value Piece at:(from)) 32) (% (value Piece at:(from)) 32)))))))) (results from:(sites) to:(from) (value Piece at:(from)))))) (remember Value ""ShapeCount"" (+ (if (> (var ""KeySite"") (regionSite (sites) index:0)) 0 1000) (var ""KeySite"")))) (if (= 0 (size Array (difference (results from:(sites Group at:(var ""KeySite"")) to:(from) (+ (+ (* 32 (- (% (value Piece at:(from)) 32) (/ (value Piece at:(from)) 32))) (% (value Piece at:(from)) 32)) (+ (max (results from:(sites Group at:(var ""KeySite"")) to:(from) (- (* 32 (- (% (value Piece at:(from)) 32) (/ (value Piece at:(from)) 32)))))) (max (results from:(sites Group at:(var ""KeySite"")) to:(from) (- (% (value Piece at:(from)) 32))))))) (results from:(sites) to:(from) (value Piece at:(from)))))) (remember Value ""ShapeCount"" (+ (if (> (var ""KeySite"") (regionSite (sites) index:0)) 0 1000) (var ""KeySite"")))) (if (= 0 (size Array (difference (results from:(sites Group at:(var ""KeySite"")) to:(from) (+ (+ (* 32 (- (/ (value Piece at:(from)) 32))) (- (% (value Piece at:(from)) 32))) (+ (max (results from:(sites Group at:(var ""KeySite"")) to:(from) (- (* 32 (- (/ (value Piece at:(from)) 32)))))) (max (results from:(sites Group at:(var ""KeySite"")) to:(from) (- (- (% (value Piece at:(from)) 32)))))))) (results from:(sites) to:(from) (value Piece at:(from)))))) (remember Value ""ShapeCount"" (+ (if (> (var ""KeySite"") (regionSite (sites) index:0)) 0 1000) (var ""KeySite"")))) (if (= 0 (size Array (difference (results from:(sites Group at:(var ""KeySite"")) to:(from) (+ (+ (* 32 (- (/ (value Piece at:(from)) 32))) (- (% (value Piece at:(from)) 32) (/ (value Piece at:(from)) 32))) (+ (max (results from:(sites Group at:(var ""KeySite"")) to:(from) (- (* 32 (- (/ (value Piece at:(from)) 32)))))) (max (results from:(sites Group at:(var ""KeySite"")) to:(from) (- (- (% (value Piece at:(from)) 32) (/ (value Piece at:(from)) 32)))))))) (results from:(sites) to:(from) (value Piece at:(from)))))) (remember Value ""ShapeCount"" (+ (if (> (var ""KeySite"") (regionSite (sites) index:0)) 0 1000) (var ""KeySite"")))) (if (= 0 (size Array (difference (results from:(sites Group at:(var ""KeySite"")) to:(from) (+ (+ (* 32 (- (% (value Piece at:(from)) 32) (/ (value Piece at:(from)) 32))) (- (/ (value Piece at:(from)) 32))) (+ (max (results from:(sites Group at:(var ""KeySite"")) to:(from) (- (* 32 (- (% (value Piece at:(from)) 32) (/ (value Piece at:(from)) 32)))))) (max (results from:(sites Group at:(var ""KeySite"")) to:(from) (- (- (/ (value Piece at:(from)) 32)))))))) (results from:(sites) to:(from) (value Piece at:(from)))))) (remember Value ""ShapeCount"" (+ (if (> (var ""KeySite"") (regionSite (sites) index:0)) 0 1000) (var ""KeySite"")))) (if (= 0 (size Array (difference (results from:(sites Group at:(var ""KeySite"")) to:(from) (+ (+ (* 32 (- (% (value Piece at:(from)) 32))) (- (/ (value Piece at:(from)) 32))) (+ (max (results from:(sites Group at:(var ""KeySite"")) to:(from) (- (* 32 (- (% (value Piece at:(from)) 32)))))) (max (results from:(sites Group at:(var ""KeySite"")) to:(from) (- (- (/ (value Piece at:(from)) 32)))))))) (results from:(sites) to:(from) (value Piece at:(from)))))) (remember Value ""ShapeCount"" (+ (if (> (var ""KeySite"") (regionSite (sites) index:0)) 0 1000) (var ""KeySite"")))) (if (= 0 (size Array (difference (results from:(sites Group at:(var ""KeySite"")) to:(from) (+ (+ (* 32 (% (value Piece at:(from)) 32)) (- (% (value Piece at:(from)) 32) (/ (value Piece at:(from)) 32))) (+ (max (results from:(sites Group at:(var ""KeySite"")) to:(from) (- (* 32 (% (value Piece at:(from)) 32))))) (max (results from:(sites Group at:(var ""KeySite"")) to:(from) (- (- (% (value Piece at:(from)) 32) (/ (value Piece at:(from)) 32)))))))) (results from:(sites) to:(from) (value Piece at:(from)))))) (remember Value ""ShapeCount"" (+ (if (> (var ""KeySite"") (regionSite (sites) index:0)) 0 1000) (var ""KeySite"")))) (if (= 0 (size Array (difference (results from:(sites Group at:(var ""KeySite"")) to:(from) (+ (+ (* 32 (- (/ (value Piece at:(from)) 32) (% (value Piece at:(from)) 32))) (- (% (value Piece at:(from)) 32))) (+ (max (results from:(sites Group at:(var ""KeySite"")) to:(from) (- (* 32 (- (/ (value Piece at:(from)) 32) (% (value Piece at:(from)) 32)))))) (max (results from:(sites Group at:(var ""KeySite"")) to:(from) (- (- (% (value Piece at:(from)) 32)))))))) (results from:(sites) to:(from) (value Piece at:(from)))))) (remember Value ""ShapeCount"" (+ (if (> (var ""KeySite"") (regionSite (sites) index:0)) 0 1000) (var ""KeySite""))))})))))} (then (if (= 0 (count Value (var ""KeySite"") in:(values Remembered ""ShapeCount""))) (set State at:(var ""KeySite"") (* (% (+ (count Value (var ""KeySite"") in:(values Remembered ""ShapeCount"")) (count Value (+ 1000 (var ""KeySite"")) in:(values Remembered ""ShapeCount""))) 2) (- 2 (% (size Group at:(var ""KeySite"")) 2)))) (set State at:(var ""KeySite"") 0)))) (then (forget Value All))) (set Score Mover 0 (then (forEach Piece (addScore Mover (state at:(from))))))})))))} (then (moveAgain)))) (then (forget Value All)))) (end (if (all Passed) (byScore)))))","###Description -Definitions: 1 A group is a stone along with all stones one can reach from it through a series of steps onto adjacent stones of the same color. 1.1 The size of a group is the number of stones in it. 2 A brood is a group along with all other groups of identical color, size and shape. Shapes are considered identical across rotational and mirror-symmetries. 2.1 The size of a brood is the number of groups in it. 2.2 The order of a brood is the size of the groups in it. Play: On the very first turn of the game, Black places one stone of their color on any hex. After, that – starting with White – take turns doing one of the following: • Pass. • Place two stones of your color on empty hexes. When the players pass consecutively, the winner is the player with the higher score. Scoring: For each of your odd-sized broods, you score 1 point if its order is odd and 2 points if its order is even. A boad of size 5 is currently selected. Nothing is currently printed on the pieces. - -###Ludii -(game ""Manifold"" (players 2) (equipment {(board (hex Hexagon 5) use:Cell) (piece ""Hex"" Each maxState:7 maxValue:1023) (piece ""Disc"" Neutral)}) (rules (play (if (or (= 0 (count Moves)) (!= 0 (count MovesThisTurn))) (do (forEach Site (sites Occupied by:Mover) (set State at:(site) 0)) next:(move Add (piece (id ""Hex"" Mover)) (to (sites Empty)) (then (set Var ""LastRow"" (row of:(max (array (sites Group at:(last To))))) (then (set Var ""LastCol"" (max (results from:(sites Group at:(last To)) to:(from) (column of:(from)))) (then (forEach Site (sites Group at:(last To)) (set Value at:(site) (+ (* 32 (- (var ""LastRow"") (row of:(site)))) (- (var ""LastCol"") (column of:(site)))))))))))) (then (forEach Group if:(= (mover) (who at:(to))) (remember Value (regionSite (sites) index:0) unique:True) (then (and {(forEach Value (values Remembered) (and {(set Var ""KeySite"" (value) (then (forEach Group if:(= (mover) (who at:(to))) (if (= (size Array (array (sites))) (size Array (array (sites Group at:(var ""KeySite""))))) (priority {(if (= 0 (size Array (difference (results from:(sites Group at:(var ""KeySite"")) to:(from) (+ (+ (* 32 (/ (value Piece at:(from)) 32)) (% (value Piece at:(from)) 32)) (+ (max (results from:(sites Group at:(var ""KeySite"")) to:(from) (- (* 32 (/ (value Piece at:(from)) 32))))) (max (results from:(sites Group at:(var ""KeySite"")) to:(from) (- (% (value Piece at:(from)) 32))))))) (results from:(sites) to:(from) (value Piece at:(from)))))) (remember Value ""ShapeCount"" (+ (if (> (var ""KeySite"") (regionSite (sites) index:0)) 0 1000) (var ""KeySite"")))) (if (= 0 (size Array (difference (results from:(sites Group at:(var ""KeySite"")) to:(from) (+ (+ (* 32 (/ (value Piece at:(from)) 32)) (- (/ (value Piece at:(from)) 32) (% (value Piece at:(from)) 32))) (+ (max (results from:(sites Group at:(var ""KeySite"")) to:(from) (- (* 32 (/ (value Piece at:(from)) 32))))) (max (results from:(sites Group at:(var ""KeySite"")) to:(from) (- (- (/ (value Piece at:(from)) 32) (% (value Piece at:(from)) 32)))))))) (results from:(sites) to:(from) (value Piece at:(from)))))) (remember Value ""ShapeCount"" (+ (if (> (var ""KeySite"") (regionSite (sites) index:0)) 0 1000) (var ""KeySite"")))) (if (= 0 (size Array (difference (results from:(sites Group at:(var ""KeySite"")) to:(from) (+ (+ (* 32 (- (/ (value Piece at:(from)) 32) (% (value Piece at:(from)) 32))) (/ (value Piece at:(from)) 32)) (+ (max (results from:(sites Group at:(var ""KeySite"")) to:(from) (- (* 32 (- (/ (value Piece at:(from)) 32) (% (value Piece at:(from)) 32)))))) (max (results from:(sites Group at:(var ""KeySite"")) to:(from) (- (/ (value Piece at:(from)) 32))))))) (results from:(sites) to:(from) (value Piece at:(from)))))) (remember Value ""ShapeCount"" (+ (if (> (var ""KeySite"") (regionSite (sites) index:0)) 0 1000) (var ""KeySite"")))) (if (= 0 (size Array (difference (results from:(sites Group at:(var ""KeySite"")) to:(from) (+ (+ (* 32 (% (value Piece at:(from)) 32)) (/ (value Piece at:(from)) 32)) (+ (max (results from:(sites Group at:(var ""KeySite"")) to:(from) (- (* 32 (% (value Piece at:(from)) 32))))) (max (results from:(sites Group at:(var ""KeySite"")) to:(from) (- (/ (value Piece at:(from)) 32))))))) (results from:(sites) to:(from) (value Piece at:(from)))))) (remember Value ""ShapeCount"" (+ (if (> (var ""KeySite"") (regionSite (sites) index:0)) 0 1000) (var ""KeySite"")))) (if (= 0 (size Array (difference (results from:(sites Group at:(var ""KeySite"")) to:(from) (+ (+ (* 32 (- (% (value Piece at:(from)) 32))) (- (/ (value Piece at:(from)) 32) (% (value Piece at:(from)) 32))) (+ (max (results from:(sites Group at:(var ""KeySite"")) to:(from) (- (* 32 (- (% (value Piece at:(from)) 32)))))) (max (results from:(sites Group at:(var ""KeySite"")) to:(from) (- (- (/ (value Piece at:(from)) 32) (% (value Piece at:(from)) 32)))))))) (results from:(sites) to:(from) (value Piece at:(from)))))) (remember Value ""ShapeCount"" (+ (if (> (var ""KeySite"") (regionSite (sites) index:0)) 0 1000) (var ""KeySite"")))) (if (= 0 (size Array (difference (results from:(sites Group at:(var ""KeySite"")) to:(from) (+ (+ (* 32 (- (% (value Piece at:(from)) 32) (/ (value Piece at:(from)) 32))) (% (value Piece at:(from)) 32)) (+ (max (results from:(sites Group at:(var ""KeySite"")) to:(from) (- (* 32 (- (% (value Piece at:(from)) 32) (/ (value Piece at:(from)) 32)))))) (max (results from:(sites Group at:(var ""KeySite"")) to:(from) (- (% (value Piece at:(from)) 32))))))) (results from:(sites) to:(from) (value Piece at:(from)))))) (remember Value ""ShapeCount"" (+ (if (> (var ""KeySite"") (regionSite (sites) index:0)) 0 1000) (var ""KeySite"")))) (if (= 0 (size Array (difference (results from:(sites Group at:(var ""KeySite"")) to:(from) (+ (+ (* 32 (- (/ (value Piece at:(from)) 32))) (- (% (value Piece at:(from)) 32))) (+ (max (results from:(sites Group at:(var ""KeySite"")) to:(from) (- (* 32 (- (/ (value Piece at:(from)) 32)))))) (max (results from:(sites Group at:(var ""KeySite"")) to:(from) (- (- (% (value Piece at:(from)) 32)))))))) (results from:(sites) to:(from) (value Piece at:(from)))))) (remember Value ""ShapeCount"" (+ (if (> (var ""KeySite"") (regionSite (sites) index:0)) 0 1000) (var ""KeySite"")))) (if (= 0 (size Array (difference (results from:(sites Group at:(var ""KeySite"")) to:(from) (+ (+ (* 32 (- (/ (value Piece at:(from)) 32))) (- (% (value Piece at:(from)) 32) (/ (value Piece at:(from)) 32))) (+ (max (results from:(sites Group at:(var ""KeySite"")) to:(from) (- (* 32 (- (/ (value Piece at:(from)) 32)))))) (max (results from:(sites Group at:(var ""KeySite"")) to:(from) (- (- (% (value Piece at:(from)) 32) (/ (value Piece at:(from)) 32)))))))) (results from:(sites) to:(from) (value Piece at:(from)))))) (remember Value ""ShapeCount"" (+ (if (> (var ""KeySite"") (regionSite (sites) index:0)) 0 1000) (var ""KeySite"")))) (if (= 0 (size Array (difference (results from:(sites Group at:(var ""KeySite"")) to:(from) (+ (+ (* 32 (- (% (value Piece at:(from)) 32) (/ (value Piece at:(from)) 32))) (- (/ (value Piece at:(from)) 32))) (+ (max (results from:(sites Group at:(var ""KeySite"")) to:(from) (- (* 32 (- (% (value Piece at:(from)) 32) (/ (value Piece at:(from)) 32)))))) (max (results from:(sites Group at:(var ""KeySite"")) to:(from) (- (- (/ (value Piece at:(from)) 32)))))))) (results from:(sites) to:(from) (value Piece at:(from)))))) (remember Value ""ShapeCount"" (+ (if (> (var ""KeySite"") (regionSite (sites) index:0)) 0 1000) (var ""KeySite"")))) (if (= 0 (size Array (difference (results from:(sites Group at:(var ""KeySite"")) to:(from) (+ (+ (* 32 (- (% (value Piece at:(from)) 32))) (- (/ (value Piece at:(from)) 32))) (+ (max (results from:(sites Group at:(var ""KeySite"")) to:(from) (- (* 32 (- (% (value Piece at:(from)) 32)))))) (max (results from:(sites Group at:(var ""KeySite"")) to:(from) (- (- (/ (value Piece at:(from)) 32)))))))) (results from:(sites) to:(from) (value Piece at:(from)))))) (remember Value ""ShapeCount"" (+ (if (> (var ""KeySite"") (regionSite (sites) index:0)) 0 1000) (var ""KeySite"")))) (if (= 0 (size Array (difference (results from:(sites Group at:(var ""KeySite"")) to:(from) (+ (+ (* 32 (% (value Piece at:(from)) 32)) (- (% (value Piece at:(from)) 32) (/ (value Piece at:(from)) 32))) (+ (max (results from:(sites Group at:(var ""KeySite"")) to:(from) (- (* 32 (% (value Piece at:(from)) 32))))) (max (results from:(sites Group at:(var ""KeySite"")) to:(from) (- (- (% (value Piece at:(from)) 32) (/ (value Piece at:(from)) 32)))))))) (results from:(sites) to:(from) (value Piece at:(from)))))) (remember Value ""ShapeCount"" (+ (if (> (var ""KeySite"") (regionSite (sites) index:0)) 0 1000) (var ""KeySite"")))) (if (= 0 (size Array (difference (results from:(sites Group at:(var ""KeySite"")) to:(from) (+ (+ (* 32 (- (/ (value Piece at:(from)) 32) (% (value Piece at:(from)) 32))) (- (% (value Piece at:(from)) 32))) (+ (max (results from:(sites Group at:(var ""KeySite"")) to:(from) (- (* 32 (- (/ (value Piece at:(from)) 32) (% (value Piece at:(from)) 32)))))) (max (results from:(sites Group at:(var ""KeySite"")) to:(from) (- (- (% (value Piece at:(from)) 32)))))))) (results from:(sites) to:(from) (value Piece at:(from)))))) (remember Value ""ShapeCount"" (+ (if (> (var ""KeySite"") (regionSite (sites) index:0)) 0 1000) (var ""KeySite""))))})))))} (then (if (= 0 (count Value (var ""KeySite"") in:(values Remembered ""ShapeCount""))) (set State at:(var ""KeySite"") (* (% (+ (count Value (var ""KeySite"") in:(values Remembered ""ShapeCount"")) (count Value (+ 1000 (var ""KeySite"")) in:(values Remembered ""ShapeCount""))) 2) (- 2 (% (size Group at:(var ""KeySite"")) 2)))) (set State at:(var ""KeySite"") 0)))) (then (forget Value All))) (set Score Mover 0 (then (forEach Piece (addScore Mover (state at:(from))))))}))))) (or (move Pass) (and {(do (forEach Site (sites Occupied by:Mover) (set State at:(site) 0)) next:(move Add (piece (id ""Hex"" Mover)) (to (sites Empty)) (then (set Var ""LastRow"" (row of:(max (array (sites Group at:(last To))))) (then (set Var ""LastCol"" (max (results from:(sites Group at:(last To)) to:(from) (column of:(from)))) (then (forEach Site (sites Group at:(last To)) (set Value at:(site) (+ (* 32 (- (var ""LastRow"") (row of:(site)))) (- (var ""LastCol"") (column of:(site)))))))))))) (then (forEach Group if:(= (mover) (who at:(to))) (remember Value (regionSite (sites) index:0) unique:True) (then (and {(forEach Value (values Remembered) (and {(set Var ""KeySite"" (value) (then (forEach Group if:(= (mover) (who at:(to))) (if (= (size Array (array (sites))) (size Array (array (sites Group at:(var ""KeySite""))))) (priority {(if (= 0 (size Array (difference (results from:(sites Group at:(var ""KeySite"")) to:(from) (+ (+ (* 32 (/ (value Piece at:(from)) 32)) (% (value Piece at:(from)) 32)) (+ (max (results from:(sites Group at:(var ""KeySite"")) to:(from) (- (* 32 (/ (value Piece at:(from)) 32))))) (max (results from:(sites Group at:(var ""KeySite"")) to:(from) (- (% (value Piece at:(from)) 32))))))) (results from:(sites) to:(from) (value Piece at:(from)))))) (remember Value ""ShapeCount"" (+ (if (> (var ""KeySite"") (regionSite (sites) index:0)) 0 1000) (var ""KeySite"")))) (if (= 0 (size Array (difference (results from:(sites Group at:(var ""KeySite"")) to:(from) (+ (+ (* 32 (/ (value Piece at:(from)) 32)) (- (/ (value Piece at:(from)) 32) (% (value Piece at:(from)) 32))) (+ (max (results from:(sites Group at:(var ""KeySite"")) to:(from) (- (* 32 (/ (value Piece at:(from)) 32))))) (max (results from:(sites Group at:(var ""KeySite"")) to:(from) (- (- (/ (value Piece at:(from)) 32) (% (value Piece at:(from)) 32)))))))) (results from:(sites) to:(from) (value Piece at:(from)))))) (remember Value ""ShapeCount"" (+ (if (> (var ""KeySite"") (regionSite (sites) index:0)) 0 1000) (var ""KeySite"")))) (if (= 0 (size Array (difference (results from:(sites Group at:(var ""KeySite"")) to:(from) (+ (+ (* 32 (- (/ (value Piece at:(from)) 32) (% (value Piece at:(from)) 32))) (/ (value Piece at:(from)) 32)) (+ (max (results from:(sites Group at:(var ""KeySite"")) to:(from) (- (* 32 (- (/ (value Piece at:(from)) 32) (% (value Piece at:(from)) 32)))))) (max (results from:(sites Group at:(var ""KeySite"")) to:(from) (- (/ (value Piece at:(from)) 32))))))) (results from:(sites) to:(from) (value Piece at:(from)))))) (remember Value ""ShapeCount"" (+ (if (> (var ""KeySite"") (regionSite (sites) index:0)) 0 1000) (var ""KeySite"")))) (if (= 0 (size Array (difference (results from:(sites Group at:(var ""KeySite"")) to:(from) (+ (+ (* 32 (% (value Piece at:(from)) 32)) (/ (value Piece at:(from)) 32)) (+ (max (results from:(sites Group at:(var ""KeySite"")) to:(from) (- (* 32 (% (value Piece at:(from)) 32))))) (max (results from:(sites Group at:(var ""KeySite"")) to:(from) (- (/ (value Piece at:(from)) 32))))))) (results from:(sites) to:(from) (value Piece at:(from)))))) (remember Value ""ShapeCount"" (+ (if (> (var ""KeySite"") (regionSite (sites) index:0)) 0 1000) (var ""KeySite"")))) (if (= 0 (size Array (difference (results from:(sites Group at:(var ""KeySite"")) to:(from) (+ (+ (* 32 (- (% (value Piece at:(from)) 32))) (- (/ (value Piece at:(from)) 32) (% (value Piece at:(from)) 32))) (+ (max (results from:(sites Group at:(var ""KeySite"")) to:(from) (- (* 32 (- (% (value Piece at:(from)) 32)))))) (max (results from:(sites Group at:(var ""KeySite"")) to:(from) (- (- (/ (value Piece at:(from)) 32) (% (value Piece at:(from)) 32)))))))) (results from:(sites) to:(from) (value Piece at:(from)))))) (remember Value ""ShapeCount"" (+ (if (> (var ""KeySite"") (regionSite (sites) index:0)) 0 1000) (var ""KeySite"")))) (if (= 0 (size Array (difference (results from:(sites Group at:(var ""KeySite"")) to:(from) (+ (+ (* 32 (- (% (value Piece at:(from)) 32) (/ (value Piece at:(from)) 32))) (% (value Piece at:(from)) 32)) (+ (max (results from:(sites Group at:(var ""KeySite"")) to:(from) (- (* 32 (- (% (value Piece at:(from)) 32) (/ (value Piece at:(from)) 32)))))) (max (results from:(sites Group at:(var ""KeySite"")) to:(from) (- (% (value Piece at:(from)) 32))))))) (results from:(sites) to:(from) (value Piece at:(from)))))) (remember Value ""ShapeCount"" (+ (if (> (var ""KeySite"") (regionSite (sites) index:0)) 0 1000) (var ""KeySite"")))) (if (= 0 (size Array (difference (results from:(sites Group at:(var ""KeySite"")) to:(from) (+ (+ (* 32 (- (/ (value Piece at:(from)) 32))) (- (% (value Piece at:(from)) 32))) (+ (max (results from:(sites Group at:(var ""KeySite"")) to:(from) (- (* 32 (- (/ (value Piece at:(from)) 32)))))) (max (results from:(sites Group at:(var ""KeySite"")) to:(from) (- (- (% (value Piece at:(from)) 32)))))))) (results from:(sites) to:(from) (value Piece at:(from)))))) (remember Value ""ShapeCount"" (+ (if (> (var ""KeySite"") (regionSite (sites) index:0)) 0 1000) (var ""KeySite"")))) (if (= 0 (size Array (difference (results from:(sites Group at:(var ""KeySite"")) to:(from) (+ (+ (* 32 (- (/ (value Piece at:(from)) 32))) (- (% (value Piece at:(from)) 32) (/ (value Piece at:(from)) 32))) (+ (max (results from:(sites Group at:(var ""KeySite"")) to:(from) (- (* 32 (- (/ (value Piece at:(from)) 32)))))) (max (results from:(sites Group at:(var ""KeySite"")) to:(from) (- (- (% (value Piece at:(from)) 32) (/ (value Piece at:(from)) 32)))))))) (results from:(sites) to:(from) (value Piece at:(from)))))) (remember Value ""ShapeCount"" (+ (if (> (var ""KeySite"") (regionSite (sites) index:0)) 0 1000) (var ""KeySite"")))) (if (= 0 (size Array (difference (results from:(sites Group at:(var ""KeySite"")) to:(from) (+ (+ (* 32 (- (% (value Piece at:(from)) 32) (/ (value Piece at:(from)) 32))) (- (/ (value Piece at:(from)) 32))) (+ (max (results from:(sites Group at:(var ""KeySite"")) to:(from) (- (* 32 (- (% (value Piece at:(from)) 32) (/ (value Piece at:(from)) 32)))))) (max (results from:(sites Group at:(var ""KeySite"")) to:(from) (- (- (/ (value Piece at:(from)) 32)))))))) (results from:(sites) to:(from) (value Piece at:(from)))))) (remember Value ""ShapeCount"" (+ (if (> (var ""KeySite"") (regionSite (sites) index:0)) 0 1000) (var ""KeySite"")))) (if (= 0 (size Array (difference (results from:(sites Group at:(var ""KeySite"")) to:(from) (+ (+ (* 32 (- (% (value Piece at:(from)) 32))) (- (/ (value Piece at:(from)) 32))) (+ (max (results from:(sites Group at:(var ""KeySite"")) to:(from) (- (* 32 (- (% (value Piece at:(from)) 32)))))) (max (results from:(sites Group at:(var ""KeySite"")) to:(from) (- (- (/ (value Piece at:(from)) 32)))))))) (results from:(sites) to:(from) (value Piece at:(from)))))) (remember Value ""ShapeCount"" (+ (if (> (var ""KeySite"") (regionSite (sites) index:0)) 0 1000) (var ""KeySite"")))) (if (= 0 (size Array (difference (results from:(sites Group at:(var ""KeySite"")) to:(from) (+ (+ (* 32 (% (value Piece at:(from)) 32)) (- (% (value Piece at:(from)) 32) (/ (value Piece at:(from)) 32))) (+ (max (results from:(sites Group at:(var ""KeySite"")) to:(from) (- (* 32 (% (value Piece at:(from)) 32))))) (max (results from:(sites Group at:(var ""KeySite"")) to:(from) (- (- (% (value Piece at:(from)) 32) (/ (value Piece at:(from)) 32)))))))) (results from:(sites) to:(from) (value Piece at:(from)))))) (remember Value ""ShapeCount"" (+ (if (> (var ""KeySite"") (regionSite (sites) index:0)) 0 1000) (var ""KeySite"")))) (if (= 0 (size Array (difference (results from:(sites Group at:(var ""KeySite"")) to:(from) (+ (+ (* 32 (- (/ (value Piece at:(from)) 32) (% (value Piece at:(from)) 32))) (- (% (value Piece at:(from)) 32))) (+ (max (results from:(sites Group at:(var ""KeySite"")) to:(from) (- (* 32 (- (/ (value Piece at:(from)) 32) (% (value Piece at:(from)) 32)))))) (max (results from:(sites Group at:(var ""KeySite"")) to:(from) (- (- (% (value Piece at:(from)) 32)))))))) (results from:(sites) to:(from) (value Piece at:(from)))))) (remember Value ""ShapeCount"" (+ (if (> (var ""KeySite"") (regionSite (sites) index:0)) 0 1000) (var ""KeySite""))))})))))} (then (if (= 0 (count Value (var ""KeySite"") in:(values Remembered ""ShapeCount""))) (set State at:(var ""KeySite"") (* (% (+ (count Value (var ""KeySite"") in:(values Remembered ""ShapeCount"")) (count Value (+ 1000 (var ""KeySite"")) in:(values Remembered ""ShapeCount""))) 2) (- 2 (% (size Group at:(var ""KeySite"")) 2)))) (set State at:(var ""KeySite"") 0)))) (then (forget Value All))) (set Score Mover 0 (then (forEach Piece (addScore Mover (state at:(from))))))})))))} (then (moveAgain)))) (then (forget Value All)))) (end (if (all Passed) (byScore)))))" "DEFINITIONS Group: like-colored stones adjacent to each other. Singletons are considered groups of size 1. Path: an empty point, or an uninterrupted straight line of empty points that have a pair of like-colored stones on both ends, which are not part of the same group. Such a pair is said to have a path. Dead group: a group in which all stones belonging to it have no path. If any stone belonging to a group has a path, the group is said to have a path. GAME PLAY (Overview) Decide which player plays as which color (Light or Dark) in any adequate way. Light goes first, then alternate turns. On each player's first turn, players place a stone of their own color on any empty point. On each player's second turn, players place another stone of their color so that their own two stones have a path. Then players take actions below on each turn, in this order. 1. Remove all opponent’s dead groups. This happens automatically in Ludii. 2. Place a stone of their own color on an empty point that is on at least one same straight line with an existing friendly stone, and no opponent's stone in between. Passing is not allowed. After the second turn, the player with no stones of their color on the board at the beginning of their turn loses. A board with side lengths 6 and 7 is currently selected","(game ""Meridians"" (players 2) (equipment {(board (dual (hex Prism 7 6)) use:Vertex) (piece ""Disc"" Each)}) (rules phases:{(phase ""Opening"" (play (move Add (to (if (< 0 (count Sites in:(sites Occupied by:Mover))) (forEach (sites Empty) if:(and (> (count Pieces Mover in:(sites LineOfSight at:(site))) 0) (= (count Sites in:(sites Around (site) Own)) 0))) (sites Empty))))) (nextPhase (= 4 (count Moves)) ""Play"")) (phase ""Play"" (play (if (can Move (move Add (to (forEach (sites Empty) if:(> (count Pieces Mover in:(sites LineOfSight at:(site))) 0))))) (move Add (to (forEach (sites Empty) if:(> (count Pieces Mover in:(sites LineOfSight at:(site))) 0))) (then (forEach Group (if (all Sites (sites) if:(= 0 (count Sites in:(difference (intersection (sites Occupied by:Mover) (sites Direction from:(site) stop:(is Occupied (to)) stopIncluded:True)) (sites))))) (remove (sites)))))) (move Pass (then (forEach Group (if (all Sites (sites) if:(= 0 (count Sites in:(difference (intersection (sites Occupied by:Mover) (sites Direction from:(site) stop:(is Occupied (to)) stopIncluded:True)) (sites))))) (remove (sites)))))))))} (end (if (and (< 4 (count Moves)) (or (= 0 (count Sites in:(sites Occupied by:P1))) (= 0 (count Sites in:(sites Occupied by:P2))))) (result Mover Loss)))))","###Description DEFINITIONS Group: like-colored stones adjacent to each other. Singletons are considered groups of size 1. Path: an empty point, or an uninterrupted straight line of empty points that have a pair of like-colored stones on both ends, which are not part of the same group. Such a pair is said to have a path. Dead group: a group in which all stones belonging to it have no path. If any stone belonging to a group has a path, the group is said to have a path. GAME PLAY (Overview) Decide which player plays as which color (Light or Dark) in any adequate way. Light goes first, then alternate turns. On each player's first turn, players place a stone of their own color on any empty point. On each player's second turn, players place another stone of their color so that their own two stones have a path. Then players take actions below on each turn, in this order. 1. Remove all opponent’s dead groups. This happens automatically in Ludii. 2. Place a stone of their own color on an empty point that is on at least one same straight line with an existing friendly stone, and no opponent's stone in between. Passing is not allowed. After the second turn, the player with no stones of their color on the board at the beginning of their turn loses. A board with side lengths 6 and 7 is currently selected @@ -2949,11 +2849,6 @@ Three concentric squares, the corners and midpoints of the squares connected wit ###Ludii (game ""Marelle Triple"" (players 2) (equipment {(board (concentric Square rings:3 joinCorners:True) use:Vertex) (hand Each) (piece ""Marker"" Each (move Step (to if:(is Empty (to))) (then (if (or {(is Line 3 N exact:True) (is Line 3 S exact:True) (is Line 3 E exact:True) (is Line 3 W exact:True)}) (moveAgain)))))}) (rules (start (place ""Marker"" ""Hand"" count:9)) phases:{(phase ""Placement"" (play (if (is Prev Mover) (move Remove (sites Occupied by:Enemy container:""Board"")) (move (from (handSite Mover)) (to (sites Empty)) (then (if (or {(is Line 3 N exact:True) (is Line 3 S exact:True) (is Line 3 E exact:True) (is Line 3 W exact:True)}) (moveAgain)))))) (nextPhase Mover (all Sites (sites Hand Mover) if:(= 0 (count Cell at:(site)))) ""Movement"")) (phase ""Movement"" (play (if (is Prev Mover) (move Remove (sites Occupied by:Enemy container:""Board"")) (if (> (count Pieces Mover) 4) (forEach Piece) (move (from (sites Occupied by:Mover)) (to (sites Empty)))))))} (end (if (<= (count Pieces Next) 2) (result Next Loss)))))" -"Goal: The last player to complete a turn wins - typically when the opponent runs out of pieces in their hand. Each player starts with a full set of 9 pieces: each combination of shape and color. Pieces once played are not owned, but may be recaptured during the game for reuse. The game starts with a placement by the first player. Thereafter, each turn has a placement followed by a movement, and one or more required piece recaptures if available. -- 1. Placement: The first step in every turn is a placement to an empty point next to at least one existing piece that can slide. -- 2. Movement: The player must choose on piece next to the newly placed piece and slide it orthogonally one or two points to a new position. The piece can only move to empty points, never crossing a piece in play. -- 3. Capture: Either (or both) of the first two actions can form one or more 'mills'. A mill is an orthogonal line of three uniquely different piece types that all share one common attribute - either color or shape. The player completes their turn by destroying every mill on the board by removing one of the 2 unmoved pieces that it contains. (Newly added and moved pieces may not be removed.) A turn is not complete until all the applicable actions have been performed. A player may not make a move that would bring their hand size to more than 9 pieces.","(game ""Millieu"" (players 2) (equipment {(board (remove (rectangle 9 3) cells:{4 5 10 11}) use:Vertex) (hand Each size:9) (piece ""Disc"" Shared maxState:3) (piece ""Square"" Shared maxState:3) (piece ""Hex"" Shared maxState:3)}) (rules (start {(place ""Disc"" (handSite P1 0) state:3) (place ""Disc"" (handSite P1 1) state:1) (place ""Disc"" (handSite P1 2) state:2) (place ""Square"" (handSite P1 3) state:3) (place ""Square"" (handSite P1 4) state:1) (place ""Square"" (handSite P1 5) state:2) (place ""Hex"" (handSite P1 6) state:3) (place ""Hex"" (handSite P1 7) state:1) (place ""Hex"" (handSite P1 8) state:2) (place ""Disc"" (handSite P2 0) state:3) (place ""Disc"" (handSite P2 1) state:1) (place ""Disc"" (handSite P2 2) state:2) (place ""Square"" (handSite P2 3) state:3) (place ""Square"" (handSite P2 4) state:1) (place ""Square"" (handSite P2 5) state:2) (place ""Hex"" (handSite P2 6) state:3) (place ""Hex"" (handSite P2 7) state:1) (place ""Hex"" (handSite P2 8) state:2) (set Score Each 9)}) (play (if (> 0 (counter)) (move (from (sites Hand Mover)) (to (sites Board) if:(is Empty (to)))) (if (not (is Prev Mover)) (move (from (sites Hand Mover)) (to (sites Board) if:(and (is Empty (to)) (or (< 0 (count Pieces in:(sites Around (to)))) (< 0 (count Pieces in:(sites (results from:(to) to:(forEach (difference (difference (sites {(% (from) 9) (+ (% (from) 9) 9) (+ (% (from) 9) 18)}) (from)) (sites Empty)) if:(or (= (site) (+ (% (from) 9) 9)) (= (from) (+ (% (from) 9) 9)))) (to)))))))) (then (and (set Var ""LastMove1"" (last To)) (moveAgain)))) (if (= 0 (count Sites in:(sites Pending))) (move (from (union (sites Around (var ""LastMove1"")) (sites (results from:(var ""LastMove1"") to:(forEach (difference (difference (sites {(% (from) 9) (+ (% (from) 9) 9) (+ (% (from) 9) 18)}) (from)) (sites Empty)) if:(or (= (site) (+ (% (from) 9) 9)) (= (from) (+ (% (from) 9) 9)))) (to))))) (to (union (sites LineOfSight Empty Vertex at:(from)) (sites (results from:(from) to:(forEach (intersection (difference (sites {(% (from) 9) (+ (% (from) 9) 9) (+ (% (from) 9) 18)}) (from)) (sites Empty)) if:(or (is Empty (+ (% (from) 9) 9)) (= (from) (+ (% (from) 9) 9)))) (to))))) (then (set Var ""LastMove2"" (last To)))) (do (move (from (sites Pending)) (to (sites Hand Mover) if:(is Empty (to)))) ifAfterwards:(all Sites (sites {(var ""LastMove1"") (var ""LastMove2"")}) if:(is Occupied (site)))) (then (and {(and {(if (or (and {(= (state at:(* (/ (var ""LastMove1"") 3) 3)) (state at:(+ {(* (/ (var ""LastMove1"") 3) 3) 1}))) (= (state at:(* (/ (var ""LastMove1"") 3) 3)) (state at:(+ {(* (/ (var ""LastMove1"") 3) 3) 1 1}))) (!= (what at:(* (/ (var ""LastMove1"") 3) 3)) (what at:(+ {(* (/ (var ""LastMove1"") 3) 3) 1}))) (!= (what at:(* (/ (var ""LastMove1"") 3) 3)) (what at:(+ {(* (/ (var ""LastMove1"") 3) 3) 1 1}))) (!= (what at:(+ {(* (/ (var ""LastMove1"") 3) 3) 1})) (what at:(+ {(* (/ (var ""LastMove1"") 3) 3) 1 1})))}) (and {(= (what at:(* (/ (var ""LastMove1"") 3) 3)) (what at:(+ {(* (/ (var ""LastMove1"") 3) 3) 1}))) (= (what at:(* (/ (var ""LastMove1"") 3) 3)) (what at:(+ {(* (/ (var ""LastMove1"") 3) 3) 1 1}))) (!= (state at:(* (/ (var ""LastMove1"") 3) 3)) (state at:(+ {(* (/ (var ""LastMove1"") 3) 3) 1}))) (!= (state at:(* (/ (var ""LastMove1"") 3) 3)) (state at:(+ {(* (/ (var ""LastMove1"") 3) 3) 1 1}))) (!= (state at:(+ {(* (/ (var ""LastMove1"") 3) 3) 1})) (state Vertex at:(+ {(* (/ (var ""LastMove1"") 3) 3) 1 1})))})) (and {(set Pending (* (/ (var ""LastMove1"") 3) 3)) (set Pending (+ (* (/ (var ""LastMove1"") 3) 3) 1)) (set Pending (+ (* (/ (var ""LastMove1"") 3) 3) 2))})) (if (or (and {(= (state at:(+ (% (var ""LastMove1"") 3) (* (/ (var ""LastMove1"") 9) 9))) (state at:(+ {(+ (% (var ""LastMove1"") 3) (* (/ (var ""LastMove1"") 9) 9)) 3}))) (= (state at:(+ (% (var ""LastMove1"") 3) (* (/ (var ""LastMove1"") 9) 9))) (state at:(+ {(+ (% (var ""LastMove1"") 3) (* (/ (var ""LastMove1"") 9) 9)) 3 3}))) (!= (what at:(+ (% (var ""LastMove1"") 3) (* (/ (var ""LastMove1"") 9) 9))) (what at:(+ {(+ (% (var ""LastMove1"") 3) (* (/ (var ""LastMove1"") 9) 9)) 3}))) (!= (what at:(+ (% (var ""LastMove1"") 3) (* (/ (var ""LastMove1"") 9) 9))) (what at:(+ {(+ (% (var ""LastMove1"") 3) (* (/ (var ""LastMove1"") 9) 9)) 3 3}))) (!= (what at:(+ {(+ (% (var ""LastMove1"") 3) (* (/ (var ""LastMove1"") 9) 9)) 3})) (what at:(+ {(+ (% (var ""LastMove1"") 3) (* (/ (var ""LastMove1"") 9) 9)) 3 3})))}) (and {(= (what at:(+ (% (var ""LastMove1"") 3) (* (/ (var ""LastMove1"") 9) 9))) (what at:(+ {(+ (% (var ""LastMove1"") 3) (* (/ (var ""LastMove1"") 9) 9)) 3}))) (= (what at:(+ (% (var ""LastMove1"") 3) (* (/ (var ""LastMove1"") 9) 9))) (what at:(+ {(+ (% (var ""LastMove1"") 3) (* (/ (var ""LastMove1"") 9) 9)) 3 3}))) (!= (state at:(+ (% (var ""LastMove1"") 3) (* (/ (var ""LastMove1"") 9) 9))) (state at:(+ {(+ (% (var ""LastMove1"") 3) (* (/ (var ""LastMove1"") 9) 9)) 3}))) (!= (state at:(+ (% (var ""LastMove1"") 3) (* (/ (var ""LastMove1"") 9) 9))) (state at:(+ {(+ (% (var ""LastMove1"") 3) (* (/ (var ""LastMove1"") 9) 9)) 3 3}))) (!= (state at:(+ {(+ (% (var ""LastMove1"") 3) (* (/ (var ""LastMove1"") 9) 9)) 3})) (state Vertex at:(+ {(+ (% (var ""LastMove1"") 3) (* (/ (var ""LastMove1"") 9) 9)) 3 3})))})) (and {(set Pending (+ (% (var ""LastMove1"") 3) (* (/ (var ""LastMove1"") 9) 9))) (set Pending (+ (+ (% (var ""LastMove1"") 3) (* (/ (var ""LastMove1"") 9) 9)) 3)) (set Pending (+ (+ (% (var ""LastMove1"") 3) (* (/ (var ""LastMove1"") 9) 9)) 6))})) (if (or (and {(= (state at:(% (var ""LastMove1"") 9)) (state at:(+ {(% (var ""LastMove1"") 9) 9}))) (= (state at:(% (var ""LastMove1"") 9)) (state at:(+ {(% (var ""LastMove1"") 9) 9 9}))) (!= (what at:(% (var ""LastMove1"") 9)) (what at:(+ {(% (var ""LastMove1"") 9) 9}))) (!= (what at:(% (var ""LastMove1"") 9)) (what at:(+ {(% (var ""LastMove1"") 9) 9 9}))) (!= (what at:(+ {(% (var ""LastMove1"") 9) 9})) (what at:(+ {(% (var ""LastMove1"") 9) 9 9})))}) (and {(= (what at:(% (var ""LastMove1"") 9)) (what at:(+ {(% (var ""LastMove1"") 9) 9}))) (= (what at:(% (var ""LastMove1"") 9)) (what at:(+ {(% (var ""LastMove1"") 9) 9 9}))) (!= (state at:(% (var ""LastMove1"") 9)) (state at:(+ {(% (var ""LastMove1"") 9) 9}))) (!= (state at:(% (var ""LastMove1"") 9)) (state at:(+ {(% (var ""LastMove1"") 9) 9 9}))) (!= (state at:(+ {(% (var ""LastMove1"") 9) 9})) (state Vertex at:(+ {(% (var ""LastMove1"") 9) 9 9})))})) (and {(set Pending (% (var ""LastMove1"") 9)) (set Pending (+ (% (var ""LastMove1"") 9) 9)) (set Pending (+ (% (var ""LastMove1"") 9) 18))}))}) (and {(if (or (and {(= (state at:(* (/ (var ""LastMove2"") 3) 3)) (state at:(+ {(* (/ (var ""LastMove2"") 3) 3) 1}))) (= (state at:(* (/ (var ""LastMove2"") 3) 3)) (state at:(+ {(* (/ (var ""LastMove2"") 3) 3) 1 1}))) (!= (what at:(* (/ (var ""LastMove2"") 3) 3)) (what at:(+ {(* (/ (var ""LastMove2"") 3) 3) 1}))) (!= (what at:(* (/ (var ""LastMove2"") 3) 3)) (what at:(+ {(* (/ (var ""LastMove2"") 3) 3) 1 1}))) (!= (what at:(+ {(* (/ (var ""LastMove2"") 3) 3) 1})) (what at:(+ {(* (/ (var ""LastMove2"") 3) 3) 1 1})))}) (and {(= (what at:(* (/ (var ""LastMove2"") 3) 3)) (what at:(+ {(* (/ (var ""LastMove2"") 3) 3) 1}))) (= (what at:(* (/ (var ""LastMove2"") 3) 3)) (what at:(+ {(* (/ (var ""LastMove2"") 3) 3) 1 1}))) (!= (state at:(* (/ (var ""LastMove2"") 3) 3)) (state at:(+ {(* (/ (var ""LastMove2"") 3) 3) 1}))) (!= (state at:(* (/ (var ""LastMove2"") 3) 3)) (state at:(+ {(* (/ (var ""LastMove2"") 3) 3) 1 1}))) (!= (state at:(+ {(* (/ (var ""LastMove2"") 3) 3) 1})) (state Vertex at:(+ {(* (/ (var ""LastMove2"") 3) 3) 1 1})))})) (and {(set Pending (* (/ (var ""LastMove2"") 3) 3)) (set Pending (+ (* (/ (var ""LastMove2"") 3) 3) 1)) (set Pending (+ (* (/ (var ""LastMove2"") 3) 3) 2))})) (if (or (and {(= (state at:(+ (% (var ""LastMove2"") 3) (* (/ (var ""LastMove2"") 9) 9))) (state at:(+ {(+ (% (var ""LastMove2"") 3) (* (/ (var ""LastMove2"") 9) 9)) 3}))) (= (state at:(+ (% (var ""LastMove2"") 3) (* (/ (var ""LastMove2"") 9) 9))) (state at:(+ {(+ (% (var ""LastMove2"") 3) (* (/ (var ""LastMove2"") 9) 9)) 3 3}))) (!= (what at:(+ (% (var ""LastMove2"") 3) (* (/ (var ""LastMove2"") 9) 9))) (what at:(+ {(+ (% (var ""LastMove2"") 3) (* (/ (var ""LastMove2"") 9) 9)) 3}))) (!= (what at:(+ (% (var ""LastMove2"") 3) (* (/ (var ""LastMove2"") 9) 9))) (what at:(+ {(+ (% (var ""LastMove2"") 3) (* (/ (var ""LastMove2"") 9) 9)) 3 3}))) (!= (what at:(+ {(+ (% (var ""LastMove2"") 3) (* (/ (var ""LastMove2"") 9) 9)) 3})) (what at:(+ {(+ (% (var ""LastMove2"") 3) (* (/ (var ""LastMove2"") 9) 9)) 3 3})))}) (and {(= (what at:(+ (% (var ""LastMove2"") 3) (* (/ (var ""LastMove2"") 9) 9))) (what at:(+ {(+ (% (var ""LastMove2"") 3) (* (/ (var ""LastMove2"") 9) 9)) 3}))) (= (what at:(+ (% (var ""LastMove2"") 3) (* (/ (var ""LastMove2"") 9) 9))) (what at:(+ {(+ (% (var ""LastMove2"") 3) (* (/ (var ""LastMove2"") 9) 9)) 3 3}))) (!= (state at:(+ (% (var ""LastMove2"") 3) (* (/ (var ""LastMove2"") 9) 9))) (state at:(+ {(+ (% (var ""LastMove2"") 3) (* (/ (var ""LastMove2"") 9) 9)) 3}))) (!= (state at:(+ (% (var ""LastMove2"") 3) (* (/ (var ""LastMove2"") 9) 9))) (state at:(+ {(+ (% (var ""LastMove2"") 3) (* (/ (var ""LastMove2"") 9) 9)) 3 3}))) (!= (state at:(+ {(+ (% (var ""LastMove2"") 3) (* (/ (var ""LastMove2"") 9) 9)) 3})) (state Vertex at:(+ {(+ (% (var ""LastMove2"") 3) (* (/ (var ""LastMove2"") 9) 9)) 3 3})))})) (and {(set Pending (+ (% (var ""LastMove2"") 3) (* (/ (var ""LastMove2"") 9) 9))) (set Pending (+ (+ (% (var ""LastMove2"") 3) (* (/ (var ""LastMove2"") 9) 9)) 3)) (set Pending (+ (+ (% (var ""LastMove2"") 3) (* (/ (var ""LastMove2"") 9) 9)) 6))})) (if (or (and {(= (state at:(% (var ""LastMove2"") 9)) (state at:(+ {(% (var ""LastMove2"") 9) 9}))) (= (state at:(% (var ""LastMove2"") 9)) (state at:(+ {(% (var ""LastMove2"") 9) 9 9}))) (!= (what at:(% (var ""LastMove2"") 9)) (what at:(+ {(% (var ""LastMove2"") 9) 9}))) (!= (what at:(% (var ""LastMove2"") 9)) (what at:(+ {(% (var ""LastMove2"") 9) 9 9}))) (!= (what at:(+ {(% (var ""LastMove2"") 9) 9})) (what at:(+ {(% (var ""LastMove2"") 9) 9 9})))}) (and {(= (what at:(% (var ""LastMove2"") 9)) (what at:(+ {(% (var ""LastMove2"") 9) 9}))) (= (what at:(% (var ""LastMove2"") 9)) (what at:(+ {(% (var ""LastMove2"") 9) 9 9}))) (!= (state at:(% (var ""LastMove2"") 9)) (state at:(+ {(% (var ""LastMove2"") 9) 9}))) (!= (state at:(% (var ""LastMove2"") 9)) (state at:(+ {(% (var ""LastMove2"") 9) 9 9}))) (!= (state at:(+ {(% (var ""LastMove2"") 9) 9})) (state Vertex at:(+ {(% (var ""LastMove2"") 9) 9 9})))})) (and {(set Pending (% (var ""LastMove2"") 9)) (set Pending (+ (% (var ""LastMove2"") 9) 9)) (set Pending (+ (% (var ""LastMove2"") 9) 18))}))}) (if (or (or {(or (and {(= (state at:(* (/ (var ""LastMove1"") 3) 3)) (state at:(+ {(* (/ (var ""LastMove1"") 3) 3) 1}))) (= (state at:(* (/ (var ""LastMove1"") 3) 3)) (state at:(+ {(* (/ (var ""LastMove1"") 3) 3) 1 1}))) (!= (what at:(* (/ (var ""LastMove1"") 3) 3)) (what at:(+ {(* (/ (var ""LastMove1"") 3) 3) 1}))) (!= (what at:(* (/ (var ""LastMove1"") 3) 3)) (what at:(+ {(* (/ (var ""LastMove1"") 3) 3) 1 1}))) (!= (what at:(+ {(* (/ (var ""LastMove1"") 3) 3) 1})) (what at:(+ {(* (/ (var ""LastMove1"") 3) 3) 1 1})))}) (and {(= (what at:(* (/ (var ""LastMove1"") 3) 3)) (what at:(+ {(* (/ (var ""LastMove1"") 3) 3) 1}))) (= (what at:(* (/ (var ""LastMove1"") 3) 3)) (what at:(+ {(* (/ (var ""LastMove1"") 3) 3) 1 1}))) (!= (state at:(* (/ (var ""LastMove1"") 3) 3)) (state at:(+ {(* (/ (var ""LastMove1"") 3) 3) 1}))) (!= (state at:(* (/ (var ""LastMove1"") 3) 3)) (state at:(+ {(* (/ (var ""LastMove1"") 3) 3) 1 1}))) (!= (state at:(+ {(* (/ (var ""LastMove1"") 3) 3) 1})) (state Vertex at:(+ {(* (/ (var ""LastMove1"") 3) 3) 1 1})))})) (or (and {(= (state at:(+ (% (var ""LastMove1"") 3) (* (/ (var ""LastMove1"") 9) 9))) (state at:(+ {(+ (% (var ""LastMove1"") 3) (* (/ (var ""LastMove1"") 9) 9)) 3}))) (= (state at:(+ (% (var ""LastMove1"") 3) (* (/ (var ""LastMove1"") 9) 9))) (state at:(+ {(+ (% (var ""LastMove1"") 3) (* (/ (var ""LastMove1"") 9) 9)) 3 3}))) (!= (what at:(+ (% (var ""LastMove1"") 3) (* (/ (var ""LastMove1"") 9) 9))) (what at:(+ {(+ (% (var ""LastMove1"") 3) (* (/ (var ""LastMove1"") 9) 9)) 3}))) (!= (what at:(+ (% (var ""LastMove1"") 3) (* (/ (var ""LastMove1"") 9) 9))) (what at:(+ {(+ (% (var ""LastMove1"") 3) (* (/ (var ""LastMove1"") 9) 9)) 3 3}))) (!= (what at:(+ {(+ (% (var ""LastMove1"") 3) (* (/ (var ""LastMove1"") 9) 9)) 3})) (what at:(+ {(+ (% (var ""LastMove1"") 3) (* (/ (var ""LastMove1"") 9) 9)) 3 3})))}) (and {(= (what at:(+ (% (var ""LastMove1"") 3) (* (/ (var ""LastMove1"") 9) 9))) (what at:(+ {(+ (% (var ""LastMove1"") 3) (* (/ (var ""LastMove1"") 9) 9)) 3}))) (= (what at:(+ (% (var ""LastMove1"") 3) (* (/ (var ""LastMove1"") 9) 9))) (what at:(+ {(+ (% (var ""LastMove1"") 3) (* (/ (var ""LastMove1"") 9) 9)) 3 3}))) (!= (state at:(+ (% (var ""LastMove1"") 3) (* (/ (var ""LastMove1"") 9) 9))) (state at:(+ {(+ (% (var ""LastMove1"") 3) (* (/ (var ""LastMove1"") 9) 9)) 3}))) (!= (state at:(+ (% (var ""LastMove1"") 3) (* (/ (var ""LastMove1"") 9) 9))) (state at:(+ {(+ (% (var ""LastMove1"") 3) (* (/ (var ""LastMove1"") 9) 9)) 3 3}))) (!= (state at:(+ {(+ (% (var ""LastMove1"") 3) (* (/ (var ""LastMove1"") 9) 9)) 3})) (state Vertex at:(+ {(+ (% (var ""LastMove1"") 3) (* (/ (var ""LastMove1"") 9) 9)) 3 3})))})) (or (and {(= (state at:(% (var ""LastMove1"") 9)) (state at:(+ {(% (var ""LastMove1"") 9) 9}))) (= (state at:(% (var ""LastMove1"") 9)) (state at:(+ {(% (var ""LastMove1"") 9) 9 9}))) (!= (what at:(% (var ""LastMove1"") 9)) (what at:(+ {(% (var ""LastMove1"") 9) 9}))) (!= (what at:(% (var ""LastMove1"") 9)) (what at:(+ {(% (var ""LastMove1"") 9) 9 9}))) (!= (what at:(+ {(% (var ""LastMove1"") 9) 9})) (what at:(+ {(% (var ""LastMove1"") 9) 9 9})))}) (and {(= (what at:(% (var ""LastMove1"") 9)) (what at:(+ {(% (var ""LastMove1"") 9) 9}))) (= (what at:(% (var ""LastMove1"") 9)) (what at:(+ {(% (var ""LastMove1"") 9) 9 9}))) (!= (state at:(% (var ""LastMove1"") 9)) (state at:(+ {(% (var ""LastMove1"") 9) 9}))) (!= (state at:(% (var ""LastMove1"") 9)) (state at:(+ {(% (var ""LastMove1"") 9) 9 9}))) (!= (state at:(+ {(% (var ""LastMove1"") 9) 9})) (state Vertex at:(+ {(% (var ""LastMove1"") 9) 9 9})))}))}) (or {(or (and {(= (state at:(* (/ (var ""LastMove2"") 3) 3)) (state at:(+ {(* (/ (var ""LastMove2"") 3) 3) 1}))) (= (state at:(* (/ (var ""LastMove2"") 3) 3)) (state at:(+ {(* (/ (var ""LastMove2"") 3) 3) 1 1}))) (!= (what at:(* (/ (var ""LastMove2"") 3) 3)) (what at:(+ {(* (/ (var ""LastMove2"") 3) 3) 1}))) (!= (what at:(* (/ (var ""LastMove2"") 3) 3)) (what at:(+ {(* (/ (var ""LastMove2"") 3) 3) 1 1}))) (!= (what at:(+ {(* (/ (var ""LastMove2"") 3) 3) 1})) (what at:(+ {(* (/ (var ""LastMove2"") 3) 3) 1 1})))}) (and {(= (what at:(* (/ (var ""LastMove2"") 3) 3)) (what at:(+ {(* (/ (var ""LastMove2"") 3) 3) 1}))) (= (what at:(* (/ (var ""LastMove2"") 3) 3)) (what at:(+ {(* (/ (var ""LastMove2"") 3) 3) 1 1}))) (!= (state at:(* (/ (var ""LastMove2"") 3) 3)) (state at:(+ {(* (/ (var ""LastMove2"") 3) 3) 1}))) (!= (state at:(* (/ (var ""LastMove2"") 3) 3)) (state at:(+ {(* (/ (var ""LastMove2"") 3) 3) 1 1}))) (!= (state at:(+ {(* (/ (var ""LastMove2"") 3) 3) 1})) (state Vertex at:(+ {(* (/ (var ""LastMove2"") 3) 3) 1 1})))})) (or (and {(= (state at:(+ (% (var ""LastMove2"") 3) (* (/ (var ""LastMove2"") 9) 9))) (state at:(+ {(+ (% (var ""LastMove2"") 3) (* (/ (var ""LastMove2"") 9) 9)) 3}))) (= (state at:(+ (% (var ""LastMove2"") 3) (* (/ (var ""LastMove2"") 9) 9))) (state at:(+ {(+ (% (var ""LastMove2"") 3) (* (/ (var ""LastMove2"") 9) 9)) 3 3}))) (!= (what at:(+ (% (var ""LastMove2"") 3) (* (/ (var ""LastMove2"") 9) 9))) (what at:(+ {(+ (% (var ""LastMove2"") 3) (* (/ (var ""LastMove2"") 9) 9)) 3}))) (!= (what at:(+ (% (var ""LastMove2"") 3) (* (/ (var ""LastMove2"") 9) 9))) (what at:(+ {(+ (% (var ""LastMove2"") 3) (* (/ (var ""LastMove2"") 9) 9)) 3 3}))) (!= (what at:(+ {(+ (% (var ""LastMove2"") 3) (* (/ (var ""LastMove2"") 9) 9)) 3})) (what at:(+ {(+ (% (var ""LastMove2"") 3) (* (/ (var ""LastMove2"") 9) 9)) 3 3})))}) (and {(= (what at:(+ (% (var ""LastMove2"") 3) (* (/ (var ""LastMove2"") 9) 9))) (what at:(+ {(+ (% (var ""LastMove2"") 3) (* (/ (var ""LastMove2"") 9) 9)) 3}))) (= (what at:(+ (% (var ""LastMove2"") 3) (* (/ (var ""LastMove2"") 9) 9))) (what at:(+ {(+ (% (var ""LastMove2"") 3) (* (/ (var ""LastMove2"") 9) 9)) 3 3}))) (!= (state at:(+ (% (var ""LastMove2"") 3) (* (/ (var ""LastMove2"") 9) 9))) (state at:(+ {(+ (% (var ""LastMove2"") 3) (* (/ (var ""LastMove2"") 9) 9)) 3}))) (!= (state at:(+ (% (var ""LastMove2"") 3) (* (/ (var ""LastMove2"") 9) 9))) (state at:(+ {(+ (% (var ""LastMove2"") 3) (* (/ (var ""LastMove2"") 9) 9)) 3 3}))) (!= (state at:(+ {(+ (% (var ""LastMove2"") 3) (* (/ (var ""LastMove2"") 9) 9)) 3})) (state Vertex at:(+ {(+ (% (var ""LastMove2"") 3) (* (/ (var ""LastMove2"") 9) 9)) 3 3})))})) (or (and {(= (state at:(% (var ""LastMove2"") 9)) (state at:(+ {(% (var ""LastMove2"") 9) 9}))) (= (state at:(% (var ""LastMove2"") 9)) (state at:(+ {(% (var ""LastMove2"") 9) 9 9}))) (!= (what at:(% (var ""LastMove2"") 9)) (what at:(+ {(% (var ""LastMove2"") 9) 9}))) (!= (what at:(% (var ""LastMove2"") 9)) (what at:(+ {(% (var ""LastMove2"") 9) 9 9}))) (!= (what at:(+ {(% (var ""LastMove2"") 9) 9})) (what at:(+ {(% (var ""LastMove2"") 9) 9 9})))}) (and {(= (what at:(% (var ""LastMove2"") 9)) (what at:(+ {(% (var ""LastMove2"") 9) 9}))) (= (what at:(% (var ""LastMove2"") 9)) (what at:(+ {(% (var ""LastMove2"") 9) 9 9}))) (!= (state at:(% (var ""LastMove2"") 9)) (state at:(+ {(% (var ""LastMove2"") 9) 9}))) (!= (state at:(% (var ""LastMove2"") 9)) (state at:(+ {(% (var ""LastMove2"") 9) 9 9}))) (!= (state at:(+ {(% (var ""LastMove2"") 9) 9})) (state Vertex at:(+ {(% (var ""LastMove2"") 9) 9 9})))}))})) (moveAgain))})))) (then (set Score Mover (count Pieces in:(sites Hand Mover)))))) (end (if (no Moves Mover) (result Mover Loss)))))","###Description -Goal: The last player to complete a turn wins - typically when the opponent runs out of pieces in their hand. Each player starts with a full set of 9 pieces: each combination of shape and color. Pieces once played are not owned, but may be recaptured during the game for reuse. The game starts with a placement by the first player. Thereafter, each turn has a placement followed by a movement, and one or more required piece recaptures if available. -- 1. Placement: The first step in every turn is a placement to an empty point next to at least one existing piece that can slide. -- 2. Movement: The player must choose on piece next to the newly placed piece and slide it orthogonally one or two points to a new position. The piece can only move to empty points, never crossing a piece in play. -- 3. Capture: Either (or both) of the first two actions can form one or more 'mills'. A mill is an orthogonal line of three uniquely different piece types that all share one common attribute - either color or shape. The player completes their turn by destroying every mill on the board by removing one of the 2 unmoved pieces that it contains. (Newly added and moved pieces may not be removed.) A turn is not complete until all the applicable actions have been performed. A player may not make a move that would bring their hand size to more than 9 pieces. - -###Ludii -(game ""Millieu"" (players 2) (equipment {(board (remove (rectangle 9 3) cells:{4 5 10 11}) use:Vertex) (hand Each size:9) (piece ""Disc"" Shared maxState:3) (piece ""Square"" Shared maxState:3) (piece ""Hex"" Shared maxState:3)}) (rules (start {(place ""Disc"" (handSite P1 0) state:3) (place ""Disc"" (handSite P1 1) state:1) (place ""Disc"" (handSite P1 2) state:2) (place ""Square"" (handSite P1 3) state:3) (place ""Square"" (handSite P1 4) state:1) (place ""Square"" (handSite P1 5) state:2) (place ""Hex"" (handSite P1 6) state:3) (place ""Hex"" (handSite P1 7) state:1) (place ""Hex"" (handSite P1 8) state:2) (place ""Disc"" (handSite P2 0) state:3) (place ""Disc"" (handSite P2 1) state:1) (place ""Disc"" (handSite P2 2) state:2) (place ""Square"" (handSite P2 3) state:3) (place ""Square"" (handSite P2 4) state:1) (place ""Square"" (handSite P2 5) state:2) (place ""Hex"" (handSite P2 6) state:3) (place ""Hex"" (handSite P2 7) state:1) (place ""Hex"" (handSite P2 8) state:2) (set Score Each 9)}) (play (if (> 0 (counter)) (move (from (sites Hand Mover)) (to (sites Board) if:(is Empty (to)))) (if (not (is Prev Mover)) (move (from (sites Hand Mover)) (to (sites Board) if:(and (is Empty (to)) (or (< 0 (count Pieces in:(sites Around (to)))) (< 0 (count Pieces in:(sites (results from:(to) to:(forEach (difference (difference (sites {(% (from) 9) (+ (% (from) 9) 9) (+ (% (from) 9) 18)}) (from)) (sites Empty)) if:(or (= (site) (+ (% (from) 9) 9)) (= (from) (+ (% (from) 9) 9)))) (to)))))))) (then (and (set Var ""LastMove1"" (last To)) (moveAgain)))) (if (= 0 (count Sites in:(sites Pending))) (move (from (union (sites Around (var ""LastMove1"")) (sites (results from:(var ""LastMove1"") to:(forEach (difference (difference (sites {(% (from) 9) (+ (% (from) 9) 9) (+ (% (from) 9) 18)}) (from)) (sites Empty)) if:(or (= (site) (+ (% (from) 9) 9)) (= (from) (+ (% (from) 9) 9)))) (to))))) (to (union (sites LineOfSight Empty Vertex at:(from)) (sites (results from:(from) to:(forEach (intersection (difference (sites {(% (from) 9) (+ (% (from) 9) 9) (+ (% (from) 9) 18)}) (from)) (sites Empty)) if:(or (is Empty (+ (% (from) 9) 9)) (= (from) (+ (% (from) 9) 9)))) (to))))) (then (set Var ""LastMove2"" (last To)))) (do (move (from (sites Pending)) (to (sites Hand Mover) if:(is Empty (to)))) ifAfterwards:(all Sites (sites {(var ""LastMove1"") (var ""LastMove2"")}) if:(is Occupied (site)))) (then (and {(and {(if (or (and {(= (state at:(* (/ (var ""LastMove1"") 3) 3)) (state at:(+ {(* (/ (var ""LastMove1"") 3) 3) 1}))) (= (state at:(* (/ (var ""LastMove1"") 3) 3)) (state at:(+ {(* (/ (var ""LastMove1"") 3) 3) 1 1}))) (!= (what at:(* (/ (var ""LastMove1"") 3) 3)) (what at:(+ {(* (/ (var ""LastMove1"") 3) 3) 1}))) (!= (what at:(* (/ (var ""LastMove1"") 3) 3)) (what at:(+ {(* (/ (var ""LastMove1"") 3) 3) 1 1}))) (!= (what at:(+ {(* (/ (var ""LastMove1"") 3) 3) 1})) (what at:(+ {(* (/ (var ""LastMove1"") 3) 3) 1 1})))}) (and {(= (what at:(* (/ (var ""LastMove1"") 3) 3)) (what at:(+ {(* (/ (var ""LastMove1"") 3) 3) 1}))) (= (what at:(* (/ (var ""LastMove1"") 3) 3)) (what at:(+ {(* (/ (var ""LastMove1"") 3) 3) 1 1}))) (!= (state at:(* (/ (var ""LastMove1"") 3) 3)) (state at:(+ {(* (/ (var ""LastMove1"") 3) 3) 1}))) (!= (state at:(* (/ (var ""LastMove1"") 3) 3)) (state at:(+ {(* (/ (var ""LastMove1"") 3) 3) 1 1}))) (!= (state at:(+ {(* (/ (var ""LastMove1"") 3) 3) 1})) (state Vertex at:(+ {(* (/ (var ""LastMove1"") 3) 3) 1 1})))})) (and {(set Pending (* (/ (var ""LastMove1"") 3) 3)) (set Pending (+ (* (/ (var ""LastMove1"") 3) 3) 1)) (set Pending (+ (* (/ (var ""LastMove1"") 3) 3) 2))})) (if (or (and {(= (state at:(+ (% (var ""LastMove1"") 3) (* (/ (var ""LastMove1"") 9) 9))) (state at:(+ {(+ (% (var ""LastMove1"") 3) (* (/ (var ""LastMove1"") 9) 9)) 3}))) (= (state at:(+ (% (var ""LastMove1"") 3) (* (/ (var ""LastMove1"") 9) 9))) (state at:(+ {(+ (% (var ""LastMove1"") 3) (* (/ (var ""LastMove1"") 9) 9)) 3 3}))) (!= (what at:(+ (% (var ""LastMove1"") 3) (* (/ (var ""LastMove1"") 9) 9))) (what at:(+ {(+ (% (var ""LastMove1"") 3) (* (/ (var ""LastMove1"") 9) 9)) 3}))) (!= (what at:(+ (% (var ""LastMove1"") 3) (* (/ (var ""LastMove1"") 9) 9))) (what at:(+ {(+ (% (var ""LastMove1"") 3) (* (/ (var ""LastMove1"") 9) 9)) 3 3}))) (!= (what at:(+ {(+ (% (var ""LastMove1"") 3) (* (/ (var ""LastMove1"") 9) 9)) 3})) (what at:(+ {(+ (% (var ""LastMove1"") 3) (* (/ (var ""LastMove1"") 9) 9)) 3 3})))}) (and {(= (what at:(+ (% (var ""LastMove1"") 3) (* (/ (var ""LastMove1"") 9) 9))) (what at:(+ {(+ (% (var ""LastMove1"") 3) (* (/ (var ""LastMove1"") 9) 9)) 3}))) (= (what at:(+ (% (var ""LastMove1"") 3) (* (/ (var ""LastMove1"") 9) 9))) (what at:(+ {(+ (% (var ""LastMove1"") 3) (* (/ (var ""LastMove1"") 9) 9)) 3 3}))) (!= (state at:(+ (% (var ""LastMove1"") 3) (* (/ (var ""LastMove1"") 9) 9))) (state at:(+ {(+ (% (var ""LastMove1"") 3) (* (/ (var ""LastMove1"") 9) 9)) 3}))) (!= (state at:(+ (% (var ""LastMove1"") 3) (* (/ (var ""LastMove1"") 9) 9))) (state at:(+ {(+ (% (var ""LastMove1"") 3) (* (/ (var ""LastMove1"") 9) 9)) 3 3}))) (!= (state at:(+ {(+ (% (var ""LastMove1"") 3) (* (/ (var ""LastMove1"") 9) 9)) 3})) (state Vertex at:(+ {(+ (% (var ""LastMove1"") 3) (* (/ (var ""LastMove1"") 9) 9)) 3 3})))})) (and {(set Pending (+ (% (var ""LastMove1"") 3) (* (/ (var ""LastMove1"") 9) 9))) (set Pending (+ (+ (% (var ""LastMove1"") 3) (* (/ (var ""LastMove1"") 9) 9)) 3)) (set Pending (+ (+ (% (var ""LastMove1"") 3) (* (/ (var ""LastMove1"") 9) 9)) 6))})) (if (or (and {(= (state at:(% (var ""LastMove1"") 9)) (state at:(+ {(% (var ""LastMove1"") 9) 9}))) (= (state at:(% (var ""LastMove1"") 9)) (state at:(+ {(% (var ""LastMove1"") 9) 9 9}))) (!= (what at:(% (var ""LastMove1"") 9)) (what at:(+ {(% (var ""LastMove1"") 9) 9}))) (!= (what at:(% (var ""LastMove1"") 9)) (what at:(+ {(% (var ""LastMove1"") 9) 9 9}))) (!= (what at:(+ {(% (var ""LastMove1"") 9) 9})) (what at:(+ {(% (var ""LastMove1"") 9) 9 9})))}) (and {(= (what at:(% (var ""LastMove1"") 9)) (what at:(+ {(% (var ""LastMove1"") 9) 9}))) (= (what at:(% (var ""LastMove1"") 9)) (what at:(+ {(% (var ""LastMove1"") 9) 9 9}))) (!= (state at:(% (var ""LastMove1"") 9)) (state at:(+ {(% (var ""LastMove1"") 9) 9}))) (!= (state at:(% (var ""LastMove1"") 9)) (state at:(+ {(% (var ""LastMove1"") 9) 9 9}))) (!= (state at:(+ {(% (var ""LastMove1"") 9) 9})) (state Vertex at:(+ {(% (var ""LastMove1"") 9) 9 9})))})) (and {(set Pending (% (var ""LastMove1"") 9)) (set Pending (+ (% (var ""LastMove1"") 9) 9)) (set Pending (+ (% (var ""LastMove1"") 9) 18))}))}) (and {(if (or (and {(= (state at:(* (/ (var ""LastMove2"") 3) 3)) (state at:(+ {(* (/ (var ""LastMove2"") 3) 3) 1}))) (= (state at:(* (/ (var ""LastMove2"") 3) 3)) (state at:(+ {(* (/ (var ""LastMove2"") 3) 3) 1 1}))) (!= (what at:(* (/ (var ""LastMove2"") 3) 3)) (what at:(+ {(* (/ (var ""LastMove2"") 3) 3) 1}))) (!= (what at:(* (/ (var ""LastMove2"") 3) 3)) (what at:(+ {(* (/ (var ""LastMove2"") 3) 3) 1 1}))) (!= (what at:(+ {(* (/ (var ""LastMove2"") 3) 3) 1})) (what at:(+ {(* (/ (var ""LastMove2"") 3) 3) 1 1})))}) (and {(= (what at:(* (/ (var ""LastMove2"") 3) 3)) (what at:(+ {(* (/ (var ""LastMove2"") 3) 3) 1}))) (= (what at:(* (/ (var ""LastMove2"") 3) 3)) (what at:(+ {(* (/ (var ""LastMove2"") 3) 3) 1 1}))) (!= (state at:(* (/ (var ""LastMove2"") 3) 3)) (state at:(+ {(* (/ (var ""LastMove2"") 3) 3) 1}))) (!= (state at:(* (/ (var ""LastMove2"") 3) 3)) (state at:(+ {(* (/ (var ""LastMove2"") 3) 3) 1 1}))) (!= (state at:(+ {(* (/ (var ""LastMove2"") 3) 3) 1})) (state Vertex at:(+ {(* (/ (var ""LastMove2"") 3) 3) 1 1})))})) (and {(set Pending (* (/ (var ""LastMove2"") 3) 3)) (set Pending (+ (* (/ (var ""LastMove2"") 3) 3) 1)) (set Pending (+ (* (/ (var ""LastMove2"") 3) 3) 2))})) (if (or (and {(= (state at:(+ (% (var ""LastMove2"") 3) (* (/ (var ""LastMove2"") 9) 9))) (state at:(+ {(+ (% (var ""LastMove2"") 3) (* (/ (var ""LastMove2"") 9) 9)) 3}))) (= (state at:(+ (% (var ""LastMove2"") 3) (* (/ (var ""LastMove2"") 9) 9))) (state at:(+ {(+ (% (var ""LastMove2"") 3) (* (/ (var ""LastMove2"") 9) 9)) 3 3}))) (!= (what at:(+ (% (var ""LastMove2"") 3) (* (/ (var ""LastMove2"") 9) 9))) (what at:(+ {(+ (% (var ""LastMove2"") 3) (* (/ (var ""LastMove2"") 9) 9)) 3}))) (!= (what at:(+ (% (var ""LastMove2"") 3) (* (/ (var ""LastMove2"") 9) 9))) (what at:(+ {(+ (% (var ""LastMove2"") 3) (* (/ (var ""LastMove2"") 9) 9)) 3 3}))) (!= (what at:(+ {(+ (% (var ""LastMove2"") 3) (* (/ (var ""LastMove2"") 9) 9)) 3})) (what at:(+ {(+ (% (var ""LastMove2"") 3) (* (/ (var ""LastMove2"") 9) 9)) 3 3})))}) (and {(= (what at:(+ (% (var ""LastMove2"") 3) (* (/ (var ""LastMove2"") 9) 9))) (what at:(+ {(+ (% (var ""LastMove2"") 3) (* (/ (var ""LastMove2"") 9) 9)) 3}))) (= (what at:(+ (% (var ""LastMove2"") 3) (* (/ (var ""LastMove2"") 9) 9))) (what at:(+ {(+ (% (var ""LastMove2"") 3) (* (/ (var ""LastMove2"") 9) 9)) 3 3}))) (!= (state at:(+ (% (var ""LastMove2"") 3) (* (/ (var ""LastMove2"") 9) 9))) (state at:(+ {(+ (% (var ""LastMove2"") 3) (* (/ (var ""LastMove2"") 9) 9)) 3}))) (!= (state at:(+ (% (var ""LastMove2"") 3) (* (/ (var ""LastMove2"") 9) 9))) (state at:(+ {(+ (% (var ""LastMove2"") 3) (* (/ (var ""LastMove2"") 9) 9)) 3 3}))) (!= (state at:(+ {(+ (% (var ""LastMove2"") 3) (* (/ (var ""LastMove2"") 9) 9)) 3})) (state Vertex at:(+ {(+ (% (var ""LastMove2"") 3) (* (/ (var ""LastMove2"") 9) 9)) 3 3})))})) (and {(set Pending (+ (% (var ""LastMove2"") 3) (* (/ (var ""LastMove2"") 9) 9))) (set Pending (+ (+ (% (var ""LastMove2"") 3) (* (/ (var ""LastMove2"") 9) 9)) 3)) (set Pending (+ (+ (% (var ""LastMove2"") 3) (* (/ (var ""LastMove2"") 9) 9)) 6))})) (if (or (and {(= (state at:(% (var ""LastMove2"") 9)) (state at:(+ {(% (var ""LastMove2"") 9) 9}))) (= (state at:(% (var ""LastMove2"") 9)) (state at:(+ {(% (var ""LastMove2"") 9) 9 9}))) (!= (what at:(% (var ""LastMove2"") 9)) (what at:(+ {(% (var ""LastMove2"") 9) 9}))) (!= (what at:(% (var ""LastMove2"") 9)) (what at:(+ {(% (var ""LastMove2"") 9) 9 9}))) (!= (what at:(+ {(% (var ""LastMove2"") 9) 9})) (what at:(+ {(% (var ""LastMove2"") 9) 9 9})))}) (and {(= (what at:(% (var ""LastMove2"") 9)) (what at:(+ {(% (var ""LastMove2"") 9) 9}))) (= (what at:(% (var ""LastMove2"") 9)) (what at:(+ {(% (var ""LastMove2"") 9) 9 9}))) (!= (state at:(% (var ""LastMove2"") 9)) (state at:(+ {(% (var ""LastMove2"") 9) 9}))) (!= (state at:(% (var ""LastMove2"") 9)) (state at:(+ {(% (var ""LastMove2"") 9) 9 9}))) (!= (state at:(+ {(% (var ""LastMove2"") 9) 9})) (state Vertex at:(+ {(% (var ""LastMove2"") 9) 9 9})))})) (and {(set Pending (% (var ""LastMove2"") 9)) (set Pending (+ (% (var ""LastMove2"") 9) 9)) (set Pending (+ (% (var ""LastMove2"") 9) 18))}))}) (if (or (or {(or (and {(= (state at:(* (/ (var ""LastMove1"") 3) 3)) (state at:(+ {(* (/ (var ""LastMove1"") 3) 3) 1}))) (= (state at:(* (/ (var ""LastMove1"") 3) 3)) (state at:(+ {(* (/ (var ""LastMove1"") 3) 3) 1 1}))) (!= (what at:(* (/ (var ""LastMove1"") 3) 3)) (what at:(+ {(* (/ (var ""LastMove1"") 3) 3) 1}))) (!= (what at:(* (/ (var ""LastMove1"") 3) 3)) (what at:(+ {(* (/ (var ""LastMove1"") 3) 3) 1 1}))) (!= (what at:(+ {(* (/ (var ""LastMove1"") 3) 3) 1})) (what at:(+ {(* (/ (var ""LastMove1"") 3) 3) 1 1})))}) (and {(= (what at:(* (/ (var ""LastMove1"") 3) 3)) (what at:(+ {(* (/ (var ""LastMove1"") 3) 3) 1}))) (= (what at:(* (/ (var ""LastMove1"") 3) 3)) (what at:(+ {(* (/ (var ""LastMove1"") 3) 3) 1 1}))) (!= (state at:(* (/ (var ""LastMove1"") 3) 3)) (state at:(+ {(* (/ (var ""LastMove1"") 3) 3) 1}))) (!= (state at:(* (/ (var ""LastMove1"") 3) 3)) (state at:(+ {(* (/ (var ""LastMove1"") 3) 3) 1 1}))) (!= (state at:(+ {(* (/ (var ""LastMove1"") 3) 3) 1})) (state Vertex at:(+ {(* (/ (var ""LastMove1"") 3) 3) 1 1})))})) (or (and {(= (state at:(+ (% (var ""LastMove1"") 3) (* (/ (var ""LastMove1"") 9) 9))) (state at:(+ {(+ (% (var ""LastMove1"") 3) (* (/ (var ""LastMove1"") 9) 9)) 3}))) (= (state at:(+ (% (var ""LastMove1"") 3) (* (/ (var ""LastMove1"") 9) 9))) (state at:(+ {(+ (% (var ""LastMove1"") 3) (* (/ (var ""LastMove1"") 9) 9)) 3 3}))) (!= (what at:(+ (% (var ""LastMove1"") 3) (* (/ (var ""LastMove1"") 9) 9))) (what at:(+ {(+ (% (var ""LastMove1"") 3) (* (/ (var ""LastMove1"") 9) 9)) 3}))) (!= (what at:(+ (% (var ""LastMove1"") 3) (* (/ (var ""LastMove1"") 9) 9))) (what at:(+ {(+ (% (var ""LastMove1"") 3) (* (/ (var ""LastMove1"") 9) 9)) 3 3}))) (!= (what at:(+ {(+ (% (var ""LastMove1"") 3) (* (/ (var ""LastMove1"") 9) 9)) 3})) (what at:(+ {(+ (% (var ""LastMove1"") 3) (* (/ (var ""LastMove1"") 9) 9)) 3 3})))}) (and {(= (what at:(+ (% (var ""LastMove1"") 3) (* (/ (var ""LastMove1"") 9) 9))) (what at:(+ {(+ (% (var ""LastMove1"") 3) (* (/ (var ""LastMove1"") 9) 9)) 3}))) (= (what at:(+ (% (var ""LastMove1"") 3) (* (/ (var ""LastMove1"") 9) 9))) (what at:(+ {(+ (% (var ""LastMove1"") 3) (* (/ (var ""LastMove1"") 9) 9)) 3 3}))) (!= (state at:(+ (% (var ""LastMove1"") 3) (* (/ (var ""LastMove1"") 9) 9))) (state at:(+ {(+ (% (var ""LastMove1"") 3) (* (/ (var ""LastMove1"") 9) 9)) 3}))) (!= (state at:(+ (% (var ""LastMove1"") 3) (* (/ (var ""LastMove1"") 9) 9))) (state at:(+ {(+ (% (var ""LastMove1"") 3) (* (/ (var ""LastMove1"") 9) 9)) 3 3}))) (!= (state at:(+ {(+ (% (var ""LastMove1"") 3) (* (/ (var ""LastMove1"") 9) 9)) 3})) (state Vertex at:(+ {(+ (% (var ""LastMove1"") 3) (* (/ (var ""LastMove1"") 9) 9)) 3 3})))})) (or (and {(= (state at:(% (var ""LastMove1"") 9)) (state at:(+ {(% (var ""LastMove1"") 9) 9}))) (= (state at:(% (var ""LastMove1"") 9)) (state at:(+ {(% (var ""LastMove1"") 9) 9 9}))) (!= (what at:(% (var ""LastMove1"") 9)) (what at:(+ {(% (var ""LastMove1"") 9) 9}))) (!= (what at:(% (var ""LastMove1"") 9)) (what at:(+ {(% (var ""LastMove1"") 9) 9 9}))) (!= (what at:(+ {(% (var ""LastMove1"") 9) 9})) (what at:(+ {(% (var ""LastMove1"") 9) 9 9})))}) (and {(= (what at:(% (var ""LastMove1"") 9)) (what at:(+ {(% (var ""LastMove1"") 9) 9}))) (= (what at:(% (var ""LastMove1"") 9)) (what at:(+ {(% (var ""LastMove1"") 9) 9 9}))) (!= (state at:(% (var ""LastMove1"") 9)) (state at:(+ {(% (var ""LastMove1"") 9) 9}))) (!= (state at:(% (var ""LastMove1"") 9)) (state at:(+ {(% (var ""LastMove1"") 9) 9 9}))) (!= (state at:(+ {(% (var ""LastMove1"") 9) 9})) (state Vertex at:(+ {(% (var ""LastMove1"") 9) 9 9})))}))}) (or {(or (and {(= (state at:(* (/ (var ""LastMove2"") 3) 3)) (state at:(+ {(* (/ (var ""LastMove2"") 3) 3) 1}))) (= (state at:(* (/ (var ""LastMove2"") 3) 3)) (state at:(+ {(* (/ (var ""LastMove2"") 3) 3) 1 1}))) (!= (what at:(* (/ (var ""LastMove2"") 3) 3)) (what at:(+ {(* (/ (var ""LastMove2"") 3) 3) 1}))) (!= (what at:(* (/ (var ""LastMove2"") 3) 3)) (what at:(+ {(* (/ (var ""LastMove2"") 3) 3) 1 1}))) (!= (what at:(+ {(* (/ (var ""LastMove2"") 3) 3) 1})) (what at:(+ {(* (/ (var ""LastMove2"") 3) 3) 1 1})))}) (and {(= (what at:(* (/ (var ""LastMove2"") 3) 3)) (what at:(+ {(* (/ (var ""LastMove2"") 3) 3) 1}))) (= (what at:(* (/ (var ""LastMove2"") 3) 3)) (what at:(+ {(* (/ (var ""LastMove2"") 3) 3) 1 1}))) (!= (state at:(* (/ (var ""LastMove2"") 3) 3)) (state at:(+ {(* (/ (var ""LastMove2"") 3) 3) 1}))) (!= (state at:(* (/ (var ""LastMove2"") 3) 3)) (state at:(+ {(* (/ (var ""LastMove2"") 3) 3) 1 1}))) (!= (state at:(+ {(* (/ (var ""LastMove2"") 3) 3) 1})) (state Vertex at:(+ {(* (/ (var ""LastMove2"") 3) 3) 1 1})))})) (or (and {(= (state at:(+ (% (var ""LastMove2"") 3) (* (/ (var ""LastMove2"") 9) 9))) (state at:(+ {(+ (% (var ""LastMove2"") 3) (* (/ (var ""LastMove2"") 9) 9)) 3}))) (= (state at:(+ (% (var ""LastMove2"") 3) (* (/ (var ""LastMove2"") 9) 9))) (state at:(+ {(+ (% (var ""LastMove2"") 3) (* (/ (var ""LastMove2"") 9) 9)) 3 3}))) (!= (what at:(+ (% (var ""LastMove2"") 3) (* (/ (var ""LastMove2"") 9) 9))) (what at:(+ {(+ (% (var ""LastMove2"") 3) (* (/ (var ""LastMove2"") 9) 9)) 3}))) (!= (what at:(+ (% (var ""LastMove2"") 3) (* (/ (var ""LastMove2"") 9) 9))) (what at:(+ {(+ (% (var ""LastMove2"") 3) (* (/ (var ""LastMove2"") 9) 9)) 3 3}))) (!= (what at:(+ {(+ (% (var ""LastMove2"") 3) (* (/ (var ""LastMove2"") 9) 9)) 3})) (what at:(+ {(+ (% (var ""LastMove2"") 3) (* (/ (var ""LastMove2"") 9) 9)) 3 3})))}) (and {(= (what at:(+ (% (var ""LastMove2"") 3) (* (/ (var ""LastMove2"") 9) 9))) (what at:(+ {(+ (% (var ""LastMove2"") 3) (* (/ (var ""LastMove2"") 9) 9)) 3}))) (= (what at:(+ (% (var ""LastMove2"") 3) (* (/ (var ""LastMove2"") 9) 9))) (what at:(+ {(+ (% (var ""LastMove2"") 3) (* (/ (var ""LastMove2"") 9) 9)) 3 3}))) (!= (state at:(+ (% (var ""LastMove2"") 3) (* (/ (var ""LastMove2"") 9) 9))) (state at:(+ {(+ (% (var ""LastMove2"") 3) (* (/ (var ""LastMove2"") 9) 9)) 3}))) (!= (state at:(+ (% (var ""LastMove2"") 3) (* (/ (var ""LastMove2"") 9) 9))) (state at:(+ {(+ (% (var ""LastMove2"") 3) (* (/ (var ""LastMove2"") 9) 9)) 3 3}))) (!= (state at:(+ {(+ (% (var ""LastMove2"") 3) (* (/ (var ""LastMove2"") 9) 9)) 3})) (state Vertex at:(+ {(+ (% (var ""LastMove2"") 3) (* (/ (var ""LastMove2"") 9) 9)) 3 3})))})) (or (and {(= (state at:(% (var ""LastMove2"") 9)) (state at:(+ {(% (var ""LastMove2"") 9) 9}))) (= (state at:(% (var ""LastMove2"") 9)) (state at:(+ {(% (var ""LastMove2"") 9) 9 9}))) (!= (what at:(% (var ""LastMove2"") 9)) (what at:(+ {(% (var ""LastMove2"") 9) 9}))) (!= (what at:(% (var ""LastMove2"") 9)) (what at:(+ {(% (var ""LastMove2"") 9) 9 9}))) (!= (what at:(+ {(% (var ""LastMove2"") 9) 9})) (what at:(+ {(% (var ""LastMove2"") 9) 9 9})))}) (and {(= (what at:(% (var ""LastMove2"") 9)) (what at:(+ {(% (var ""LastMove2"") 9) 9}))) (= (what at:(% (var ""LastMove2"") 9)) (what at:(+ {(% (var ""LastMove2"") 9) 9 9}))) (!= (state at:(% (var ""LastMove2"") 9)) (state at:(+ {(% (var ""LastMove2"") 9) 9}))) (!= (state at:(% (var ""LastMove2"") 9)) (state at:(+ {(% (var ""LastMove2"") 9) 9 9}))) (!= (state at:(+ {(% (var ""LastMove2"") 9) 9})) (state Vertex at:(+ {(% (var ""LastMove2"") 9) 9 9})))}))})) (moveAgain))})))) (then (set Score Mover (count Pieces in:(sites Hand Mover)))))) (end (if (no Moves Mover) (result Mover Loss)))))" "DROP - On each turn, each player picks any stone of either color, and changes its color. Then, like in Othello, flips all stones of the other color that are between that stone and the next of same color, in any orthogonal or diagonal direction. GOAL - One player wins if it is able to make an horizontal 8 in-a-row of stones of any color. The other player wins by making a vertical 8 in-a-row. If, after a move, there are one horizontal and one vertical 8 in-a-row, the player that made the move losses.","(game ""Minefield"" (players 2) (equipment {(board (square 8)) (piece ""Disc"" Neutral (flips 1 2))}) (rules (start {(place ""Disc0"" (sites Phase 0) state:1) (place ""Disc0"" (sites Phase 1) state:2)}) (play (move Select (from (sites Board)) (then (flip (last To) (then (custodial (from (last To)) Adjacent (between if:(!= (state at:(between)) (state at:(last To))) (apply (allCombinations (add (piece ""Disc0"" state:(mover)) (to (last To))) (flip (between))))) (to if:(= (state at:(to)) (state at:(last To)))))))))) (end {(if (and (!= 0 (count Sites in:(forEach (sites Column 0) if:(or (all Sites (sites Row (row of:(site))) if:(= 1 (state at:(site)))) (all Sites (sites Row (row of:(site))) if:(= 2 (state at:(site)))))))) (!= 0 (count Sites in:(forEach (sites Row 0) if:(or (all Sites (sites Column (column of:(site))) if:(= 1 (state at:(site)))) (all Sites (sites Column (column of:(site))) if:(= 2 (state at:(site))))))))) (result Mover Loss)) (if (!= 0 (count Sites in:(forEach (sites Column 0) if:(or (all Sites (sites Row (row of:(site))) if:(= 1 (state at:(site)))) (all Sites (sites Row (row of:(site))) if:(= 2 (state at:(site)))))))) (result P1 Win)) (if (!= 0 (count Sites in:(forEach (sites Row 0) if:(or (all Sites (sites Column (column of:(site))) if:(= 1 (state at:(site)))) (all Sites (sites Column (column of:(site))) if:(= 2 (state at:(site)))))))) (result P2 Win))})))","###Description DROP - On each turn, each player picks any stone of either color, and changes its color. Then, like in Othello, flips all stones of the other color that are between that stone and the next of same color, in any orthogonal or diagonal direction. GOAL - One player wins if it is able to make an horizontal 8 in-a-row of stones of any color. The other player wins by making a vertical 8 in-a-row. If, after a move, there are one horizontal and one vertical 8 in-a-row, the player that made the move losses. @@ -3034,11 +2929,6 @@ The game starts with the board empty. Order plays first, then turns alternate. O ###Ludii (game ""Order and Chaos"" (players 2) (equipment {(board (square 6)) (piece ""Disc"" Shared) (piece ""Cross"" Shared) (hand Shared size:2)}) (rules (start {(place ""Disc"" (handSite Shared)) (place ""Cross"" (handSite Shared 1))}) (play (move (from (sites Hand Shared)) (to (sites Empty)) copy:True)) (end {(if (is Line 5) (result P1 Win)) (if (no Moves Next) (result P2 Win))})))" -"After placing a marble, the player has to twist one of the grids by 90°, thus changing the board after every turn. The first player to get five marbles in a row wins. In case of both players having five in a row in the same time, the game is a draw.","(game ""Pentago"" (players 2) (equipment {(board (square 6) use:Vertex) (piece ""Ball"" Each) (regions ""BottomLeft"" (expand origin:(coord ""B2"") All)) (regions ""BottomRight"" (expand origin:(coord ""E2"") All)) (regions ""TopLeft"" (expand origin:(coord ""B5"") All)) (regions ""TopRight"" (expand origin:(coord ""E5"") All))}) (rules phases:{(phase ""Place"" (play (move Add (to (sites Empty)) (then (moveAgain)))) (end (if (is Line 5 All) (result Mover Win))) (nextPhase Mover ""Rotate"")) (phase ""Rotate"" (play (or (move Select (from (sites {""B2"" ""B5"" ""E2"" ""E5""})) (then (if (= (last To) (coord ""E5"")) (do (and {(set Var ""TopLeft"" (what at:(coord ""D6""))) (set Var ""TopRight"" (what at:(coord ""F6""))) (set Var ""BottomRight"" (what at:(coord ""F4""))) (set Var ""BottomLeft"" (what at:(coord ""D4""))) (set Var ""Bottom"" (what at:(coord ""E4""))) (set Var ""Left"" (what at:(coord ""D5""))) (set Var ""Top"" (what at:(coord ""E6""))) (set Var ""Right"" (what at:(coord ""F5"")))}) next:(and {(if (!= 0 (var ""TopLeft"")) (remove (coord ""D6""))) (if (!= 0 (var ""TopRight"")) (remove (coord ""F6""))) (if (!= 0 (var ""BottomRight"")) (remove (coord ""F4""))) (if (!= 0 (var ""BottomLeft"")) (remove (coord ""D4""))) (if (!= 0 (var ""Bottom"")) (remove (coord ""E4""))) (if (!= 0 (var ""Left"")) (remove (coord ""D5""))) (if (!= 0 (var ""Top"")) (remove (coord ""E6""))) (if (!= 0 (var ""Right"")) (remove (coord ""F5""))) (if (!= 0 (var ""TopLeft"")) (add (piece (var ""TopLeft"")) (to (coord ""F6"")))) (if (!= 0 (var ""TopRight"")) (add (piece (var ""TopRight"")) (to (coord ""F4"")))) (if (!= 0 (var ""BottomRight"")) (add (piece (var ""BottomRight"")) (to (coord ""D4"")))) (if (!= 0 (var ""BottomLeft"")) (add (piece (var ""BottomLeft"")) (to (coord ""D6"")))) (if (!= 0 (var ""Bottom"")) (add (piece (var ""Bottom"")) (to (coord ""D5"")))) (if (!= 0 (var ""Left"")) (add (piece (var ""Left"")) (to (coord ""E6"")))) (if (!= 0 (var ""Top"")) (add (piece (var ""Top"")) (to (coord ""F5"")))) (if (!= 0 (var ""Right"")) (add (piece (var ""Right"")) (to (coord ""E4""))))})) (if (= (last To) (coord ""B5"")) (do (and {(set Var ""TopLeft"" (what at:(coord ""A6""))) (set Var ""TopRight"" (what at:(coord ""C6""))) (set Var ""BottomRight"" (what at:(coord ""C4""))) (set Var ""BottomLeft"" (what at:(coord ""A4""))) (set Var ""Bottom"" (what at:(coord ""B4""))) (set Var ""Left"" (what at:(coord ""A5""))) (set Var ""Top"" (what at:(coord ""B6""))) (set Var ""Right"" (what at:(coord ""C5"")))}) next:(and {(if (!= 0 (var ""TopLeft"")) (remove (coord ""A6""))) (if (!= 0 (var ""TopRight"")) (remove (coord ""C6""))) (if (!= 0 (var ""BottomRight"")) (remove (coord ""C4""))) (if (!= 0 (var ""BottomLeft"")) (remove (coord ""A4""))) (if (!= 0 (var ""Bottom"")) (remove (coord ""B4""))) (if (!= 0 (var ""Left"")) (remove (coord ""A5""))) (if (!= 0 (var ""Top"")) (remove (coord ""B6""))) (if (!= 0 (var ""Right"")) (remove (coord ""C5""))) (if (!= 0 (var ""TopLeft"")) (add (piece (var ""TopLeft"")) (to (coord ""C6"")))) (if (!= 0 (var ""TopRight"")) (add (piece (var ""TopRight"")) (to (coord ""C4"")))) (if (!= 0 (var ""BottomRight"")) (add (piece (var ""BottomRight"")) (to (coord ""A4"")))) (if (!= 0 (var ""BottomLeft"")) (add (piece (var ""BottomLeft"")) (to (coord ""A6"")))) (if (!= 0 (var ""Bottom"")) (add (piece (var ""Bottom"")) (to (coord ""A5"")))) (if (!= 0 (var ""Left"")) (add (piece (var ""Left"")) (to (coord ""B6"")))) (if (!= 0 (var ""Top"")) (add (piece (var ""Top"")) (to (coord ""C5"")))) (if (!= 0 (var ""Right"")) (add (piece (var ""Right"")) (to (coord ""B4""))))})) (if (= (last To) (coord ""B2"")) (do (and {(set Var ""TopLeft"" (what at:(coord ""A3""))) (set Var ""TopRight"" (what at:(coord ""C3""))) (set Var ""BottomRight"" (what at:(coord ""C1""))) (set Var ""BottomLeft"" (what at:(coord ""A1""))) (set Var ""Bottom"" (what at:(coord ""B1""))) (set Var ""Left"" (what at:(coord ""A2""))) (set Var ""Top"" (what at:(coord ""B3""))) (set Var ""Right"" (what at:(coord ""C2"")))}) next:(and {(if (!= 0 (var ""TopLeft"")) (remove (coord ""A3""))) (if (!= 0 (var ""TopRight"")) (remove (coord ""C3""))) (if (!= 0 (var ""BottomRight"")) (remove (coord ""C1""))) (if (!= 0 (var ""BottomLeft"")) (remove (coord ""A1""))) (if (!= 0 (var ""Bottom"")) (remove (coord ""B1""))) (if (!= 0 (var ""Left"")) (remove (coord ""A2""))) (if (!= 0 (var ""Top"")) (remove (coord ""B3""))) (if (!= 0 (var ""Right"")) (remove (coord ""C2""))) (if (!= 0 (var ""TopLeft"")) (add (piece (var ""TopLeft"")) (to (coord ""C3"")))) (if (!= 0 (var ""TopRight"")) (add (piece (var ""TopRight"")) (to (coord ""C1"")))) (if (!= 0 (var ""BottomRight"")) (add (piece (var ""BottomRight"")) (to (coord ""A1"")))) (if (!= 0 (var ""BottomLeft"")) (add (piece (var ""BottomLeft"")) (to (coord ""A3"")))) (if (!= 0 (var ""Bottom"")) (add (piece (var ""Bottom"")) (to (coord ""A2"")))) (if (!= 0 (var ""Left"")) (add (piece (var ""Left"")) (to (coord ""B3"")))) (if (!= 0 (var ""Top"")) (add (piece (var ""Top"")) (to (coord ""C2"")))) (if (!= 0 (var ""Right"")) (add (piece (var ""Right"")) (to (coord ""B1""))))})) (do (and {(set Var ""TopLeft"" (what at:(coord ""D3""))) (set Var ""TopRight"" (what at:(coord ""F3""))) (set Var ""BottomRight"" (what at:(coord ""F1""))) (set Var ""BottomLeft"" (what at:(coord ""D1""))) (set Var ""Bottom"" (what at:(coord ""E1""))) (set Var ""Left"" (what at:(coord ""D2""))) (set Var ""Top"" (what at:(coord ""E3""))) (set Var ""Right"" (what at:(coord ""F2"")))}) next:(and {(if (!= 0 (var ""TopLeft"")) (remove (coord ""D3""))) (if (!= 0 (var ""TopRight"")) (remove (coord ""F3""))) (if (!= 0 (var ""BottomRight"")) (remove (coord ""F1""))) (if (!= 0 (var ""BottomLeft"")) (remove (coord ""D1""))) (if (!= 0 (var ""Bottom"")) (remove (coord ""E1""))) (if (!= 0 (var ""Left"")) (remove (coord ""D2""))) (if (!= 0 (var ""Top"")) (remove (coord ""E3""))) (if (!= 0 (var ""Right"")) (remove (coord ""F2""))) (if (!= 0 (var ""TopLeft"")) (add (piece (var ""TopLeft"")) (to (coord ""F3"")))) (if (!= 0 (var ""TopRight"")) (add (piece (var ""TopRight"")) (to (coord ""F1"")))) (if (!= 0 (var ""BottomRight"")) (add (piece (var ""BottomRight"")) (to (coord ""D1"")))) (if (!= 0 (var ""BottomLeft"")) (add (piece (var ""BottomLeft"")) (to (coord ""D3"")))) (if (!= 0 (var ""Bottom"")) (add (piece (var ""Bottom"")) (to (coord ""D2"")))) (if (!= 0 (var ""Left"")) (add (piece (var ""Left"")) (to (coord ""E3"")))) (if (!= 0 (var ""Top"")) (add (piece (var ""Top"")) (to (coord ""F2"")))) (if (!= 0 (var ""Right"")) (add (piece (var ""Right"")) (to (coord ""E1""))))}))))))) (move Select (from (sites {""B2"" ""B5"" ""E2"" ""E5""})) (then (if (= (last To) (coord ""E5"")) (do (and {(set Var ""TopLeft"" (what at:(coord ""D6""))) (set Var ""TopRight"" (what at:(coord ""F6""))) (set Var ""BottomRight"" (what at:(coord ""F4""))) (set Var ""BottomLeft"" (what at:(coord ""D4""))) (set Var ""Bottom"" (what at:(coord ""E4""))) (set Var ""Left"" (what at:(coord ""D5""))) (set Var ""Top"" (what at:(coord ""E6""))) (set Var ""Right"" (what at:(coord ""F5"")))}) next:(and {(if (!= 0 (var ""TopLeft"")) (remove (coord ""D6""))) (if (!= 0 (var ""TopRight"")) (remove (coord ""F6""))) (if (!= 0 (var ""BottomRight"")) (remove (coord ""F4""))) (if (!= 0 (var ""BottomLeft"")) (remove (coord ""D4""))) (if (!= 0 (var ""Bottom"")) (remove (coord ""E4""))) (if (!= 0 (var ""Left"")) (remove (coord ""D5""))) (if (!= 0 (var ""Top"")) (remove (coord ""E6""))) (if (!= 0 (var ""Right"")) (remove (coord ""F5""))) (if (!= 0 (var ""TopLeft"")) (add (piece (var ""TopLeft"")) (to (coord ""D4"")))) (if (!= 0 (var ""TopRight"")) (add (piece (var ""TopRight"")) (to (coord ""D6"")))) (if (!= 0 (var ""BottomRight"")) (add (piece (var ""BottomRight"")) (to (coord ""F6"")))) (if (!= 0 (var ""BottomLeft"")) (add (piece (var ""BottomLeft"")) (to (coord ""F4"")))) (if (!= 0 (var ""Bottom"")) (add (piece (var ""Bottom"")) (to (coord ""F5"")))) (if (!= 0 (var ""Left"")) (add (piece (var ""Left"")) (to (coord ""E4"")))) (if (!= 0 (var ""Top"")) (add (piece (var ""Top"")) (to (coord ""D5"")))) (if (!= 0 (var ""Right"")) (add (piece (var ""Right"")) (to (coord ""E6""))))})) (if (= (last To) (coord ""B5"")) (do (and {(set Var ""TopLeft"" (what at:(coord ""A6""))) (set Var ""TopRight"" (what at:(coord ""C6""))) (set Var ""BottomRight"" (what at:(coord ""C4""))) (set Var ""BottomLeft"" (what at:(coord ""A4""))) (set Var ""Bottom"" (what at:(coord ""B4""))) (set Var ""Left"" (what at:(coord ""A5""))) (set Var ""Top"" (what at:(coord ""B6""))) (set Var ""Right"" (what at:(coord ""C5"")))}) next:(and {(if (!= 0 (var ""TopLeft"")) (remove (coord ""A6""))) (if (!= 0 (var ""TopRight"")) (remove (coord ""C6""))) (if (!= 0 (var ""BottomRight"")) (remove (coord ""C4""))) (if (!= 0 (var ""BottomLeft"")) (remove (coord ""A4""))) (if (!= 0 (var ""Bottom"")) (remove (coord ""B4""))) (if (!= 0 (var ""Left"")) (remove (coord ""A5""))) (if (!= 0 (var ""Top"")) (remove (coord ""B6""))) (if (!= 0 (var ""Right"")) (remove (coord ""C5""))) (if (!= 0 (var ""TopLeft"")) (add (piece (var ""TopLeft"")) (to (coord ""A4"")))) (if (!= 0 (var ""TopRight"")) (add (piece (var ""TopRight"")) (to (coord ""A6"")))) (if (!= 0 (var ""BottomRight"")) (add (piece (var ""BottomRight"")) (to (coord ""C6"")))) (if (!= 0 (var ""BottomLeft"")) (add (piece (var ""BottomLeft"")) (to (coord ""C4"")))) (if (!= 0 (var ""Bottom"")) (add (piece (var ""Bottom"")) (to (coord ""C5"")))) (if (!= 0 (var ""Left"")) (add (piece (var ""Left"")) (to (coord ""B4"")))) (if (!= 0 (var ""Top"")) (add (piece (var ""Top"")) (to (coord ""A5"")))) (if (!= 0 (var ""Right"")) (add (piece (var ""Right"")) (to (coord ""B6""))))})) (if (= (last To) (coord ""B2"")) (do (and {(set Var ""TopLeft"" (what at:(coord ""A3""))) (set Var ""TopRight"" (what at:(coord ""C3""))) (set Var ""BottomRight"" (what at:(coord ""C1""))) (set Var ""BottomLeft"" (what at:(coord ""A1""))) (set Var ""Bottom"" (what at:(coord ""B1""))) (set Var ""Left"" (what at:(coord ""A2""))) (set Var ""Top"" (what at:(coord ""B3""))) (set Var ""Right"" (what at:(coord ""C2"")))}) next:(and {(if (!= 0 (var ""TopLeft"")) (remove (coord ""A3""))) (if (!= 0 (var ""TopRight"")) (remove (coord ""C3""))) (if (!= 0 (var ""BottomRight"")) (remove (coord ""C1""))) (if (!= 0 (var ""BottomLeft"")) (remove (coord ""A1""))) (if (!= 0 (var ""Bottom"")) (remove (coord ""B1""))) (if (!= 0 (var ""Left"")) (remove (coord ""A2""))) (if (!= 0 (var ""Top"")) (remove (coord ""B3""))) (if (!= 0 (var ""Right"")) (remove (coord ""C2""))) (if (!= 0 (var ""TopLeft"")) (add (piece (var ""TopLeft"")) (to (coord ""A1"")))) (if (!= 0 (var ""TopRight"")) (add (piece (var ""TopRight"")) (to (coord ""A3"")))) (if (!= 0 (var ""BottomRight"")) (add (piece (var ""BottomRight"")) (to (coord ""C3"")))) (if (!= 0 (var ""BottomLeft"")) (add (piece (var ""BottomLeft"")) (to (coord ""C1"")))) (if (!= 0 (var ""Bottom"")) (add (piece (var ""Bottom"")) (to (coord ""C2"")))) (if (!= 0 (var ""Left"")) (add (piece (var ""Left"")) (to (coord ""B1"")))) (if (!= 0 (var ""Top"")) (add (piece (var ""Top"")) (to (coord ""A2"")))) (if (!= 0 (var ""Right"")) (add (piece (var ""Right"")) (to (coord ""B3""))))})) (do (and {(set Var ""TopLeft"" (what at:(coord ""D3""))) (set Var ""TopRight"" (what at:(coord ""F3""))) (set Var ""BottomRight"" (what at:(coord ""F1""))) (set Var ""BottomLeft"" (what at:(coord ""D1""))) (set Var ""Bottom"" (what at:(coord ""E1""))) (set Var ""Left"" (what at:(coord ""D2""))) (set Var ""Top"" (what at:(coord ""E3""))) (set Var ""Right"" (what at:(coord ""F2"")))}) next:(and {(if (!= 0 (var ""TopLeft"")) (remove (coord ""D3""))) (if (!= 0 (var ""TopRight"")) (remove (coord ""F3""))) (if (!= 0 (var ""BottomRight"")) (remove (coord ""F1""))) (if (!= 0 (var ""BottomLeft"")) (remove (coord ""D1""))) (if (!= 0 (var ""Bottom"")) (remove (coord ""E1""))) (if (!= 0 (var ""Left"")) (remove (coord ""D2""))) (if (!= 0 (var ""Top"")) (remove (coord ""E3""))) (if (!= 0 (var ""Right"")) (remove (coord ""F2""))) (if (!= 0 (var ""TopLeft"")) (add (piece (var ""TopLeft"")) (to (coord ""D1"")))) (if (!= 0 (var ""TopRight"")) (add (piece (var ""TopRight"")) (to (coord ""D3"")))) (if (!= 0 (var ""BottomRight"")) (add (piece (var ""BottomRight"")) (to (coord ""F3"")))) (if (!= 0 (var ""BottomLeft"")) (add (piece (var ""BottomLeft"")) (to (coord ""F1"")))) (if (!= 0 (var ""Bottom"")) (add (piece (var ""Bottom"")) (to (coord ""F2"")))) (if (!= 0 (var ""Left"")) (add (piece (var ""Left"")) (to (coord ""E1"")))) (if (!= 0 (var ""Top"")) (add (piece (var ""Top"")) (to (coord ""D2"")))) (if (!= 0 (var ""Right"")) (add (piece (var ""Right"")) (to (coord ""E3""))))}))))))))) (end {(if (and (is Line 5 All throughAny:(if (is In (last To) (sites ""BottomLeft"")) (intersection (sites Occupied by:Mover) (sites ""BottomLeft"")) (if (is In (last To) (sites ""BottomRight"")) (intersection (sites Occupied by:Mover) (sites ""BottomRight"")) (if (is In (last To) (sites ""TopLeft"")) (intersection (sites Occupied by:Mover) (sites ""TopLeft"")) (intersection (sites Occupied by:Mover) (sites ""TopRight"")))))) (is Line 5 All throughAny:(if (is In (last To) (sites ""BottomLeft"")) (intersection (sites Occupied by:Next) (sites ""BottomLeft"")) (if (is In (last To) (sites ""BottomRight"")) (intersection (sites Occupied by:Next) (sites ""BottomRight"")) (if (is In (last To) (sites ""TopLeft"")) (intersection (sites Occupied by:Next) (sites ""TopLeft"")) (intersection (sites Occupied by:Next) (sites ""TopRight""))))))) (result Mover Draw)) (if (is Line 5 All throughAny:(if (is In (last To) (sites ""BottomLeft"")) (intersection (sites Occupied by:Mover) (sites ""BottomLeft"")) (if (is In (last To) (sites ""BottomRight"")) (intersection (sites Occupied by:Mover) (sites ""BottomRight"")) (if (is In (last To) (sites ""TopLeft"")) (intersection (sites Occupied by:Mover) (sites ""TopLeft"")) (intersection (sites Occupied by:Mover) (sites ""TopRight"")))))) (result Mover Win)) (if (is Line 5 All throughAny:(if (is In (last To) (sites ""BottomLeft"")) (intersection (sites Occupied by:Next) (sites ""BottomLeft"")) (if (is In (last To) (sites ""BottomRight"")) (intersection (sites Occupied by:Next) (sites ""BottomRight"")) (if (is In (last To) (sites ""TopLeft"")) (intersection (sites Occupied by:Next) (sites ""TopLeft"")) (intersection (sites Occupied by:Next) (sites ""TopRight"")))))) (result Next Win))}) (nextPhase Mover ""Place""))}))","###Description -After placing a marble, the player has to twist one of the grids by 90°, thus changing the board after every turn. The first player to get five marbles in a row wins. In case of both players having five in a row in the same time, the game is a draw. - -###Ludii -(game ""Pentago"" (players 2) (equipment {(board (square 6) use:Vertex) (piece ""Ball"" Each) (regions ""BottomLeft"" (expand origin:(coord ""B2"") All)) (regions ""BottomRight"" (expand origin:(coord ""E2"") All)) (regions ""TopLeft"" (expand origin:(coord ""B5"") All)) (regions ""TopRight"" (expand origin:(coord ""E5"") All))}) (rules phases:{(phase ""Place"" (play (move Add (to (sites Empty)) (then (moveAgain)))) (end (if (is Line 5 All) (result Mover Win))) (nextPhase Mover ""Rotate"")) (phase ""Rotate"" (play (or (move Select (from (sites {""B2"" ""B5"" ""E2"" ""E5""})) (then (if (= (last To) (coord ""E5"")) (do (and {(set Var ""TopLeft"" (what at:(coord ""D6""))) (set Var ""TopRight"" (what at:(coord ""F6""))) (set Var ""BottomRight"" (what at:(coord ""F4""))) (set Var ""BottomLeft"" (what at:(coord ""D4""))) (set Var ""Bottom"" (what at:(coord ""E4""))) (set Var ""Left"" (what at:(coord ""D5""))) (set Var ""Top"" (what at:(coord ""E6""))) (set Var ""Right"" (what at:(coord ""F5"")))}) next:(and {(if (!= 0 (var ""TopLeft"")) (remove (coord ""D6""))) (if (!= 0 (var ""TopRight"")) (remove (coord ""F6""))) (if (!= 0 (var ""BottomRight"")) (remove (coord ""F4""))) (if (!= 0 (var ""BottomLeft"")) (remove (coord ""D4""))) (if (!= 0 (var ""Bottom"")) (remove (coord ""E4""))) (if (!= 0 (var ""Left"")) (remove (coord ""D5""))) (if (!= 0 (var ""Top"")) (remove (coord ""E6""))) (if (!= 0 (var ""Right"")) (remove (coord ""F5""))) (if (!= 0 (var ""TopLeft"")) (add (piece (var ""TopLeft"")) (to (coord ""F6"")))) (if (!= 0 (var ""TopRight"")) (add (piece (var ""TopRight"")) (to (coord ""F4"")))) (if (!= 0 (var ""BottomRight"")) (add (piece (var ""BottomRight"")) (to (coord ""D4"")))) (if (!= 0 (var ""BottomLeft"")) (add (piece (var ""BottomLeft"")) (to (coord ""D6"")))) (if (!= 0 (var ""Bottom"")) (add (piece (var ""Bottom"")) (to (coord ""D5"")))) (if (!= 0 (var ""Left"")) (add (piece (var ""Left"")) (to (coord ""E6"")))) (if (!= 0 (var ""Top"")) (add (piece (var ""Top"")) (to (coord ""F5"")))) (if (!= 0 (var ""Right"")) (add (piece (var ""Right"")) (to (coord ""E4""))))})) (if (= (last To) (coord ""B5"")) (do (and {(set Var ""TopLeft"" (what at:(coord ""A6""))) (set Var ""TopRight"" (what at:(coord ""C6""))) (set Var ""BottomRight"" (what at:(coord ""C4""))) (set Var ""BottomLeft"" (what at:(coord ""A4""))) (set Var ""Bottom"" (what at:(coord ""B4""))) (set Var ""Left"" (what at:(coord ""A5""))) (set Var ""Top"" (what at:(coord ""B6""))) (set Var ""Right"" (what at:(coord ""C5"")))}) next:(and {(if (!= 0 (var ""TopLeft"")) (remove (coord ""A6""))) (if (!= 0 (var ""TopRight"")) (remove (coord ""C6""))) (if (!= 0 (var ""BottomRight"")) (remove (coord ""C4""))) (if (!= 0 (var ""BottomLeft"")) (remove (coord ""A4""))) (if (!= 0 (var ""Bottom"")) (remove (coord ""B4""))) (if (!= 0 (var ""Left"")) (remove (coord ""A5""))) (if (!= 0 (var ""Top"")) (remove (coord ""B6""))) (if (!= 0 (var ""Right"")) (remove (coord ""C5""))) (if (!= 0 (var ""TopLeft"")) (add (piece (var ""TopLeft"")) (to (coord ""C6"")))) (if (!= 0 (var ""TopRight"")) (add (piece (var ""TopRight"")) (to (coord ""C4"")))) (if (!= 0 (var ""BottomRight"")) (add (piece (var ""BottomRight"")) (to (coord ""A4"")))) (if (!= 0 (var ""BottomLeft"")) (add (piece (var ""BottomLeft"")) (to (coord ""A6"")))) (if (!= 0 (var ""Bottom"")) (add (piece (var ""Bottom"")) (to (coord ""A5"")))) (if (!= 0 (var ""Left"")) (add (piece (var ""Left"")) (to (coord ""B6"")))) (if (!= 0 (var ""Top"")) (add (piece (var ""Top"")) (to (coord ""C5"")))) (if (!= 0 (var ""Right"")) (add (piece (var ""Right"")) (to (coord ""B4""))))})) (if (= (last To) (coord ""B2"")) (do (and {(set Var ""TopLeft"" (what at:(coord ""A3""))) (set Var ""TopRight"" (what at:(coord ""C3""))) (set Var ""BottomRight"" (what at:(coord ""C1""))) (set Var ""BottomLeft"" (what at:(coord ""A1""))) (set Var ""Bottom"" (what at:(coord ""B1""))) (set Var ""Left"" (what at:(coord ""A2""))) (set Var ""Top"" (what at:(coord ""B3""))) (set Var ""Right"" (what at:(coord ""C2"")))}) next:(and {(if (!= 0 (var ""TopLeft"")) (remove (coord ""A3""))) (if (!= 0 (var ""TopRight"")) (remove (coord ""C3""))) (if (!= 0 (var ""BottomRight"")) (remove (coord ""C1""))) (if (!= 0 (var ""BottomLeft"")) (remove (coord ""A1""))) (if (!= 0 (var ""Bottom"")) (remove (coord ""B1""))) (if (!= 0 (var ""Left"")) (remove (coord ""A2""))) (if (!= 0 (var ""Top"")) (remove (coord ""B3""))) (if (!= 0 (var ""Right"")) (remove (coord ""C2""))) (if (!= 0 (var ""TopLeft"")) (add (piece (var ""TopLeft"")) (to (coord ""C3"")))) (if (!= 0 (var ""TopRight"")) (add (piece (var ""TopRight"")) (to (coord ""C1"")))) (if (!= 0 (var ""BottomRight"")) (add (piece (var ""BottomRight"")) (to (coord ""A1"")))) (if (!= 0 (var ""BottomLeft"")) (add (piece (var ""BottomLeft"")) (to (coord ""A3"")))) (if (!= 0 (var ""Bottom"")) (add (piece (var ""Bottom"")) (to (coord ""A2"")))) (if (!= 0 (var ""Left"")) (add (piece (var ""Left"")) (to (coord ""B3"")))) (if (!= 0 (var ""Top"")) (add (piece (var ""Top"")) (to (coord ""C2"")))) (if (!= 0 (var ""Right"")) (add (piece (var ""Right"")) (to (coord ""B1""))))})) (do (and {(set Var ""TopLeft"" (what at:(coord ""D3""))) (set Var ""TopRight"" (what at:(coord ""F3""))) (set Var ""BottomRight"" (what at:(coord ""F1""))) (set Var ""BottomLeft"" (what at:(coord ""D1""))) (set Var ""Bottom"" (what at:(coord ""E1""))) (set Var ""Left"" (what at:(coord ""D2""))) (set Var ""Top"" (what at:(coord ""E3""))) (set Var ""Right"" (what at:(coord ""F2"")))}) next:(and {(if (!= 0 (var ""TopLeft"")) (remove (coord ""D3""))) (if (!= 0 (var ""TopRight"")) (remove (coord ""F3""))) (if (!= 0 (var ""BottomRight"")) (remove (coord ""F1""))) (if (!= 0 (var ""BottomLeft"")) (remove (coord ""D1""))) (if (!= 0 (var ""Bottom"")) (remove (coord ""E1""))) (if (!= 0 (var ""Left"")) (remove (coord ""D2""))) (if (!= 0 (var ""Top"")) (remove (coord ""E3""))) (if (!= 0 (var ""Right"")) (remove (coord ""F2""))) (if (!= 0 (var ""TopLeft"")) (add (piece (var ""TopLeft"")) (to (coord ""F3"")))) (if (!= 0 (var ""TopRight"")) (add (piece (var ""TopRight"")) (to (coord ""F1"")))) (if (!= 0 (var ""BottomRight"")) (add (piece (var ""BottomRight"")) (to (coord ""D1"")))) (if (!= 0 (var ""BottomLeft"")) (add (piece (var ""BottomLeft"")) (to (coord ""D3"")))) (if (!= 0 (var ""Bottom"")) (add (piece (var ""Bottom"")) (to (coord ""D2"")))) (if (!= 0 (var ""Left"")) (add (piece (var ""Left"")) (to (coord ""E3"")))) (if (!= 0 (var ""Top"")) (add (piece (var ""Top"")) (to (coord ""F2"")))) (if (!= 0 (var ""Right"")) (add (piece (var ""Right"")) (to (coord ""E1""))))}))))))) (move Select (from (sites {""B2"" ""B5"" ""E2"" ""E5""})) (then (if (= (last To) (coord ""E5"")) (do (and {(set Var ""TopLeft"" (what at:(coord ""D6""))) (set Var ""TopRight"" (what at:(coord ""F6""))) (set Var ""BottomRight"" (what at:(coord ""F4""))) (set Var ""BottomLeft"" (what at:(coord ""D4""))) (set Var ""Bottom"" (what at:(coord ""E4""))) (set Var ""Left"" (what at:(coord ""D5""))) (set Var ""Top"" (what at:(coord ""E6""))) (set Var ""Right"" (what at:(coord ""F5"")))}) next:(and {(if (!= 0 (var ""TopLeft"")) (remove (coord ""D6""))) (if (!= 0 (var ""TopRight"")) (remove (coord ""F6""))) (if (!= 0 (var ""BottomRight"")) (remove (coord ""F4""))) (if (!= 0 (var ""BottomLeft"")) (remove (coord ""D4""))) (if (!= 0 (var ""Bottom"")) (remove (coord ""E4""))) (if (!= 0 (var ""Left"")) (remove (coord ""D5""))) (if (!= 0 (var ""Top"")) (remove (coord ""E6""))) (if (!= 0 (var ""Right"")) (remove (coord ""F5""))) (if (!= 0 (var ""TopLeft"")) (add (piece (var ""TopLeft"")) (to (coord ""D4"")))) (if (!= 0 (var ""TopRight"")) (add (piece (var ""TopRight"")) (to (coord ""D6"")))) (if (!= 0 (var ""BottomRight"")) (add (piece (var ""BottomRight"")) (to (coord ""F6"")))) (if (!= 0 (var ""BottomLeft"")) (add (piece (var ""BottomLeft"")) (to (coord ""F4"")))) (if (!= 0 (var ""Bottom"")) (add (piece (var ""Bottom"")) (to (coord ""F5"")))) (if (!= 0 (var ""Left"")) (add (piece (var ""Left"")) (to (coord ""E4"")))) (if (!= 0 (var ""Top"")) (add (piece (var ""Top"")) (to (coord ""D5"")))) (if (!= 0 (var ""Right"")) (add (piece (var ""Right"")) (to (coord ""E6""))))})) (if (= (last To) (coord ""B5"")) (do (and {(set Var ""TopLeft"" (what at:(coord ""A6""))) (set Var ""TopRight"" (what at:(coord ""C6""))) (set Var ""BottomRight"" (what at:(coord ""C4""))) (set Var ""BottomLeft"" (what at:(coord ""A4""))) (set Var ""Bottom"" (what at:(coord ""B4""))) (set Var ""Left"" (what at:(coord ""A5""))) (set Var ""Top"" (what at:(coord ""B6""))) (set Var ""Right"" (what at:(coord ""C5"")))}) next:(and {(if (!= 0 (var ""TopLeft"")) (remove (coord ""A6""))) (if (!= 0 (var ""TopRight"")) (remove (coord ""C6""))) (if (!= 0 (var ""BottomRight"")) (remove (coord ""C4""))) (if (!= 0 (var ""BottomLeft"")) (remove (coord ""A4""))) (if (!= 0 (var ""Bottom"")) (remove (coord ""B4""))) (if (!= 0 (var ""Left"")) (remove (coord ""A5""))) (if (!= 0 (var ""Top"")) (remove (coord ""B6""))) (if (!= 0 (var ""Right"")) (remove (coord ""C5""))) (if (!= 0 (var ""TopLeft"")) (add (piece (var ""TopLeft"")) (to (coord ""A4"")))) (if (!= 0 (var ""TopRight"")) (add (piece (var ""TopRight"")) (to (coord ""A6"")))) (if (!= 0 (var ""BottomRight"")) (add (piece (var ""BottomRight"")) (to (coord ""C6"")))) (if (!= 0 (var ""BottomLeft"")) (add (piece (var ""BottomLeft"")) (to (coord ""C4"")))) (if (!= 0 (var ""Bottom"")) (add (piece (var ""Bottom"")) (to (coord ""C5"")))) (if (!= 0 (var ""Left"")) (add (piece (var ""Left"")) (to (coord ""B4"")))) (if (!= 0 (var ""Top"")) (add (piece (var ""Top"")) (to (coord ""A5"")))) (if (!= 0 (var ""Right"")) (add (piece (var ""Right"")) (to (coord ""B6""))))})) (if (= (last To) (coord ""B2"")) (do (and {(set Var ""TopLeft"" (what at:(coord ""A3""))) (set Var ""TopRight"" (what at:(coord ""C3""))) (set Var ""BottomRight"" (what at:(coord ""C1""))) (set Var ""BottomLeft"" (what at:(coord ""A1""))) (set Var ""Bottom"" (what at:(coord ""B1""))) (set Var ""Left"" (what at:(coord ""A2""))) (set Var ""Top"" (what at:(coord ""B3""))) (set Var ""Right"" (what at:(coord ""C2"")))}) next:(and {(if (!= 0 (var ""TopLeft"")) (remove (coord ""A3""))) (if (!= 0 (var ""TopRight"")) (remove (coord ""C3""))) (if (!= 0 (var ""BottomRight"")) (remove (coord ""C1""))) (if (!= 0 (var ""BottomLeft"")) (remove (coord ""A1""))) (if (!= 0 (var ""Bottom"")) (remove (coord ""B1""))) (if (!= 0 (var ""Left"")) (remove (coord ""A2""))) (if (!= 0 (var ""Top"")) (remove (coord ""B3""))) (if (!= 0 (var ""Right"")) (remove (coord ""C2""))) (if (!= 0 (var ""TopLeft"")) (add (piece (var ""TopLeft"")) (to (coord ""A1"")))) (if (!= 0 (var ""TopRight"")) (add (piece (var ""TopRight"")) (to (coord ""A3"")))) (if (!= 0 (var ""BottomRight"")) (add (piece (var ""BottomRight"")) (to (coord ""C3"")))) (if (!= 0 (var ""BottomLeft"")) (add (piece (var ""BottomLeft"")) (to (coord ""C1"")))) (if (!= 0 (var ""Bottom"")) (add (piece (var ""Bottom"")) (to (coord ""C2"")))) (if (!= 0 (var ""Left"")) (add (piece (var ""Left"")) (to (coord ""B1"")))) (if (!= 0 (var ""Top"")) (add (piece (var ""Top"")) (to (coord ""A2"")))) (if (!= 0 (var ""Right"")) (add (piece (var ""Right"")) (to (coord ""B3""))))})) (do (and {(set Var ""TopLeft"" (what at:(coord ""D3""))) (set Var ""TopRight"" (what at:(coord ""F3""))) (set Var ""BottomRight"" (what at:(coord ""F1""))) (set Var ""BottomLeft"" (what at:(coord ""D1""))) (set Var ""Bottom"" (what at:(coord ""E1""))) (set Var ""Left"" (what at:(coord ""D2""))) (set Var ""Top"" (what at:(coord ""E3""))) (set Var ""Right"" (what at:(coord ""F2"")))}) next:(and {(if (!= 0 (var ""TopLeft"")) (remove (coord ""D3""))) (if (!= 0 (var ""TopRight"")) (remove (coord ""F3""))) (if (!= 0 (var ""BottomRight"")) (remove (coord ""F1""))) (if (!= 0 (var ""BottomLeft"")) (remove (coord ""D1""))) (if (!= 0 (var ""Bottom"")) (remove (coord ""E1""))) (if (!= 0 (var ""Left"")) (remove (coord ""D2""))) (if (!= 0 (var ""Top"")) (remove (coord ""E3""))) (if (!= 0 (var ""Right"")) (remove (coord ""F2""))) (if (!= 0 (var ""TopLeft"")) (add (piece (var ""TopLeft"")) (to (coord ""D1"")))) (if (!= 0 (var ""TopRight"")) (add (piece (var ""TopRight"")) (to (coord ""D3"")))) (if (!= 0 (var ""BottomRight"")) (add (piece (var ""BottomRight"")) (to (coord ""F3"")))) (if (!= 0 (var ""BottomLeft"")) (add (piece (var ""BottomLeft"")) (to (coord ""F1"")))) (if (!= 0 (var ""Bottom"")) (add (piece (var ""Bottom"")) (to (coord ""F2"")))) (if (!= 0 (var ""Left"")) (add (piece (var ""Left"")) (to (coord ""E1"")))) (if (!= 0 (var ""Top"")) (add (piece (var ""Top"")) (to (coord ""D2"")))) (if (!= 0 (var ""Right"")) (add (piece (var ""Right"")) (to (coord ""E3""))))}))))))))) (end {(if (and (is Line 5 All throughAny:(if (is In (last To) (sites ""BottomLeft"")) (intersection (sites Occupied by:Mover) (sites ""BottomLeft"")) (if (is In (last To) (sites ""BottomRight"")) (intersection (sites Occupied by:Mover) (sites ""BottomRight"")) (if (is In (last To) (sites ""TopLeft"")) (intersection (sites Occupied by:Mover) (sites ""TopLeft"")) (intersection (sites Occupied by:Mover) (sites ""TopRight"")))))) (is Line 5 All throughAny:(if (is In (last To) (sites ""BottomLeft"")) (intersection (sites Occupied by:Next) (sites ""BottomLeft"")) (if (is In (last To) (sites ""BottomRight"")) (intersection (sites Occupied by:Next) (sites ""BottomRight"")) (if (is In (last To) (sites ""TopLeft"")) (intersection (sites Occupied by:Next) (sites ""TopLeft"")) (intersection (sites Occupied by:Next) (sites ""TopRight""))))))) (result Mover Draw)) (if (is Line 5 All throughAny:(if (is In (last To) (sites ""BottomLeft"")) (intersection (sites Occupied by:Mover) (sites ""BottomLeft"")) (if (is In (last To) (sites ""BottomRight"")) (intersection (sites Occupied by:Mover) (sites ""BottomRight"")) (if (is In (last To) (sites ""TopLeft"")) (intersection (sites Occupied by:Mover) (sites ""TopLeft"")) (intersection (sites Occupied by:Mover) (sites ""TopRight"")))))) (result Mover Win)) (if (is Line 5 All throughAny:(if (is In (last To) (sites ""BottomLeft"")) (intersection (sites Occupied by:Next) (sites ""BottomLeft"")) (if (is In (last To) (sites ""BottomRight"")) (intersection (sites Occupied by:Next) (sites ""BottomRight"")) (if (is In (last To) (sites ""TopLeft"")) (intersection (sites Occupied by:Next) (sites ""TopLeft"")) (intersection (sites Occupied by:Next) (sites ""TopRight"")))))) (result Next Win))}) (nextPhase Mover ""Place""))}))" "The board starts empty. White plays first. Players take turns placing a piece of their colour on an empty cell. Passing is not allowed. After each move, the opponent's pieces with no freedom are captured and removed from the board. A piece has freedom if the group it belongs to touches an empty cell. It is not allowed to place a piece in a space without freedom, unless that move captures the other player's pieces to create freedom. The game ends when one of the players wins a game by making a line of five (or more) stones of their colour. The game is played on the half of a HexHex board of size 7.","(game ""Pentalath"" (players 2) (equipment {(board (intersect {(hex 7) (shift -5.2 0 (hex Rectangle 7 14))})) (piece ""Marker"" Each)}) (rules (play (do (move Add (to (sites Empty)) (then (enclose (from (last To)) (between if:(is Enemy (who at:(between))) (apply (remove (between))))))) ifAfterwards:(> (count Liberties Orthogonal) 0))) (end (if (is Line 5) (result Mover Win)))))","###Description The board starts empty. White plays first. Players take turns placing a piece of their colour on an empty cell. Passing is not allowed. After each move, the opponent's pieces with no freedom are captured and removed from the board. A piece has freedom if the group it belongs to touches an empty cell. It is not allowed to place a piece in a space without freedom, unless that move captures the other player's pieces to create freedom. The game ends when one of the players wins a game by making a line of five (or more) stones of their colour. The game is played on the half of a HexHex board of size 7. @@ -3349,11 +3239,6 @@ Three concentric hexagons, with lines connecting the corners and midpoints of th ###Ludii (game ""Zurgaan Tal"" (players 2) (equipment {(board (rotate 30 (concentric Hexagon rings:3 joinCorners:True)) use:Vertex) (hand Each) (piece ""Marker"" Each (move Step (to if:(is Empty (to))) (then (if (is Line 3) (moveAgain)))))}) (rules (start (place ""Marker"" ""Hand"" count:17)) phases:{(phase ""Placement"" (play (if (is Prev Mover) (move Remove (forEach (sites Occupied by:Enemy container:""Board"") if:(not (is Line 3 Orthogonal through:(site))))) (move (from (handSite Mover)) (to (sites Empty)) (then (if (is Line 3) (moveAgain)))))) (nextPhase Mover (all Sites (sites Hand Mover) if:(= 0 (count Cell at:(site)))) ""Movement"")) (phase ""Movement"" (play (if (is Prev Mover) (move Remove (forEach (sites Occupied by:Enemy container:""Board"") if:(not (is Line 3 Orthogonal through:(site))))) (forEach Piece))))} (end (if (no Pieces Next) (result Next Loss)))))" -"A game is played in two rounds. In each round, players strive to achieve a particular goal, unique to them. But at the same time, they pursue a general objective. The player who first achieves one of his two objectives wins the round. The purpose of Life: Life wants to expand. To achieve this objective, there must be at least one Life pawn in each segment and in each ring of the Circle of Life. Death's Goal: Death wants to rule. To achieve this goal, at least one complete segment or ring of the Circle of Life must be filled with Death pawns. Overall Goal: Both players are equally striving to fulfill their destiny. To achieve this objective, you must have all of your 14 pawns on the Circle of Life. A game is played in two rounds. In each round, one of the players assumes the role of Life, the other that of Death. After the first round, the players switch roles. The player who assumes the role of Life begins. When it is their turn, the player performs one of two actions: Place a pawn in a free space on the Circle of Life. This location must be vertically or horizontally adjacent to a Life token (same for Death). During the very first turn, the player can place his pawn wherever he wants. Or turn a ring one segment (45 degrees) clockwise. Special power of Life: birth. If, by placing his pawn, the player has finished filling a segment with Life pawns, the player who took on the role of Life has the right to place another Life pawn in any empty space. . In doing so, he must comply with the investment rules. Special power of Death: disintegration. If, after a Death token has been placed, a Life token is completely surrounded by Death tokens (either vertically or horizontally), the Life token must be replaced by a Death token. the death A round ends when a player has achieved one of their two objectives. The winner of this round counts his pawns that are on the Circle of Life. After two rounds, when each of the players has taken on the role of Life and Death once, the game ends. Now it's a matter of determining who the final winner is: If a player wins both rounds, they've won the whole game! If each player wins a round, they compare the number of checkers it took each to win a round. Whoever needed the fewest pawns is the final winner. In the event of a tie, the game ends as in real life: with a draw.","(game ""Azteka"" (players 2) (equipment {(board (remove (concentric {0 0 8 8 8 8}) cells:{1})) (piece ""Pawn"" Each) (hand Each) (regions ""RingOne"" {24 25 26 27 28 29 30 31}) (regions ""RingTwo"" {16 17 18 19 20 21 22 23}) (regions ""RingThree"" {8 9 10 11 12 13 14 15}) (regions ""RingFour"" {0 1 2 3 4 5 6 7}) (regions ""SegmentOne"" {0 8 16 24}) (regions ""SegmentTwo"" {2 10 18 26}) (regions ""SegmentThree"" {3 11 19 27}) (regions ""SegmentFour"" {4 12 20 28}) (regions ""SegmentFive"" {5 13 21 29}) (regions ""SegmentSix"" {6 14 22 30}) (regions ""SegmentSeven"" {7 15 23 31}) (regions ""SegmentEight"" {1 9 17 25})}) (rules (start (place ""Pawn"" ""Hand"" count:14)) phases:{(phase ""FirstPhase"" (play (if (is Prev Mover) (move (from (handSite Mover)) (to (sites Around (sites Occupied by:Mover) Orthogonal if:(is Empty (to)))) (then (if (and (not (all Sites (sites Hand Mover) if:(= 0 (count Cell at:(site))))) (if (is In (last To) (sites ""SegmentOne"")) (all Sites (sites ""SegmentOne"") if:(= (who at:(site)) P1)) (if (is In (last To) (sites ""SegmentTwo"")) (all Sites (sites ""SegmentTwo"") if:(= (who at:(site)) P1)) (if (is In (last To) (sites ""SegmentThree"")) (all Sites (sites ""SegmentThree"") if:(= (who at:(site)) P1)) (if (is In (last To) (sites ""SegmentFour"")) (all Sites (sites ""SegmentFour"") if:(= (who at:(site)) P1)) (if (is In (last To) (sites ""SegmentFive"")) (all Sites (sites ""SegmentFive"") if:(= (who at:(site)) P1)) (if (is In (last To) (sites ""SegmentSix"")) (all Sites (sites ""SegmentSix"") if:(= (who at:(site)) P1)) (if (is In (last To) (sites ""SegmentSeven"")) (all Sites (sites ""SegmentSeven"") if:(= (who at:(site)) P1)) (all Sites (sites ""SegmentEight"") if:(= (who at:(site)) P1)))))))))) (moveAgain)))) (or (if (not (all Sites (sites Hand Mover) if:(= 0 (count Cell at:(site))))) (move (from (handSite Mover)) (to (if (< (count Moves) 2) (sites Empty) (sites Around (sites Occupied by:Mover) Orthogonal if:(is Empty (to))))))) (if (>= (count Moves) 2) (or {(move Select (from 27) (to 26) (then (do (set Var (what at:27)) next:(and {(remove 27) (if (is Occupied 28) (move (from 28) (to 27))) (if (is Occupied 29) (move (from 29) (to 28))) (if (is Occupied 30) (move (from 30) (to 29))) (if (is Occupied 31) (move (from 31) (to 30))) (if (is Occupied 25) (move (from 25) (to 31))) (if (is Occupied 24) (move (from 24) (to 25))) (if (is Occupied 26) (move (from 26) (to 24))) (if (!= 0 (var)) (add (piece (var)) (to 26)))})))) (move Select (from 19) (to 18) (then (do (set Var (what at:19)) next:(and {(remove 19) (if (is Occupied 20) (move (from 20) (to 19))) (if (is Occupied 21) (move (from 21) (to 20))) (if (is Occupied 22) (move (from 22) (to 21))) (if (is Occupied 23) (move (from 23) (to 22))) (if (is Occupied 17) (move (from 17) (to 23))) (if (is Occupied 16) (move (from 16) (to 17))) (if (is Occupied 18) (move (from 18) (to 16))) (if (!= 0 (var)) (add (piece (var)) (to 18)))})))) (move Select (from 11) (to 10) (then (do (set Var (what at:11)) next:(and {(remove 11) (if (is Occupied 12) (move (from 12) (to 11))) (if (is Occupied 13) (move (from 13) (to 12))) (if (is Occupied 14) (move (from 14) (to 13))) (if (is Occupied 15) (move (from 15) (to 14))) (if (is Occupied 9) (move (from 9) (to 15))) (if (is Occupied 8) (move (from 8) (to 9))) (if (is Occupied 10) (move (from 10) (to 8))) (if (!= 0 (var)) (add (piece (var)) (to 10)))})))) (move Select (from 3) (to 2) (then (do (set Var (what at:3)) next:(and {(remove 3) (if (is Occupied 4) (move (from 4) (to 3))) (if (is Occupied 5) (move (from 5) (to 4))) (if (is Occupied 6) (move (from 6) (to 5))) (if (is Occupied 7) (move (from 7) (to 6))) (if (is Occupied 1) (move (from 1) (to 7))) (if (is Occupied 0) (move (from 0) (to 1))) (if (is Occupied 2) (move (from 2) (to 0))) (if (!= 0 (var)) (add (piece (var)) (to 2)))}))))})) (then (if (is Mover P1) (if (and (not (all Sites (sites Hand Mover) if:(= 0 (count Cell at:(site))))) (if (is In (last To) (sites ""SegmentOne"")) (all Sites (sites ""SegmentOne"") if:(= (who at:(site)) P1)) (if (is In (last To) (sites ""SegmentTwo"")) (all Sites (sites ""SegmentTwo"") if:(= (who at:(site)) P1)) (if (is In (last To) (sites ""SegmentThree"")) (all Sites (sites ""SegmentThree"") if:(= (who at:(site)) P1)) (if (is In (last To) (sites ""SegmentFour"")) (all Sites (sites ""SegmentFour"") if:(= (who at:(site)) P1)) (if (is In (last To) (sites ""SegmentFive"")) (all Sites (sites ""SegmentFive"") if:(= (who at:(site)) P1)) (if (is In (last To) (sites ""SegmentSix"")) (all Sites (sites ""SegmentSix"") if:(= (who at:(site)) P1)) (if (is In (last To) (sites ""SegmentSeven"")) (all Sites (sites ""SegmentSeven"") if:(= (who at:(site)) P1)) (all Sites (sites ""SegmentEight"") if:(= (who at:(site)) P1)))))))))) (moveAgain)) (surround (from (last To)) Orthogonal (between if:(is Enemy (who at:(between))) (apply (fromTo (from (handSite Mover)) (to (between))))) (to if:(is Friend (who at:(to)))))))) (then (if (is Mover P1) (if (or (= 14 (count Sites in:(sites Occupied by:P1))) (and {(not (all Sites (sites ""RingOne"") if:(!= (who at:(site)) P1))) (not (all Sites (sites ""RingTwo"") if:(!= (who at:(site)) P1))) (not (all Sites (sites ""RingThree"") if:(!= (who at:(site)) P1))) (not (all Sites (sites ""RingFour"") if:(!= (who at:(site)) P1))) (not (all Sites (sites ""SegmentOne"") if:(!= (who at:(site)) P1))) (not (all Sites (sites ""SegmentTwo"") if:(!= (who at:(site)) P1))) (not (all Sites (sites ""SegmentThree"") if:(!= (who at:(site)) P1))) (not (all Sites (sites ""SegmentFour"") if:(!= (who at:(site)) P1))) (not (all Sites (sites ""SegmentFive"") if:(!= (who at:(site)) P1))) (not (all Sites (sites ""SegmentSix"") if:(!= (who at:(site)) P1))) (not (all Sites (sites ""SegmentSeven"") if:(!= (who at:(site)) P1))) (not (all Sites (sites ""SegmentEight"") if:(!= (who at:(site)) P1)))})) (and {(set Score P1 (count Pieces Mover in:(sites Board))) (remove (sites Board)) (remove (sites Hand P1)) (remove (sites Hand P2)) (add (piece (id ""Pawn"" P1)) (to (handSite P1)) count:14) (add (piece (id ""Pawn"" P2)) (to (handSite P2)) count:14) (set NextPlayer (player 2)) (set Pending)})) (if (or (= 14 (count Sites in:(sites Occupied by:P2))) (or {(all Sites (sites ""RingOne"") if:(= (who at:(site)) P2)) (all Sites (sites ""RingTwo"") if:(= (who at:(site)) P2)) (all Sites (sites ""RingThree"") if:(= (who at:(site)) P2)) (all Sites (sites ""RingFour"") if:(= (who at:(site)) P2)) (all Sites (sites ""SegmentOne"") if:(= (who at:(site)) P2)) (all Sites (sites ""SegmentTwo"") if:(= (who at:(site)) P2)) (all Sites (sites ""SegmentThree"") if:(= (who at:(site)) P2)) (all Sites (sites ""SegmentFour"") if:(= (who at:(site)) P2)) (all Sites (sites ""SegmentFive"") if:(= (who at:(site)) P2)) (all Sites (sites ""SegmentSix"") if:(= (who at:(site)) P2)) (all Sites (sites ""SegmentSeven"") if:(= (who at:(site)) P2)) (all Sites (sites ""SegmentEight"") if:(= (who at:(site)) P2))})) (and {(set Score P2 (count Pieces Mover in:(sites Board))) (remove (sites Board)) (remove (sites Hand P1)) (remove (sites Hand P2)) (add (piece (id ""Pawn"" P1)) (to (handSite P1)) count:14) (add (piece (id ""Pawn"" P2)) (to (handSite P2)) count:14) (set NextPlayer (player 2)) (set Pending)})))))) (nextPhase (or (!= 0 (score P1)) (!= 0 (score P2))) ""SecondPhase"")) (phase ""SecondPhase"" (play (if (and (not (is Pending)) (is Prev Mover)) (move (from (handSite Mover)) (to (sites Around (sites Occupied by:Mover) Orthogonal if:(is Empty (to)))) (then (if (and (not (all Sites (sites Hand Mover) if:(= 0 (count Cell at:(site))))) (if (is In (last To) (sites ""SegmentOne"")) (all Sites (sites ""SegmentOne"") if:(= (who at:(site)) P2)) (if (is In (last To) (sites ""SegmentTwo"")) (all Sites (sites ""SegmentTwo"") if:(= (who at:(site)) P2)) (if (is In (last To) (sites ""SegmentThree"")) (all Sites (sites ""SegmentThree"") if:(= (who at:(site)) P2)) (if (is In (last To) (sites ""SegmentFour"")) (all Sites (sites ""SegmentFour"") if:(= (who at:(site)) P2)) (if (is In (last To) (sites ""SegmentFive"")) (all Sites (sites ""SegmentFive"") if:(= (who at:(site)) P2)) (if (is In (last To) (sites ""SegmentSix"")) (all Sites (sites ""SegmentSix"") if:(= (who at:(site)) P2)) (if (is In (last To) (sites ""SegmentSeven"")) (all Sites (sites ""SegmentSeven"") if:(= (who at:(site)) P2)) (all Sites (sites ""SegmentEight"") if:(= (who at:(site)) P2)))))))))) (moveAgain)))) (or (if (not (all Sites (sites Hand Mover) if:(= 0 (count Cell at:(site))))) (move (from (handSite Mover)) (to (if (< (count Sites in:(sites Occupied by:All container:""Board"")) 2) (sites Empty) (sites Around (sites Occupied by:Mover) Orthogonal if:(is Empty (to))))))) (if (>= (count Sites in:(sites Occupied by:All container:""Board"")) 2) (or {(move Select (from 27) (to 26) (then (do (set Var (what at:27)) next:(and {(remove 27) (if (is Occupied 28) (move (from 28) (to 27))) (if (is Occupied 29) (move (from 29) (to 28))) (if (is Occupied 30) (move (from 30) (to 29))) (if (is Occupied 31) (move (from 31) (to 30))) (if (is Occupied 25) (move (from 25) (to 31))) (if (is Occupied 24) (move (from 24) (to 25))) (if (is Occupied 26) (move (from 26) (to 24))) (if (!= 0 (var)) (add (piece (var)) (to 26)))})))) (move Select (from 19) (to 18) (then (do (set Var (what at:19)) next:(and {(remove 19) (if (is Occupied 20) (move (from 20) (to 19))) (if (is Occupied 21) (move (from 21) (to 20))) (if (is Occupied 22) (move (from 22) (to 21))) (if (is Occupied 23) (move (from 23) (to 22))) (if (is Occupied 17) (move (from 17) (to 23))) (if (is Occupied 16) (move (from 16) (to 17))) (if (is Occupied 18) (move (from 18) (to 16))) (if (!= 0 (var)) (add (piece (var)) (to 18)))})))) (move Select (from 11) (to 10) (then (do (set Var (what at:11)) next:(and {(remove 11) (if (is Occupied 12) (move (from 12) (to 11))) (if (is Occupied 13) (move (from 13) (to 12))) (if (is Occupied 14) (move (from 14) (to 13))) (if (is Occupied 15) (move (from 15) (to 14))) (if (is Occupied 9) (move (from 9) (to 15))) (if (is Occupied 8) (move (from 8) (to 9))) (if (is Occupied 10) (move (from 10) (to 8))) (if (!= 0 (var)) (add (piece (var)) (to 10)))})))) (move Select (from 3) (to 2) (then (do (set Var (what at:3)) next:(and {(remove 3) (if (is Occupied 4) (move (from 4) (to 3))) (if (is Occupied 5) (move (from 5) (to 4))) (if (is Occupied 6) (move (from 6) (to 5))) (if (is Occupied 7) (move (from 7) (to 6))) (if (is Occupied 1) (move (from 1) (to 7))) (if (is Occupied 0) (move (from 0) (to 1))) (if (is Occupied 2) (move (from 2) (to 0))) (if (!= 0 (var)) (add (piece (var)) (to 2)))}))))})) (then (if (is Mover P2) (if (and (not (all Sites (sites Hand Mover) if:(= 0 (count Cell at:(site))))) (if (is In (last To) (sites ""SegmentOne"")) (all Sites (sites ""SegmentOne"") if:(= (who at:(site)) P2)) (if (is In (last To) (sites ""SegmentTwo"")) (all Sites (sites ""SegmentTwo"") if:(= (who at:(site)) P2)) (if (is In (last To) (sites ""SegmentThree"")) (all Sites (sites ""SegmentThree"") if:(= (who at:(site)) P2)) (if (is In (last To) (sites ""SegmentFour"")) (all Sites (sites ""SegmentFour"") if:(= (who at:(site)) P2)) (if (is In (last To) (sites ""SegmentFive"")) (all Sites (sites ""SegmentFive"") if:(= (who at:(site)) P2)) (if (is In (last To) (sites ""SegmentSix"")) (all Sites (sites ""SegmentSix"") if:(= (who at:(site)) P2)) (if (is In (last To) (sites ""SegmentSeven"")) (all Sites (sites ""SegmentSeven"") if:(= (who at:(site)) P2)) (all Sites (sites ""SegmentEight"") if:(= (who at:(site)) P2)))))))))) (moveAgain)) (surround (from (last To)) Orthogonal (between if:(is Enemy (who at:(between))) (apply (fromTo (from (handSite Mover)) (to (between))))) (to if:(is Friend (who at:(to)))))))) (then (if (is Mover P2) (if (or (= 14 (count Sites in:(sites Occupied by:P2))) (and {(not (all Sites (sites ""RingOne"") if:(!= (who at:(site)) P2))) (not (all Sites (sites ""RingTwo"") if:(!= (who at:(site)) P2))) (not (all Sites (sites ""RingThree"") if:(!= (who at:(site)) P2))) (not (all Sites (sites ""RingFour"") if:(!= (who at:(site)) P2))) (not (all Sites (sites ""SegmentOne"") if:(!= (who at:(site)) P2))) (not (all Sites (sites ""SegmentTwo"") if:(!= (who at:(site)) P2))) (not (all Sites (sites ""SegmentThree"") if:(!= (who at:(site)) P2))) (not (all Sites (sites ""SegmentFour"") if:(!= (who at:(site)) P2))) (not (all Sites (sites ""SegmentFive"") if:(!= (who at:(site)) P2))) (not (all Sites (sites ""SegmentSix"") if:(!= (who at:(site)) P2))) (not (all Sites (sites ""SegmentSeven"") if:(!= (who at:(site)) P2))) (not (all Sites (sites ""SegmentEight"") if:(!= (who at:(site)) P2)))})) (if (> (score P2) 0) (set Var ""End"" 2) (if (> (count Pieces Mover in:(sites Board)) (score P1)) (and (set Var ""End"" 1) (set Score P2 (count Pieces Mover in:(sites Board)))) (if (< (count Pieces Mover in:(sites Board)) (score P1)) (and (set Var ""End"" 2) (set Score P2 (count Pieces Mover in:(sites Board)))) (set Var ""End"" 3))))) (if (or (= 14 (count Sites in:(sites Occupied by:P1))) (or {(all Sites (sites ""RingOne"") if:(= (who at:(site)) P1)) (all Sites (sites ""RingTwo"") if:(= (who at:(site)) P1)) (all Sites (sites ""RingThree"") if:(= (who at:(site)) P1)) (all Sites (sites ""RingFour"") if:(= (who at:(site)) P1)) (all Sites (sites ""SegmentOne"") if:(= (who at:(site)) P1)) (all Sites (sites ""SegmentTwo"") if:(= (who at:(site)) P1)) (all Sites (sites ""SegmentThree"") if:(= (who at:(site)) P1)) (all Sites (sites ""SegmentFour"") if:(= (who at:(site)) P1)) (all Sites (sites ""SegmentFive"") if:(= (who at:(site)) P1)) (all Sites (sites ""SegmentSix"") if:(= (who at:(site)) P1)) (all Sites (sites ""SegmentSeven"") if:(= (who at:(site)) P1)) (all Sites (sites ""SegmentEight"") if:(= (who at:(site)) P1))})) (if (> (score P1) 0) (set Var ""End"" 1) (if (> (count Pieces Mover in:(sites Board)) (score P2)) (and (set Var ""End"" 2) (set Score P1 (count Pieces Mover in:(sites Board)))) (if (< (count Pieces Mover in:(sites Board)) (score P2)) (and (set Var ""End"" 1) (set Score P1 (count Pieces Mover in:(sites Board)))) (set Var ""End"" 3))))))))) (end {(if (= (var ""End"") 3) (result Mover Draw)) (if (= (var ""End"") 2) (result P2 Win)) (if (= (var ""End"") 1) (result P1 Win))}))}))","###Description -A game is played in two rounds. In each round, players strive to achieve a particular goal, unique to them. But at the same time, they pursue a general objective. The player who first achieves one of his two objectives wins the round. The purpose of Life: Life wants to expand. To achieve this objective, there must be at least one Life pawn in each segment and in each ring of the Circle of Life. Death's Goal: Death wants to rule. To achieve this goal, at least one complete segment or ring of the Circle of Life must be filled with Death pawns. Overall Goal: Both players are equally striving to fulfill their destiny. To achieve this objective, you must have all of your 14 pawns on the Circle of Life. A game is played in two rounds. In each round, one of the players assumes the role of Life, the other that of Death. After the first round, the players switch roles. The player who assumes the role of Life begins. When it is their turn, the player performs one of two actions: Place a pawn in a free space on the Circle of Life. This location must be vertically or horizontally adjacent to a Life token (same for Death). During the very first turn, the player can place his pawn wherever he wants. Or turn a ring one segment (45 degrees) clockwise. Special power of Life: birth. If, by placing his pawn, the player has finished filling a segment with Life pawns, the player who took on the role of Life has the right to place another Life pawn in any empty space. . In doing so, he must comply with the investment rules. Special power of Death: disintegration. If, after a Death token has been placed, a Life token is completely surrounded by Death tokens (either vertically or horizontally), the Life token must be replaced by a Death token. the death A round ends when a player has achieved one of their two objectives. The winner of this round counts his pawns that are on the Circle of Life. After two rounds, when each of the players has taken on the role of Life and Death once, the game ends. Now it's a matter of determining who the final winner is: If a player wins both rounds, they've won the whole game! If each player wins a round, they compare the number of checkers it took each to win a round. Whoever needed the fewest pawns is the final winner. In the event of a tie, the game ends as in real life: with a draw. - -###Ludii -(game ""Azteka"" (players 2) (equipment {(board (remove (concentric {0 0 8 8 8 8}) cells:{1})) (piece ""Pawn"" Each) (hand Each) (regions ""RingOne"" {24 25 26 27 28 29 30 31}) (regions ""RingTwo"" {16 17 18 19 20 21 22 23}) (regions ""RingThree"" {8 9 10 11 12 13 14 15}) (regions ""RingFour"" {0 1 2 3 4 5 6 7}) (regions ""SegmentOne"" {0 8 16 24}) (regions ""SegmentTwo"" {2 10 18 26}) (regions ""SegmentThree"" {3 11 19 27}) (regions ""SegmentFour"" {4 12 20 28}) (regions ""SegmentFive"" {5 13 21 29}) (regions ""SegmentSix"" {6 14 22 30}) (regions ""SegmentSeven"" {7 15 23 31}) (regions ""SegmentEight"" {1 9 17 25})}) (rules (start (place ""Pawn"" ""Hand"" count:14)) phases:{(phase ""FirstPhase"" (play (if (is Prev Mover) (move (from (handSite Mover)) (to (sites Around (sites Occupied by:Mover) Orthogonal if:(is Empty (to)))) (then (if (and (not (all Sites (sites Hand Mover) if:(= 0 (count Cell at:(site))))) (if (is In (last To) (sites ""SegmentOne"")) (all Sites (sites ""SegmentOne"") if:(= (who at:(site)) P1)) (if (is In (last To) (sites ""SegmentTwo"")) (all Sites (sites ""SegmentTwo"") if:(= (who at:(site)) P1)) (if (is In (last To) (sites ""SegmentThree"")) (all Sites (sites ""SegmentThree"") if:(= (who at:(site)) P1)) (if (is In (last To) (sites ""SegmentFour"")) (all Sites (sites ""SegmentFour"") if:(= (who at:(site)) P1)) (if (is In (last To) (sites ""SegmentFive"")) (all Sites (sites ""SegmentFive"") if:(= (who at:(site)) P1)) (if (is In (last To) (sites ""SegmentSix"")) (all Sites (sites ""SegmentSix"") if:(= (who at:(site)) P1)) (if (is In (last To) (sites ""SegmentSeven"")) (all Sites (sites ""SegmentSeven"") if:(= (who at:(site)) P1)) (all Sites (sites ""SegmentEight"") if:(= (who at:(site)) P1)))))))))) (moveAgain)))) (or (if (not (all Sites (sites Hand Mover) if:(= 0 (count Cell at:(site))))) (move (from (handSite Mover)) (to (if (< (count Moves) 2) (sites Empty) (sites Around (sites Occupied by:Mover) Orthogonal if:(is Empty (to))))))) (if (>= (count Moves) 2) (or {(move Select (from 27) (to 26) (then (do (set Var (what at:27)) next:(and {(remove 27) (if (is Occupied 28) (move (from 28) (to 27))) (if (is Occupied 29) (move (from 29) (to 28))) (if (is Occupied 30) (move (from 30) (to 29))) (if (is Occupied 31) (move (from 31) (to 30))) (if (is Occupied 25) (move (from 25) (to 31))) (if (is Occupied 24) (move (from 24) (to 25))) (if (is Occupied 26) (move (from 26) (to 24))) (if (!= 0 (var)) (add (piece (var)) (to 26)))})))) (move Select (from 19) (to 18) (then (do (set Var (what at:19)) next:(and {(remove 19) (if (is Occupied 20) (move (from 20) (to 19))) (if (is Occupied 21) (move (from 21) (to 20))) (if (is Occupied 22) (move (from 22) (to 21))) (if (is Occupied 23) (move (from 23) (to 22))) (if (is Occupied 17) (move (from 17) (to 23))) (if (is Occupied 16) (move (from 16) (to 17))) (if (is Occupied 18) (move (from 18) (to 16))) (if (!= 0 (var)) (add (piece (var)) (to 18)))})))) (move Select (from 11) (to 10) (then (do (set Var (what at:11)) next:(and {(remove 11) (if (is Occupied 12) (move (from 12) (to 11))) (if (is Occupied 13) (move (from 13) (to 12))) (if (is Occupied 14) (move (from 14) (to 13))) (if (is Occupied 15) (move (from 15) (to 14))) (if (is Occupied 9) (move (from 9) (to 15))) (if (is Occupied 8) (move (from 8) (to 9))) (if (is Occupied 10) (move (from 10) (to 8))) (if (!= 0 (var)) (add (piece (var)) (to 10)))})))) (move Select (from 3) (to 2) (then (do (set Var (what at:3)) next:(and {(remove 3) (if (is Occupied 4) (move (from 4) (to 3))) (if (is Occupied 5) (move (from 5) (to 4))) (if (is Occupied 6) (move (from 6) (to 5))) (if (is Occupied 7) (move (from 7) (to 6))) (if (is Occupied 1) (move (from 1) (to 7))) (if (is Occupied 0) (move (from 0) (to 1))) (if (is Occupied 2) (move (from 2) (to 0))) (if (!= 0 (var)) (add (piece (var)) (to 2)))}))))})) (then (if (is Mover P1) (if (and (not (all Sites (sites Hand Mover) if:(= 0 (count Cell at:(site))))) (if (is In (last To) (sites ""SegmentOne"")) (all Sites (sites ""SegmentOne"") if:(= (who at:(site)) P1)) (if (is In (last To) (sites ""SegmentTwo"")) (all Sites (sites ""SegmentTwo"") if:(= (who at:(site)) P1)) (if (is In (last To) (sites ""SegmentThree"")) (all Sites (sites ""SegmentThree"") if:(= (who at:(site)) P1)) (if (is In (last To) (sites ""SegmentFour"")) (all Sites (sites ""SegmentFour"") if:(= (who at:(site)) P1)) (if (is In (last To) (sites ""SegmentFive"")) (all Sites (sites ""SegmentFive"") if:(= (who at:(site)) P1)) (if (is In (last To) (sites ""SegmentSix"")) (all Sites (sites ""SegmentSix"") if:(= (who at:(site)) P1)) (if (is In (last To) (sites ""SegmentSeven"")) (all Sites (sites ""SegmentSeven"") if:(= (who at:(site)) P1)) (all Sites (sites ""SegmentEight"") if:(= (who at:(site)) P1)))))))))) (moveAgain)) (surround (from (last To)) Orthogonal (between if:(is Enemy (who at:(between))) (apply (fromTo (from (handSite Mover)) (to (between))))) (to if:(is Friend (who at:(to)))))))) (then (if (is Mover P1) (if (or (= 14 (count Sites in:(sites Occupied by:P1))) (and {(not (all Sites (sites ""RingOne"") if:(!= (who at:(site)) P1))) (not (all Sites (sites ""RingTwo"") if:(!= (who at:(site)) P1))) (not (all Sites (sites ""RingThree"") if:(!= (who at:(site)) P1))) (not (all Sites (sites ""RingFour"") if:(!= (who at:(site)) P1))) (not (all Sites (sites ""SegmentOne"") if:(!= (who at:(site)) P1))) (not (all Sites (sites ""SegmentTwo"") if:(!= (who at:(site)) P1))) (not (all Sites (sites ""SegmentThree"") if:(!= (who at:(site)) P1))) (not (all Sites (sites ""SegmentFour"") if:(!= (who at:(site)) P1))) (not (all Sites (sites ""SegmentFive"") if:(!= (who at:(site)) P1))) (not (all Sites (sites ""SegmentSix"") if:(!= (who at:(site)) P1))) (not (all Sites (sites ""SegmentSeven"") if:(!= (who at:(site)) P1))) (not (all Sites (sites ""SegmentEight"") if:(!= (who at:(site)) P1)))})) (and {(set Score P1 (count Pieces Mover in:(sites Board))) (remove (sites Board)) (remove (sites Hand P1)) (remove (sites Hand P2)) (add (piece (id ""Pawn"" P1)) (to (handSite P1)) count:14) (add (piece (id ""Pawn"" P2)) (to (handSite P2)) count:14) (set NextPlayer (player 2)) (set Pending)})) (if (or (= 14 (count Sites in:(sites Occupied by:P2))) (or {(all Sites (sites ""RingOne"") if:(= (who at:(site)) P2)) (all Sites (sites ""RingTwo"") if:(= (who at:(site)) P2)) (all Sites (sites ""RingThree"") if:(= (who at:(site)) P2)) (all Sites (sites ""RingFour"") if:(= (who at:(site)) P2)) (all Sites (sites ""SegmentOne"") if:(= (who at:(site)) P2)) (all Sites (sites ""SegmentTwo"") if:(= (who at:(site)) P2)) (all Sites (sites ""SegmentThree"") if:(= (who at:(site)) P2)) (all Sites (sites ""SegmentFour"") if:(= (who at:(site)) P2)) (all Sites (sites ""SegmentFive"") if:(= (who at:(site)) P2)) (all Sites (sites ""SegmentSix"") if:(= (who at:(site)) P2)) (all Sites (sites ""SegmentSeven"") if:(= (who at:(site)) P2)) (all Sites (sites ""SegmentEight"") if:(= (who at:(site)) P2))})) (and {(set Score P2 (count Pieces Mover in:(sites Board))) (remove (sites Board)) (remove (sites Hand P1)) (remove (sites Hand P2)) (add (piece (id ""Pawn"" P1)) (to (handSite P1)) count:14) (add (piece (id ""Pawn"" P2)) (to (handSite P2)) count:14) (set NextPlayer (player 2)) (set Pending)})))))) (nextPhase (or (!= 0 (score P1)) (!= 0 (score P2))) ""SecondPhase"")) (phase ""SecondPhase"" (play (if (and (not (is Pending)) (is Prev Mover)) (move (from (handSite Mover)) (to (sites Around (sites Occupied by:Mover) Orthogonal if:(is Empty (to)))) (then (if (and (not (all Sites (sites Hand Mover) if:(= 0 (count Cell at:(site))))) (if (is In (last To) (sites ""SegmentOne"")) (all Sites (sites ""SegmentOne"") if:(= (who at:(site)) P2)) (if (is In (last To) (sites ""SegmentTwo"")) (all Sites (sites ""SegmentTwo"") if:(= (who at:(site)) P2)) (if (is In (last To) (sites ""SegmentThree"")) (all Sites (sites ""SegmentThree"") if:(= (who at:(site)) P2)) (if (is In (last To) (sites ""SegmentFour"")) (all Sites (sites ""SegmentFour"") if:(= (who at:(site)) P2)) (if (is In (last To) (sites ""SegmentFive"")) (all Sites (sites ""SegmentFive"") if:(= (who at:(site)) P2)) (if (is In (last To) (sites ""SegmentSix"")) (all Sites (sites ""SegmentSix"") if:(= (who at:(site)) P2)) (if (is In (last To) (sites ""SegmentSeven"")) (all Sites (sites ""SegmentSeven"") if:(= (who at:(site)) P2)) (all Sites (sites ""SegmentEight"") if:(= (who at:(site)) P2)))))))))) (moveAgain)))) (or (if (not (all Sites (sites Hand Mover) if:(= 0 (count Cell at:(site))))) (move (from (handSite Mover)) (to (if (< (count Sites in:(sites Occupied by:All container:""Board"")) 2) (sites Empty) (sites Around (sites Occupied by:Mover) Orthogonal if:(is Empty (to))))))) (if (>= (count Sites in:(sites Occupied by:All container:""Board"")) 2) (or {(move Select (from 27) (to 26) (then (do (set Var (what at:27)) next:(and {(remove 27) (if (is Occupied 28) (move (from 28) (to 27))) (if (is Occupied 29) (move (from 29) (to 28))) (if (is Occupied 30) (move (from 30) (to 29))) (if (is Occupied 31) (move (from 31) (to 30))) (if (is Occupied 25) (move (from 25) (to 31))) (if (is Occupied 24) (move (from 24) (to 25))) (if (is Occupied 26) (move (from 26) (to 24))) (if (!= 0 (var)) (add (piece (var)) (to 26)))})))) (move Select (from 19) (to 18) (then (do (set Var (what at:19)) next:(and {(remove 19) (if (is Occupied 20) (move (from 20) (to 19))) (if (is Occupied 21) (move (from 21) (to 20))) (if (is Occupied 22) (move (from 22) (to 21))) (if (is Occupied 23) (move (from 23) (to 22))) (if (is Occupied 17) (move (from 17) (to 23))) (if (is Occupied 16) (move (from 16) (to 17))) (if (is Occupied 18) (move (from 18) (to 16))) (if (!= 0 (var)) (add (piece (var)) (to 18)))})))) (move Select (from 11) (to 10) (then (do (set Var (what at:11)) next:(and {(remove 11) (if (is Occupied 12) (move (from 12) (to 11))) (if (is Occupied 13) (move (from 13) (to 12))) (if (is Occupied 14) (move (from 14) (to 13))) (if (is Occupied 15) (move (from 15) (to 14))) (if (is Occupied 9) (move (from 9) (to 15))) (if (is Occupied 8) (move (from 8) (to 9))) (if (is Occupied 10) (move (from 10) (to 8))) (if (!= 0 (var)) (add (piece (var)) (to 10)))})))) (move Select (from 3) (to 2) (then (do (set Var (what at:3)) next:(and {(remove 3) (if (is Occupied 4) (move (from 4) (to 3))) (if (is Occupied 5) (move (from 5) (to 4))) (if (is Occupied 6) (move (from 6) (to 5))) (if (is Occupied 7) (move (from 7) (to 6))) (if (is Occupied 1) (move (from 1) (to 7))) (if (is Occupied 0) (move (from 0) (to 1))) (if (is Occupied 2) (move (from 2) (to 0))) (if (!= 0 (var)) (add (piece (var)) (to 2)))}))))})) (then (if (is Mover P2) (if (and (not (all Sites (sites Hand Mover) if:(= 0 (count Cell at:(site))))) (if (is In (last To) (sites ""SegmentOne"")) (all Sites (sites ""SegmentOne"") if:(= (who at:(site)) P2)) (if (is In (last To) (sites ""SegmentTwo"")) (all Sites (sites ""SegmentTwo"") if:(= (who at:(site)) P2)) (if (is In (last To) (sites ""SegmentThree"")) (all Sites (sites ""SegmentThree"") if:(= (who at:(site)) P2)) (if (is In (last To) (sites ""SegmentFour"")) (all Sites (sites ""SegmentFour"") if:(= (who at:(site)) P2)) (if (is In (last To) (sites ""SegmentFive"")) (all Sites (sites ""SegmentFive"") if:(= (who at:(site)) P2)) (if (is In (last To) (sites ""SegmentSix"")) (all Sites (sites ""SegmentSix"") if:(= (who at:(site)) P2)) (if (is In (last To) (sites ""SegmentSeven"")) (all Sites (sites ""SegmentSeven"") if:(= (who at:(site)) P2)) (all Sites (sites ""SegmentEight"") if:(= (who at:(site)) P2)))))))))) (moveAgain)) (surround (from (last To)) Orthogonal (between if:(is Enemy (who at:(between))) (apply (fromTo (from (handSite Mover)) (to (between))))) (to if:(is Friend (who at:(to)))))))) (then (if (is Mover P2) (if (or (= 14 (count Sites in:(sites Occupied by:P2))) (and {(not (all Sites (sites ""RingOne"") if:(!= (who at:(site)) P2))) (not (all Sites (sites ""RingTwo"") if:(!= (who at:(site)) P2))) (not (all Sites (sites ""RingThree"") if:(!= (who at:(site)) P2))) (not (all Sites (sites ""RingFour"") if:(!= (who at:(site)) P2))) (not (all Sites (sites ""SegmentOne"") if:(!= (who at:(site)) P2))) (not (all Sites (sites ""SegmentTwo"") if:(!= (who at:(site)) P2))) (not (all Sites (sites ""SegmentThree"") if:(!= (who at:(site)) P2))) (not (all Sites (sites ""SegmentFour"") if:(!= (who at:(site)) P2))) (not (all Sites (sites ""SegmentFive"") if:(!= (who at:(site)) P2))) (not (all Sites (sites ""SegmentSix"") if:(!= (who at:(site)) P2))) (not (all Sites (sites ""SegmentSeven"") if:(!= (who at:(site)) P2))) (not (all Sites (sites ""SegmentEight"") if:(!= (who at:(site)) P2)))})) (if (> (score P2) 0) (set Var ""End"" 2) (if (> (count Pieces Mover in:(sites Board)) (score P1)) (and (set Var ""End"" 1) (set Score P2 (count Pieces Mover in:(sites Board)))) (if (< (count Pieces Mover in:(sites Board)) (score P1)) (and (set Var ""End"" 2) (set Score P2 (count Pieces Mover in:(sites Board)))) (set Var ""End"" 3))))) (if (or (= 14 (count Sites in:(sites Occupied by:P1))) (or {(all Sites (sites ""RingOne"") if:(= (who at:(site)) P1)) (all Sites (sites ""RingTwo"") if:(= (who at:(site)) P1)) (all Sites (sites ""RingThree"") if:(= (who at:(site)) P1)) (all Sites (sites ""RingFour"") if:(= (who at:(site)) P1)) (all Sites (sites ""SegmentOne"") if:(= (who at:(site)) P1)) (all Sites (sites ""SegmentTwo"") if:(= (who at:(site)) P1)) (all Sites (sites ""SegmentThree"") if:(= (who at:(site)) P1)) (all Sites (sites ""SegmentFour"") if:(= (who at:(site)) P1)) (all Sites (sites ""SegmentFive"") if:(= (who at:(site)) P1)) (all Sites (sites ""SegmentSix"") if:(= (who at:(site)) P1)) (all Sites (sites ""SegmentSeven"") if:(= (who at:(site)) P1)) (all Sites (sites ""SegmentEight"") if:(= (who at:(site)) P1))})) (if (> (score P1) 0) (set Var ""End"" 1) (if (> (count Pieces Mover in:(sites Board)) (score P2)) (and (set Var ""End"" 2) (set Score P1 (count Pieces Mover in:(sites Board)))) (if (< (count Pieces Mover in:(sites Board)) (score P2)) (and (set Var ""End"" 1) (set Score P1 (count Pieces Mover in:(sites Board)))) (set Var ""End"" 3))))))))) (end {(if (= (var ""End"") 3) (result Mover Draw)) (if (= (var ""End"") 2) (result P2 Win)) (if (= (var ""End"") 1) (result P1 Win))}))}))" "The game begins with an empty Diamond board. Black moves first, then turns alternate. (To offset any advantage Black has in moving first, the pie rule is used: White can choose to switch sides after Black's first move, playing from then on as Black. White has this option only after Black's first move.) The game is executed in two phases: 1) Placement phase. Players take turns placing one of their pieces on any open point on the board. No placements result in a capture in this phase. A player can win the game in this phase if they are able to occupy all four corners of a board square; otherwise, play proceeds to the Movement phase once all 24 pieces have been placed. 2) Movement phase. For their turn, a player may either: - move one of their pieces along a straight line to an adjacent empty point; or, - remove a neutral piece from the board—but only if no white or black piece is adjacent to it. Capturing moves are possible in the Movement phase. If the points of a triangle contain exactly one white and one black piece, either player can capture the opponent piece by occupying the remaining open point (""cornering"" the enemy piece on the triangle). If a move simultaneously corners two opponent pieces on two different triangles, then neither enemy piece is captured. A piece can move safely to a triangle point even if the other two points of the triangle are occupied by enemy pieces. A player wins by being the first to occupy all four corners (points) of a board square with their pieces. The game is drawn if any of the following occurs: - The player whose turn it is to move cannot move a piece. - In the last 50 moves (25 moves per player) no capture has been made, nor neutral piece removed.","(game ""Diamond"" (players 2) (equipment {(board (rotate 90 (tiling T33434 3)) use:Vertex) (piece ""Disc"" Each (move Step (to if:(is Empty (to))) (then (if (= 1 (count Sites in:(forEach (sites Incident Cell of:Vertex at:(last To)) if:(and {(= 3 (count Sites in:(sites Incident Vertex of:Cell at:(site)))) (= 2 (count Sites in:(forEach (sites Incident Vertex of:Cell at:(site)) if:(is Mover (who at:(site)))))) (= 1 (count Sites in:(forEach (sites Incident Vertex of:Cell at:(site)) if:(is Next (who at:(site))))))})))) (forEach Site (sites Incident Cell of:Vertex at:(last To)) (if (and {(= 3 (count Sites in:(sites Incident Vertex of:Cell at:(site)))) (= 2 (count Sites in:(forEach (sites Incident Vertex of:Cell at:(site)) if:(is Mover (who at:(site)))))) (= 1 (count Sites in:(forEach (sites Incident Vertex of:Cell at:(site)) if:(is Next (who at:(site))))))}) (and (forEach Site (forEach (sites Incident Vertex of:Cell at:(site)) if:(is Next (who at:(site)))) (and (remove (site)) (add (piece (id ""Disc"" Neutral)) (to (site))))) (set Counter)))))))) (piece ""Disc"" Neutral) (hand Each) (regions P1 {(sites Side W) (sites Side E)}) (regions P2 {(sites Side N) (sites Side S)})}) (rules (meta (swap)) (start (place ""Disc"" ""Hand"" count:12)) phases:{(phase ""Placement"" (play (move (from (handSite Mover)) (to (sites Empty)) (then (and (forEach Site (sites Incident Cell of:Vertex at:(last To)) (if (= 4 (count Sites in:(forEach (sites Incident Vertex of:Cell at:(site)) if:(is Mover (who at:(site)))))) (trigger ""Win"" Mover))) (set Counter))))) (nextPhase Mover (is Empty (handSite Mover)) ""Movement"")) (phase ""Movement"" (play (or (forEach Piece) (move Remove (sites Occupied by:Neutral)))))} (end {(if (is Triggered ""Win"" Mover) (result Mover Win)) (if (or (no Moves Mover) (= (counter) 49)) (result Mover Draw))})))","###Description The game begins with an empty Diamond board. Black moves first, then turns alternate. (To offset any advantage Black has in moving first, the pie rule is used: White can choose to switch sides after Black's first move, playing from then on as Black. White has this option only after Black's first move.) The game is executed in two phases: 1) Placement phase. Players take turns placing one of their pieces on any open point on the board. No placements result in a capture in this phase. A player can win the game in this phase if they are able to occupy all four corners of a board square; otherwise, play proceeds to the Movement phase once all 24 pieces have been placed. 2) Movement phase. For their turn, a player may either: - move one of their pieces along a straight line to an adjacent empty point; or, - remove a neutral piece from the board—but only if no white or black piece is adjacent to it. Capturing moves are possible in the Movement phase. If the points of a triangle contain exactly one white and one black piece, either player can capture the opponent piece by occupying the remaining open point (""cornering"" the enemy piece on the triangle). If a move simultaneously corners two opponent pieces on two different triangles, then neither enemy piece is captured. A piece can move safely to a triangle point even if the other two points of the triangle are occupied by enemy pieces. A player wins by being the first to occupy all four corners (points) of a board square with their pieces. The game is drawn if any of the following occurs: - The player whose turn it is to move cannot move a piece. - In the last 50 moves (25 moves per player) no capture has been made, nor neutral piece removed. @@ -3389,11 +3274,6 @@ Played on a square grid. The board begins empty. One player plays as Black, the ###Ludii (game ""BlooGo"" (players 2) (equipment {(board (square 9) use:Vertex) (piece ""Ball"" Each)}) (rules (meta (no Repeat)) (play (move Add (to (sites Empty)) (then (forEach Site (sites Occupied by:Next) (if (= (count Liberties at:(site) Orthogonal) 0) (move Remove (site) (then (addScore Mover 1)))))))) (end {(if (>= (score Mover) 5) (result Mover Win))})))" -"Definitions: -- A 'bug' is an entire group of connected, same-color stones on the board. A single stone is also a bug. -- The 'size' of a bug is the number of stones it contains. -- The 'type' of a bug is its size and shape. Rotating or reflecting the shape of a bug does not affect its type. -- 'Growing' a bug is the creation of a new bug or the enlargement a single bug, using a single stone. (Merger is never allowed.) -- 'Eating' is the removal of an adjacent bug of the same type. Play: The board starts empty. Black begins the game by placing one black stone on any empty space. Then, starting with White, the players take turns. Each turn starts with a required growth, followed by eating and bonus growth in succession until no more bugs are available to eat. Bug mergers are never allowed. Note! A player who CANNOT move, WINS. Required growth: -- The moving player must place a stone to grow a bug. -- This first growth in a turn must not result in a bug that is larger than all the other bugs on the board. Successive cycles of eating and growth: If there are any bugs that can be eaten, a new Eat-and-Bonus-Growth cycle must be taken. Eating -- A bug is chosen to do the eating. -- It must be able to grow after eating. -- It must then eat every bug that it can. (i.e. all the bugs of the same type that are next to it) Bonus Growth -- The same bug that ate must grow. -- For this bonus growth there is no limit to the size of the bug that results. If there are still bugs that can be eaten on the board, the cycle repeats. If not, the next player's turn starts. Ending the game: If you CANNOT place a stone at the beginning of your turn, you have WON. That is: you win if you’ve filled the ecosystem with your bugs so much you can no longer expand. The winner receives a point for each position where the other player could still place a stone. The more experienced player's score must exceed any handicap agreed at the begining of the game. 3 Hexagon","(game ""Bug"" (players 2) (equipment {(board (hex Hexagon 3) use:Cell) (piece ""Hex"" Each maxValue:1023)}) (rules (play (if (not (is Prev Mover)) (if (> 1 (max (union (sizes Group Mover) (sizes Group Next)))) (move Add (to (sites Board))) (move Add (to (sites Empty) if:(and (= (+ 1 (count Sites in:(sites Group from:(sites Around (to) if:(is Mover (who at:(to))))))) (+ 1 (count Sites in:(sites Group at:(regionSite (sites Around (to) if:(is Mover (who at:(to)))) index:0))))) (<= (+ 1 (count Sites in:(sites Group from:(sites Around (to) if:(is Mover (who at:(to))))))) (max (union (sizes Group Mover) (sizes Group Next))))) (apply (set Var ""Last2Grow"" (mover)))) (then (and (forEach Site (sites Group at:(last To)) (set State at:(site) 0)) (priority (do (and (forget Value All) (set Var ""LastRow"" (row of:(max (array (sites Group at:(last To))))) (then (set Var ""LastCol"" (max (results from:(sites Group at:(last To)) to:(from) (column of:(from)))) (then (forEach Site (sites Group at:(last To)) (set Value at:(site) (+ (* 32 (- (var ""LastRow"") (row of:(site)))) (- (var ""LastCol"") (column of:(site))))))))))) next:(forEach Group if:(is Next (who at:(to))) (if (and (= (size Array (array (sites))) (size Array (array (sites Group at:(last To))))) (< 0 (size Array (array (intersection (sites) (sites Around (sites Group at:(last To)))))))) (priority {(if (= 0 (size Array (difference (results from:(sites Group at:(last To)) to:(from) (+ (+ (* 32 (/ (value Piece at:(from)) 32)) (% (value Piece at:(from)) 32)) (+ (max (results from:(sites Group at:(last To)) to:(from) (- (* 32 (/ (value Piece at:(from)) 32))))) (max (results from:(sites Group at:(last To)) to:(from) (- (% (value Piece at:(from)) 32))))))) (results from:(sites) to:(from) (value Piece at:(from)))))) (forEach Site (sites) (set State at:(site) 1))) (if (= 0 (size Array (difference (results from:(sites Group at:(last To)) to:(from) (+ (+ (* 32 (/ (value Piece at:(from)) 32)) (- (/ (value Piece at:(from)) 32) (% (value Piece at:(from)) 32))) (+ (max (results from:(sites Group at:(last To)) to:(from) (- (* 32 (/ (value Piece at:(from)) 32))))) (max (results from:(sites Group at:(last To)) to:(from) (- (- (/ (value Piece at:(from)) 32) (% (value Piece at:(from)) 32)))))))) (results from:(sites) to:(from) (value Piece at:(from)))))) (forEach Site (sites) (set State at:(site) 1))) (if (= 0 (size Array (difference (results from:(sites Group at:(last To)) to:(from) (+ (+ (* 32 (- (/ (value Piece at:(from)) 32) (% (value Piece at:(from)) 32))) (/ (value Piece at:(from)) 32)) (+ (max (results from:(sites Group at:(last To)) to:(from) (- (* 32 (- (/ (value Piece at:(from)) 32) (% (value Piece at:(from)) 32)))))) (max (results from:(sites Group at:(last To)) to:(from) (- (/ (value Piece at:(from)) 32))))))) (results from:(sites) to:(from) (value Piece at:(from)))))) (forEach Site (sites) (set State at:(site) 1))) (if (= 0 (size Array (difference (results from:(sites Group at:(last To)) to:(from) (+ (+ (* 32 (% (value Piece at:(from)) 32)) (/ (value Piece at:(from)) 32)) (+ (max (results from:(sites Group at:(last To)) to:(from) (- (* 32 (% (value Piece at:(from)) 32))))) (max (results from:(sites Group at:(last To)) to:(from) (- (/ (value Piece at:(from)) 32))))))) (results from:(sites) to:(from) (value Piece at:(from)))))) (forEach Site (sites) (set State at:(site) 1))) (if (= 0 (size Array (difference (results from:(sites Group at:(last To)) to:(from) (+ (+ (* 32 (- (% (value Piece at:(from)) 32))) (- (/ (value Piece at:(from)) 32) (% (value Piece at:(from)) 32))) (+ (max (results from:(sites Group at:(last To)) to:(from) (- (* 32 (- (% (value Piece at:(from)) 32)))))) (max (results from:(sites Group at:(last To)) to:(from) (- (- (/ (value Piece at:(from)) 32) (% (value Piece at:(from)) 32)))))))) (results from:(sites) to:(from) (value Piece at:(from)))))) (forEach Site (sites) (set State at:(site) 1))) (if (= 0 (size Array (difference (results from:(sites Group at:(last To)) to:(from) (+ (+ (* 32 (- (% (value Piece at:(from)) 32) (/ (value Piece at:(from)) 32))) (% (value Piece at:(from)) 32)) (+ (max (results from:(sites Group at:(last To)) to:(from) (- (* 32 (- (% (value Piece at:(from)) 32) (/ (value Piece at:(from)) 32)))))) (max (results from:(sites Group at:(last To)) to:(from) (- (% (value Piece at:(from)) 32))))))) (results from:(sites) to:(from) (value Piece at:(from)))))) (forEach Site (sites) (set State at:(site) 1))) (if (= 0 (size Array (difference (results from:(sites Group at:(last To)) to:(from) (+ (+ (* 32 (- (/ (value Piece at:(from)) 32))) (- (% (value Piece at:(from)) 32))) (+ (max (results from:(sites Group at:(last To)) to:(from) (- (* 32 (- (/ (value Piece at:(from)) 32)))))) (max (results from:(sites Group at:(last To)) to:(from) (- (- (% (value Piece at:(from)) 32)))))))) (results from:(sites) to:(from) (value Piece at:(from)))))) (forEach Site (sites) (set State at:(site) 1))) (if (= 0 (size Array (difference (results from:(sites Group at:(last To)) to:(from) (+ (+ (* 32 (- (/ (value Piece at:(from)) 32))) (- (% (value Piece at:(from)) 32) (/ (value Piece at:(from)) 32))) (+ (max (results from:(sites Group at:(last To)) to:(from) (- (* 32 (- (/ (value Piece at:(from)) 32)))))) (max (results from:(sites Group at:(last To)) to:(from) (- (- (% (value Piece at:(from)) 32) (/ (value Piece at:(from)) 32)))))))) (results from:(sites) to:(from) (value Piece at:(from)))))) (forEach Site (sites) (set State at:(site) 1))) (if (= 0 (size Array (difference (results from:(sites Group at:(last To)) to:(from) (+ (+ (* 32 (- (% (value Piece at:(from)) 32) (/ (value Piece at:(from)) 32))) (- (/ (value Piece at:(from)) 32))) (+ (max (results from:(sites Group at:(last To)) to:(from) (- (* 32 (- (% (value Piece at:(from)) 32) (/ (value Piece at:(from)) 32)))))) (max (results from:(sites Group at:(last To)) to:(from) (- (- (/ (value Piece at:(from)) 32)))))))) (results from:(sites) to:(from) (value Piece at:(from)))))) (forEach Site (sites) (set State at:(site) 1))) (if (= 0 (size Array (difference (results from:(sites Group at:(last To)) to:(from) (+ (+ (* 32 (- (% (value Piece at:(from)) 32))) (- (/ (value Piece at:(from)) 32))) (+ (max (results from:(sites Group at:(last To)) to:(from) (- (* 32 (- (% (value Piece at:(from)) 32)))))) (max (results from:(sites Group at:(last To)) to:(from) (- (- (/ (value Piece at:(from)) 32)))))))) (results from:(sites) to:(from) (value Piece at:(from)))))) (forEach Site (sites) (set State at:(site) 1))) (if (= 0 (size Array (difference (results from:(sites Group at:(last To)) to:(from) (+ (+ (* 32 (% (value Piece at:(from)) 32)) (- (% (value Piece at:(from)) 32) (/ (value Piece at:(from)) 32))) (+ (max (results from:(sites Group at:(last To)) to:(from) (- (* 32 (% (value Piece at:(from)) 32))))) (max (results from:(sites Group at:(last To)) to:(from) (- (- (% (value Piece at:(from)) 32) (/ (value Piece at:(from)) 32)))))))) (results from:(sites) to:(from) (value Piece at:(from)))))) (forEach Site (sites) (set State at:(site) 1))) (if (= 0 (size Array (difference (results from:(sites Group at:(last To)) to:(from) (+ (+ (* 32 (- (/ (value Piece at:(from)) 32) (% (value Piece at:(from)) 32))) (- (% (value Piece at:(from)) 32))) (+ (max (results from:(sites Group at:(last To)) to:(from) (- (* 32 (- (/ (value Piece at:(from)) 32) (% (value Piece at:(from)) 32)))))) (max (results from:(sites Group at:(last To)) to:(from) (- (- (% (value Piece at:(from)) 32)))))))) (results from:(sites) to:(from) (value Piece at:(from)))))) (forEach Site (sites) (set State at:(site) 1)))} (then (forEach Site (sites Group at:(last To)) (set State at:(site) 1) (then (moveAgain)))))))) (and (forget Value All) (set Var ""LastRow"" (row of:(max (array (sites Group at:(last To))))) (then (set Var ""LastCol"" (max (results from:(sites Group at:(last To)) to:(from) (column of:(from)))) (then (forEach Site (sites Group at:(last To)) (set Value at:(site) (+ (* 32 (- (var ""LastRow"") (row of:(site)))) (- (var ""LastCol"") (column of:(site)))))))))))))))) (if (= 0 (size Array (values Remembered))) (do (forEach Group if:(and (is Mover (who at:(to))) (= 1 (state at:(to)))) (move Select (from (max (array (sites)))) (then (forEach Group if:(is Next (who at:(to))) (if (and (= (size Array (array (sites))) (size Array (array (sites Group at:(last To))))) (< 0 (size Array (array (intersection (sites) (sites Around (sites Group at:(last To)))))))) (priority {(if (= 0 (size Array (difference (results from:(sites Group at:(last To)) to:(from) (+ (+ (* 32 (/ (value Piece at:(from)) 32)) (% (value Piece at:(from)) 32)) (+ (max (results from:(sites Group at:(last To)) to:(from) (- (* 32 (/ (value Piece at:(from)) 32))))) (max (results from:(sites Group at:(last To)) to:(from) (- (% (value Piece at:(from)) 32))))))) (results from:(sites) to:(from) (value Piece at:(from)))))) (forEach Value (array (sites)) (remember Value (value)))) (if (= 0 (size Array (difference (results from:(sites Group at:(last To)) to:(from) (+ (+ (* 32 (/ (value Piece at:(from)) 32)) (- (/ (value Piece at:(from)) 32) (% (value Piece at:(from)) 32))) (+ (max (results from:(sites Group at:(last To)) to:(from) (- (* 32 (/ (value Piece at:(from)) 32))))) (max (results from:(sites Group at:(last To)) to:(from) (- (- (/ (value Piece at:(from)) 32) (% (value Piece at:(from)) 32)))))))) (results from:(sites) to:(from) (value Piece at:(from)))))) (forEach Value (array (sites)) (remember Value (value)))) (if (= 0 (size Array (difference (results from:(sites Group at:(last To)) to:(from) (+ (+ (* 32 (- (/ (value Piece at:(from)) 32) (% (value Piece at:(from)) 32))) (/ (value Piece at:(from)) 32)) (+ (max (results from:(sites Group at:(last To)) to:(from) (- (* 32 (- (/ (value Piece at:(from)) 32) (% (value Piece at:(from)) 32)))))) (max (results from:(sites Group at:(last To)) to:(from) (- (/ (value Piece at:(from)) 32))))))) (results from:(sites) to:(from) (value Piece at:(from)))))) (forEach Value (array (sites)) (remember Value (value)))) (if (= 0 (size Array (difference (results from:(sites Group at:(last To)) to:(from) (+ (+ (* 32 (% (value Piece at:(from)) 32)) (/ (value Piece at:(from)) 32)) (+ (max (results from:(sites Group at:(last To)) to:(from) (- (* 32 (% (value Piece at:(from)) 32))))) (max (results from:(sites Group at:(last To)) to:(from) (- (/ (value Piece at:(from)) 32))))))) (results from:(sites) to:(from) (value Piece at:(from)))))) (forEach Value (array (sites)) (remember Value (value)))) (if (= 0 (size Array (difference (results from:(sites Group at:(last To)) to:(from) (+ (+ (* 32 (- (% (value Piece at:(from)) 32))) (- (/ (value Piece at:(from)) 32) (% (value Piece at:(from)) 32))) (+ (max (results from:(sites Group at:(last To)) to:(from) (- (* 32 (- (% (value Piece at:(from)) 32)))))) (max (results from:(sites Group at:(last To)) to:(from) (- (- (/ (value Piece at:(from)) 32) (% (value Piece at:(from)) 32)))))))) (results from:(sites) to:(from) (value Piece at:(from)))))) (forEach Value (array (sites)) (remember Value (value)))) (if (= 0 (size Array (difference (results from:(sites Group at:(last To)) to:(from) (+ (+ (* 32 (- (% (value Piece at:(from)) 32) (/ (value Piece at:(from)) 32))) (% (value Piece at:(from)) 32)) (+ (max (results from:(sites Group at:(last To)) to:(from) (- (* 32 (- (% (value Piece at:(from)) 32) (/ (value Piece at:(from)) 32)))))) (max (results from:(sites Group at:(last To)) to:(from) (- (% (value Piece at:(from)) 32))))))) (results from:(sites) to:(from) (value Piece at:(from)))))) (forEach Value (array (sites)) (remember Value (value)))) (if (= 0 (size Array (difference (results from:(sites Group at:(last To)) to:(from) (+ (+ (* 32 (- (/ (value Piece at:(from)) 32))) (- (% (value Piece at:(from)) 32))) (+ (max (results from:(sites Group at:(last To)) to:(from) (- (* 32 (- (/ (value Piece at:(from)) 32)))))) (max (results from:(sites Group at:(last To)) to:(from) (- (- (% (value Piece at:(from)) 32)))))))) (results from:(sites) to:(from) (value Piece at:(from)))))) (forEach Value (array (sites)) (remember Value (value)))) (if (= 0 (size Array (difference (results from:(sites Group at:(last To)) to:(from) (+ (+ (* 32 (- (/ (value Piece at:(from)) 32))) (- (% (value Piece at:(from)) 32) (/ (value Piece at:(from)) 32))) (+ (max (results from:(sites Group at:(last To)) to:(from) (- (* 32 (- (/ (value Piece at:(from)) 32)))))) (max (results from:(sites Group at:(last To)) to:(from) (- (- (% (value Piece at:(from)) 32) (/ (value Piece at:(from)) 32)))))))) (results from:(sites) to:(from) (value Piece at:(from)))))) (forEach Value (array (sites)) (remember Value (value)))) (if (= 0 (size Array (difference (results from:(sites Group at:(last To)) to:(from) (+ (+ (* 32 (- (% (value Piece at:(from)) 32) (/ (value Piece at:(from)) 32))) (- (/ (value Piece at:(from)) 32))) (+ (max (results from:(sites Group at:(last To)) to:(from) (- (* 32 (- (% (value Piece at:(from)) 32) (/ (value Piece at:(from)) 32)))))) (max (results from:(sites Group at:(last To)) to:(from) (- (- (/ (value Piece at:(from)) 32)))))))) (results from:(sites) to:(from) (value Piece at:(from)))))) (forEach Value (array (sites)) (remember Value (value)))) (if (= 0 (size Array (difference (results from:(sites Group at:(last To)) to:(from) (+ (+ (* 32 (- (% (value Piece at:(from)) 32))) (- (/ (value Piece at:(from)) 32))) (+ (max (results from:(sites Group at:(last To)) to:(from) (- (* 32 (- (% (value Piece at:(from)) 32)))))) (max (results from:(sites Group at:(last To)) to:(from) (- (- (/ (value Piece at:(from)) 32)))))))) (results from:(sites) to:(from) (value Piece at:(from)))))) (forEach Value (array (sites)) (remember Value (value)))) (if (= 0 (size Array (difference (results from:(sites Group at:(last To)) to:(from) (+ (+ (* 32 (% (value Piece at:(from)) 32)) (- (% (value Piece at:(from)) 32) (/ (value Piece at:(from)) 32))) (+ (max (results from:(sites Group at:(last To)) to:(from) (- (* 32 (% (value Piece at:(from)) 32))))) (max (results from:(sites Group at:(last To)) to:(from) (- (- (% (value Piece at:(from)) 32) (/ (value Piece at:(from)) 32)))))))) (results from:(sites) to:(from) (value Piece at:(from)))))) (forEach Value (array (sites)) (remember Value (value)))) (if (= 0 (size Array (difference (results from:(sites Group at:(last To)) to:(from) (+ (+ (* 32 (- (/ (value Piece at:(from)) 32) (% (value Piece at:(from)) 32))) (- (% (value Piece at:(from)) 32))) (+ (max (results from:(sites Group at:(last To)) to:(from) (- (* 32 (- (/ (value Piece at:(from)) 32) (% (value Piece at:(from)) 32)))))) (max (results from:(sites Group at:(last To)) to:(from) (- (- (% (value Piece at:(from)) 32)))))))) (results from:(sites) to:(from) (value Piece at:(from)))))) (forEach Value (array (sites)) (remember Value (value))))} (then (and {(remove (sites (values Remembered))) (forEach Site (sites Group at:(last To)) (set State at:(site) 0)) (moveAgain)})))))))) ifAfterwards:(< 0 (count Sites in:(difference (intersection (sites Empty) (sites Around (sites Group at:(last To)))) (sites Around (difference (sites Occupied by:Mover) (sites Group at:(last To)))))))) (move Add (to (sites Empty) if:(and (is In (to) (sites Around (sites Group at:(last From)))) (= (+ 1 (count Sites in:(sites Group from:(sites Around (to) if:(is Mover (who at:(to))))))) (+ 1 (count Sites in:(sites Group at:(regionSite (sites Around (to) if:(is Mover (who at:(to)))) index:0))))))) (then (and (forEach Site (sites Group at:(last To)) (set State at:(site) 0)) (priority (do (and (forget Value All) (set Var ""LastRow"" (row of:(max (array (sites Group at:(last To))))) (then (set Var ""LastCol"" (max (results from:(sites Group at:(last To)) to:(from) (column of:(from)))) (then (forEach Site (sites Group at:(last To)) (set Value at:(site) (+ (* 32 (- (var ""LastRow"") (row of:(site)))) (- (var ""LastCol"") (column of:(site))))))))))) next:(forEach Group if:(is Next (who at:(to))) (if (and (= (size Array (array (sites))) (size Array (array (sites Group at:(last To))))) (< 0 (size Array (array (intersection (sites) (sites Around (sites Group at:(last To)))))))) (priority {(if (= 0 (size Array (difference (results from:(sites Group at:(last To)) to:(from) (+ (+ (* 32 (/ (value Piece at:(from)) 32)) (% (value Piece at:(from)) 32)) (+ (max (results from:(sites Group at:(last To)) to:(from) (- (* 32 (/ (value Piece at:(from)) 32))))) (max (results from:(sites Group at:(last To)) to:(from) (- (% (value Piece at:(from)) 32))))))) (results from:(sites) to:(from) (value Piece at:(from)))))) (forEach Site (sites) (set State at:(site) 1))) (if (= 0 (size Array (difference (results from:(sites Group at:(last To)) to:(from) (+ (+ (* 32 (/ (value Piece at:(from)) 32)) (- (/ (value Piece at:(from)) 32) (% (value Piece at:(from)) 32))) (+ (max (results from:(sites Group at:(last To)) to:(from) (- (* 32 (/ (value Piece at:(from)) 32))))) (max (results from:(sites Group at:(last To)) to:(from) (- (- (/ (value Piece at:(from)) 32) (% (value Piece at:(from)) 32)))))))) (results from:(sites) to:(from) (value Piece at:(from)))))) (forEach Site (sites) (set State at:(site) 1))) (if (= 0 (size Array (difference (results from:(sites Group at:(last To)) to:(from) (+ (+ (* 32 (- (/ (value Piece at:(from)) 32) (% (value Piece at:(from)) 32))) (/ (value Piece at:(from)) 32)) (+ (max (results from:(sites Group at:(last To)) to:(from) (- (* 32 (- (/ (value Piece at:(from)) 32) (% (value Piece at:(from)) 32)))))) (max (results from:(sites Group at:(last To)) to:(from) (- (/ (value Piece at:(from)) 32))))))) (results from:(sites) to:(from) (value Piece at:(from)))))) (forEach Site (sites) (set State at:(site) 1))) (if (= 0 (size Array (difference (results from:(sites Group at:(last To)) to:(from) (+ (+ (* 32 (% (value Piece at:(from)) 32)) (/ (value Piece at:(from)) 32)) (+ (max (results from:(sites Group at:(last To)) to:(from) (- (* 32 (% (value Piece at:(from)) 32))))) (max (results from:(sites Group at:(last To)) to:(from) (- (/ (value Piece at:(from)) 32))))))) (results from:(sites) to:(from) (value Piece at:(from)))))) (forEach Site (sites) (set State at:(site) 1))) (if (= 0 (size Array (difference (results from:(sites Group at:(last To)) to:(from) (+ (+ (* 32 (- (% (value Piece at:(from)) 32))) (- (/ (value Piece at:(from)) 32) (% (value Piece at:(from)) 32))) (+ (max (results from:(sites Group at:(last To)) to:(from) (- (* 32 (- (% (value Piece at:(from)) 32)))))) (max (results from:(sites Group at:(last To)) to:(from) (- (- (/ (value Piece at:(from)) 32) (% (value Piece at:(from)) 32)))))))) (results from:(sites) to:(from) (value Piece at:(from)))))) (forEach Site (sites) (set State at:(site) 1))) (if (= 0 (size Array (difference (results from:(sites Group at:(last To)) to:(from) (+ (+ (* 32 (- (% (value Piece at:(from)) 32) (/ (value Piece at:(from)) 32))) (% (value Piece at:(from)) 32)) (+ (max (results from:(sites Group at:(last To)) to:(from) (- (* 32 (- (% (value Piece at:(from)) 32) (/ (value Piece at:(from)) 32)))))) (max (results from:(sites Group at:(last To)) to:(from) (- (% (value Piece at:(from)) 32))))))) (results from:(sites) to:(from) (value Piece at:(from)))))) (forEach Site (sites) (set State at:(site) 1))) (if (= 0 (size Array (difference (results from:(sites Group at:(last To)) to:(from) (+ (+ (* 32 (- (/ (value Piece at:(from)) 32))) (- (% (value Piece at:(from)) 32))) (+ (max (results from:(sites Group at:(last To)) to:(from) (- (* 32 (- (/ (value Piece at:(from)) 32)))))) (max (results from:(sites Group at:(last To)) to:(from) (- (- (% (value Piece at:(from)) 32)))))))) (results from:(sites) to:(from) (value Piece at:(from)))))) (forEach Site (sites) (set State at:(site) 1))) (if (= 0 (size Array (difference (results from:(sites Group at:(last To)) to:(from) (+ (+ (* 32 (- (/ (value Piece at:(from)) 32))) (- (% (value Piece at:(from)) 32) (/ (value Piece at:(from)) 32))) (+ (max (results from:(sites Group at:(last To)) to:(from) (- (* 32 (- (/ (value Piece at:(from)) 32)))))) (max (results from:(sites Group at:(last To)) to:(from) (- (- (% (value Piece at:(from)) 32) (/ (value Piece at:(from)) 32)))))))) (results from:(sites) to:(from) (value Piece at:(from)))))) (forEach Site (sites) (set State at:(site) 1))) (if (= 0 (size Array (difference (results from:(sites Group at:(last To)) to:(from) (+ (+ (* 32 (- (% (value Piece at:(from)) 32) (/ (value Piece at:(from)) 32))) (- (/ (value Piece at:(from)) 32))) (+ (max (results from:(sites Group at:(last To)) to:(from) (- (* 32 (- (% (value Piece at:(from)) 32) (/ (value Piece at:(from)) 32)))))) (max (results from:(sites Group at:(last To)) to:(from) (- (- (/ (value Piece at:(from)) 32)))))))) (results from:(sites) to:(from) (value Piece at:(from)))))) (forEach Site (sites) (set State at:(site) 1))) (if (= 0 (size Array (difference (results from:(sites Group at:(last To)) to:(from) (+ (+ (* 32 (- (% (value Piece at:(from)) 32))) (- (/ (value Piece at:(from)) 32))) (+ (max (results from:(sites Group at:(last To)) to:(from) (- (* 32 (- (% (value Piece at:(from)) 32)))))) (max (results from:(sites Group at:(last To)) to:(from) (- (- (/ (value Piece at:(from)) 32)))))))) (results from:(sites) to:(from) (value Piece at:(from)))))) (forEach Site (sites) (set State at:(site) 1))) (if (= 0 (size Array (difference (results from:(sites Group at:(last To)) to:(from) (+ (+ (* 32 (% (value Piece at:(from)) 32)) (- (% (value Piece at:(from)) 32) (/ (value Piece at:(from)) 32))) (+ (max (results from:(sites Group at:(last To)) to:(from) (- (* 32 (% (value Piece at:(from)) 32))))) (max (results from:(sites Group at:(last To)) to:(from) (- (- (% (value Piece at:(from)) 32) (/ (value Piece at:(from)) 32)))))))) (results from:(sites) to:(from) (value Piece at:(from)))))) (forEach Site (sites) (set State at:(site) 1))) (if (= 0 (size Array (difference (results from:(sites Group at:(last To)) to:(from) (+ (+ (* 32 (- (/ (value Piece at:(from)) 32) (% (value Piece at:(from)) 32))) (- (% (value Piece at:(from)) 32))) (+ (max (results from:(sites Group at:(last To)) to:(from) (- (* 32 (- (/ (value Piece at:(from)) 32) (% (value Piece at:(from)) 32)))))) (max (results from:(sites Group at:(last To)) to:(from) (- (- (% (value Piece at:(from)) 32)))))))) (results from:(sites) to:(from) (value Piece at:(from)))))) (forEach Site (sites) (set State at:(site) 1)))} (then (forEach Site (sites Group at:(last To)) (set State at:(site) 1) (then (moveAgain)))))))) (and (forget Value All) (set Var ""LastRow"" (row of:(max (array (sites Group at:(last To))))) (then (set Var ""LastCol"" (max (results from:(sites Group at:(last To)) to:(from) (column of:(from)))) (then (forEach Site (sites Group at:(last To)) (set Value at:(site) (+ (* 32 (- (var ""LastRow"") (row of:(site)))) (- (var ""LastCol"") (column of:(site)))))))))))))))) (then (and (set Score Mover 0) (set Score Next (count Sites in:(sites To (move Add (to (sites Empty) if:(and (= (+ 1 (count Sites in:(sites Group from:(sites Around (to) if:(is Mover (who at:(to))))))) (+ 1 (count Sites in:(sites Group at:(regionSite (sites Around (to) if:(is Mover (who at:(to)))) index:0))))) (<= (+ 1 (count Sites in:(sites Group from:(sites Around (to) if:(is Mover (who at:(to))))))) (max (union (sizes Group Mover) (sizes Group Next)))))))))))))) (end (if (and (no Moves Mover) (not (is Prev Mover))) (if (= (var ""Last2Grow"") (mover)) (result Mover Loss)) (result Mover Win)))))","###Description -Definitions: -- A 'bug' is an entire group of connected, same-color stones on the board. A single stone is also a bug. -- The 'size' of a bug is the number of stones it contains. -- The 'type' of a bug is its size and shape. Rotating or reflecting the shape of a bug does not affect its type. -- 'Growing' a bug is the creation of a new bug or the enlargement a single bug, using a single stone. (Merger is never allowed.) -- 'Eating' is the removal of an adjacent bug of the same type. Play: The board starts empty. Black begins the game by placing one black stone on any empty space. Then, starting with White, the players take turns. Each turn starts with a required growth, followed by eating and bonus growth in succession until no more bugs are available to eat. Bug mergers are never allowed. Note! A player who CANNOT move, WINS. Required growth: -- The moving player must place a stone to grow a bug. -- This first growth in a turn must not result in a bug that is larger than all the other bugs on the board. Successive cycles of eating and growth: If there are any bugs that can be eaten, a new Eat-and-Bonus-Growth cycle must be taken. Eating -- A bug is chosen to do the eating. -- It must be able to grow after eating. -- It must then eat every bug that it can. (i.e. all the bugs of the same type that are next to it) Bonus Growth -- The same bug that ate must grow. -- For this bonus growth there is no limit to the size of the bug that results. If there are still bugs that can be eaten on the board, the cycle repeats. If not, the next player's turn starts. Ending the game: If you CANNOT place a stone at the beginning of your turn, you have WON. That is: you win if you’ve filled the ecosystem with your bugs so much you can no longer expand. The winner receives a point for each position where the other player could still place a stone. The more experienced player's score must exceed any handicap agreed at the begining of the game. 3 Hexagon - -###Ludii -(game ""Bug"" (players 2) (equipment {(board (hex Hexagon 3) use:Cell) (piece ""Hex"" Each maxValue:1023)}) (rules (play (if (not (is Prev Mover)) (if (> 1 (max (union (sizes Group Mover) (sizes Group Next)))) (move Add (to (sites Board))) (move Add (to (sites Empty) if:(and (= (+ 1 (count Sites in:(sites Group from:(sites Around (to) if:(is Mover (who at:(to))))))) (+ 1 (count Sites in:(sites Group at:(regionSite (sites Around (to) if:(is Mover (who at:(to)))) index:0))))) (<= (+ 1 (count Sites in:(sites Group from:(sites Around (to) if:(is Mover (who at:(to))))))) (max (union (sizes Group Mover) (sizes Group Next))))) (apply (set Var ""Last2Grow"" (mover)))) (then (and (forEach Site (sites Group at:(last To)) (set State at:(site) 0)) (priority (do (and (forget Value All) (set Var ""LastRow"" (row of:(max (array (sites Group at:(last To))))) (then (set Var ""LastCol"" (max (results from:(sites Group at:(last To)) to:(from) (column of:(from)))) (then (forEach Site (sites Group at:(last To)) (set Value at:(site) (+ (* 32 (- (var ""LastRow"") (row of:(site)))) (- (var ""LastCol"") (column of:(site))))))))))) next:(forEach Group if:(is Next (who at:(to))) (if (and (= (size Array (array (sites))) (size Array (array (sites Group at:(last To))))) (< 0 (size Array (array (intersection (sites) (sites Around (sites Group at:(last To)))))))) (priority {(if (= 0 (size Array (difference (results from:(sites Group at:(last To)) to:(from) (+ (+ (* 32 (/ (value Piece at:(from)) 32)) (% (value Piece at:(from)) 32)) (+ (max (results from:(sites Group at:(last To)) to:(from) (- (* 32 (/ (value Piece at:(from)) 32))))) (max (results from:(sites Group at:(last To)) to:(from) (- (% (value Piece at:(from)) 32))))))) (results from:(sites) to:(from) (value Piece at:(from)))))) (forEach Site (sites) (set State at:(site) 1))) (if (= 0 (size Array (difference (results from:(sites Group at:(last To)) to:(from) (+ (+ (* 32 (/ (value Piece at:(from)) 32)) (- (/ (value Piece at:(from)) 32) (% (value Piece at:(from)) 32))) (+ (max (results from:(sites Group at:(last To)) to:(from) (- (* 32 (/ (value Piece at:(from)) 32))))) (max (results from:(sites Group at:(last To)) to:(from) (- (- (/ (value Piece at:(from)) 32) (% (value Piece at:(from)) 32)))))))) (results from:(sites) to:(from) (value Piece at:(from)))))) (forEach Site (sites) (set State at:(site) 1))) (if (= 0 (size Array (difference (results from:(sites Group at:(last To)) to:(from) (+ (+ (* 32 (- (/ (value Piece at:(from)) 32) (% (value Piece at:(from)) 32))) (/ (value Piece at:(from)) 32)) (+ (max (results from:(sites Group at:(last To)) to:(from) (- (* 32 (- (/ (value Piece at:(from)) 32) (% (value Piece at:(from)) 32)))))) (max (results from:(sites Group at:(last To)) to:(from) (- (/ (value Piece at:(from)) 32))))))) (results from:(sites) to:(from) (value Piece at:(from)))))) (forEach Site (sites) (set State at:(site) 1))) (if (= 0 (size Array (difference (results from:(sites Group at:(last To)) to:(from) (+ (+ (* 32 (% (value Piece at:(from)) 32)) (/ (value Piece at:(from)) 32)) (+ (max (results from:(sites Group at:(last To)) to:(from) (- (* 32 (% (value Piece at:(from)) 32))))) (max (results from:(sites Group at:(last To)) to:(from) (- (/ (value Piece at:(from)) 32))))))) (results from:(sites) to:(from) (value Piece at:(from)))))) (forEach Site (sites) (set State at:(site) 1))) (if (= 0 (size Array (difference (results from:(sites Group at:(last To)) to:(from) (+ (+ (* 32 (- (% (value Piece at:(from)) 32))) (- (/ (value Piece at:(from)) 32) (% (value Piece at:(from)) 32))) (+ (max (results from:(sites Group at:(last To)) to:(from) (- (* 32 (- (% (value Piece at:(from)) 32)))))) (max (results from:(sites Group at:(last To)) to:(from) (- (- (/ (value Piece at:(from)) 32) (% (value Piece at:(from)) 32)))))))) (results from:(sites) to:(from) (value Piece at:(from)))))) (forEach Site (sites) (set State at:(site) 1))) (if (= 0 (size Array (difference (results from:(sites Group at:(last To)) to:(from) (+ (+ (* 32 (- (% (value Piece at:(from)) 32) (/ (value Piece at:(from)) 32))) (% (value Piece at:(from)) 32)) (+ (max (results from:(sites Group at:(last To)) to:(from) (- (* 32 (- (% (value Piece at:(from)) 32) (/ (value Piece at:(from)) 32)))))) (max (results from:(sites Group at:(last To)) to:(from) (- (% (value Piece at:(from)) 32))))))) (results from:(sites) to:(from) (value Piece at:(from)))))) (forEach Site (sites) (set State at:(site) 1))) (if (= 0 (size Array (difference (results from:(sites Group at:(last To)) to:(from) (+ (+ (* 32 (- (/ (value Piece at:(from)) 32))) (- (% (value Piece at:(from)) 32))) (+ (max (results from:(sites Group at:(last To)) to:(from) (- (* 32 (- (/ (value Piece at:(from)) 32)))))) (max (results from:(sites Group at:(last To)) to:(from) (- (- (% (value Piece at:(from)) 32)))))))) (results from:(sites) to:(from) (value Piece at:(from)))))) (forEach Site (sites) (set State at:(site) 1))) (if (= 0 (size Array (difference (results from:(sites Group at:(last To)) to:(from) (+ (+ (* 32 (- (/ (value Piece at:(from)) 32))) (- (% (value Piece at:(from)) 32) (/ (value Piece at:(from)) 32))) (+ (max (results from:(sites Group at:(last To)) to:(from) (- (* 32 (- (/ (value Piece at:(from)) 32)))))) (max (results from:(sites Group at:(last To)) to:(from) (- (- (% (value Piece at:(from)) 32) (/ (value Piece at:(from)) 32)))))))) (results from:(sites) to:(from) (value Piece at:(from)))))) (forEach Site (sites) (set State at:(site) 1))) (if (= 0 (size Array (difference (results from:(sites Group at:(last To)) to:(from) (+ (+ (* 32 (- (% (value Piece at:(from)) 32) (/ (value Piece at:(from)) 32))) (- (/ (value Piece at:(from)) 32))) (+ (max (results from:(sites Group at:(last To)) to:(from) (- (* 32 (- (% (value Piece at:(from)) 32) (/ (value Piece at:(from)) 32)))))) (max (results from:(sites Group at:(last To)) to:(from) (- (- (/ (value Piece at:(from)) 32)))))))) (results from:(sites) to:(from) (value Piece at:(from)))))) (forEach Site (sites) (set State at:(site) 1))) (if (= 0 (size Array (difference (results from:(sites Group at:(last To)) to:(from) (+ (+ (* 32 (- (% (value Piece at:(from)) 32))) (- (/ (value Piece at:(from)) 32))) (+ (max (results from:(sites Group at:(last To)) to:(from) (- (* 32 (- (% (value Piece at:(from)) 32)))))) (max (results from:(sites Group at:(last To)) to:(from) (- (- (/ (value Piece at:(from)) 32)))))))) (results from:(sites) to:(from) (value Piece at:(from)))))) (forEach Site (sites) (set State at:(site) 1))) (if (= 0 (size Array (difference (results from:(sites Group at:(last To)) to:(from) (+ (+ (* 32 (% (value Piece at:(from)) 32)) (- (% (value Piece at:(from)) 32) (/ (value Piece at:(from)) 32))) (+ (max (results from:(sites Group at:(last To)) to:(from) (- (* 32 (% (value Piece at:(from)) 32))))) (max (results from:(sites Group at:(last To)) to:(from) (- (- (% (value Piece at:(from)) 32) (/ (value Piece at:(from)) 32)))))))) (results from:(sites) to:(from) (value Piece at:(from)))))) (forEach Site (sites) (set State at:(site) 1))) (if (= 0 (size Array (difference (results from:(sites Group at:(last To)) to:(from) (+ (+ (* 32 (- (/ (value Piece at:(from)) 32) (% (value Piece at:(from)) 32))) (- (% (value Piece at:(from)) 32))) (+ (max (results from:(sites Group at:(last To)) to:(from) (- (* 32 (- (/ (value Piece at:(from)) 32) (% (value Piece at:(from)) 32)))))) (max (results from:(sites Group at:(last To)) to:(from) (- (- (% (value Piece at:(from)) 32)))))))) (results from:(sites) to:(from) (value Piece at:(from)))))) (forEach Site (sites) (set State at:(site) 1)))} (then (forEach Site (sites Group at:(last To)) (set State at:(site) 1) (then (moveAgain)))))))) (and (forget Value All) (set Var ""LastRow"" (row of:(max (array (sites Group at:(last To))))) (then (set Var ""LastCol"" (max (results from:(sites Group at:(last To)) to:(from) (column of:(from)))) (then (forEach Site (sites Group at:(last To)) (set Value at:(site) (+ (* 32 (- (var ""LastRow"") (row of:(site)))) (- (var ""LastCol"") (column of:(site)))))))))))))))) (if (= 0 (size Array (values Remembered))) (do (forEach Group if:(and (is Mover (who at:(to))) (= 1 (state at:(to)))) (move Select (from (max (array (sites)))) (then (forEach Group if:(is Next (who at:(to))) (if (and (= (size Array (array (sites))) (size Array (array (sites Group at:(last To))))) (< 0 (size Array (array (intersection (sites) (sites Around (sites Group at:(last To)))))))) (priority {(if (= 0 (size Array (difference (results from:(sites Group at:(last To)) to:(from) (+ (+ (* 32 (/ (value Piece at:(from)) 32)) (% (value Piece at:(from)) 32)) (+ (max (results from:(sites Group at:(last To)) to:(from) (- (* 32 (/ (value Piece at:(from)) 32))))) (max (results from:(sites Group at:(last To)) to:(from) (- (% (value Piece at:(from)) 32))))))) (results from:(sites) to:(from) (value Piece at:(from)))))) (forEach Value (array (sites)) (remember Value (value)))) (if (= 0 (size Array (difference (results from:(sites Group at:(last To)) to:(from) (+ (+ (* 32 (/ (value Piece at:(from)) 32)) (- (/ (value Piece at:(from)) 32) (% (value Piece at:(from)) 32))) (+ (max (results from:(sites Group at:(last To)) to:(from) (- (* 32 (/ (value Piece at:(from)) 32))))) (max (results from:(sites Group at:(last To)) to:(from) (- (- (/ (value Piece at:(from)) 32) (% (value Piece at:(from)) 32)))))))) (results from:(sites) to:(from) (value Piece at:(from)))))) (forEach Value (array (sites)) (remember Value (value)))) (if (= 0 (size Array (difference (results from:(sites Group at:(last To)) to:(from) (+ (+ (* 32 (- (/ (value Piece at:(from)) 32) (% (value Piece at:(from)) 32))) (/ (value Piece at:(from)) 32)) (+ (max (results from:(sites Group at:(last To)) to:(from) (- (* 32 (- (/ (value Piece at:(from)) 32) (% (value Piece at:(from)) 32)))))) (max (results from:(sites Group at:(last To)) to:(from) (- (/ (value Piece at:(from)) 32))))))) (results from:(sites) to:(from) (value Piece at:(from)))))) (forEach Value (array (sites)) (remember Value (value)))) (if (= 0 (size Array (difference (results from:(sites Group at:(last To)) to:(from) (+ (+ (* 32 (% (value Piece at:(from)) 32)) (/ (value Piece at:(from)) 32)) (+ (max (results from:(sites Group at:(last To)) to:(from) (- (* 32 (% (value Piece at:(from)) 32))))) (max (results from:(sites Group at:(last To)) to:(from) (- (/ (value Piece at:(from)) 32))))))) (results from:(sites) to:(from) (value Piece at:(from)))))) (forEach Value (array (sites)) (remember Value (value)))) (if (= 0 (size Array (difference (results from:(sites Group at:(last To)) to:(from) (+ (+ (* 32 (- (% (value Piece at:(from)) 32))) (- (/ (value Piece at:(from)) 32) (% (value Piece at:(from)) 32))) (+ (max (results from:(sites Group at:(last To)) to:(from) (- (* 32 (- (% (value Piece at:(from)) 32)))))) (max (results from:(sites Group at:(last To)) to:(from) (- (- (/ (value Piece at:(from)) 32) (% (value Piece at:(from)) 32)))))))) (results from:(sites) to:(from) (value Piece at:(from)))))) (forEach Value (array (sites)) (remember Value (value)))) (if (= 0 (size Array (difference (results from:(sites Group at:(last To)) to:(from) (+ (+ (* 32 (- (% (value Piece at:(from)) 32) (/ (value Piece at:(from)) 32))) (% (value Piece at:(from)) 32)) (+ (max (results from:(sites Group at:(last To)) to:(from) (- (* 32 (- (% (value Piece at:(from)) 32) (/ (value Piece at:(from)) 32)))))) (max (results from:(sites Group at:(last To)) to:(from) (- (% (value Piece at:(from)) 32))))))) (results from:(sites) to:(from) (value Piece at:(from)))))) (forEach Value (array (sites)) (remember Value (value)))) (if (= 0 (size Array (difference (results from:(sites Group at:(last To)) to:(from) (+ (+ (* 32 (- (/ (value Piece at:(from)) 32))) (- (% (value Piece at:(from)) 32))) (+ (max (results from:(sites Group at:(last To)) to:(from) (- (* 32 (- (/ (value Piece at:(from)) 32)))))) (max (results from:(sites Group at:(last To)) to:(from) (- (- (% (value Piece at:(from)) 32)))))))) (results from:(sites) to:(from) (value Piece at:(from)))))) (forEach Value (array (sites)) (remember Value (value)))) (if (= 0 (size Array (difference (results from:(sites Group at:(last To)) to:(from) (+ (+ (* 32 (- (/ (value Piece at:(from)) 32))) (- (% (value Piece at:(from)) 32) (/ (value Piece at:(from)) 32))) (+ (max (results from:(sites Group at:(last To)) to:(from) (- (* 32 (- (/ (value Piece at:(from)) 32)))))) (max (results from:(sites Group at:(last To)) to:(from) (- (- (% (value Piece at:(from)) 32) (/ (value Piece at:(from)) 32)))))))) (results from:(sites) to:(from) (value Piece at:(from)))))) (forEach Value (array (sites)) (remember Value (value)))) (if (= 0 (size Array (difference (results from:(sites Group at:(last To)) to:(from) (+ (+ (* 32 (- (% (value Piece at:(from)) 32) (/ (value Piece at:(from)) 32))) (- (/ (value Piece at:(from)) 32))) (+ (max (results from:(sites Group at:(last To)) to:(from) (- (* 32 (- (% (value Piece at:(from)) 32) (/ (value Piece at:(from)) 32)))))) (max (results from:(sites Group at:(last To)) to:(from) (- (- (/ (value Piece at:(from)) 32)))))))) (results from:(sites) to:(from) (value Piece at:(from)))))) (forEach Value (array (sites)) (remember Value (value)))) (if (= 0 (size Array (difference (results from:(sites Group at:(last To)) to:(from) (+ (+ (* 32 (- (% (value Piece at:(from)) 32))) (- (/ (value Piece at:(from)) 32))) (+ (max (results from:(sites Group at:(last To)) to:(from) (- (* 32 (- (% (value Piece at:(from)) 32)))))) (max (results from:(sites Group at:(last To)) to:(from) (- (- (/ (value Piece at:(from)) 32)))))))) (results from:(sites) to:(from) (value Piece at:(from)))))) (forEach Value (array (sites)) (remember Value (value)))) (if (= 0 (size Array (difference (results from:(sites Group at:(last To)) to:(from) (+ (+ (* 32 (% (value Piece at:(from)) 32)) (- (% (value Piece at:(from)) 32) (/ (value Piece at:(from)) 32))) (+ (max (results from:(sites Group at:(last To)) to:(from) (- (* 32 (% (value Piece at:(from)) 32))))) (max (results from:(sites Group at:(last To)) to:(from) (- (- (% (value Piece at:(from)) 32) (/ (value Piece at:(from)) 32)))))))) (results from:(sites) to:(from) (value Piece at:(from)))))) (forEach Value (array (sites)) (remember Value (value)))) (if (= 0 (size Array (difference (results from:(sites Group at:(last To)) to:(from) (+ (+ (* 32 (- (/ (value Piece at:(from)) 32) (% (value Piece at:(from)) 32))) (- (% (value Piece at:(from)) 32))) (+ (max (results from:(sites Group at:(last To)) to:(from) (- (* 32 (- (/ (value Piece at:(from)) 32) (% (value Piece at:(from)) 32)))))) (max (results from:(sites Group at:(last To)) to:(from) (- (- (% (value Piece at:(from)) 32)))))))) (results from:(sites) to:(from) (value Piece at:(from)))))) (forEach Value (array (sites)) (remember Value (value))))} (then (and {(remove (sites (values Remembered))) (forEach Site (sites Group at:(last To)) (set State at:(site) 0)) (moveAgain)})))))))) ifAfterwards:(< 0 (count Sites in:(difference (intersection (sites Empty) (sites Around (sites Group at:(last To)))) (sites Around (difference (sites Occupied by:Mover) (sites Group at:(last To)))))))) (move Add (to (sites Empty) if:(and (is In (to) (sites Around (sites Group at:(last From)))) (= (+ 1 (count Sites in:(sites Group from:(sites Around (to) if:(is Mover (who at:(to))))))) (+ 1 (count Sites in:(sites Group at:(regionSite (sites Around (to) if:(is Mover (who at:(to)))) index:0))))))) (then (and (forEach Site (sites Group at:(last To)) (set State at:(site) 0)) (priority (do (and (forget Value All) (set Var ""LastRow"" (row of:(max (array (sites Group at:(last To))))) (then (set Var ""LastCol"" (max (results from:(sites Group at:(last To)) to:(from) (column of:(from)))) (then (forEach Site (sites Group at:(last To)) (set Value at:(site) (+ (* 32 (- (var ""LastRow"") (row of:(site)))) (- (var ""LastCol"") (column of:(site))))))))))) next:(forEach Group if:(is Next (who at:(to))) (if (and (= (size Array (array (sites))) (size Array (array (sites Group at:(last To))))) (< 0 (size Array (array (intersection (sites) (sites Around (sites Group at:(last To)))))))) (priority {(if (= 0 (size Array (difference (results from:(sites Group at:(last To)) to:(from) (+ (+ (* 32 (/ (value Piece at:(from)) 32)) (% (value Piece at:(from)) 32)) (+ (max (results from:(sites Group at:(last To)) to:(from) (- (* 32 (/ (value Piece at:(from)) 32))))) (max (results from:(sites Group at:(last To)) to:(from) (- (% (value Piece at:(from)) 32))))))) (results from:(sites) to:(from) (value Piece at:(from)))))) (forEach Site (sites) (set State at:(site) 1))) (if (= 0 (size Array (difference (results from:(sites Group at:(last To)) to:(from) (+ (+ (* 32 (/ (value Piece at:(from)) 32)) (- (/ (value Piece at:(from)) 32) (% (value Piece at:(from)) 32))) (+ (max (results from:(sites Group at:(last To)) to:(from) (- (* 32 (/ (value Piece at:(from)) 32))))) (max (results from:(sites Group at:(last To)) to:(from) (- (- (/ (value Piece at:(from)) 32) (% (value Piece at:(from)) 32)))))))) (results from:(sites) to:(from) (value Piece at:(from)))))) (forEach Site (sites) (set State at:(site) 1))) (if (= 0 (size Array (difference (results from:(sites Group at:(last To)) to:(from) (+ (+ (* 32 (- (/ (value Piece at:(from)) 32) (% (value Piece at:(from)) 32))) (/ (value Piece at:(from)) 32)) (+ (max (results from:(sites Group at:(last To)) to:(from) (- (* 32 (- (/ (value Piece at:(from)) 32) (% (value Piece at:(from)) 32)))))) (max (results from:(sites Group at:(last To)) to:(from) (- (/ (value Piece at:(from)) 32))))))) (results from:(sites) to:(from) (value Piece at:(from)))))) (forEach Site (sites) (set State at:(site) 1))) (if (= 0 (size Array (difference (results from:(sites Group at:(last To)) to:(from) (+ (+ (* 32 (% (value Piece at:(from)) 32)) (/ (value Piece at:(from)) 32)) (+ (max (results from:(sites Group at:(last To)) to:(from) (- (* 32 (% (value Piece at:(from)) 32))))) (max (results from:(sites Group at:(last To)) to:(from) (- (/ (value Piece at:(from)) 32))))))) (results from:(sites) to:(from) (value Piece at:(from)))))) (forEach Site (sites) (set State at:(site) 1))) (if (= 0 (size Array (difference (results from:(sites Group at:(last To)) to:(from) (+ (+ (* 32 (- (% (value Piece at:(from)) 32))) (- (/ (value Piece at:(from)) 32) (% (value Piece at:(from)) 32))) (+ (max (results from:(sites Group at:(last To)) to:(from) (- (* 32 (- (% (value Piece at:(from)) 32)))))) (max (results from:(sites Group at:(last To)) to:(from) (- (- (/ (value Piece at:(from)) 32) (% (value Piece at:(from)) 32)))))))) (results from:(sites) to:(from) (value Piece at:(from)))))) (forEach Site (sites) (set State at:(site) 1))) (if (= 0 (size Array (difference (results from:(sites Group at:(last To)) to:(from) (+ (+ (* 32 (- (% (value Piece at:(from)) 32) (/ (value Piece at:(from)) 32))) (% (value Piece at:(from)) 32)) (+ (max (results from:(sites Group at:(last To)) to:(from) (- (* 32 (- (% (value Piece at:(from)) 32) (/ (value Piece at:(from)) 32)))))) (max (results from:(sites Group at:(last To)) to:(from) (- (% (value Piece at:(from)) 32))))))) (results from:(sites) to:(from) (value Piece at:(from)))))) (forEach Site (sites) (set State at:(site) 1))) (if (= 0 (size Array (difference (results from:(sites Group at:(last To)) to:(from) (+ (+ (* 32 (- (/ (value Piece at:(from)) 32))) (- (% (value Piece at:(from)) 32))) (+ (max (results from:(sites Group at:(last To)) to:(from) (- (* 32 (- (/ (value Piece at:(from)) 32)))))) (max (results from:(sites Group at:(last To)) to:(from) (- (- (% (value Piece at:(from)) 32)))))))) (results from:(sites) to:(from) (value Piece at:(from)))))) (forEach Site (sites) (set State at:(site) 1))) (if (= 0 (size Array (difference (results from:(sites Group at:(last To)) to:(from) (+ (+ (* 32 (- (/ (value Piece at:(from)) 32))) (- (% (value Piece at:(from)) 32) (/ (value Piece at:(from)) 32))) (+ (max (results from:(sites Group at:(last To)) to:(from) (- (* 32 (- (/ (value Piece at:(from)) 32)))))) (max (results from:(sites Group at:(last To)) to:(from) (- (- (% (value Piece at:(from)) 32) (/ (value Piece at:(from)) 32)))))))) (results from:(sites) to:(from) (value Piece at:(from)))))) (forEach Site (sites) (set State at:(site) 1))) (if (= 0 (size Array (difference (results from:(sites Group at:(last To)) to:(from) (+ (+ (* 32 (- (% (value Piece at:(from)) 32) (/ (value Piece at:(from)) 32))) (- (/ (value Piece at:(from)) 32))) (+ (max (results from:(sites Group at:(last To)) to:(from) (- (* 32 (- (% (value Piece at:(from)) 32) (/ (value Piece at:(from)) 32)))))) (max (results from:(sites Group at:(last To)) to:(from) (- (- (/ (value Piece at:(from)) 32)))))))) (results from:(sites) to:(from) (value Piece at:(from)))))) (forEach Site (sites) (set State at:(site) 1))) (if (= 0 (size Array (difference (results from:(sites Group at:(last To)) to:(from) (+ (+ (* 32 (- (% (value Piece at:(from)) 32))) (- (/ (value Piece at:(from)) 32))) (+ (max (results from:(sites Group at:(last To)) to:(from) (- (* 32 (- (% (value Piece at:(from)) 32)))))) (max (results from:(sites Group at:(last To)) to:(from) (- (- (/ (value Piece at:(from)) 32)))))))) (results from:(sites) to:(from) (value Piece at:(from)))))) (forEach Site (sites) (set State at:(site) 1))) (if (= 0 (size Array (difference (results from:(sites Group at:(last To)) to:(from) (+ (+ (* 32 (% (value Piece at:(from)) 32)) (- (% (value Piece at:(from)) 32) (/ (value Piece at:(from)) 32))) (+ (max (results from:(sites Group at:(last To)) to:(from) (- (* 32 (% (value Piece at:(from)) 32))))) (max (results from:(sites Group at:(last To)) to:(from) (- (- (% (value Piece at:(from)) 32) (/ (value Piece at:(from)) 32)))))))) (results from:(sites) to:(from) (value Piece at:(from)))))) (forEach Site (sites) (set State at:(site) 1))) (if (= 0 (size Array (difference (results from:(sites Group at:(last To)) to:(from) (+ (+ (* 32 (- (/ (value Piece at:(from)) 32) (% (value Piece at:(from)) 32))) (- (% (value Piece at:(from)) 32))) (+ (max (results from:(sites Group at:(last To)) to:(from) (- (* 32 (- (/ (value Piece at:(from)) 32) (% (value Piece at:(from)) 32)))))) (max (results from:(sites Group at:(last To)) to:(from) (- (- (% (value Piece at:(from)) 32)))))))) (results from:(sites) to:(from) (value Piece at:(from)))))) (forEach Site (sites) (set State at:(site) 1)))} (then (forEach Site (sites Group at:(last To)) (set State at:(site) 1) (then (moveAgain)))))))) (and (forget Value All) (set Var ""LastRow"" (row of:(max (array (sites Group at:(last To))))) (then (set Var ""LastCol"" (max (results from:(sites Group at:(last To)) to:(from) (column of:(from)))) (then (forEach Site (sites Group at:(last To)) (set Value at:(site) (+ (* 32 (- (var ""LastRow"") (row of:(site)))) (- (var ""LastCol"") (column of:(site)))))))))))))))) (then (and (set Score Mover 0) (set Score Next (count Sites in:(sites To (move Add (to (sites Empty) if:(and (= (+ 1 (count Sites in:(sites Group from:(sites Around (to) if:(is Mover (who at:(to))))))) (+ 1 (count Sites in:(sites Group at:(regionSite (sites Around (to) if:(is Mover (who at:(to)))) index:0))))) (<= (+ 1 (count Sites in:(sites Group from:(sites Around (to) if:(is Mover (who at:(to))))))) (max (union (sizes Group Mover) (sizes Group Next)))))))))))))) (end (if (and (no Moves Mover) (not (is Prev Mover))) (if (= (var ""Last2Grow"") (mover)) (result Mover Loss)) (result Mover Win)))))" "Like Go, Cavity is played on the points of a square grid, and groups (chains, more precisely) and liberties are defined the same way. An empty region is a group (chain) of empty points, and it is said to be adjacent to a stone if any of its points are. Setup: Starting with Black, place one stone each on any empty point. The setup is over as soon as the players have one stone each on the board. Play: On your turn, place a stone of your color on any point in an empty region that's adjacent to a stone of your color. After placement, first remove all enemy groups that have no liberties, then remove all friendly groups that have no liberties. In this phase, as soon as one player is the only one with stones on the board, the game is over and that player is the winner. The game is balanced with the pie rule. The game is played on an 11x11 board","(game ""Cavity"" (players 2) (equipment {(board (square 11) use:Vertex) (piece ""Marker"" Each)}) (rules (meta (swap)) phases:{(phase ""Opening"" (play (move Add (to (sites Empty)))) (nextPhase (and (= 1 (count Sites in:(sites Occupied by:P1))) (= 1 (count Sites in:(sites Occupied by:P2)))) ""Play"")) (phase ""Play"" (play (move Add (to (sites Empty) if:(> Infinity (count Steps Orthogonal (step (to if:(or (is Empty (to)) (is In (to) (sites Occupied by:Mover))))) (to) (sites Occupied by:Mover)))) (then (if (can Move (enclose (from (last To)) Orthogonal (between if:(is Enemy (who at:(between))) (apply (remove (between)))))) (enclose (from (last To)) Orthogonal (between if:(is Enemy (who at:(between))) (apply (remove (between))))) (enclose (from (last To)) Orthogonal (between if:(is Mover (who at:(between))) (apply (remove (between))))))))))} (end (forEach Player if:(and (< 2 (count Moves)) (no Pieces Player)) (result Player Loss)))))","###Description Like Go, Cavity is played on the points of a square grid, and groups (chains, more precisely) and liberties are defined the same way. An empty region is a group (chain) of empty points, and it is said to be adjacent to a stone if any of its points are. Setup: Starting with Black, place one stone each on any empty point. The setup is over as soon as the players have one stone each on the board. Play: On your turn, place a stone of your color on any point in an empty region that's adjacent to a stone of your color. After placement, first remove all enemy groups that have no liberties, then remove all friendly groups that have no liberties. In this phase, as soon as one player is the only one with stones on the board, the game is over and that player is the winner. The game is balanced with the pie rule. The game is played on an 11x11 board @@ -4444,11 +4324,6 @@ Here, the King and Rook move as usual, and the knight moves exactly two squares, ###Ludii (game ""Acedrex (Alfonso)"" (players {(player N) (player S)}) (equipment {(board (square 8)) (piece ""King"" Each (move Step (to if:(not (is Friend (who at:(to)))) (apply (if (is Enemy (who at:(to))) (remove (to) (then (set Var 1)))))))) (piece ""Queen"" Each (or (move Step Diagonal (to if:(not (is Friend (who at:(to)))) (apply (if (is Enemy (who at:(to))) (remove (to) (then (set Var 1))))))) (if (not (= 1 (state at:(from)))) (move Hop Diagonal (between if:True) (to if:(is Empty (to))))) (then (if (not (= 1 (state at:(last To)))) (set State at:(last To) 1))))) (piece ""Bishop"" Each (move Hop Diagonal (between if:True) (to if:(not (is Friend (who at:(to)))) (apply (if (is Enemy (who at:(to))) (remove (to) (then (set Var 1)))))))) (piece ""Knight"" Each (move Leap {{F F R F} {F F L F}} (to if:(not (is Friend (who at:(to)))) (apply (if (is Enemy (who at:(to))) (remove (to) (then (set Var 1)))))))) (piece ""Rook"" Each (move Slide Orthogonal (to if:(is Enemy (who at:(to))) (apply (remove (to) (then (set Var 1))))))) (piece ""Pawn"" Each (or {(if (and (not (= (var) 1)) (is In (from) (sites Start (piece (what at:(from)))))) (move Slide Forward (between (exact 2) if:(is Empty (between))) (to if:(is Empty (to))))) (move Step Forward (to if:(is Empty (to)))) (move Step (directions {FR FL}) (to if:(is Enemy (who at:(to))) (apply (if (is Enemy (who at:(to))) (remove (to) (then (set Var 1)))))))} (then (if (and (= (where ""Queen"" Mover) -1) (is In (last To) (sites Mover ""Promotion""))) (promote (last To) (piece ""Queen"") Mover))))) (regions ""Promotion"" P1 (sites Top)) (regions ""Promotion"" P2 (sites Bottom))}) (rules (start {(place ""Pawn1"" (sites Row 1)) (place ""Pawn2"" (sites Row 6)) (place ""Rook1"" {""A1"" ""H1""} state:1) (place ""Knight1"" {""B1"" ""G1""}) (place ""Bishop1"" {""C1"" ""F1""}) (place ""Queen1"" coord:""D1"") (place ""King1"" coord:""E1"" state:1) (place ""Rook2"" {""A8"" ""H8""} state:1) (place ""Knight2"" {""B8"" ""G8""}) (place ""Bishop2"" {""C8"" ""F8""}) (place ""Queen2"" coord:""D8"") (place ""King2"" coord:""E8"" state:1)}) (play (do (forEach Piece) ifAfterwards:(not (is Threatened (id ""King"" Mover))))) (end (if (and (is Threatened (id ""King"" Next)) (not (can Move (do (forEach Piece Next) ifAfterwards:(not (is Threatened (id ""King"" Next))))))) (result Mover Win)))))" -"Played on an 8x8 checkered board, with large diagonals drawn on the inner square 4x4 spaces. Four players, seated, from top left, anti-clockwise: red, black, white, green. Each player has four pawns, a knight, a fil, a rook, and a king. The kings begin in the corner space, with the knight to the adjacent square in the row with the king, the rook in the square in the column adjacent to the king, and the fil in the remaining 2x2 square in the corner. The pawns are placed on the orthogonally adjacent squares to this formation. Pieces move as follows: King: One square in any direction. Knight: As a knight in Chess. Rook: Orthogonally any number of spaces. Fil: moves diagonally two spaces, jumping over any piece in the intervening square. Pawns: move forward along the direction of their nearest edge, but capture diagonally forward. Upon reaching the opposite edge of the board, pawns are immediately promoted to ""Fers,"" which moves diagonally one space in any direction. Pieces are taken by moving onto a space occupied by an enemy piece. Kings cannot be in check at the end of their turn, if this is not possible the king is checkmated and that player loses. Each player makes an opening bet. Any time a player loses a piece or their king is placed in check, they must pay into the pot. When a player's king is checkmated, they must pay into the pot for their remaining pieces, and all their pieces are removed from the board. Each player may capture only the pieces of the player to their right. As players are eliminated, the targeted player is changed accordingly.","(game ""Acedrex de los Cuatros Tiempos"" (players 4) (equipment {(board (square 8)) (piece ""King"" Each (move Step (to if:(or (is Empty (to)) (= (if (is Mover P1) (if (is Active P2) 2 (if (is Active P3) 3 4)) (if (is Mover P2) (if (is Active P3) 3 (if (is Active P4) 4 1)) (if (is Mover P3) (if (is Active P4) 4 (if (is Active P1) 1 2)) (if (is Active P1) 1 (if (is Active P2) 2 3))))) (who at:(to)))) (apply (if (= (if (is Mover P1) (if (is Active P2) 2 (if (is Active P3) 3 4)) (if (is Mover P2) (if (is Active P3) 3 (if (is Active P4) 4 1)) (if (is Mover P3) (if (is Active P4) 4 (if (is Active P1) 1 2)) (if (is Active P1) 1 (if (is Active P2) 2 3))))) (who at:(to))) (and (remove (to)) (and (note player:Next ""Pays into the pot"" to:Next) (set Pot (+ (pot) (amount Next)))))))))) (piece ""Pawn"" P1 W (or {(move Step Forward (to if:(is Empty (to)))) (move Step (directions {FR FL}) (to if:(= (if (is Mover P1) (if (is Active P2) 2 (if (is Active P3) 3 4)) (if (is Mover P2) (if (is Active P3) 3 (if (is Active P4) 4 1)) (if (is Mover P3) (if (is Active P4) 4 (if (is Active P1) 1 2)) (if (is Active P1) 1 (if (is Active P2) 2 3))))) (who at:(to))) (apply (if (= (if (is Mover P1) (if (is Active P2) 2 (if (is Active P3) 3 4)) (if (is Mover P2) (if (is Active P3) 3 (if (is Active P4) 4 1)) (if (is Mover P3) (if (is Active P4) 4 (if (is Active P1) 1 2)) (if (is Active P1) 1 (if (is Active P2) 2 3))))) (who at:(to))) (and (remove (to)) (and (note player:Next ""Pays into the pot"" to:Next) (set Pot (+ (pot) (amount Next)))))))))} (then (if (is In (last To) (sites Left)) (promote (last To) (piece ""Queen"") Mover))))) (piece ""Pawn3d"" P1 N (or {(move Step Forward (to if:(is Empty (to)))) (move Step (directions {FR FL}) (to if:(= (if (is Mover P1) (if (is Active P2) 2 (if (is Active P3) 3 4)) (if (is Mover P2) (if (is Active P3) 3 (if (is Active P4) 4 1)) (if (is Mover P3) (if (is Active P4) 4 (if (is Active P1) 1 2)) (if (is Active P1) 1 (if (is Active P2) 2 3))))) (who at:(to))) (apply (if (= (if (is Mover P1) (if (is Active P2) 2 (if (is Active P3) 3 4)) (if (is Mover P2) (if (is Active P3) 3 (if (is Active P4) 4 1)) (if (is Mover P3) (if (is Active P4) 4 (if (is Active P1) 1 2)) (if (is Active P1) 1 (if (is Active P2) 2 3))))) (who at:(to))) (and (remove (to)) (and (note player:Next ""Pays into the pot"" to:Next) (set Pot (+ (pot) (amount Next)))))))))} (then (if (is In (last To) (sites Top)) (promote (last To) (piece ""Queen"") Mover))))) (piece ""Pawn"" P2 W (or {(move Step Forward (to if:(is Empty (to)))) (move Step (directions {FR FL}) (to if:(= (if (is Mover P1) (if (is Active P2) 2 (if (is Active P3) 3 4)) (if (is Mover P2) (if (is Active P3) 3 (if (is Active P4) 4 1)) (if (is Mover P3) (if (is Active P4) 4 (if (is Active P1) 1 2)) (if (is Active P1) 1 (if (is Active P2) 2 3))))) (who at:(to))) (apply (if (= (if (is Mover P1) (if (is Active P2) 2 (if (is Active P3) 3 4)) (if (is Mover P2) (if (is Active P3) 3 (if (is Active P4) 4 1)) (if (is Mover P3) (if (is Active P4) 4 (if (is Active P1) 1 2)) (if (is Active P1) 1 (if (is Active P2) 2 3))))) (who at:(to))) (and (remove (to)) (and (note player:Next ""Pays into the pot"" to:Next) (set Pot (+ (pot) (amount Next)))))))))} (then (if (is In (last To) (sites Left)) (promote (last To) (piece ""Queen"") Mover))))) (piece ""Pawn3d"" P2 S (or {(move Step Forward (to if:(is Empty (to)))) (move Step (directions {FR FL}) (to if:(= (if (is Mover P1) (if (is Active P2) 2 (if (is Active P3) 3 4)) (if (is Mover P2) (if (is Active P3) 3 (if (is Active P4) 4 1)) (if (is Mover P3) (if (is Active P4) 4 (if (is Active P1) 1 2)) (if (is Active P1) 1 (if (is Active P2) 2 3))))) (who at:(to))) (apply (if (= (if (is Mover P1) (if (is Active P2) 2 (if (is Active P3) 3 4)) (if (is Mover P2) (if (is Active P3) 3 (if (is Active P4) 4 1)) (if (is Mover P3) (if (is Active P4) 4 (if (is Active P1) 1 2)) (if (is Active P1) 1 (if (is Active P2) 2 3))))) (who at:(to))) (and (remove (to)) (and (note player:Next ""Pays into the pot"" to:Next) (set Pot (+ (pot) (amount Next)))))))))} (then (if (is In (last To) (sites Bottom)) (promote (last To) (piece ""Queen"") Mover))))) (piece ""Pawn"" P3 E (or {(move Step Forward (to if:(is Empty (to)))) (move Step (directions {FR FL}) (to if:(= (if (is Mover P1) (if (is Active P2) 2 (if (is Active P3) 3 4)) (if (is Mover P2) (if (is Active P3) 3 (if (is Active P4) 4 1)) (if (is Mover P3) (if (is Active P4) 4 (if (is Active P1) 1 2)) (if (is Active P1) 1 (if (is Active P2) 2 3))))) (who at:(to))) (apply (if (= (if (is Mover P1) (if (is Active P2) 2 (if (is Active P3) 3 4)) (if (is Mover P2) (if (is Active P3) 3 (if (is Active P4) 4 1)) (if (is Mover P3) (if (is Active P4) 4 (if (is Active P1) 1 2)) (if (is Active P1) 1 (if (is Active P2) 2 3))))) (who at:(to))) (and (remove (to)) (and (note player:Next ""Pays into the pot"" to:Next) (set Pot (+ (pot) (amount Next)))))))))} (then (if (is In (last To) (sites Right)) (promote (last To) (piece ""Queen"") Mover))))) (piece ""Pawn3d"" P3 S (or {(move Step Forward (to if:(is Empty (to)))) (move Step (directions {FR FL}) (to if:(= (if (is Mover P1) (if (is Active P2) 2 (if (is Active P3) 3 4)) (if (is Mover P2) (if (is Active P3) 3 (if (is Active P4) 4 1)) (if (is Mover P3) (if (is Active P4) 4 (if (is Active P1) 1 2)) (if (is Active P1) 1 (if (is Active P2) 2 3))))) (who at:(to))) (apply (if (= (if (is Mover P1) (if (is Active P2) 2 (if (is Active P3) 3 4)) (if (is Mover P2) (if (is Active P3) 3 (if (is Active P4) 4 1)) (if (is Mover P3) (if (is Active P4) 4 (if (is Active P1) 1 2)) (if (is Active P1) 1 (if (is Active P2) 2 3))))) (who at:(to))) (and (remove (to)) (and (note player:Next ""Pays into the pot"" to:Next) (set Pot (+ (pot) (amount Next)))))))))} (then (if (is In (last To) (sites Bottom)) (promote (last To) (piece ""Queen"") Mover))))) (piece ""Pawn"" P4 E (or {(move Step Forward (to if:(is Empty (to)))) (move Step (directions {FR FL}) (to if:(= (if (is Mover P1) (if (is Active P2) 2 (if (is Active P3) 3 4)) (if (is Mover P2) (if (is Active P3) 3 (if (is Active P4) 4 1)) (if (is Mover P3) (if (is Active P4) 4 (if (is Active P1) 1 2)) (if (is Active P1) 1 (if (is Active P2) 2 3))))) (who at:(to))) (apply (if (= (if (is Mover P1) (if (is Active P2) 2 (if (is Active P3) 3 4)) (if (is Mover P2) (if (is Active P3) 3 (if (is Active P4) 4 1)) (if (is Mover P3) (if (is Active P4) 4 (if (is Active P1) 1 2)) (if (is Active P1) 1 (if (is Active P2) 2 3))))) (who at:(to))) (and (remove (to)) (and (note player:Next ""Pays into the pot"" to:Next) (set Pot (+ (pot) (amount Next)))))))))} (then (if (is In (last To) (sites Right)) (promote (last To) (piece ""Queen"") Mover))))) (piece ""Pawn3d"" P4 N (or {(move Step Forward (to if:(is Empty (to)))) (move Step (directions {FR FL}) (to if:(= (if (is Mover P1) (if (is Active P2) 2 (if (is Active P3) 3 4)) (if (is Mover P2) (if (is Active P3) 3 (if (is Active P4) 4 1)) (if (is Mover P3) (if (is Active P4) 4 (if (is Active P1) 1 2)) (if (is Active P1) 1 (if (is Active P2) 2 3))))) (who at:(to))) (apply (if (= (if (is Mover P1) (if (is Active P2) 2 (if (is Active P3) 3 4)) (if (is Mover P2) (if (is Active P3) 3 (if (is Active P4) 4 1)) (if (is Mover P3) (if (is Active P4) 4 (if (is Active P1) 1 2)) (if (is Active P1) 1 (if (is Active P2) 2 3))))) (who at:(to))) (and (remove (to)) (and (note player:Next ""Pays into the pot"" to:Next) (set Pot (+ (pot) (amount Next)))))))))} (then (if (is In (last To) (sites Top)) (promote (last To) (piece ""Queen"") Mover))))) (piece ""Knight"" Each (move Leap {{F F R F} {F F L F}} (to if:(or (is Empty (to)) (= (if (is Mover P1) (if (is Active P2) 2 (if (is Active P3) 3 4)) (if (is Mover P2) (if (is Active P3) 3 (if (is Active P4) 4 1)) (if (is Mover P3) (if (is Active P4) 4 (if (is Active P1) 1 2)) (if (is Active P1) 1 (if (is Active P2) 2 3))))) (who at:(to)))) (apply (if (= (if (is Mover P1) (if (is Active P2) 2 (if (is Active P3) 3 4)) (if (is Mover P2) (if (is Active P3) 3 (if (is Active P4) 4 1)) (if (is Mover P3) (if (is Active P4) 4 (if (is Active P1) 1 2)) (if (is Active P1) 1 (if (is Active P2) 2 3))))) (who at:(to))) (and (remove (to)) (and (note player:Next ""Pays into the pot"" to:Next) (set Pot (+ (pot) (amount Next)))))))))) (piece ""Rook"" Each (move Slide Orthogonal (to if:(= (if (is Mover P1) (if (is Active P2) 2 (if (is Active P3) 3 4)) (if (is Mover P2) (if (is Active P3) 3 (if (is Active P4) 4 1)) (if (is Mover P3) (if (is Active P4) 4 (if (is Active P1) 1 2)) (if (is Active P1) 1 (if (is Active P2) 2 3))))) (who at:(to))) (apply (if (= (if (is Mover P1) (if (is Active P2) 2 (if (is Active P3) 3 4)) (if (is Mover P2) (if (is Active P3) 3 (if (is Active P4) 4 1)) (if (is Mover P3) (if (is Active P4) 4 (if (is Active P1) 1 2)) (if (is Active P1) 1 (if (is Active P2) 2 3))))) (who at:(to))) (and (remove (to)) (and (note player:Next ""Pays into the pot"" to:Next) (set Pot (+ (pot) (amount Next)))))))))) (piece ""Bishop"" Each (move Hop Diagonal (between if:True) (to if:(or (is Empty (to)) (= (if (is Mover P1) (if (is Active P2) 2 (if (is Active P3) 3 4)) (if (is Mover P2) (if (is Active P3) 3 (if (is Active P4) 4 1)) (if (is Mover P3) (if (is Active P4) 4 (if (is Active P1) 1 2)) (if (is Active P1) 1 (if (is Active P2) 2 3))))) (who at:(to)))) (apply (if (= (if (is Mover P1) (if (is Active P2) 2 (if (is Active P3) 3 4)) (if (is Mover P2) (if (is Active P3) 3 (if (is Active P4) 4 1)) (if (is Mover P3) (if (is Active P4) 4 (if (is Active P1) 1 2)) (if (is Active P1) 1 (if (is Active P2) 2 3))))) (who at:(to))) (and (remove (to)) (and (note player:Next ""Pays into the pot"" to:Next) (set Pot (+ (pot) (amount Next)))))))))) (piece ""Queen"" Each (move Step Diagonal (to if:(or (is Empty (to)) (= (if (is Mover P1) (if (is Active P2) 2 (if (is Active P3) 3 4)) (if (is Mover P2) (if (is Active P3) 3 (if (is Active P4) 4 1)) (if (is Mover P3) (if (is Active P4) 4 (if (is Active P1) 1 2)) (if (is Active P1) 1 (if (is Active P2) 2 3))))) (who at:(to)))) (apply (if (= (if (is Mover P1) (if (is Active P2) 2 (if (is Active P3) 3 4)) (if (is Mover P2) (if (is Active P3) 3 (if (is Active P4) 4 1)) (if (is Mover P3) (if (is Active P4) 4 (if (is Active P1) 1 2)) (if (is Active P1) 1 (if (is Active P2) 2 3))))) (who at:(to))) (and (remove (to)) (and (note player:Next ""Pays into the pot"" to:Next) (set Pot (+ (pot) (amount Next))))))))))}) (rules (start {(place ""King1"" coord:""H1"") (place ""Knight1"" coord:""G1"") (place ""Rook1"" coord:""H2"") (place ""Bishop1"" coord:""G2"") (place ""Pawn1"" {""F1"" ""F2""}) (place ""Pawn3d1"" {""G3"" ""H3""}) (place ""King2"" coord:""H8"") (place ""Knight2"" coord:""G8"") (place ""Rook2"" coord:""H7"") (place ""Bishop2"" coord:""G7"") (place ""Pawn2"" {""F8"" ""F7""}) (place ""Pawn3d2"" {""H6"" ""G6""}) (place ""King3"" coord:""A8"") (place ""Knight3"" coord:""B8"") (place ""Rook3"" coord:""A7"") (place ""Bishop3"" coord:""B7"") (place ""Pawn3"" {""C7"" ""C8""}) (place ""Pawn3d3"" {""A6"" ""B6""}) (place ""King4"" coord:""A1"") (place ""Knight4"" coord:""B1"") (place ""Rook4"" coord:""A2"") (place ""Bishop4"" coord:""B2"") (place ""Pawn4"" {""C1"" ""C2""}) (place ""Pawn3d4"" {""A3"" ""B3""})}) phases:{(phase ""Betting"" (play (move Bet Mover (range 0 100))) (nextPhase Mover)) (phase ""Playing"" (play (do (forEach Piece) ifAfterwards:(not (is Threatened (id ""King"" Mover))) (then (if (is Threatened (id ""King"" Next)) (if (not (can Move (do (forEach Piece Next) ifAfterwards:(not (is Threatened (id ""King"" Next)))))) (forEach Site (sites Occupied by:Next) (and (remove (to)) (and (note player:Next ""Pays into the pot"" to:Next) (set Pot (+ (pot) (amount Next)))))) (and (note player:Next ""Pays into the pot"" to:Next) (set Pot (+ (pot) (amount Next))))))))))} (end (if (no Pieces Next) (result Next Loss)))))","###Description -Played on an 8x8 checkered board, with large diagonals drawn on the inner square 4x4 spaces. Four players, seated, from top left, anti-clockwise: red, black, white, green. Each player has four pawns, a knight, a fil, a rook, and a king. The kings begin in the corner space, with the knight to the adjacent square in the row with the king, the rook in the square in the column adjacent to the king, and the fil in the remaining 2x2 square in the corner. The pawns are placed on the orthogonally adjacent squares to this formation. Pieces move as follows: King: One square in any direction. Knight: As a knight in Chess. Rook: Orthogonally any number of spaces. Fil: moves diagonally two spaces, jumping over any piece in the intervening square. Pawns: move forward along the direction of their nearest edge, but capture diagonally forward. Upon reaching the opposite edge of the board, pawns are immediately promoted to ""Fers,"" which moves diagonally one space in any direction. Pieces are taken by moving onto a space occupied by an enemy piece. Kings cannot be in check at the end of their turn, if this is not possible the king is checkmated and that player loses. Each player makes an opening bet. Any time a player loses a piece or their king is placed in check, they must pay into the pot. When a player's king is checkmated, they must pay into the pot for their remaining pieces, and all their pieces are removed from the board. Each player may capture only the pieces of the player to their right. As players are eliminated, the targeted player is changed accordingly. - -###Ludii -(game ""Acedrex de los Cuatros Tiempos"" (players 4) (equipment {(board (square 8)) (piece ""King"" Each (move Step (to if:(or (is Empty (to)) (= (if (is Mover P1) (if (is Active P2) 2 (if (is Active P3) 3 4)) (if (is Mover P2) (if (is Active P3) 3 (if (is Active P4) 4 1)) (if (is Mover P3) (if (is Active P4) 4 (if (is Active P1) 1 2)) (if (is Active P1) 1 (if (is Active P2) 2 3))))) (who at:(to)))) (apply (if (= (if (is Mover P1) (if (is Active P2) 2 (if (is Active P3) 3 4)) (if (is Mover P2) (if (is Active P3) 3 (if (is Active P4) 4 1)) (if (is Mover P3) (if (is Active P4) 4 (if (is Active P1) 1 2)) (if (is Active P1) 1 (if (is Active P2) 2 3))))) (who at:(to))) (and (remove (to)) (and (note player:Next ""Pays into the pot"" to:Next) (set Pot (+ (pot) (amount Next)))))))))) (piece ""Pawn"" P1 W (or {(move Step Forward (to if:(is Empty (to)))) (move Step (directions {FR FL}) (to if:(= (if (is Mover P1) (if (is Active P2) 2 (if (is Active P3) 3 4)) (if (is Mover P2) (if (is Active P3) 3 (if (is Active P4) 4 1)) (if (is Mover P3) (if (is Active P4) 4 (if (is Active P1) 1 2)) (if (is Active P1) 1 (if (is Active P2) 2 3))))) (who at:(to))) (apply (if (= (if (is Mover P1) (if (is Active P2) 2 (if (is Active P3) 3 4)) (if (is Mover P2) (if (is Active P3) 3 (if (is Active P4) 4 1)) (if (is Mover P3) (if (is Active P4) 4 (if (is Active P1) 1 2)) (if (is Active P1) 1 (if (is Active P2) 2 3))))) (who at:(to))) (and (remove (to)) (and (note player:Next ""Pays into the pot"" to:Next) (set Pot (+ (pot) (amount Next)))))))))} (then (if (is In (last To) (sites Left)) (promote (last To) (piece ""Queen"") Mover))))) (piece ""Pawn3d"" P1 N (or {(move Step Forward (to if:(is Empty (to)))) (move Step (directions {FR FL}) (to if:(= (if (is Mover P1) (if (is Active P2) 2 (if (is Active P3) 3 4)) (if (is Mover P2) (if (is Active P3) 3 (if (is Active P4) 4 1)) (if (is Mover P3) (if (is Active P4) 4 (if (is Active P1) 1 2)) (if (is Active P1) 1 (if (is Active P2) 2 3))))) (who at:(to))) (apply (if (= (if (is Mover P1) (if (is Active P2) 2 (if (is Active P3) 3 4)) (if (is Mover P2) (if (is Active P3) 3 (if (is Active P4) 4 1)) (if (is Mover P3) (if (is Active P4) 4 (if (is Active P1) 1 2)) (if (is Active P1) 1 (if (is Active P2) 2 3))))) (who at:(to))) (and (remove (to)) (and (note player:Next ""Pays into the pot"" to:Next) (set Pot (+ (pot) (amount Next)))))))))} (then (if (is In (last To) (sites Top)) (promote (last To) (piece ""Queen"") Mover))))) (piece ""Pawn"" P2 W (or {(move Step Forward (to if:(is Empty (to)))) (move Step (directions {FR FL}) (to if:(= (if (is Mover P1) (if (is Active P2) 2 (if (is Active P3) 3 4)) (if (is Mover P2) (if (is Active P3) 3 (if (is Active P4) 4 1)) (if (is Mover P3) (if (is Active P4) 4 (if (is Active P1) 1 2)) (if (is Active P1) 1 (if (is Active P2) 2 3))))) (who at:(to))) (apply (if (= (if (is Mover P1) (if (is Active P2) 2 (if (is Active P3) 3 4)) (if (is Mover P2) (if (is Active P3) 3 (if (is Active P4) 4 1)) (if (is Mover P3) (if (is Active P4) 4 (if (is Active P1) 1 2)) (if (is Active P1) 1 (if (is Active P2) 2 3))))) (who at:(to))) (and (remove (to)) (and (note player:Next ""Pays into the pot"" to:Next) (set Pot (+ (pot) (amount Next)))))))))} (then (if (is In (last To) (sites Left)) (promote (last To) (piece ""Queen"") Mover))))) (piece ""Pawn3d"" P2 S (or {(move Step Forward (to if:(is Empty (to)))) (move Step (directions {FR FL}) (to if:(= (if (is Mover P1) (if (is Active P2) 2 (if (is Active P3) 3 4)) (if (is Mover P2) (if (is Active P3) 3 (if (is Active P4) 4 1)) (if (is Mover P3) (if (is Active P4) 4 (if (is Active P1) 1 2)) (if (is Active P1) 1 (if (is Active P2) 2 3))))) (who at:(to))) (apply (if (= (if (is Mover P1) (if (is Active P2) 2 (if (is Active P3) 3 4)) (if (is Mover P2) (if (is Active P3) 3 (if (is Active P4) 4 1)) (if (is Mover P3) (if (is Active P4) 4 (if (is Active P1) 1 2)) (if (is Active P1) 1 (if (is Active P2) 2 3))))) (who at:(to))) (and (remove (to)) (and (note player:Next ""Pays into the pot"" to:Next) (set Pot (+ (pot) (amount Next)))))))))} (then (if (is In (last To) (sites Bottom)) (promote (last To) (piece ""Queen"") Mover))))) (piece ""Pawn"" P3 E (or {(move Step Forward (to if:(is Empty (to)))) (move Step (directions {FR FL}) (to if:(= (if (is Mover P1) (if (is Active P2) 2 (if (is Active P3) 3 4)) (if (is Mover P2) (if (is Active P3) 3 (if (is Active P4) 4 1)) (if (is Mover P3) (if (is Active P4) 4 (if (is Active P1) 1 2)) (if (is Active P1) 1 (if (is Active P2) 2 3))))) (who at:(to))) (apply (if (= (if (is Mover P1) (if (is Active P2) 2 (if (is Active P3) 3 4)) (if (is Mover P2) (if (is Active P3) 3 (if (is Active P4) 4 1)) (if (is Mover P3) (if (is Active P4) 4 (if (is Active P1) 1 2)) (if (is Active P1) 1 (if (is Active P2) 2 3))))) (who at:(to))) (and (remove (to)) (and (note player:Next ""Pays into the pot"" to:Next) (set Pot (+ (pot) (amount Next)))))))))} (then (if (is In (last To) (sites Right)) (promote (last To) (piece ""Queen"") Mover))))) (piece ""Pawn3d"" P3 S (or {(move Step Forward (to if:(is Empty (to)))) (move Step (directions {FR FL}) (to if:(= (if (is Mover P1) (if (is Active P2) 2 (if (is Active P3) 3 4)) (if (is Mover P2) (if (is Active P3) 3 (if (is Active P4) 4 1)) (if (is Mover P3) (if (is Active P4) 4 (if (is Active P1) 1 2)) (if (is Active P1) 1 (if (is Active P2) 2 3))))) (who at:(to))) (apply (if (= (if (is Mover P1) (if (is Active P2) 2 (if (is Active P3) 3 4)) (if (is Mover P2) (if (is Active P3) 3 (if (is Active P4) 4 1)) (if (is Mover P3) (if (is Active P4) 4 (if (is Active P1) 1 2)) (if (is Active P1) 1 (if (is Active P2) 2 3))))) (who at:(to))) (and (remove (to)) (and (note player:Next ""Pays into the pot"" to:Next) (set Pot (+ (pot) (amount Next)))))))))} (then (if (is In (last To) (sites Bottom)) (promote (last To) (piece ""Queen"") Mover))))) (piece ""Pawn"" P4 E (or {(move Step Forward (to if:(is Empty (to)))) (move Step (directions {FR FL}) (to if:(= (if (is Mover P1) (if (is Active P2) 2 (if (is Active P3) 3 4)) (if (is Mover P2) (if (is Active P3) 3 (if (is Active P4) 4 1)) (if (is Mover P3) (if (is Active P4) 4 (if (is Active P1) 1 2)) (if (is Active P1) 1 (if (is Active P2) 2 3))))) (who at:(to))) (apply (if (= (if (is Mover P1) (if (is Active P2) 2 (if (is Active P3) 3 4)) (if (is Mover P2) (if (is Active P3) 3 (if (is Active P4) 4 1)) (if (is Mover P3) (if (is Active P4) 4 (if (is Active P1) 1 2)) (if (is Active P1) 1 (if (is Active P2) 2 3))))) (who at:(to))) (and (remove (to)) (and (note player:Next ""Pays into the pot"" to:Next) (set Pot (+ (pot) (amount Next)))))))))} (then (if (is In (last To) (sites Right)) (promote (last To) (piece ""Queen"") Mover))))) (piece ""Pawn3d"" P4 N (or {(move Step Forward (to if:(is Empty (to)))) (move Step (directions {FR FL}) (to if:(= (if (is Mover P1) (if (is Active P2) 2 (if (is Active P3) 3 4)) (if (is Mover P2) (if (is Active P3) 3 (if (is Active P4) 4 1)) (if (is Mover P3) (if (is Active P4) 4 (if (is Active P1) 1 2)) (if (is Active P1) 1 (if (is Active P2) 2 3))))) (who at:(to))) (apply (if (= (if (is Mover P1) (if (is Active P2) 2 (if (is Active P3) 3 4)) (if (is Mover P2) (if (is Active P3) 3 (if (is Active P4) 4 1)) (if (is Mover P3) (if (is Active P4) 4 (if (is Active P1) 1 2)) (if (is Active P1) 1 (if (is Active P2) 2 3))))) (who at:(to))) (and (remove (to)) (and (note player:Next ""Pays into the pot"" to:Next) (set Pot (+ (pot) (amount Next)))))))))} (then (if (is In (last To) (sites Top)) (promote (last To) (piece ""Queen"") Mover))))) (piece ""Knight"" Each (move Leap {{F F R F} {F F L F}} (to if:(or (is Empty (to)) (= (if (is Mover P1) (if (is Active P2) 2 (if (is Active P3) 3 4)) (if (is Mover P2) (if (is Active P3) 3 (if (is Active P4) 4 1)) (if (is Mover P3) (if (is Active P4) 4 (if (is Active P1) 1 2)) (if (is Active P1) 1 (if (is Active P2) 2 3))))) (who at:(to)))) (apply (if (= (if (is Mover P1) (if (is Active P2) 2 (if (is Active P3) 3 4)) (if (is Mover P2) (if (is Active P3) 3 (if (is Active P4) 4 1)) (if (is Mover P3) (if (is Active P4) 4 (if (is Active P1) 1 2)) (if (is Active P1) 1 (if (is Active P2) 2 3))))) (who at:(to))) (and (remove (to)) (and (note player:Next ""Pays into the pot"" to:Next) (set Pot (+ (pot) (amount Next)))))))))) (piece ""Rook"" Each (move Slide Orthogonal (to if:(= (if (is Mover P1) (if (is Active P2) 2 (if (is Active P3) 3 4)) (if (is Mover P2) (if (is Active P3) 3 (if (is Active P4) 4 1)) (if (is Mover P3) (if (is Active P4) 4 (if (is Active P1) 1 2)) (if (is Active P1) 1 (if (is Active P2) 2 3))))) (who at:(to))) (apply (if (= (if (is Mover P1) (if (is Active P2) 2 (if (is Active P3) 3 4)) (if (is Mover P2) (if (is Active P3) 3 (if (is Active P4) 4 1)) (if (is Mover P3) (if (is Active P4) 4 (if (is Active P1) 1 2)) (if (is Active P1) 1 (if (is Active P2) 2 3))))) (who at:(to))) (and (remove (to)) (and (note player:Next ""Pays into the pot"" to:Next) (set Pot (+ (pot) (amount Next)))))))))) (piece ""Bishop"" Each (move Hop Diagonal (between if:True) (to if:(or (is Empty (to)) (= (if (is Mover P1) (if (is Active P2) 2 (if (is Active P3) 3 4)) (if (is Mover P2) (if (is Active P3) 3 (if (is Active P4) 4 1)) (if (is Mover P3) (if (is Active P4) 4 (if (is Active P1) 1 2)) (if (is Active P1) 1 (if (is Active P2) 2 3))))) (who at:(to)))) (apply (if (= (if (is Mover P1) (if (is Active P2) 2 (if (is Active P3) 3 4)) (if (is Mover P2) (if (is Active P3) 3 (if (is Active P4) 4 1)) (if (is Mover P3) (if (is Active P4) 4 (if (is Active P1) 1 2)) (if (is Active P1) 1 (if (is Active P2) 2 3))))) (who at:(to))) (and (remove (to)) (and (note player:Next ""Pays into the pot"" to:Next) (set Pot (+ (pot) (amount Next)))))))))) (piece ""Queen"" Each (move Step Diagonal (to if:(or (is Empty (to)) (= (if (is Mover P1) (if (is Active P2) 2 (if (is Active P3) 3 4)) (if (is Mover P2) (if (is Active P3) 3 (if (is Active P4) 4 1)) (if (is Mover P3) (if (is Active P4) 4 (if (is Active P1) 1 2)) (if (is Active P1) 1 (if (is Active P2) 2 3))))) (who at:(to)))) (apply (if (= (if (is Mover P1) (if (is Active P2) 2 (if (is Active P3) 3 4)) (if (is Mover P2) (if (is Active P3) 3 (if (is Active P4) 4 1)) (if (is Mover P3) (if (is Active P4) 4 (if (is Active P1) 1 2)) (if (is Active P1) 1 (if (is Active P2) 2 3))))) (who at:(to))) (and (remove (to)) (and (note player:Next ""Pays into the pot"" to:Next) (set Pot (+ (pot) (amount Next))))))))))}) (rules (start {(place ""King1"" coord:""H1"") (place ""Knight1"" coord:""G1"") (place ""Rook1"" coord:""H2"") (place ""Bishop1"" coord:""G2"") (place ""Pawn1"" {""F1"" ""F2""}) (place ""Pawn3d1"" {""G3"" ""H3""}) (place ""King2"" coord:""H8"") (place ""Knight2"" coord:""G8"") (place ""Rook2"" coord:""H7"") (place ""Bishop2"" coord:""G7"") (place ""Pawn2"" {""F8"" ""F7""}) (place ""Pawn3d2"" {""H6"" ""G6""}) (place ""King3"" coord:""A8"") (place ""Knight3"" coord:""B8"") (place ""Rook3"" coord:""A7"") (place ""Bishop3"" coord:""B7"") (place ""Pawn3"" {""C7"" ""C8""}) (place ""Pawn3d3"" {""A6"" ""B6""}) (place ""King4"" coord:""A1"") (place ""Knight4"" coord:""B1"") (place ""Rook4"" coord:""A2"") (place ""Bishop4"" coord:""B2"") (place ""Pawn4"" {""C1"" ""C2""}) (place ""Pawn3d4"" {""A3"" ""B3""})}) phases:{(phase ""Betting"" (play (move Bet Mover (range 0 100))) (nextPhase Mover)) (phase ""Playing"" (play (do (forEach Piece) ifAfterwards:(not (is Threatened (id ""King"" Mover))) (then (if (is Threatened (id ""King"" Next)) (if (not (can Move (do (forEach Piece Next) ifAfterwards:(not (is Threatened (id ""King"" Next)))))) (forEach Site (sites Occupied by:Next) (and (remove (to)) (and (note player:Next ""Pays into the pot"" to:Next) (set Pot (+ (pot) (amount Next)))))) (and (note player:Next ""Pays into the pot"" to:Next) (set Pot (+ (pot) (amount Next))))))))))} (end (if (no Pieces Next) (result Next Loss)))))" "A move in Alice chess has two basic stipulations: the move must be legal on the board on which it is played, and the square transferred to on the opposite board must be vacant. (Consequently, capture is possible only on the board upon which a piece currently stands). The en passant rule is removed.","(game ""Alice Chess"" (players {(player N) (player S)}) (equipment {(board (square 8)) (piece ""Pawn"" Each (or {(if (is In (from) (sites Start (piece (what at:(from))))) (move Slide Forward (between (exact 2) if:(or (is Empty (between)) (!= (value Piece at:(from)) (value Piece at:(between))))) (to if:(is Empty (to)) (apply if:(is Empty (to)))))) (move Step Forward (to if:(is Empty (to)))) (move Step (directions {FR FL}) (to if:(and (is Enemy (who at:(to))) (= (value Piece at:(from)) (value Piece at:(to)))) (apply (remove (to)))))} (then (and {(if (is In (last To) (sites Mover ""Promotion"")) (moveAgain)) (set Counter) (set Value at:(last To) (% (+ (value Piece at:(last To)) 1) 2))})))) (piece ""Rook"" Each (move Slide Orthogonal (between if:(or (is Empty (between)) (!= (value Piece at:(from)) (value Piece at:(between))))) (to if:(and (is Enemy (who at:(to))) (= (value Piece at:(from)) (value Piece at:(to)))) (apply if:(or (and (is Enemy (who at:(to))) (= (value Piece at:(from)) (value Piece at:(to)))) (is Empty (to))) (if (and (is Enemy (who at:(to))) (= (value Piece at:(from)) (value Piece at:(to)))) (remove (to) (then (set Counter)))))) (then (and (if (= (state at:(last To)) 1) (set State at:(last To) 0)) (set Value at:(last To) (% (+ (value Piece at:(last To)) 1) 2)))))) (piece ""King"" Each (move Step (to if:(and (not (is Friend (who at:(to)))) (or (is Empty (to)) (= (value Piece at:(from)) (value Piece at:(to))))) (apply if:(or (and (is Enemy (who at:(to))) (= (value Piece at:(from)) (value Piece at:(to)))) (is Empty (to))) (if (and (is Enemy (who at:(to))) (= (value Piece at:(from)) (value Piece at:(to)))) (remove (to) (then (set Counter)))))) (then (and (if (= (state at:(last To)) 1) (set State at:(last To) 0)) (set Value at:(last To) (% (+ (value Piece at:(last To)) 1) 2)))))) (piece ""Bishop"" Each (move Slide Diagonal (between if:(or (is Empty (between)) (!= (value Piece at:(from)) (value Piece at:(between))))) (to if:(and (is Enemy (who at:(to))) (= (value Piece at:(from)) (value Piece at:(to)))) (apply if:(or (and (is Enemy (who at:(to))) (= (value Piece at:(from)) (value Piece at:(to)))) (is Empty (to))) (if (and (is Enemy (who at:(to))) (= (value Piece at:(from)) (value Piece at:(to)))) (remove (to) (then (set Counter)))))) (then (set Value at:(last To) (% (+ (value Piece at:(last To)) 1) 2))))) (piece ""Knight"" Each (move Leap {{F F R F} {F F L F}} (to if:(and (not (is Friend (who at:(to)))) (or (is Empty (to)) (= (value Piece at:(from)) (value Piece at:(to))))) (apply if:(or (and (is Enemy (who at:(to))) (= (value Piece at:(from)) (value Piece at:(to)))) (is Empty (to))) (if (and (is Enemy (who at:(to))) (= (value Piece at:(from)) (value Piece at:(to)))) (remove (to) (then (set Counter)))))) (then (set Value at:(last To) (% (+ (value Piece at:(last To)) 1) 2))))) (piece ""Queen"" Each (move Slide (between if:(or (is Empty (between)) (!= (value Piece at:(from)) (value Piece at:(between))))) (to if:(and (is Enemy (who at:(to))) (= (value Piece at:(from)) (value Piece at:(to)))) (apply if:(or (and (is Enemy (who at:(to))) (= (value Piece at:(from)) (value Piece at:(to)))) (is Empty (to))) (if (and (is Enemy (who at:(to))) (= (value Piece at:(from)) (value Piece at:(to)))) (remove (to) (then (set Counter)))))) (then (set Value at:(last To) (% (+ (value Piece at:(last To)) 1) 2))))) (map ""King"" {(pair 1 ""E1"") (pair 2 ""E8"")}) (map ""RookLeft"" {(pair 1 ""A1"") (pair 2 ""A8"")}) (map ""RookRight"" {(pair 1 ""H1"") (pair 2 ""H8"")}) (regions ""Promotion"" P1 (sites Top)) (regions ""Promotion"" P2 (sites Bottom))}) (rules (start {(place ""Pawn1"" (sites Row 1)) (place ""Pawn2"" (sites Row 6)) (place ""Rook1"" {""A1"" ""H1""} state:1) (place ""Knight1"" {""B1"" ""G1""}) (place ""Bishop1"" {""C1"" ""F1""}) (place ""Queen1"" coord:""D1"") (place ""King1"" coord:""E1"" state:1) (place ""Rook2"" {""A8"" ""H8""} state:1) (place ""Knight2"" {""B8"" ""G8""}) (place ""Bishop2"" {""C8"" ""F8""}) (place ""Queen2"" coord:""D8"") (place ""King2"" coord:""E8"" state:1)}) (play (if (is Prev Mover) (do (set Var ""promotedValue"" (value Piece at:(last To))) next:(move Promote (last To) (piece {""Queen"" ""Knight"" ""Bishop"" ""Rook""}) Mover (then (set Value at:(last To) (var ""promotedValue""))))) (do (or (forEach Piece) (if (and (= (state at:(mapEntry ""King"" (mover))) 1) (not (is Threatened (id ""King"" Mover)))) (or (if (and (= (state at:(mapEntry ""RookLeft"" (mover))) 1) (can Move (do (set Value at:(mapEntry ""RookLeft"" (mover)) (% (+ (value Piece at:(mapEntry ""RookLeft"" (mover))) 1) 2)) next:(slide (from (mapEntry ""RookLeft"" (mover))) E (between (exact 3) if:(or (is Empty (between)) (!= (value Piece at:(from)) (value Piece at:(between))))) (to if:True (apply (set State at:(from) 0))))))) (do (set Value at:(mapEntry ""King"" (mover)) (% (+ (value Piece at:(mapEntry ""King"" (mover))) 1) 2)) next:(move Slide (from (mapEntry ""King"" (mover))) W (between (exact 2) if:(and (is Empty (to)) (not (is Threatened (id ""King"" Mover) at:(to))))) (to if:True (apply (set State at:(from) 0))) (then (do (set Value at:(mapEntry ""RookLeft"" (mover)) (% (+ (value Piece at:(mapEntry ""RookLeft"" (mover))) 1) 2)) next:(slide (from (mapEntry ""RookLeft"" (mover))) E (between (exact 3) if:True) (to if:True (apply (set State at:(from) 0))))))))) (if (and (= (state at:(mapEntry ""RookRight"" (mover))) 1) (can Move (do (set Value at:(mapEntry ""RookRight"" (mover)) (% (+ (value Piece at:(mapEntry ""RookRight"" (mover))) 1) 2)) next:(slide (from (mapEntry ""RookRight"" (mover))) W (between (exact 2) if:(or (is Empty (between)) (!= (value Piece at:(from)) (value Piece at:(between))))) (to if:True (apply (set State at:(from) 0))))))) (do (set Value at:(mapEntry ""King"" (mover)) (% (+ (value Piece at:(mapEntry ""King"" (mover))) 1) 2)) next:(move Slide (from (mapEntry ""King"" (mover))) E (between (exact 2) if:(and (is Empty (to)) (not (is Threatened (id ""King"" Mover) at:(to))))) (to if:True (apply (set State at:(from) 0))) (then (do (set Value at:(mapEntry ""RookRight"" (mover)) (% (+ (value Piece at:(mapEntry ""RookRight"" (mover))) 1) 2)) next:(slide (from (mapEntry ""RookRight"" (mover))) W (between (exact 2) if:True) (to if:True (apply (set State at:(from) 0)))))))))))) ifAfterwards:(not (is Threatened (id ""King"" Mover)))))) (end {(if (and (is Threatened (id ""King"" Next)) (not (can Move (do (forEach Piece Next) ifAfterwards:(not (is Threatened (id ""King"" Next))))))) (result Mover Win)) (if (or (no Moves Mover) (= (counter) 99)) (result Mover Draw))})))","###Description A move in Alice chess has two basic stipulations: the move must be legal on the board on which it is played, and the square transferred to on the opposite board must be vacant. (Consequently, capture is possible only on the board upon which a piece currently stands). The en passant rule is removed. @@ -4714,11 +4589,6 @@ Play begins with the pieces arranged in the last row of squares on opposite side ###Ludii (game ""Hasami Shogi"" (players 2) (equipment {(board (square 9)) (piece ""Fuhyo"" P1 (move Slide Orthogonal (then (or (custodial (from (last To)) Orthogonal (between (max 1) if:(is Enemy (who at:(between))) (apply (remove (between)))) (to if:(is Friend (who at:(to))))) (surround (from (last To)) Orthogonal (between if:(and (is In (between) (sites Corners)) (is Enemy (who at:(between)))) (apply (remove (between)))) (to if:(is Friend (who at:(to))))))))) (piece ""Tokin"" P2 (move Slide Orthogonal (then (or (custodial (from (last To)) Orthogonal (between (max 1) if:(is Enemy (who at:(between))) (apply (remove (between)))) (to if:(is Friend (who at:(to))))) (surround (from (last To)) Orthogonal (between if:(and (is In (between) (sites Corners)) (is Enemy (who at:(between)))) (apply (remove (between)))) (to if:(is Friend (who at:(to)))))))))}) (rules (start {(place ""Fuhyo1"" (sites Bottom)) (place ""Tokin2"" (sites Top))}) (play (forEach Piece)) (end (if (= (count Pieces Next) 1) (result Mover Win)))))" -"Piece movement has been updated to work on hexagonal cells, but all other rules remain the same.","(game ""Hexshogi"" (players {(player N) (player S)}) (equipment {(board (rotate 90 (remove (hex Rectangle 9 11) cells:{0 10 21 31 42 52 63 73 84 94}))) (piece ""Osho"" Each (move Step All (to if:(not (is Friend (who at:(to)))) (apply (if (is Enemy (who at:(to))) (add (piece (mapEntry ""Captured"" (what at:(to)))) (to (mapEntry ""Where"" (what at:(to)))))))))) (piece ""Fuhyo"" Each (move Step Forward (to if:(not (is Friend (who at:(to)))) (apply (if (is Enemy (who at:(to))) (add (piece (mapEntry ""Captured"" (what at:(to)))) (to (mapEntry ""Where"" (what at:(to)))))))) (then (if (is In (last To) (sites Mover ""Promotion"")) (if (is In (last To) (sites Mover ""LastRank"")) (move Promote (last To) (piece (mapEntry ""Promoted"" (what at:(last To))))) (moveAgain)))))) (piece ""Ginsho"" Each (move Leap {{F} {F L F} {F R F} {L F L F} {R F R F} {L L F L F} {R R F R F}} rotations:False (to if:(not (is Friend (who at:(to)))) (apply (if (is Enemy (who at:(to))) (add (piece (mapEntry ""Captured"" (what at:(to)))) (to (mapEntry ""Where"" (what at:(to)))))))))) (piece ""Hisha"" Each (move Slide Orthogonal (to if:(is Enemy (who at:(to))) (apply (if (is Enemy (who at:(to))) (add (piece (mapEntry ""Captured"" (what at:(to)))) (to (mapEntry ""Where"" (what at:(to)))))))) (then (if (or (is In (last To) (sites Mover ""Promotion"")) (is In (last From) (sites Mover ""Promotion""))) (moveAgain))))) (piece ""Kakugyo"" Each (move Slide Diagonal (to if:(is Enemy (who at:(to))) (apply (if (is Enemy (who at:(to))) (add (piece (mapEntry ""Captured"" (what at:(to)))) (to (mapEntry ""Where"" (what at:(to)))))))) (then (if (or (is In (last To) (sites Mover ""Promotion"")) (is In (last From) (sites Mover ""Promotion""))) (moveAgain))))) (piece ""Keima"" Each (move Leap {{F F R F} {F F L F}} rotations:False (to if:(not (is Friend (who at:(to)))) (apply if:(is Enemy (who at:(to))) (add (piece (mapEntry ""Captured"" (what at:(to)))) (to (mapEntry ""Where"" (what at:(to))))))) (then (if (is In (last To) (sites Mover ""Promotion"")) (if (is In (last To) (sites Mover ""TwoFurthestRank"")) (move Promote (last To) (piece (mapEntry ""Promoted"" (what at:(last To))))) (moveAgain)))))) (piece ""Kyosha"" Each (move Slide Forward (to if:(is Enemy (who at:(to))) (apply (if (is Enemy (who at:(to))) (add (piece (mapEntry ""Captured"" (what at:(to)))) (to (mapEntry ""Where"" (what at:(to)))))))) (then (if (is In (last To) (sites Mover ""Promotion"")) (if (is In (last To) (sites Mover ""LastRank"")) (move Promote (last To) (piece (mapEntry ""Promoted"" (what at:(last To))))) (moveAgain)))))) (piece ""Kinsho"" Each (move Leap {{F} {F L F} {F R F} {L F} {R F} {L L F} {R R F} {L L L F}} rotations:False (to if:(not (is Friend (who at:(to)))) (apply (if (is Enemy (who at:(to))) (add (piece (mapEntry ""Captured"" (what at:(to)))) (to (mapEntry ""Where"" (what at:(to)))))))))) (piece ""Tokin"" Each (move Leap {{F} {F L F} {F R F} {L F} {R F} {L L F} {R R F} {L L L F}} rotations:False (to if:(not (is Friend (who at:(to)))) (apply (if (is Enemy (who at:(to))) (add (piece (mapEntry ""Captured"" (what at:(to)))) (to (mapEntry ""Where"" (what at:(to)))))))))) (piece ""Narigin"" Each (move Leap {{F} {F L F} {F R F} {L F} {R F} {L L F} {R R F} {L L L F}} rotations:False (to if:(not (is Friend (who at:(to)))) (apply (if (is Enemy (who at:(to))) (add (piece (mapEntry ""Captured"" (what at:(to)))) (to (mapEntry ""Where"" (what at:(to)))))))))) (piece ""Ryuo"" Each (or (move Slide Orthogonal (to if:(is Enemy (who at:(to))) (apply (if (is Enemy (who at:(to))) (add (piece (mapEntry ""Captured"" (what at:(to)))) (to (mapEntry ""Where"" (what at:(to))))))))) (move Step Diagonal (to if:(not (is Friend (who at:(to)))) (apply (if (is Enemy (who at:(to))) (add (piece (mapEntry ""Captured"" (what at:(to)))) (to (mapEntry ""Where"" (what at:(to))))))))))) (piece ""Ryuma"" Each (or (move Slide Diagonal (to if:(is Enemy (who at:(to))) (apply (if (is Enemy (who at:(to))) (add (piece (mapEntry ""Captured"" (what at:(to)))) (to (mapEntry ""Where"" (what at:(to))))))))) (move Step Orthogonal (to if:(not (is Friend (who at:(to)))) (apply (if (is Enemy (who at:(to))) (add (piece (mapEntry ""Captured"" (what at:(to)))) (to (mapEntry ""Where"" (what at:(to))))))))))) (piece ""Narikei"" Each (move Leap {{F} {F L F} {F R F} {L F} {R F} {L L F} {R R F} {L L L F}} rotations:False (to if:(not (is Friend (who at:(to)))) (apply (if (is Enemy (who at:(to))) (add (piece (mapEntry ""Captured"" (what at:(to)))) (to (mapEntry ""Where"" (what at:(to)))))))))) (piece ""Narikyo"" Each (move Leap {{F} {F L F} {F R F} {L F} {R F} {L L F} {R R F} {L L L F}} rotations:False (to if:(not (is Friend (who at:(to)))) (apply (if (is Enemy (who at:(to))) (add (piece (mapEntry ""Captured"" (what at:(to)))) (to (mapEntry ""Where"" (what at:(to)))))))))) (regions ""LastRankP1"" P1 (forEach (sites Board) if:(= (site) (ahead (site) N)))) (regions ""LastRankP2"" P2 (forEach (sites Board) if:(= (site) (ahead (site) S)))) (regions ""TwoFurthestRankP1"" P1 (forEach (sites Board) if:(= (site) (ahead (site) steps:2 N)))) (regions ""TwoFurthestRankP2"" P2 (forEach (sites Board) if:(= (site) (ahead (site) steps:2 S)))) (regions ""Promotion"" P1 (forEach (sites Board) if:(= (site) (ahead (site) steps:3 N)))) (regions ""Promotion"" P2 (forEach (sites Board) if:(= (site) (ahead (site) steps:3 S)))) (map ""Where"" {(pair (id ""Fuhyo"" P1) (handSite P2)) (pair (id ""Fuhyo"" P2) (handSite P1)) (pair (id ""Ginsho"" P1) (handSite P2 1)) (pair (id ""Ginsho"" P2) (handSite P1 1)) (pair (id ""Hisha"" P1) (handSite P2 2)) (pair (id ""Hisha"" P2) (handSite P1 2)) (pair (id ""Kakugyo"" P1) (handSite P2 3)) (pair (id ""Kakugyo"" P2) (handSite P1 3)) (pair (id ""Keima"" P1) (handSite P2 4)) (pair (id ""Keima"" P2) (handSite P1 4)) (pair (id ""Kyosha"" P1) (handSite P2 5)) (pair (id ""Kyosha"" P2) (handSite P1 5)) (pair (id ""Kinsho"" P1) (handSite P2 6)) (pair (id ""Kinsho"" P2) (handSite P1 6)) (pair (id ""Tokin"" P1) (handSite P2)) (pair (id ""Tokin"" P2) (handSite P1)) (pair (id ""Narigin"" P1) (handSite P2 1)) (pair (id ""Narigin"" P2) (handSite P1 1)) (pair (id ""Ryuo"" P1) (handSite P2 2)) (pair (id ""Ryuo"" P2) (handSite P1 2)) (pair (id ""Ryuma"" P1) (handSite P2 3)) (pair (id ""Ryuma"" P2) (handSite P1 3)) (pair (id ""Narikei"" P1) (handSite P2 4)) (pair (id ""Narikei"" P2) (handSite P1 4)) (pair (id ""Narikyo"" P1) (handSite P2 5)) (pair (id ""Narikyo"" P2) (handSite P1 5))}) (map ""Captured"" {(pair (id ""Fuhyo"" P1) (id ""Fuhyo"" P2)) (pair (id ""Fuhyo"" P2) (id ""Fuhyo"" P1)) (pair (id ""Ginsho"" P1) (id ""Ginsho"" P2)) (pair (id ""Ginsho"" P2) (id ""Ginsho"" P1)) (pair (id ""Hisha"" P1) (id ""Hisha"" P2)) (pair (id ""Hisha"" P2) (id ""Hisha"" P1)) (pair (id ""Kakugyo"" P1) (id ""Kakugyo"" P2)) (pair (id ""Kakugyo"" P2) (id ""Kakugyo"" P1)) (pair (id ""Keima"" P1) (id ""Keima"" P2)) (pair (id ""Keima"" P2) (id ""Keima"" P1)) (pair (id ""Kyosha"" P1) (id ""Kyosha"" P2)) (pair (id ""Kyosha"" P2) (id ""Kyosha"" P1)) (pair (id ""Kinsho"" P1) (id ""Kinsho"" P2)) (pair (id ""Kinsho"" P2) (id ""Kinsho"" P1)) (pair (id ""Tokin"" P1) (id ""Fuhyo"" P2)) (pair (id ""Tokin"" P2) (id ""Fuhyo"" P1)) (pair (id ""Narigin"" P1) (id ""Ginsho"" P2)) (pair (id ""Narigin"" P2) (id ""Ginsho"" P1)) (pair (id ""Ryuo"" P1) (id ""Hisha"" P2)) (pair (id ""Ryuo"" P2) (id ""Hisha"" P1)) (pair (id ""Ryuma"" P1) (id ""Kakugyo"" P2)) (pair (id ""Ryuma"" P2) (id ""Kakugyo"" P1)) (pair (id ""Narikei"" P1) (id ""Keima"" P2)) (pair (id ""Narikei"" P2) (id ""Keima"" P1)) (pair (id ""Narikyo"" P1) (id ""Kyosha"" P2)) (pair (id ""Narikyo"" P2) (id ""Kyosha"" P1))}) (map ""Promoted"" {(pair (id ""Fuhyo"" P1) (id ""Tokin"" P1)) (pair (id ""Fuhyo"" P2) (id ""Tokin"" P2)) (pair (id ""Ginsho"" P1) (id ""Narigin"" P1)) (pair (id ""Ginsho"" P2) (id ""Narigin"" P2)) (pair (id ""Hisha"" P1) (id ""Ryuo"" P1)) (pair (id ""Hisha"" P2) (id ""Ryuo"" P2)) (pair (id ""Kakugyo"" P1) (id ""Ryuma"" P1)) (pair (id ""Kakugyo"" P2) (id ""Ryuma"" P2)) (pair (id ""Keima"" P1) (id ""Narikei"" P1)) (pair (id ""Keima"" P2) (id ""Narikei"" P2)) (pair (id ""Kyosha"" P1) (id ""Narikyo"" P1)) (pair (id ""Kyosha"" P2) (id ""Narikyo"" P2))}) (hand Each size:7)}) (rules (start {(place ""Osho1"" coord:""C3"") (place ""Kinsho1"" {""B3"" ""C2""}) (place ""Ginsho1"" {""B4"" ""D2""}) (place ""Keima1"" {""A4"" ""D1""}) (place ""Kyosha1"" {""A5"" ""E1""}) (place ""Kakugyo1"" coord:""C5"") (place ""Hisha1"" coord:""E3"") (place ""Fuhyo1"" {""C7"" ""C6"" ""D6"" ""D5"" ""E5"" ""E4"" ""F4"" ""F3"" ""G3""}) (place ""Osho2"" coord:""K11"") (place ""Kinsho2"" {""K12"" ""L11""}) (place ""Ginsho2"" {""J12"" ""L10""}) (place ""Keima2"" {""J13"" ""M10""}) (place ""Kyosha2"" {""I13"" ""M9""}) (place ""Kakugyo2"" coord:""K9"") (place ""Hisha2"" coord:""I11"") (place ""Fuhyo2"" {""G11"" ""H11"" ""H10"" ""I10"" ""I9"" ""J9"" ""J8"" ""K8"" ""K7""})}) (play (if (is Prev Mover) (or (move Promote (last To) (piece (mapEntry ""Promoted"" (what at:(last To))))) (move Pass)) (do (or {(move (from (sites Occupied by:Mover container:""Hand"" components:{""Kakugyo"" ""Ginsho"" ""Hisha"" ""Kinsho""})) (to (sites Empty))) (do (move (from (sites Occupied by:Mover container:""Hand"" component:""Fuhyo"")) (to (difference (sites Empty) (sites Mover ""LastRank"")) if:(= (count Sites in:(sites Occupied by:Mover container:""Board"" component:""Fuhyo"")) (count Sites in:(difference (sites Occupied by:Mover container:""Board"" component:""Fuhyo"") (union (sites Direction from:(to) N) (sites Direction from:(to) S))))))) ifAfterwards:(not (and (is Threatened (id ""Osho"" Next)) (not (can Move (do (or {(move (from (sites Occupied by:Next container:""Hand"" components:{""Kakugyo"" ""Ginsho"" ""Hisha"" ""Kinsho""})) (to (sites Empty))) (do (move (from (sites Occupied by:Next container:""Hand"" component:""Fuhyo"")) (to (difference (sites Empty) (sites Next ""LastRank"")) if:(= (count Sites in:(sites Occupied by:Next container:""Board"" component:""Fuhyo"")) (count Sites in:(difference (sites Occupied by:Next container:""Board"" component:""Fuhyo"") (union (sites Direction from:(to) N) (sites Direction from:(to) S))))))) ifAfterwards:(not (is Threatened (id ""Osho"" Mover)))) (move (from (sites Occupied by:Next container:""Hand"" component:""Kyosha"")) (to (difference (sites Empty) (sites Next ""LastRank"")))) (move (from (sites Occupied by:Next container:""Hand"" component:""Keima"")) (to (difference (sites Empty) (sites Next ""TwoFurthestRank"")))) (forEach Piece Next)}) ifAfterwards:(not (is Threatened (id ""Osho"" Next))))))))) (move (from (sites Occupied by:Mover container:""Hand"" component:""Kyosha"")) (to (difference (sites Empty) (sites Mover ""LastRank"")))) (move (from (sites Occupied by:Mover container:""Hand"" component:""Keima"")) (to (difference (sites Empty) (sites Mover ""TwoFurthestRank"")))) (forEach Piece)}) ifAfterwards:(not (is Threatened (id ""Osho"" Mover)))))) (end {(if (and (is Threatened (id ""Osho"" Next)) (not (can Move (do (or {(move (from (sites Occupied by:Next container:""Hand"" components:{""Kakugyo"" ""Ginsho"" ""Hisha"" ""Kinsho""})) (to (sites Empty))) (do (move (from (sites Occupied by:Next container:""Hand"" component:""Fuhyo"")) (to (difference (sites Empty) (sites Next ""LastRank"")) if:(= (count Sites in:(sites Occupied by:Next container:""Board"" component:""Fuhyo"")) (count Sites in:(difference (sites Occupied by:Next container:""Board"" component:""Fuhyo"") (union (sites Direction from:(to) N) (sites Direction from:(to) S))))))) ifAfterwards:(not (is Threatened (id ""Osho"" Mover)))) (move (from (sites Occupied by:Next container:""Hand"" component:""Kyosha"")) (to (difference (sites Empty) (sites Next ""LastRank"")))) (move (from (sites Occupied by:Next container:""Hand"" component:""Keima"")) (to (difference (sites Empty) (sites Next ""TwoFurthestRank"")))) (forEach Piece Next)}) ifAfterwards:(not (is Threatened (id ""Osho"" Next))))))) (result Mover Win)) (if (no Moves Next) (result Mover Win))})))","###Description -Piece movement has been updated to work on hexagonal cells, but all other rules remain the same. - -###Ludii -(game ""Hexshogi"" (players {(player N) (player S)}) (equipment {(board (rotate 90 (remove (hex Rectangle 9 11) cells:{0 10 21 31 42 52 63 73 84 94}))) (piece ""Osho"" Each (move Step All (to if:(not (is Friend (who at:(to)))) (apply (if (is Enemy (who at:(to))) (add (piece (mapEntry ""Captured"" (what at:(to)))) (to (mapEntry ""Where"" (what at:(to)))))))))) (piece ""Fuhyo"" Each (move Step Forward (to if:(not (is Friend (who at:(to)))) (apply (if (is Enemy (who at:(to))) (add (piece (mapEntry ""Captured"" (what at:(to)))) (to (mapEntry ""Where"" (what at:(to)))))))) (then (if (is In (last To) (sites Mover ""Promotion"")) (if (is In (last To) (sites Mover ""LastRank"")) (move Promote (last To) (piece (mapEntry ""Promoted"" (what at:(last To))))) (moveAgain)))))) (piece ""Ginsho"" Each (move Leap {{F} {F L F} {F R F} {L F L F} {R F R F} {L L F L F} {R R F R F}} rotations:False (to if:(not (is Friend (who at:(to)))) (apply (if (is Enemy (who at:(to))) (add (piece (mapEntry ""Captured"" (what at:(to)))) (to (mapEntry ""Where"" (what at:(to)))))))))) (piece ""Hisha"" Each (move Slide Orthogonal (to if:(is Enemy (who at:(to))) (apply (if (is Enemy (who at:(to))) (add (piece (mapEntry ""Captured"" (what at:(to)))) (to (mapEntry ""Where"" (what at:(to)))))))) (then (if (or (is In (last To) (sites Mover ""Promotion"")) (is In (last From) (sites Mover ""Promotion""))) (moveAgain))))) (piece ""Kakugyo"" Each (move Slide Diagonal (to if:(is Enemy (who at:(to))) (apply (if (is Enemy (who at:(to))) (add (piece (mapEntry ""Captured"" (what at:(to)))) (to (mapEntry ""Where"" (what at:(to)))))))) (then (if (or (is In (last To) (sites Mover ""Promotion"")) (is In (last From) (sites Mover ""Promotion""))) (moveAgain))))) (piece ""Keima"" Each (move Leap {{F F R F} {F F L F}} rotations:False (to if:(not (is Friend (who at:(to)))) (apply if:(is Enemy (who at:(to))) (add (piece (mapEntry ""Captured"" (what at:(to)))) (to (mapEntry ""Where"" (what at:(to))))))) (then (if (is In (last To) (sites Mover ""Promotion"")) (if (is In (last To) (sites Mover ""TwoFurthestRank"")) (move Promote (last To) (piece (mapEntry ""Promoted"" (what at:(last To))))) (moveAgain)))))) (piece ""Kyosha"" Each (move Slide Forward (to if:(is Enemy (who at:(to))) (apply (if (is Enemy (who at:(to))) (add (piece (mapEntry ""Captured"" (what at:(to)))) (to (mapEntry ""Where"" (what at:(to)))))))) (then (if (is In (last To) (sites Mover ""Promotion"")) (if (is In (last To) (sites Mover ""LastRank"")) (move Promote (last To) (piece (mapEntry ""Promoted"" (what at:(last To))))) (moveAgain)))))) (piece ""Kinsho"" Each (move Leap {{F} {F L F} {F R F} {L F} {R F} {L L F} {R R F} {L L L F}} rotations:False (to if:(not (is Friend (who at:(to)))) (apply (if (is Enemy (who at:(to))) (add (piece (mapEntry ""Captured"" (what at:(to)))) (to (mapEntry ""Where"" (what at:(to)))))))))) (piece ""Tokin"" Each (move Leap {{F} {F L F} {F R F} {L F} {R F} {L L F} {R R F} {L L L F}} rotations:False (to if:(not (is Friend (who at:(to)))) (apply (if (is Enemy (who at:(to))) (add (piece (mapEntry ""Captured"" (what at:(to)))) (to (mapEntry ""Where"" (what at:(to)))))))))) (piece ""Narigin"" Each (move Leap {{F} {F L F} {F R F} {L F} {R F} {L L F} {R R F} {L L L F}} rotations:False (to if:(not (is Friend (who at:(to)))) (apply (if (is Enemy (who at:(to))) (add (piece (mapEntry ""Captured"" (what at:(to)))) (to (mapEntry ""Where"" (what at:(to)))))))))) (piece ""Ryuo"" Each (or (move Slide Orthogonal (to if:(is Enemy (who at:(to))) (apply (if (is Enemy (who at:(to))) (add (piece (mapEntry ""Captured"" (what at:(to)))) (to (mapEntry ""Where"" (what at:(to))))))))) (move Step Diagonal (to if:(not (is Friend (who at:(to)))) (apply (if (is Enemy (who at:(to))) (add (piece (mapEntry ""Captured"" (what at:(to)))) (to (mapEntry ""Where"" (what at:(to))))))))))) (piece ""Ryuma"" Each (or (move Slide Diagonal (to if:(is Enemy (who at:(to))) (apply (if (is Enemy (who at:(to))) (add (piece (mapEntry ""Captured"" (what at:(to)))) (to (mapEntry ""Where"" (what at:(to))))))))) (move Step Orthogonal (to if:(not (is Friend (who at:(to)))) (apply (if (is Enemy (who at:(to))) (add (piece (mapEntry ""Captured"" (what at:(to)))) (to (mapEntry ""Where"" (what at:(to))))))))))) (piece ""Narikei"" Each (move Leap {{F} {F L F} {F R F} {L F} {R F} {L L F} {R R F} {L L L F}} rotations:False (to if:(not (is Friend (who at:(to)))) (apply (if (is Enemy (who at:(to))) (add (piece (mapEntry ""Captured"" (what at:(to)))) (to (mapEntry ""Where"" (what at:(to)))))))))) (piece ""Narikyo"" Each (move Leap {{F} {F L F} {F R F} {L F} {R F} {L L F} {R R F} {L L L F}} rotations:False (to if:(not (is Friend (who at:(to)))) (apply (if (is Enemy (who at:(to))) (add (piece (mapEntry ""Captured"" (what at:(to)))) (to (mapEntry ""Where"" (what at:(to)))))))))) (regions ""LastRankP1"" P1 (forEach (sites Board) if:(= (site) (ahead (site) N)))) (regions ""LastRankP2"" P2 (forEach (sites Board) if:(= (site) (ahead (site) S)))) (regions ""TwoFurthestRankP1"" P1 (forEach (sites Board) if:(= (site) (ahead (site) steps:2 N)))) (regions ""TwoFurthestRankP2"" P2 (forEach (sites Board) if:(= (site) (ahead (site) steps:2 S)))) (regions ""Promotion"" P1 (forEach (sites Board) if:(= (site) (ahead (site) steps:3 N)))) (regions ""Promotion"" P2 (forEach (sites Board) if:(= (site) (ahead (site) steps:3 S)))) (map ""Where"" {(pair (id ""Fuhyo"" P1) (handSite P2)) (pair (id ""Fuhyo"" P2) (handSite P1)) (pair (id ""Ginsho"" P1) (handSite P2 1)) (pair (id ""Ginsho"" P2) (handSite P1 1)) (pair (id ""Hisha"" P1) (handSite P2 2)) (pair (id ""Hisha"" P2) (handSite P1 2)) (pair (id ""Kakugyo"" P1) (handSite P2 3)) (pair (id ""Kakugyo"" P2) (handSite P1 3)) (pair (id ""Keima"" P1) (handSite P2 4)) (pair (id ""Keima"" P2) (handSite P1 4)) (pair (id ""Kyosha"" P1) (handSite P2 5)) (pair (id ""Kyosha"" P2) (handSite P1 5)) (pair (id ""Kinsho"" P1) (handSite P2 6)) (pair (id ""Kinsho"" P2) (handSite P1 6)) (pair (id ""Tokin"" P1) (handSite P2)) (pair (id ""Tokin"" P2) (handSite P1)) (pair (id ""Narigin"" P1) (handSite P2 1)) (pair (id ""Narigin"" P2) (handSite P1 1)) (pair (id ""Ryuo"" P1) (handSite P2 2)) (pair (id ""Ryuo"" P2) (handSite P1 2)) (pair (id ""Ryuma"" P1) (handSite P2 3)) (pair (id ""Ryuma"" P2) (handSite P1 3)) (pair (id ""Narikei"" P1) (handSite P2 4)) (pair (id ""Narikei"" P2) (handSite P1 4)) (pair (id ""Narikyo"" P1) (handSite P2 5)) (pair (id ""Narikyo"" P2) (handSite P1 5))}) (map ""Captured"" {(pair (id ""Fuhyo"" P1) (id ""Fuhyo"" P2)) (pair (id ""Fuhyo"" P2) (id ""Fuhyo"" P1)) (pair (id ""Ginsho"" P1) (id ""Ginsho"" P2)) (pair (id ""Ginsho"" P2) (id ""Ginsho"" P1)) (pair (id ""Hisha"" P1) (id ""Hisha"" P2)) (pair (id ""Hisha"" P2) (id ""Hisha"" P1)) (pair (id ""Kakugyo"" P1) (id ""Kakugyo"" P2)) (pair (id ""Kakugyo"" P2) (id ""Kakugyo"" P1)) (pair (id ""Keima"" P1) (id ""Keima"" P2)) (pair (id ""Keima"" P2) (id ""Keima"" P1)) (pair (id ""Kyosha"" P1) (id ""Kyosha"" P2)) (pair (id ""Kyosha"" P2) (id ""Kyosha"" P1)) (pair (id ""Kinsho"" P1) (id ""Kinsho"" P2)) (pair (id ""Kinsho"" P2) (id ""Kinsho"" P1)) (pair (id ""Tokin"" P1) (id ""Fuhyo"" P2)) (pair (id ""Tokin"" P2) (id ""Fuhyo"" P1)) (pair (id ""Narigin"" P1) (id ""Ginsho"" P2)) (pair (id ""Narigin"" P2) (id ""Ginsho"" P1)) (pair (id ""Ryuo"" P1) (id ""Hisha"" P2)) (pair (id ""Ryuo"" P2) (id ""Hisha"" P1)) (pair (id ""Ryuma"" P1) (id ""Kakugyo"" P2)) (pair (id ""Ryuma"" P2) (id ""Kakugyo"" P1)) (pair (id ""Narikei"" P1) (id ""Keima"" P2)) (pair (id ""Narikei"" P2) (id ""Keima"" P1)) (pair (id ""Narikyo"" P1) (id ""Kyosha"" P2)) (pair (id ""Narikyo"" P2) (id ""Kyosha"" P1))}) (map ""Promoted"" {(pair (id ""Fuhyo"" P1) (id ""Tokin"" P1)) (pair (id ""Fuhyo"" P2) (id ""Tokin"" P2)) (pair (id ""Ginsho"" P1) (id ""Narigin"" P1)) (pair (id ""Ginsho"" P2) (id ""Narigin"" P2)) (pair (id ""Hisha"" P1) (id ""Ryuo"" P1)) (pair (id ""Hisha"" P2) (id ""Ryuo"" P2)) (pair (id ""Kakugyo"" P1) (id ""Ryuma"" P1)) (pair (id ""Kakugyo"" P2) (id ""Ryuma"" P2)) (pair (id ""Keima"" P1) (id ""Narikei"" P1)) (pair (id ""Keima"" P2) (id ""Narikei"" P2)) (pair (id ""Kyosha"" P1) (id ""Narikyo"" P1)) (pair (id ""Kyosha"" P2) (id ""Narikyo"" P2))}) (hand Each size:7)}) (rules (start {(place ""Osho1"" coord:""C3"") (place ""Kinsho1"" {""B3"" ""C2""}) (place ""Ginsho1"" {""B4"" ""D2""}) (place ""Keima1"" {""A4"" ""D1""}) (place ""Kyosha1"" {""A5"" ""E1""}) (place ""Kakugyo1"" coord:""C5"") (place ""Hisha1"" coord:""E3"") (place ""Fuhyo1"" {""C7"" ""C6"" ""D6"" ""D5"" ""E5"" ""E4"" ""F4"" ""F3"" ""G3""}) (place ""Osho2"" coord:""K11"") (place ""Kinsho2"" {""K12"" ""L11""}) (place ""Ginsho2"" {""J12"" ""L10""}) (place ""Keima2"" {""J13"" ""M10""}) (place ""Kyosha2"" {""I13"" ""M9""}) (place ""Kakugyo2"" coord:""K9"") (place ""Hisha2"" coord:""I11"") (place ""Fuhyo2"" {""G11"" ""H11"" ""H10"" ""I10"" ""I9"" ""J9"" ""J8"" ""K8"" ""K7""})}) (play (if (is Prev Mover) (or (move Promote (last To) (piece (mapEntry ""Promoted"" (what at:(last To))))) (move Pass)) (do (or {(move (from (sites Occupied by:Mover container:""Hand"" components:{""Kakugyo"" ""Ginsho"" ""Hisha"" ""Kinsho""})) (to (sites Empty))) (do (move (from (sites Occupied by:Mover container:""Hand"" component:""Fuhyo"")) (to (difference (sites Empty) (sites Mover ""LastRank"")) if:(= (count Sites in:(sites Occupied by:Mover container:""Board"" component:""Fuhyo"")) (count Sites in:(difference (sites Occupied by:Mover container:""Board"" component:""Fuhyo"") (union (sites Direction from:(to) N) (sites Direction from:(to) S))))))) ifAfterwards:(not (and (is Threatened (id ""Osho"" Next)) (not (can Move (do (or {(move (from (sites Occupied by:Next container:""Hand"" components:{""Kakugyo"" ""Ginsho"" ""Hisha"" ""Kinsho""})) (to (sites Empty))) (do (move (from (sites Occupied by:Next container:""Hand"" component:""Fuhyo"")) (to (difference (sites Empty) (sites Next ""LastRank"")) if:(= (count Sites in:(sites Occupied by:Next container:""Board"" component:""Fuhyo"")) (count Sites in:(difference (sites Occupied by:Next container:""Board"" component:""Fuhyo"") (union (sites Direction from:(to) N) (sites Direction from:(to) S))))))) ifAfterwards:(not (is Threatened (id ""Osho"" Mover)))) (move (from (sites Occupied by:Next container:""Hand"" component:""Kyosha"")) (to (difference (sites Empty) (sites Next ""LastRank"")))) (move (from (sites Occupied by:Next container:""Hand"" component:""Keima"")) (to (difference (sites Empty) (sites Next ""TwoFurthestRank"")))) (forEach Piece Next)}) ifAfterwards:(not (is Threatened (id ""Osho"" Next))))))))) (move (from (sites Occupied by:Mover container:""Hand"" component:""Kyosha"")) (to (difference (sites Empty) (sites Mover ""LastRank"")))) (move (from (sites Occupied by:Mover container:""Hand"" component:""Keima"")) (to (difference (sites Empty) (sites Mover ""TwoFurthestRank"")))) (forEach Piece)}) ifAfterwards:(not (is Threatened (id ""Osho"" Mover)))))) (end {(if (and (is Threatened (id ""Osho"" Next)) (not (can Move (do (or {(move (from (sites Occupied by:Next container:""Hand"" components:{""Kakugyo"" ""Ginsho"" ""Hisha"" ""Kinsho""})) (to (sites Empty))) (do (move (from (sites Occupied by:Next container:""Hand"" component:""Fuhyo"")) (to (difference (sites Empty) (sites Next ""LastRank"")) if:(= (count Sites in:(sites Occupied by:Next container:""Board"" component:""Fuhyo"")) (count Sites in:(difference (sites Occupied by:Next container:""Board"" component:""Fuhyo"") (union (sites Direction from:(to) N) (sites Direction from:(to) S))))))) ifAfterwards:(not (is Threatened (id ""Osho"" Mover)))) (move (from (sites Occupied by:Next container:""Hand"" component:""Kyosha"")) (to (difference (sites Empty) (sites Next ""LastRank"")))) (move (from (sites Occupied by:Next container:""Hand"" component:""Keima"")) (to (difference (sites Empty) (sites Next ""TwoFurthestRank"")))) (forEach Piece Next)}) ifAfterwards:(not (is Threatened (id ""Osho"" Next))))))) (result Mover Win)) (if (no Moves Next) (result Mover Win))})))" "Two players play on a board ruled into a grid of 5 ranks (rows) by 5 files (columns). Each player has a set of 5 wedge-shaped pieces, of slightly different sizes. From largest to smallest (most to least powerful) they are: 1 king, 1 gold general, 1 silver general, 1 tokin, 1 pawn. There is no promotion zone in Kyoto shogi. Every time a piece makes a move it alternately promotes and reverts to its unpromoted state. Promotion is effected by turning the piece over after it moves, revealing the name of its promoted rank; demotion is effected by turning the piece back. The promotion rules and values are reminiscent of microshogi and entirely different from standard shogi: A king cannot promote. A tokin promotes to a lance and vice versa. A silver general promotes to a bishop and vice versa. A gold general promotes to a knight and vice versa. A pawn promotes to a rook and vice versa. A piece is allowed to move, capture or be dropped in a manner that will prevent it from moving on a subsequent turn, which is illegal in standard shogi. For example, a rook can move onto the farthest rank, becoming a pawn and unable to move further. Such pieces may be captured as any other. A captured piece may be dropped with either side facing up. There are no restrictions on where pieces can be dropped, other than that the square must be empty. So unlike in regular Shogi, pieces can be dropped in places where they can never move again, pawns can be dropped in files that already contain a pawn, and checkmate can be delivered through a pawn drop. The conditions to win are the same of the conditions of Shogi by checkmating the King.","(game ""Kyoto Shogi"" (players {(player N) (player S)}) (equipment {(board (square 5)) (piece ""Osho"" Each (move Step (to if:(not (is Friend (who at:(to)))) (apply (if (is Enemy (who at:(to))) (add (piece (mapEntry ""Captured"" (what at:(to)))) (to (mapEntry ""Where"" (what at:(to)))))))))) (piece ""Fuhyo"" Each (move Step Forward (to if:(not (is Friend (who at:(to)))) (apply (if (is Enemy (who at:(to))) (add (piece (mapEntry ""Captured"" (what at:(to)))) (to (mapEntry ""Where"" (what at:(to)))))))) (then (promote (last To) (piece (mapEntry ""Promoted"" (what at:(last To)))))))) (piece ""Ginsho"" Each (move Step (directions {Forward BL BR FL FR}) (to if:(not (is Friend (who at:(to)))) (apply (if (is Enemy (who at:(to))) (add (piece (mapEntry ""Captured"" (what at:(to)))) (to (mapEntry ""Where"" (what at:(to)))))))) (then (promote (last To) (piece (mapEntry ""Promoted"" (what at:(last To)))))))) (piece ""Hisha"" Each (move Slide Orthogonal (to if:(is Enemy (who at:(to))) (apply (if (is Enemy (who at:(to))) (add (piece (mapEntry ""Captured"" (what at:(to)))) (to (mapEntry ""Where"" (what at:(to)))))))) (then (promote (last To) (piece (mapEntry ""Promoted"" (what at:(last To)))))))) (piece ""Kakugyo"" Each (move Slide Diagonal (to if:(is Enemy (who at:(to))) (apply (if (is Enemy (who at:(to))) (add (piece (mapEntry ""Captured"" (what at:(to)))) (to (mapEntry ""Where"" (what at:(to)))))))) (then (promote (last To) (piece (mapEntry ""Promoted"" (what at:(last To)))))))) (piece ""Keima"" Each (forEach Direction Forward (to if:True (apply (forEach Direction (from (to)) (directions {FR FL}) (if (not (is Friend (who at:(to)))) (move (from) (to (apply if:(is Enemy (who at:(to))) (add (piece (mapEntry ""Captured"" (what at:(to)))) (to (mapEntry ""Where"" (what at:(to)))))))))))) (then (promote (last To) (piece (mapEntry ""Promoted"" (what at:(last To)))))))) (piece ""Kyosha"" Each (move Slide Forward (to if:(is Enemy (who at:(to))) (apply (if (is Enemy (who at:(to))) (add (piece (mapEntry ""Captured"" (what at:(to)))) (to (mapEntry ""Where"" (what at:(to)))))))) (then (promote (last To) (piece (mapEntry ""Promoted"" (what at:(last To)))))))) (piece ""Kinsho"" Each (move Step (directions {Forward Backward Rightward Leftward FL FR}) (to if:(not (is Friend (who at:(to)))) (apply (if (is Enemy (who at:(to))) (add (piece (mapEntry ""Captured"" (what at:(to)))) (to (mapEntry ""Where"" (what at:(to)))))))) (then (promote (last To) (piece (mapEntry ""Promoted"" (what at:(last To)))))))) (piece ""Tokin"" Each (move Step (directions {Forward Backward Rightward Leftward FL FR}) (to if:(not (is Friend (who at:(to)))) (apply (if (is Enemy (who at:(to))) (add (piece (mapEntry ""Captured"" (what at:(to)))) (to (mapEntry ""Where"" (what at:(to)))))))) (then (promote (last To) (piece (mapEntry ""Promoted"" (what at:(last To)))))))) (map ""Where"" {(pair (id ""Fuhyo"" P1) (handSite P2)) (pair (id ""Fuhyo"" P2) (handSite P1)) (pair (id ""Ginsho"" P1) (handSite P2 1)) (pair (id ""Ginsho"" P2) (handSite P1 1)) (pair (id ""Kinsho"" P1) (handSite P2 2)) (pair (id ""Kinsho"" P2) (handSite P1 2)) (pair (id ""Tokin"" P1) (handSite P2 3)) (pair (id ""Tokin"" P2) (handSite P1 3)) (pair (id ""Hisha"" P1) (handSite P2)) (pair (id ""Hisha"" P2) (handSite P1)) (pair (id ""Kakugyo"" P1) (handSite P2 1)) (pair (id ""Kakugyo"" P2) (handSite P1 1)) (pair (id ""Keima"" P1) (handSite P2 2)) (pair (id ""Keima"" P2) (handSite P1 2)) (pair (id ""Kyosha"" P1) (handSite P2 3)) (pair (id ""Kyosha"" P2) (handSite P1 3))}) (map ""Captured"" {(pair (id ""Fuhyo"" P1) (id ""Fuhyo"" P2)) (pair (id ""Fuhyo"" P2) (id ""Fuhyo"" P1)) (pair (id ""Ginsho"" P1) (id ""Ginsho"" P2)) (pair (id ""Ginsho"" P2) (id ""Ginsho"" P1)) (pair (id ""Kinsho"" P1) (id ""Kinsho"" P2)) (pair (id ""Kinsho"" P2) (id ""Kinsho"" P1)) (pair (id ""Tokin"" P1) (id ""Tokin"" P2)) (pair (id ""Tokin"" P2) (id ""Tokin"" P1)) (pair (id ""Hisha"" P1) (id ""Fuhyo"" P2)) (pair (id ""Hisha"" P2) (id ""Fuhyo"" P1)) (pair (id ""Kakugyo"" P1) (id ""Ginsho"" P2)) (pair (id ""Kakugyo"" P2) (id ""Ginsho"" P1)) (pair (id ""Keima"" P1) (id ""Kinsho"" P2)) (pair (id ""Keima"" P2) (id ""Kinsho"" P1)) (pair (id ""Kyosha"" P1) (id ""Tokin"" P2)) (pair (id ""Kyosha"" P2) (id ""Tokin"" P1))}) (map ""Promoted"" {(pair (id ""Fuhyo"" P1) (id ""Hisha"" P1)) (pair (id ""Fuhyo"" P2) (id ""Hisha"" P2)) (pair (id ""Ginsho"" P1) (id ""Kakugyo"" P1)) (pair (id ""Ginsho"" P2) (id ""Kakugyo"" P2)) (pair (id ""Keima"" P1) (id ""Kinsho"" P1)) (pair (id ""Keima"" P2) (id ""Kinsho"" P2)) (pair (id ""Kyosha"" P1) (id ""Tokin"" P1)) (pair (id ""Kyosha"" P2) (id ""Tokin"" P2)) (pair (id ""Hisha"" P1) (id ""Fuhyo"" P1)) (pair (id ""Hisha"" P2) (id ""Fuhyo"" P2)) (pair (id ""Kakugyo"" P1) (id ""Ginsho"" P1)) (pair (id ""Kakugyo"" P2) (id ""Ginsho"" P2)) (pair (id ""Kinsho"" P1) (id ""Keima"" P1)) (pair (id ""Kinsho"" P2) (id ""Keima"" P2)) (pair (id ""Tokin"" P1) (id ""Kyosha"" P1)) (pair (id ""Tokin"" P2) (id ""Kyosha"" P2))}) (hand Each size:4)}) (rules (start {(place ""Osho1"" coord:""C1"") (place ""Tokin1"" coord:""A1"") (place ""Ginsho1"" coord:""B1"") (place ""Kinsho1"" coord:""D1"") (place ""Fuhyo1"" coord:""E1"") (place ""Osho2"" coord:""C5"") (place ""Tokin2"" coord:""E5"") (place ""Ginsho2"" coord:""D5"") (place ""Kinsho2"" coord:""B5"") (place ""Fuhyo2"" coord:""A5"")}) (play (if (is Prev Mover) (move Promote (last To) (piece {(mapEntry ""Promoted"" (what at:(last To))) (what at:(last To))})) (do (or (move (from (sites Occupied by:Mover container:""Hand"")) (to (sites Empty)) (then (moveAgain))) (forEach Piece)) ifAfterwards:(not (is Threatened (id ""Osho"" Mover)))))) (end {(if (and (is Threatened (id ""Osho"" Next)) (not (can Move (do (or (move (from (sites Occupied by:Next container:""Hand"")) (to (sites Empty)) (then (moveAgain))) (forEach Piece Next)) ifAfterwards:(not (is Threatened (id ""Osho"" Next))))))) (result Mover Win)) (if (no Moves Next) (result Mover Win))})))","###Description Two players play on a board ruled into a grid of 5 ranks (rows) by 5 files (columns). Each player has a set of 5 wedge-shaped pieces, of slightly different sizes. From largest to smallest (most to least powerful) they are: 1 king, 1 gold general, 1 silver general, 1 tokin, 1 pawn. There is no promotion zone in Kyoto shogi. Every time a piece makes a move it alternately promotes and reverts to its unpromoted state. Promotion is effected by turning the piece over after it moves, revealing the name of its promoted rank; demotion is effected by turning the piece back. The promotion rules and values are reminiscent of microshogi and entirely different from standard shogi: A king cannot promote. A tokin promotes to a lance and vice versa. A silver general promotes to a bishop and vice versa. A gold general promotes to a knight and vice versa. A pawn promotes to a rook and vice versa. A piece is allowed to move, capture or be dropped in a manner that will prevent it from moving on a subsequent turn, which is illegal in standard shogi. For example, a rook can move onto the farthest rank, becoming a pawn and unable to move further. Such pieces may be captured as any other. A captured piece may be dropped with either side facing up. There are no restrictions on where pieces can be dropped, other than that the square must be empty. So unlike in regular Shogi, pieces can be dropped in places where they can never move again, pawns can be dropped in files that already contain a pawn, and checkmate can be delivered through a pawn drop. The conditions to win are the same of the conditions of Shogi by checkmating the King. @@ -4729,26 +4599,11 @@ The rules are identical to those of standard Shogi, except that it is played wit ###Ludii (game ""Minishogi"" (players {(player N) (player S)}) (equipment {(board (square 5)) (piece ""Osho"" Each (move Step (to if:(not (is Friend (who at:(to)))) (apply (if (is Enemy (who at:(to))) (add (piece (mapEntry ""Captured"" (what at:(to)))) (to (mapEntry ""Where"" (what at:(to)))))))))) (piece ""Fuhyo"" Each (move Step Forward (to if:(not (is Friend (who at:(to)))) (apply (if (is Enemy (who at:(to))) (add (piece (mapEntry ""Captured"" (what at:(to)))) (to (mapEntry ""Where"" (what at:(to)))))))) (then (if (is In (last To) (sites Mover ""Promotion"")) (move Promote (last To) (piece (mapEntry ""Promoted"" (what at:(last To))))))))) (piece ""Ginsho"" Each (move Step (directions {Forward BL BR FL FR}) (to if:(not (is Friend (who at:(to)))) (apply (if (is Enemy (who at:(to))) (add (piece (mapEntry ""Captured"" (what at:(to)))) (to (mapEntry ""Where"" (what at:(to)))))))) (then (if (or (is In (last To) (sites Mover ""Promotion"")) (is In (last From) (sites Mover ""Promotion""))) (moveAgain))))) (piece ""Hisha"" Each (move Slide Orthogonal (to if:(is Enemy (who at:(to))) (apply (if (is Enemy (who at:(to))) (add (piece (mapEntry ""Captured"" (what at:(to)))) (to (mapEntry ""Where"" (what at:(to)))))))) (then (if (or (is In (last To) (sites Mover ""Promotion"")) (is In (last From) (sites Mover ""Promotion""))) (moveAgain))))) (piece ""Kakugyo"" Each (move Slide Diagonal (to if:(is Enemy (who at:(to))) (apply (if (is Enemy (who at:(to))) (add (piece (mapEntry ""Captured"" (what at:(to)))) (to (mapEntry ""Where"" (what at:(to)))))))) (then (if (or (is In (last To) (sites Mover ""Promotion"")) (is In (last From) (sites Mover ""Promotion""))) (moveAgain))))) (piece ""Kinsho"" Each (move Step (directions {Forward Backward Rightward Leftward FL FR}) (to if:(not (is Friend (who at:(to)))) (apply (if (is Enemy (who at:(to))) (add (piece (mapEntry ""Captured"" (what at:(to)))) (to (mapEntry ""Where"" (what at:(to)))))))))) (piece ""Tokin"" Each (move Step (directions {Forward Backward Rightward Leftward FL FR}) (to if:(not (is Friend (who at:(to)))) (apply (if (is Enemy (who at:(to))) (add (piece (mapEntry ""Captured"" (what at:(to)))) (to (mapEntry ""Where"" (what at:(to)))))))))) (piece ""Narigin"" Each (move Step (directions {Forward Backward Rightward Leftward FL FR}) (to if:(not (is Friend (who at:(to)))) (apply (if (is Enemy (who at:(to))) (add (piece (mapEntry ""Captured"" (what at:(to)))) (to (mapEntry ""Where"" (what at:(to)))))))))) (piece ""Ryuo"" Each (or (move Slide Orthogonal (to if:(is Enemy (who at:(to))) (apply (if (is Enemy (who at:(to))) (add (piece (mapEntry ""Captured"" (what at:(to)))) (to (mapEntry ""Where"" (what at:(to))))))))) (move Step Diagonal (to if:(not (is Friend (who at:(to)))) (apply (if (is Enemy (who at:(to))) (add (piece (mapEntry ""Captured"" (what at:(to)))) (to (mapEntry ""Where"" (what at:(to))))))))))) (piece ""Ryuma"" Each (or (move Slide Diagonal (to if:(is Enemy (who at:(to))) (apply (if (is Enemy (who at:(to))) (add (piece (mapEntry ""Captured"" (what at:(to)))) (to (mapEntry ""Where"" (what at:(to))))))))) (move Step Orthogonal (to if:(not (is Friend (who at:(to)))) (apply (if (is Enemy (who at:(to))) (add (piece (mapEntry ""Captured"" (what at:(to)))) (to (mapEntry ""Where"" (what at:(to))))))))))) (regions ""Promotion"" P1 (sites Top)) (regions ""Promotion"" P2 (sites Bottom)) (map ""Where"" {(pair (id ""Fuhyo"" P1) (handSite P2)) (pair (id ""Fuhyo"" P2) (handSite P1)) (pair (id ""Ginsho"" P1) (handSite P2 1)) (pair (id ""Ginsho"" P2) (handSite P1 1)) (pair (id ""Hisha"" P1) (handSite P2 2)) (pair (id ""Hisha"" P2) (handSite P1 2)) (pair (id ""Kakugyo"" P1) (handSite P2 3)) (pair (id ""Kakugyo"" P2) (handSite P1 3)) (pair (id ""Kinsho"" P1) (handSite P2 4)) (pair (id ""Kinsho"" P2) (handSite P1 4)) (pair (id ""Tokin"" P1) (handSite P2)) (pair (id ""Tokin"" P2) (handSite P1)) (pair (id ""Narigin"" P1) (handSite P2 1)) (pair (id ""Narigin"" P2) (handSite P1 1)) (pair (id ""Ryuo"" P1) (handSite P2 2)) (pair (id ""Ryuo"" P2) (handSite P1 2)) (pair (id ""Ryuma"" P1) (handSite P2 3)) (pair (id ""Ryuma"" P2) (handSite P1 3))}) (map ""Captured"" {(pair (id ""Fuhyo"" P1) (id ""Fuhyo"" P2)) (pair (id ""Fuhyo"" P2) (id ""Fuhyo"" P1)) (pair (id ""Ginsho"" P1) (id ""Ginsho"" P2)) (pair (id ""Ginsho"" P2) (id ""Ginsho"" P1)) (pair (id ""Hisha"" P1) (id ""Hisha"" P2)) (pair (id ""Hisha"" P2) (id ""Hisha"" P1)) (pair (id ""Kakugyo"" P1) (id ""Kakugyo"" P2)) (pair (id ""Kakugyo"" P2) (id ""Kakugyo"" P1)) (pair (id ""Kinsho"" P1) (id ""Kinsho"" P2)) (pair (id ""Kinsho"" P2) (id ""Kinsho"" P1)) (pair (id ""Tokin"" P1) (id ""Fuhyo"" P2)) (pair (id ""Tokin"" P2) (id ""Fuhyo"" P1)) (pair (id ""Narigin"" P1) (id ""Ginsho"" P2)) (pair (id ""Narigin"" P2) (id ""Ginsho"" P1)) (pair (id ""Ryuo"" P1) (id ""Hisha"" P2)) (pair (id ""Ryuo"" P2) (id ""Hisha"" P1)) (pair (id ""Ryuma"" P1) (id ""Kakugyo"" P2)) (pair (id ""Ryuma"" P2) (id ""Kakugyo"" P1))}) (map ""Promoted"" {(pair (id ""Fuhyo"" P1) (id ""Tokin"" P1)) (pair (id ""Fuhyo"" P2) (id ""Tokin"" P2)) (pair (id ""Ginsho"" P1) (id ""Narigin"" P1)) (pair (id ""Ginsho"" P2) (id ""Narigin"" P2)) (pair (id ""Hisha"" P1) (id ""Ryuo"" P1)) (pair (id ""Hisha"" P2) (id ""Ryuo"" P2)) (pair (id ""Kakugyo"" P1) (id ""Ryuma"" P1)) (pair (id ""Kakugyo"" P2) (id ""Ryuma"" P2))}) (hand Each size:5)}) (rules (start {(place ""Osho1"" coord:""A1"") (place ""Kinsho1"" coord:""B1"") (place ""Ginsho1"" coord:""C1"") (place ""Kakugyo1"" coord:""D1"") (place ""Hisha1"" coord:""E1"") (place ""Fuhyo1"" coord:""A2"") (place ""Osho2"" coord:""E5"") (place ""Kinsho2"" coord:""D5"") (place ""Ginsho2"" coord:""C5"") (place ""Kakugyo2"" coord:""B5"") (place ""Hisha2"" coord:""A5"") (place ""Fuhyo2"" coord:""E4"")}) (play (if (is Prev Mover) (or (move Promote (last To) (piece (mapEntry ""Promoted"" (what at:(last To))))) (move Pass)) (do (or {(move (from (sites Occupied by:Mover container:""Hand"" components:{""Kakugyo"" ""Ginsho"" ""Hisha"" ""Kinsho""})) (to (sites Empty))) (do (move (from (sites Occupied by:Mover container:""Hand"" component:""Fuhyo"")) (to (difference (sites Empty) (sites Mover ""Promotion"")) if:(= (count Sites in:(sites Occupied by:Mover container:""Board"" component:""Fuhyo"")) (count Sites in:(difference (sites Occupied by:Mover container:""Board"" component:""Fuhyo"") (sites Column (column of:(to)))))))) ifAfterwards:(not (and (is Threatened (id ""Osho"" Next)) (not (can Move (do (or {(move (from (sites Occupied by:Next container:""Hand"" components:{""Kakugyo"" ""Ginsho"" ""Hisha"" ""Kinsho""})) (to (sites Empty))) (do (move (from (sites Occupied by:Next container:""Hand"" component:""Fuhyo"")) (to (difference (sites Empty) (sites Next ""Promotion"")) if:(= (count Sites in:(sites Occupied by:Next container:""Board"" component:""Fuhyo"")) (count Sites in:(difference (sites Occupied by:Next container:""Board"" component:""Fuhyo"") (sites Column (column of:(to)))))))) ifAfterwards:(not (is Threatened (id ""Osho"" Mover)))) (forEach Piece Next)}) ifAfterwards:(not (is Threatened (id ""Osho"" Next))))))))) (forEach Piece)}) ifAfterwards:(not (is Threatened (id ""Osho"" Mover)))))) (end {(if (and (is Threatened (id ""Osho"" Next)) (not (can Move (do (or {(move (from (sites Occupied by:Next container:""Hand"" components:{""Kakugyo"" ""Ginsho"" ""Hisha"" ""Kinsho""})) (to (sites Empty))) (do (move (from (sites Occupied by:Next container:""Hand"" component:""Fuhyo"")) (to (difference (sites Empty) (sites Next ""Promotion"")) if:(= (count Sites in:(sites Occupied by:Next container:""Board"" component:""Fuhyo"")) (count Sites in:(difference (sites Occupied by:Next container:""Board"" component:""Fuhyo"") (sites Column (column of:(to)))))))) ifAfterwards:(not (is Threatened (id ""Osho"" Mover)))) (forEach Piece Next)}) ifAfterwards:(not (is Threatened (id ""Osho"" Next))))))) (result Mover Win)) (if (no Moves Next) (result Mover Win))})))" -Pieces move as follows: Osho(1): moves one space in any direction Hisha(1): moves any number of spaces orthogonally. Kakugyo(1): moves any number of spaces diagonally. Kinsho(2): moves one square in any direction except diagonally backwards. Ginsho (2): moves one square diagonally or one square forward orthogonally. Keima(2): moves one space forward and then one space diagonally forward. Kyosha(2): moves any number of spaces only forward or backward. Fuhyo(9): moves one space forward. Pieces are promoted when reaching the opposite third of the board. Pieces are captured when an opponent's piece moves to the space it occupies. Captured pieces are held and can re-enter the game under the control of the capturing player as their turn. The goal is to capture the other player's king.,"(game ""Shogi"" (players {(player N) (player S)}) (equipment {(board (square 9)) (piece ""Osho"" Each (move Step (to if:(not (is Friend (who at:(to)))) (apply (if (is Enemy (who at:(to))) (add (piece (mapEntry ""Captured"" (what at:(to)))) (to (mapEntry ""Where"" (what at:(to)))))))))) (piece ""Fuhyo"" Each (move Step Forward (to if:(not (is Friend (who at:(to)))) (apply (if (is Enemy (who at:(to))) (add (piece (mapEntry ""Captured"" (what at:(to)))) (to (mapEntry ""Where"" (what at:(to)))))))) (then (if (is In (last To) (sites Mover ""Promotion"")) (if (is In (last To) (sites Mover ""LastRank"")) (move Promote (last To) (piece (mapEntry ""Promoted"" (what at:(last To))))) (moveAgain)))))) (piece ""Ginsho"" Each (move Step (directions {Forward BL BR FL FR}) (to if:(not (is Friend (who at:(to)))) (apply (if (is Enemy (who at:(to))) (add (piece (mapEntry ""Captured"" (what at:(to)))) (to (mapEntry ""Where"" (what at:(to)))))))) (then (if (or (is In (last To) (sites Mover ""Promotion"")) (is In (last From) (sites Mover ""Promotion""))) (moveAgain))))) (piece ""Hisha"" Each (move Slide Orthogonal (to if:(is Enemy (who at:(to))) (apply (if (is Enemy (who at:(to))) (add (piece (mapEntry ""Captured"" (what at:(to)))) (to (mapEntry ""Where"" (what at:(to)))))))) (then (if (or (is In (last To) (sites Mover ""Promotion"")) (is In (last From) (sites Mover ""Promotion""))) (moveAgain))))) (piece ""Kakugyo"" Each (move Slide Diagonal (to if:(is Enemy (who at:(to))) (apply (if (is Enemy (who at:(to))) (add (piece (mapEntry ""Captured"" (what at:(to)))) (to (mapEntry ""Where"" (what at:(to)))))))) (then (if (or (is In (last To) (sites Mover ""Promotion"")) (is In (last From) (sites Mover ""Promotion""))) (moveAgain))))) (piece ""Keima"" Each (forEach Direction Forward (to if:True (apply (forEach Direction (from (to)) (directions {FR FL}) (if (not (is Friend (who at:(to)))) (move (from) (to (apply if:(is Enemy (who at:(to))) (add (piece (mapEntry ""Captured"" (what at:(to)))) (to (mapEntry ""Where"" (what at:(to)))))))))))) (then (if (is In (last To) (sites Mover ""Promotion"")) (if (is In (last To) (sites Mover ""TwoFurthestRank"")) (move Promote (last To) (piece (mapEntry ""Promoted"" (what at:(last To))))) (moveAgain)))))) (piece ""Kyosha"" Each (move Slide Forward (to if:(is Enemy (who at:(to))) (apply (if (is Enemy (who at:(to))) (add (piece (mapEntry ""Captured"" (what at:(to)))) (to (mapEntry ""Where"" (what at:(to)))))))) (then (if (is In (last To) (sites Mover ""Promotion"")) (if (is In (last To) (sites Mover ""LastRank"")) (move Promote (last To) (piece (mapEntry ""Promoted"" (what at:(last To))))) (moveAgain)))))) (piece ""Kinsho"" Each (move Step (directions {Forward Backward Rightward Leftward FL FR}) (to if:(not (is Friend (who at:(to)))) (apply (if (is Enemy (who at:(to))) (add (piece (mapEntry ""Captured"" (what at:(to)))) (to (mapEntry ""Where"" (what at:(to)))))))))) (piece ""Tokin"" Each (move Step (directions {Forward Backward Rightward Leftward FL FR}) (to if:(not (is Friend (who at:(to)))) (apply (if (is Enemy (who at:(to))) (add (piece (mapEntry ""Captured"" (what at:(to)))) (to (mapEntry ""Where"" (what at:(to)))))))))) (piece ""Narigin"" Each (move Step (directions {Forward Backward Rightward Leftward FL FR}) (to if:(not (is Friend (who at:(to)))) (apply (if (is Enemy (who at:(to))) (add (piece (mapEntry ""Captured"" (what at:(to)))) (to (mapEntry ""Where"" (what at:(to)))))))))) (piece ""Ryuo"" Each (or (move Slide Orthogonal (to if:(is Enemy (who at:(to))) (apply (if (is Enemy (who at:(to))) (add (piece (mapEntry ""Captured"" (what at:(to)))) (to (mapEntry ""Where"" (what at:(to))))))))) (move Step Diagonal (to if:(not (is Friend (who at:(to)))) (apply (if (is Enemy (who at:(to))) (add (piece (mapEntry ""Captured"" (what at:(to)))) (to (mapEntry ""Where"" (what at:(to))))))))))) (piece ""Ryuma"" Each (or (move Slide Diagonal (to if:(is Enemy (who at:(to))) (apply (if (is Enemy (who at:(to))) (add (piece (mapEntry ""Captured"" (what at:(to)))) (to (mapEntry ""Where"" (what at:(to))))))))) (move Step Orthogonal (to if:(not (is Friend (who at:(to)))) (apply (if (is Enemy (who at:(to))) (add (piece (mapEntry ""Captured"" (what at:(to)))) (to (mapEntry ""Where"" (what at:(to))))))))))) (piece ""Narikei"" Each (move Step (directions {Forward Backward Rightward Leftward FL FR}) (to if:(not (is Friend (who at:(to)))) (apply (if (is Enemy (who at:(to))) (add (piece (mapEntry ""Captured"" (what at:(to)))) (to (mapEntry ""Where"" (what at:(to)))))))))) (piece ""Narikyo"" Each (move Step (directions {Forward Backward Rightward Leftward FL FR}) (to if:(not (is Friend (who at:(to)))) (apply (if (is Enemy (who at:(to))) (add (piece (mapEntry ""Captured"" (what at:(to)))) (to (mapEntry ""Where"" (what at:(to)))))))))) (regions ""LastRankP1"" P1 (sites Top)) (regions ""LastRankP2"" P2 (sites Bottom)) (regions ""TwoFurthestRankP1"" P1 (expand (sites Top))) (regions ""TwoFurthestRankP2"" P2 (expand (sites Bottom))) (regions ""Promotion"" P1 (expand (sites Top) steps:2)) (regions ""Promotion"" P2 (expand (sites Bottom) steps:2)) (map ""Where"" {(pair (id ""Fuhyo"" P1) (handSite P2)) (pair (id ""Fuhyo"" P2) (handSite P1)) (pair (id ""Ginsho"" P1) (handSite P2 1)) (pair (id ""Ginsho"" P2) (handSite P1 1)) (pair (id ""Hisha"" P1) (handSite P2 2)) (pair (id ""Hisha"" P2) (handSite P1 2)) (pair (id ""Kakugyo"" P1) (handSite P2 3)) (pair (id ""Kakugyo"" P2) (handSite P1 3)) (pair (id ""Keima"" P1) (handSite P2 4)) (pair (id ""Keima"" P2) (handSite P1 4)) (pair (id ""Kyosha"" P1) (handSite P2 5)) (pair (id ""Kyosha"" P2) (handSite P1 5)) (pair (id ""Kinsho"" P1) (handSite P2 6)) (pair (id ""Kinsho"" P2) (handSite P1 6)) (pair (id ""Tokin"" P1) (handSite P2)) (pair (id ""Tokin"" P2) (handSite P1)) (pair (id ""Narigin"" P1) (handSite P2 1)) (pair (id ""Narigin"" P2) (handSite P1 1)) (pair (id ""Ryuo"" P1) (handSite P2 2)) (pair (id ""Ryuo"" P2) (handSite P1 2)) (pair (id ""Ryuma"" P1) (handSite P2 3)) (pair (id ""Ryuma"" P2) (handSite P1 3)) (pair (id ""Narikei"" P1) (handSite P2 4)) (pair (id ""Narikei"" P2) (handSite P1 4)) (pair (id ""Narikyo"" P1) (handSite P2 5)) (pair (id ""Narikyo"" P2) (handSite P1 5))}) (map ""Captured"" {(pair (id ""Fuhyo"" P1) (id ""Fuhyo"" P2)) (pair (id ""Fuhyo"" P2) (id ""Fuhyo"" P1)) (pair (id ""Ginsho"" P1) (id ""Ginsho"" P2)) (pair (id ""Ginsho"" P2) (id ""Ginsho"" P1)) (pair (id ""Hisha"" P1) (id ""Hisha"" P2)) (pair (id ""Hisha"" P2) (id ""Hisha"" P1)) (pair (id ""Kakugyo"" P1) (id ""Kakugyo"" P2)) (pair (id ""Kakugyo"" P2) (id ""Kakugyo"" P1)) (pair (id ""Keima"" P1) (id ""Keima"" P2)) (pair (id ""Keima"" P2) (id ""Keima"" P1)) (pair (id ""Kyosha"" P1) (id ""Kyosha"" P2)) (pair (id ""Kyosha"" P2) (id ""Kyosha"" P1)) (pair (id ""Kinsho"" P1) (id ""Kinsho"" P2)) (pair (id ""Kinsho"" P2) (id ""Kinsho"" P1)) (pair (id ""Tokin"" P1) (id ""Fuhyo"" P2)) (pair (id ""Tokin"" P2) (id ""Fuhyo"" P1)) (pair (id ""Narigin"" P1) (id ""Ginsho"" P2)) (pair (id ""Narigin"" P2) (id ""Ginsho"" P1)) (pair (id ""Ryuo"" P1) (id ""Hisha"" P2)) (pair (id ""Ryuo"" P2) (id ""Hisha"" P1)) (pair (id ""Ryuma"" P1) (id ""Kakugyo"" P2)) (pair (id ""Ryuma"" P2) (id ""Kakugyo"" P1)) (pair (id ""Narikei"" P1) (id ""Keima"" P2)) (pair (id ""Narikei"" P2) (id ""Keima"" P1)) (pair (id ""Narikyo"" P1) (id ""Kyosha"" P2)) (pair (id ""Narikyo"" P2) (id ""Kyosha"" P1))}) (map ""Promoted"" {(pair (id ""Fuhyo"" P1) (id ""Tokin"" P1)) (pair (id ""Fuhyo"" P2) (id ""Tokin"" P2)) (pair (id ""Ginsho"" P1) (id ""Narigin"" P1)) (pair (id ""Ginsho"" P2) (id ""Narigin"" P2)) (pair (id ""Hisha"" P1) (id ""Ryuo"" P1)) (pair (id ""Hisha"" P2) (id ""Ryuo"" P2)) (pair (id ""Kakugyo"" P1) (id ""Ryuma"" P1)) (pair (id ""Kakugyo"" P2) (id ""Ryuma"" P2)) (pair (id ""Keima"" P1) (id ""Narikei"" P1)) (pair (id ""Keima"" P2) (id ""Narikei"" P2)) (pair (id ""Kyosha"" P1) (id ""Narikyo"" P1)) (pair (id ""Kyosha"" P2) (id ""Narikyo"" P2))}) (hand Each size:7)}) (rules (start {(place ""Osho1"" coord:""E1"") (place ""Kinsho1"" {""D1"" ""F1""}) (place ""Ginsho1"" {""C1"" ""G1""}) (place ""Keima1"" {""B1"" ""H1""}) (place ""Kyosha1"" {""A1"" ""I1""}) (place ""Kakugyo1"" coord:""B2"") (place ""Hisha1"" coord:""H2"") (place ""Fuhyo1"" (sites Row 2)) (place ""Osho2"" coord:""E9"") (place ""Kinsho2"" {""D9"" ""F9""}) (place ""Ginsho2"" {""C9"" ""G9""}) (place ""Keima2"" {""B9"" ""H9""}) (place ""Kyosha2"" {""A9"" ""I9""}) (place ""Kakugyo2"" coord:""H8"") (place ""Hisha2"" coord:""B8"") (place ""Fuhyo2"" (sites Row 6))}) (play (if (is Prev Mover) (or (move Promote (last To) (piece (mapEntry ""Promoted"" (what at:(last To))))) (move Pass)) (do (or {(move (from (sites Occupied by:Mover container:""Hand"" components:{""Kakugyo"" ""Ginsho"" ""Hisha"" ""Kinsho""})) (to (sites Empty))) (do (move (from (sites Occupied by:Mover container:""Hand"" component:""Fuhyo"")) (to (difference (sites Empty) (sites Mover ""LastRank"")) if:(= (count Sites in:(sites Occupied by:Mover container:""Board"" component:""Fuhyo"")) (count Sites in:(difference (sites Occupied by:Mover container:""Board"" component:""Fuhyo"") (sites Column (column of:(to)))))))) ifAfterwards:(not (and (is Threatened (id ""Osho"" Next)) (not (can Move (do (or {(move (from (sites Occupied by:Next container:""Hand"" components:{""Kakugyo"" ""Ginsho"" ""Hisha"" ""Kinsho""})) (to (sites Empty))) (do (move (from (sites Occupied by:Next container:""Hand"" component:""Fuhyo"")) (to (difference (sites Empty) (sites Next ""LastRank"")) if:(= (count Sites in:(sites Occupied by:Next container:""Board"" component:""Fuhyo"")) (count Sites in:(difference (sites Occupied by:Next container:""Board"" component:""Fuhyo"") (sites Column (column of:(to)))))))) ifAfterwards:(not (is Threatened (id ""Osho"" Mover)))) (move (from (sites Occupied by:Next container:""Hand"" component:""Kyosha"")) (to (difference (sites Empty) (sites Next ""LastRank"")))) (move (from (sites Occupied by:Next container:""Hand"" component:""Keima"")) (to (difference (sites Empty) (sites Next ""TwoFurthestRank"")))) (forEach Piece Next)}) ifAfterwards:(not (is Threatened (id ""Osho"" Next))))))))) (move (from (sites Occupied by:Mover container:""Hand"" component:""Kyosha"")) (to (difference (sites Empty) (sites Mover ""LastRank"")))) (move (from (sites Occupied by:Mover container:""Hand"" component:""Keima"")) (to (difference (sites Empty) (sites Mover ""TwoFurthestRank"")))) (forEach Piece)}) ifAfterwards:(not (is Threatened (id ""Osho"" Mover)))))) (end {(if (and (is Threatened (id ""Osho"" Next)) (not (can Move (do (or {(move (from (sites Occupied by:Next container:""Hand"" components:{""Kakugyo"" ""Ginsho"" ""Hisha"" ""Kinsho""})) (to (sites Empty))) (do (move (from (sites Occupied by:Next container:""Hand"" component:""Fuhyo"")) (to (difference (sites Empty) (sites Next ""LastRank"")) if:(= (count Sites in:(sites Occupied by:Next container:""Board"" component:""Fuhyo"")) (count Sites in:(difference (sites Occupied by:Next container:""Board"" component:""Fuhyo"") (sites Column (column of:(to)))))))) ifAfterwards:(not (is Threatened (id ""Osho"" Mover)))) (move (from (sites Occupied by:Next container:""Hand"" component:""Kyosha"")) (to (difference (sites Empty) (sites Next ""LastRank"")))) (move (from (sites Occupied by:Next container:""Hand"" component:""Keima"")) (to (difference (sites Empty) (sites Next ""TwoFurthestRank"")))) (forEach Piece Next)}) ifAfterwards:(not (is Threatened (id ""Osho"" Next))))))) (result Mover Win)) (if (no Moves Next) (result Mover Win))})))","###Description -Pieces move as follows: Osho(1): moves one space in any direction Hisha(1): moves any number of spaces orthogonally. Kakugyo(1): moves any number of spaces diagonally. Kinsho(2): moves one square in any direction except diagonally backwards. Ginsho (2): moves one square diagonally or one square forward orthogonally. Keima(2): moves one space forward and then one space diagonally forward. Kyosha(2): moves any number of spaces only forward or backward. Fuhyo(9): moves one space forward. Pieces are promoted when reaching the opposite third of the board. Pieces are captured when an opponent's piece moves to the space it occupies. Captured pieces are held and can re-enter the game under the control of the capturing player as their turn. The goal is to capture the other player's king. - -###Ludii -(game ""Shogi"" (players {(player N) (player S)}) (equipment {(board (square 9)) (piece ""Osho"" Each (move Step (to if:(not (is Friend (who at:(to)))) (apply (if (is Enemy (who at:(to))) (add (piece (mapEntry ""Captured"" (what at:(to)))) (to (mapEntry ""Where"" (what at:(to)))))))))) (piece ""Fuhyo"" Each (move Step Forward (to if:(not (is Friend (who at:(to)))) (apply (if (is Enemy (who at:(to))) (add (piece (mapEntry ""Captured"" (what at:(to)))) (to (mapEntry ""Where"" (what at:(to)))))))) (then (if (is In (last To) (sites Mover ""Promotion"")) (if (is In (last To) (sites Mover ""LastRank"")) (move Promote (last To) (piece (mapEntry ""Promoted"" (what at:(last To))))) (moveAgain)))))) (piece ""Ginsho"" Each (move Step (directions {Forward BL BR FL FR}) (to if:(not (is Friend (who at:(to)))) (apply (if (is Enemy (who at:(to))) (add (piece (mapEntry ""Captured"" (what at:(to)))) (to (mapEntry ""Where"" (what at:(to)))))))) (then (if (or (is In (last To) (sites Mover ""Promotion"")) (is In (last From) (sites Mover ""Promotion""))) (moveAgain))))) (piece ""Hisha"" Each (move Slide Orthogonal (to if:(is Enemy (who at:(to))) (apply (if (is Enemy (who at:(to))) (add (piece (mapEntry ""Captured"" (what at:(to)))) (to (mapEntry ""Where"" (what at:(to)))))))) (then (if (or (is In (last To) (sites Mover ""Promotion"")) (is In (last From) (sites Mover ""Promotion""))) (moveAgain))))) (piece ""Kakugyo"" Each (move Slide Diagonal (to if:(is Enemy (who at:(to))) (apply (if (is Enemy (who at:(to))) (add (piece (mapEntry ""Captured"" (what at:(to)))) (to (mapEntry ""Where"" (what at:(to)))))))) (then (if (or (is In (last To) (sites Mover ""Promotion"")) (is In (last From) (sites Mover ""Promotion""))) (moveAgain))))) (piece ""Keima"" Each (forEach Direction Forward (to if:True (apply (forEach Direction (from (to)) (directions {FR FL}) (if (not (is Friend (who at:(to)))) (move (from) (to (apply if:(is Enemy (who at:(to))) (add (piece (mapEntry ""Captured"" (what at:(to)))) (to (mapEntry ""Where"" (what at:(to)))))))))))) (then (if (is In (last To) (sites Mover ""Promotion"")) (if (is In (last To) (sites Mover ""TwoFurthestRank"")) (move Promote (last To) (piece (mapEntry ""Promoted"" (what at:(last To))))) (moveAgain)))))) (piece ""Kyosha"" Each (move Slide Forward (to if:(is Enemy (who at:(to))) (apply (if (is Enemy (who at:(to))) (add (piece (mapEntry ""Captured"" (what at:(to)))) (to (mapEntry ""Where"" (what at:(to)))))))) (then (if (is In (last To) (sites Mover ""Promotion"")) (if (is In (last To) (sites Mover ""LastRank"")) (move Promote (last To) (piece (mapEntry ""Promoted"" (what at:(last To))))) (moveAgain)))))) (piece ""Kinsho"" Each (move Step (directions {Forward Backward Rightward Leftward FL FR}) (to if:(not (is Friend (who at:(to)))) (apply (if (is Enemy (who at:(to))) (add (piece (mapEntry ""Captured"" (what at:(to)))) (to (mapEntry ""Where"" (what at:(to)))))))))) (piece ""Tokin"" Each (move Step (directions {Forward Backward Rightward Leftward FL FR}) (to if:(not (is Friend (who at:(to)))) (apply (if (is Enemy (who at:(to))) (add (piece (mapEntry ""Captured"" (what at:(to)))) (to (mapEntry ""Where"" (what at:(to)))))))))) (piece ""Narigin"" Each (move Step (directions {Forward Backward Rightward Leftward FL FR}) (to if:(not (is Friend (who at:(to)))) (apply (if (is Enemy (who at:(to))) (add (piece (mapEntry ""Captured"" (what at:(to)))) (to (mapEntry ""Where"" (what at:(to)))))))))) (piece ""Ryuo"" Each (or (move Slide Orthogonal (to if:(is Enemy (who at:(to))) (apply (if (is Enemy (who at:(to))) (add (piece (mapEntry ""Captured"" (what at:(to)))) (to (mapEntry ""Where"" (what at:(to))))))))) (move Step Diagonal (to if:(not (is Friend (who at:(to)))) (apply (if (is Enemy (who at:(to))) (add (piece (mapEntry ""Captured"" (what at:(to)))) (to (mapEntry ""Where"" (what at:(to))))))))))) (piece ""Ryuma"" Each (or (move Slide Diagonal (to if:(is Enemy (who at:(to))) (apply (if (is Enemy (who at:(to))) (add (piece (mapEntry ""Captured"" (what at:(to)))) (to (mapEntry ""Where"" (what at:(to))))))))) (move Step Orthogonal (to if:(not (is Friend (who at:(to)))) (apply (if (is Enemy (who at:(to))) (add (piece (mapEntry ""Captured"" (what at:(to)))) (to (mapEntry ""Where"" (what at:(to))))))))))) (piece ""Narikei"" Each (move Step (directions {Forward Backward Rightward Leftward FL FR}) (to if:(not (is Friend (who at:(to)))) (apply (if (is Enemy (who at:(to))) (add (piece (mapEntry ""Captured"" (what at:(to)))) (to (mapEntry ""Where"" (what at:(to)))))))))) (piece ""Narikyo"" Each (move Step (directions {Forward Backward Rightward Leftward FL FR}) (to if:(not (is Friend (who at:(to)))) (apply (if (is Enemy (who at:(to))) (add (piece (mapEntry ""Captured"" (what at:(to)))) (to (mapEntry ""Where"" (what at:(to)))))))))) (regions ""LastRankP1"" P1 (sites Top)) (regions ""LastRankP2"" P2 (sites Bottom)) (regions ""TwoFurthestRankP1"" P1 (expand (sites Top))) (regions ""TwoFurthestRankP2"" P2 (expand (sites Bottom))) (regions ""Promotion"" P1 (expand (sites Top) steps:2)) (regions ""Promotion"" P2 (expand (sites Bottom) steps:2)) (map ""Where"" {(pair (id ""Fuhyo"" P1) (handSite P2)) (pair (id ""Fuhyo"" P2) (handSite P1)) (pair (id ""Ginsho"" P1) (handSite P2 1)) (pair (id ""Ginsho"" P2) (handSite P1 1)) (pair (id ""Hisha"" P1) (handSite P2 2)) (pair (id ""Hisha"" P2) (handSite P1 2)) (pair (id ""Kakugyo"" P1) (handSite P2 3)) (pair (id ""Kakugyo"" P2) (handSite P1 3)) (pair (id ""Keima"" P1) (handSite P2 4)) (pair (id ""Keima"" P2) (handSite P1 4)) (pair (id ""Kyosha"" P1) (handSite P2 5)) (pair (id ""Kyosha"" P2) (handSite P1 5)) (pair (id ""Kinsho"" P1) (handSite P2 6)) (pair (id ""Kinsho"" P2) (handSite P1 6)) (pair (id ""Tokin"" P1) (handSite P2)) (pair (id ""Tokin"" P2) (handSite P1)) (pair (id ""Narigin"" P1) (handSite P2 1)) (pair (id ""Narigin"" P2) (handSite P1 1)) (pair (id ""Ryuo"" P1) (handSite P2 2)) (pair (id ""Ryuo"" P2) (handSite P1 2)) (pair (id ""Ryuma"" P1) (handSite P2 3)) (pair (id ""Ryuma"" P2) (handSite P1 3)) (pair (id ""Narikei"" P1) (handSite P2 4)) (pair (id ""Narikei"" P2) (handSite P1 4)) (pair (id ""Narikyo"" P1) (handSite P2 5)) (pair (id ""Narikyo"" P2) (handSite P1 5))}) (map ""Captured"" {(pair (id ""Fuhyo"" P1) (id ""Fuhyo"" P2)) (pair (id ""Fuhyo"" P2) (id ""Fuhyo"" P1)) (pair (id ""Ginsho"" P1) (id ""Ginsho"" P2)) (pair (id ""Ginsho"" P2) (id ""Ginsho"" P1)) (pair (id ""Hisha"" P1) (id ""Hisha"" P2)) (pair (id ""Hisha"" P2) (id ""Hisha"" P1)) (pair (id ""Kakugyo"" P1) (id ""Kakugyo"" P2)) (pair (id ""Kakugyo"" P2) (id ""Kakugyo"" P1)) (pair (id ""Keima"" P1) (id ""Keima"" P2)) (pair (id ""Keima"" P2) (id ""Keima"" P1)) (pair (id ""Kyosha"" P1) (id ""Kyosha"" P2)) (pair (id ""Kyosha"" P2) (id ""Kyosha"" P1)) (pair (id ""Kinsho"" P1) (id ""Kinsho"" P2)) (pair (id ""Kinsho"" P2) (id ""Kinsho"" P1)) (pair (id ""Tokin"" P1) (id ""Fuhyo"" P2)) (pair (id ""Tokin"" P2) (id ""Fuhyo"" P1)) (pair (id ""Narigin"" P1) (id ""Ginsho"" P2)) (pair (id ""Narigin"" P2) (id ""Ginsho"" P1)) (pair (id ""Ryuo"" P1) (id ""Hisha"" P2)) (pair (id ""Ryuo"" P2) (id ""Hisha"" P1)) (pair (id ""Ryuma"" P1) (id ""Kakugyo"" P2)) (pair (id ""Ryuma"" P2) (id ""Kakugyo"" P1)) (pair (id ""Narikei"" P1) (id ""Keima"" P2)) (pair (id ""Narikei"" P2) (id ""Keima"" P1)) (pair (id ""Narikyo"" P1) (id ""Kyosha"" P2)) (pair (id ""Narikyo"" P2) (id ""Kyosha"" P1))}) (map ""Promoted"" {(pair (id ""Fuhyo"" P1) (id ""Tokin"" P1)) (pair (id ""Fuhyo"" P2) (id ""Tokin"" P2)) (pair (id ""Ginsho"" P1) (id ""Narigin"" P1)) (pair (id ""Ginsho"" P2) (id ""Narigin"" P2)) (pair (id ""Hisha"" P1) (id ""Ryuo"" P1)) (pair (id ""Hisha"" P2) (id ""Ryuo"" P2)) (pair (id ""Kakugyo"" P1) (id ""Ryuma"" P1)) (pair (id ""Kakugyo"" P2) (id ""Ryuma"" P2)) (pair (id ""Keima"" P1) (id ""Narikei"" P1)) (pair (id ""Keima"" P2) (id ""Narikei"" P2)) (pair (id ""Kyosha"" P1) (id ""Narikyo"" P1)) (pair (id ""Kyosha"" P2) (id ""Narikyo"" P2))}) (hand Each size:7)}) (rules (start {(place ""Osho1"" coord:""E1"") (place ""Kinsho1"" {""D1"" ""F1""}) (place ""Ginsho1"" {""C1"" ""G1""}) (place ""Keima1"" {""B1"" ""H1""}) (place ""Kyosha1"" {""A1"" ""I1""}) (place ""Kakugyo1"" coord:""B2"") (place ""Hisha1"" coord:""H2"") (place ""Fuhyo1"" (sites Row 2)) (place ""Osho2"" coord:""E9"") (place ""Kinsho2"" {""D9"" ""F9""}) (place ""Ginsho2"" {""C9"" ""G9""}) (place ""Keima2"" {""B9"" ""H9""}) (place ""Kyosha2"" {""A9"" ""I9""}) (place ""Kakugyo2"" coord:""H8"") (place ""Hisha2"" coord:""B8"") (place ""Fuhyo2"" (sites Row 6))}) (play (if (is Prev Mover) (or (move Promote (last To) (piece (mapEntry ""Promoted"" (what at:(last To))))) (move Pass)) (do (or {(move (from (sites Occupied by:Mover container:""Hand"" components:{""Kakugyo"" ""Ginsho"" ""Hisha"" ""Kinsho""})) (to (sites Empty))) (do (move (from (sites Occupied by:Mover container:""Hand"" component:""Fuhyo"")) (to (difference (sites Empty) (sites Mover ""LastRank"")) if:(= (count Sites in:(sites Occupied by:Mover container:""Board"" component:""Fuhyo"")) (count Sites in:(difference (sites Occupied by:Mover container:""Board"" component:""Fuhyo"") (sites Column (column of:(to)))))))) ifAfterwards:(not (and (is Threatened (id ""Osho"" Next)) (not (can Move (do (or {(move (from (sites Occupied by:Next container:""Hand"" components:{""Kakugyo"" ""Ginsho"" ""Hisha"" ""Kinsho""})) (to (sites Empty))) (do (move (from (sites Occupied by:Next container:""Hand"" component:""Fuhyo"")) (to (difference (sites Empty) (sites Next ""LastRank"")) if:(= (count Sites in:(sites Occupied by:Next container:""Board"" component:""Fuhyo"")) (count Sites in:(difference (sites Occupied by:Next container:""Board"" component:""Fuhyo"") (sites Column (column of:(to)))))))) ifAfterwards:(not (is Threatened (id ""Osho"" Mover)))) (move (from (sites Occupied by:Next container:""Hand"" component:""Kyosha"")) (to (difference (sites Empty) (sites Next ""LastRank"")))) (move (from (sites Occupied by:Next container:""Hand"" component:""Keima"")) (to (difference (sites Empty) (sites Next ""TwoFurthestRank"")))) (forEach Piece Next)}) ifAfterwards:(not (is Threatened (id ""Osho"" Next))))))))) (move (from (sites Occupied by:Mover container:""Hand"" component:""Kyosha"")) (to (difference (sites Empty) (sites Mover ""LastRank"")))) (move (from (sites Occupied by:Mover container:""Hand"" component:""Keima"")) (to (difference (sites Empty) (sites Mover ""TwoFurthestRank"")))) (forEach Piece)}) ifAfterwards:(not (is Threatened (id ""Osho"" Mover)))))) (end {(if (and (is Threatened (id ""Osho"" Next)) (not (can Move (do (or {(move (from (sites Occupied by:Next container:""Hand"" components:{""Kakugyo"" ""Ginsho"" ""Hisha"" ""Kinsho""})) (to (sites Empty))) (do (move (from (sites Occupied by:Next container:""Hand"" component:""Fuhyo"")) (to (difference (sites Empty) (sites Next ""LastRank"")) if:(= (count Sites in:(sites Occupied by:Next container:""Board"" component:""Fuhyo"")) (count Sites in:(difference (sites Occupied by:Next container:""Board"" component:""Fuhyo"") (sites Column (column of:(to)))))))) ifAfterwards:(not (is Threatened (id ""Osho"" Mover)))) (move (from (sites Occupied by:Next container:""Hand"" component:""Kyosha"")) (to (difference (sites Empty) (sites Next ""LastRank"")))) (move (from (sites Occupied by:Next container:""Hand"" component:""Keima"")) (to (difference (sites Empty) (sites Next ""TwoFurthestRank"")))) (forEach Piece Next)}) ifAfterwards:(not (is Threatened (id ""Osho"" Next))))))) (result Mover Win)) (if (no Moves Next) (result Mover Win))})))" -Rules in the Wikipedia page. The rules are describing from wikipedia.,"(game ""Tenjiku Shogi"" (players {(player N) (player S)}) (equipment {(board (square 16)) (piece ""Pawn"" (move Step Forward (to if:(not (is Friend (who at:(to)))) (apply (remove (to)))))) (piece ""King"" (move Step Adjacent (to if:(not (is Friend (who at:(to)))) (apply (remove (to)))))) (piece ""Prince"" (move Step Adjacent (to if:(not (is Friend (who at:(to)))) (apply (remove (to)))))) (piece ""DrunkenElephant"" (move Step (difference Adjacent (directions {Backward})) (to if:(not (is Friend (who at:(to)))) (apply (remove (to)))))) (piece ""ViceGeneral"" (or {(if (not (is Prev Mover)) (or (move Hop Diagonal (between (range 1 (count Columns)) if:(not (is In (what at:(between)) (sites {(id ""King1"") (id ""King2"") (id ""Prince1"") (id ""Prince2"") (id ""GreatGeneral1"") (id ""GreatGeneral2"") (id ""ViceGeneral1"") (id ""ViceGeneral2"")})))) (to if:(and (is Enemy (who at:(to))) (not (is In (what at:(to)) (sites {(id ""King"" Next) (id ""Prince"" Next)})))) (apply (if (is Enemy (who at:(to))) (remove (to)))))) (move Slide Diagonal (to if:(is Enemy (who at:(to))) (apply (if (is Enemy (who at:(to))) (remove (to)))))))) (move Step Adjacent (to if:(is Empty (to))) (then (if (< (value Player Mover) 1) (and (set Value Mover (+ 1 (value Player Mover))) (moveAgain)) (set Value Mover -1)))) (move Step Adjacent (to if:(is Enemy (who at:(to))) (apply (remove (to)))) (then (set Value Mover -1)))})) (piece ""GreatGeneral"" (or (move Hop Adjacent (between (range 1 (count Columns)) if:(not (is In (what at:(between)) (sites {(id ""King1"") (id ""King2"") (id ""Prince1"") (id ""Prince2"") (id ""GreatGeneral1"") (id ""GreatGeneral2"")})))) (to if:(and (is Enemy (who at:(to))) (not (is In (what at:(to)) (sites {(id ""King"" Next) (id ""Prince"" Next)})))) (apply (if (is Enemy (who at:(to))) (remove (to)))))) (move Slide Adjacent (to if:(is Enemy (who at:(to))) (apply (if (is Enemy (who at:(to))) (remove (to)))))))) (piece ""BishopGeneral"" (or (move Hop Diagonal (between (range 1 (count Columns)) if:(not (is In (what at:(between)) (sites {(id ""King1"") (id ""King2"") (id ""Prince1"") (id ""Prince2"") (id ""GreatGeneral1"") (id ""GreatGeneral2"") (id ""ViceGeneral1"") (id ""ViceGeneral2"") (id ""BishopGeneral1"") (id ""BishopGeneral2"") (id ""RookGeneral1"") (id ""RookGeneral2"")})))) (to if:(and (is Enemy (who at:(to))) (not (is In (what at:(to)) (sites {(id ""King"" Next) (id ""Prince"" Next)})))) (apply (if (is Enemy (who at:(to))) (remove (to)))))) (move Slide Diagonal (to if:(is Enemy (who at:(to))) (apply (if (is Enemy (who at:(to))) (remove (to)))))) (then (if (and (= (state at:(last To)) 0) (or (is In (last To) (sites Mover ""Promotion"")) (is In (last From) (sites Mover ""Promotion"")))) (moveAgain))))) (piece ""RookGeneral"" (or (move Hop Orthogonal (between (range 1 (count Columns)) if:(not (is In (what at:(between)) (sites {(id ""King1"") (id ""King2"") (id ""Prince1"") (id ""Prince2"") (id ""GreatGeneral1"") (id ""GreatGeneral2"") (id ""ViceGeneral1"") (id ""ViceGeneral2"") (id ""BishopGeneral1"") (id ""BishopGeneral2"") (id ""RookGeneral1"") (id ""RookGeneral2"")})))) (to if:(and (is Enemy (who at:(to))) (not (is In (what at:(to)) (sites {(id ""King"" Next) (id ""Prince"" Next)})))) (apply (if (is Enemy (who at:(to))) (remove (to)))))) (move Slide Orthogonal (to if:(is Enemy (who at:(to))) (apply (if (is Enemy (who at:(to))) (remove (to)))))) (then (if (and (= (state at:(last To)) 0) (or (is In (last To) (sites Mover ""Promotion"")) (is In (last From) (sites Mover ""Promotion"")))) (moveAgain))))) (piece ""Lion"" (or {(move Step Adjacent (to if:(not (is Friend (who at:(to)))) (apply (if (is Enemy (who at:(to))) (remove (to))))) (then (step (from (last To)) N (to if:(not (is Friend (who at:(to)))) (apply (if (is Enemy (who at:(to))) (remove (to)))))))) (move Step Adjacent (to if:(not (is Friend (who at:(to)))) (apply (if (is Enemy (who at:(to))) (remove (to))))) (then (step (from (last To)) S (to if:(not (is Friend (who at:(to)))) (apply (if (is Enemy (who at:(to))) (remove (to)))))))) (move Step Adjacent (to if:(not (is Friend (who at:(to)))) (apply (if (is Enemy (who at:(to))) (remove (to))))) (then (step (from (last To)) E (to if:(not (is Friend (who at:(to)))) (apply (if (is Enemy (who at:(to))) (remove (to)))))))) (move Step Adjacent (to if:(not (is Friend (who at:(to)))) (apply (if (is Enemy (who at:(to))) (remove (to))))) (then (step (from (last To)) W (to if:(not (is Friend (who at:(to)))) (apply (if (is Enemy (who at:(to))) (remove (to)))))))) (move Step Adjacent (to if:(not (is Friend (who at:(to)))) (apply (if (is Enemy (who at:(to))) (remove (to))))) (then (step (from (last To)) NE (to if:(not (is Friend (who at:(to)))) (apply (if (is Enemy (who at:(to))) (remove (to)))))))) (move Step Adjacent (to if:(not (is Friend (who at:(to)))) (apply (if (is Enemy (who at:(to))) (remove (to))))) (then (step (from (last To)) NW (to if:(not (is Friend (who at:(to)))) (apply (if (is Enemy (who at:(to))) (remove (to)))))))) (move Step Adjacent (to if:(not (is Friend (who at:(to)))) (apply (if (is Enemy (who at:(to))) (remove (to))))) (then (step (from (last To)) SW (to if:(not (is Friend (who at:(to)))) (apply (if (is Enemy (who at:(to))) (remove (to)))))))) (move Step Adjacent (to if:(not (is Friend (who at:(to)))) (apply (if (is Enemy (who at:(to))) (remove (to))))) (then (step (from (last To)) SE (to if:(not (is Friend (who at:(to)))) (apply (if (is Enemy (who at:(to))) (remove (to)))))))) (move Hop Adjacent (between if:True) (to if:(not (is Friend (who at:(to)))) (apply (if (is Enemy (who at:(to))) (remove (to)))))) (move Leap {{F F R F} {F F L F}} (to if:(not (is Friend (who at:(to)))) (apply (if (is Enemy (who at:(to))) (remove (to))))))} (then (if (and (= (state at:(last To)) 0) (or (is In (last To) (sites Mover ""Promotion"")) (is In (last From) (sites Mover ""Promotion"")))) (moveAgain))))) (piece ""HornedFalcon"" (or {(move Step Forward (to if:(not (is Friend (who at:(to)))) (apply (if (is Enemy (who at:(to))) (remove (to))))) (then (step (from (last To)) N (to if:(not (is Friend (who at:(to)))) (apply (if (is Enemy (who at:(to))) (remove (to)))))))) (move Step Forward (to if:(not (is Friend (who at:(to)))) (apply (if (is Enemy (who at:(to))) (remove (to))))) (then (step (from (last To)) S (to if:(not (is Friend (who at:(to)))) (apply (if (is Enemy (who at:(to))) (remove (to)))))))) (move Hop Forward (between if:True) (to if:(not (is Friend (who at:(to)))) (apply (if (is Enemy (who at:(to))) (remove (to)))))) (move Slide (difference Adjacent (directions {Forward})) (to if:(is Enemy (who at:(to))) (apply (if (is Enemy (who at:(to))) (remove (to))))))} (then (if (and (= (state at:(last To)) 0) (or (is In (last To) (sites Mover ""Promotion"")) (is In (last From) (sites Mover ""Promotion"")))) (moveAgain))))) (piece ""SoaringEagle"" (or {(move Step FL (to if:(not (is Friend (who at:(to)))) (apply (if (is Enemy (who at:(to))) (remove (to))))) (then (step (from (last To)) NW (to if:(not (is Friend (who at:(to)))) (apply (if (is Enemy (who at:(to))) (remove (to)))))))) (move Step FL (to if:(not (is Friend (who at:(to)))) (apply (if (is Enemy (who at:(to))) (remove (to))))) (then (step (from (last To)) SE (to if:(not (is Friend (who at:(to)))) (apply (if (is Enemy (who at:(to))) (remove (to)))))))) (move Step FR (to if:(not (is Friend (who at:(to)))) (apply (if (is Enemy (who at:(to))) (remove (to))))) (then (step (from (last To)) SW (to if:(not (is Friend (who at:(to)))) (apply (if (is Enemy (who at:(to))) (remove (to)))))))) (move Step FR (to if:(not (is Friend (who at:(to)))) (apply (if (is Enemy (who at:(to))) (remove (to))))) (then (step (from (last To)) NE (to if:(not (is Friend (who at:(to)))) (apply (if (is Enemy (who at:(to))) (remove (to)))))))) (move Hop (directions {FL FR}) (between if:True) (to if:(not (is Friend (who at:(to)))) (apply (if (is Enemy (who at:(to))) (remove (to)))))) (move Slide (difference Adjacent (directions {FL FR})) (to if:(is Enemy (who at:(to))) (apply (if (is Enemy (who at:(to))) (remove (to))))))} (then (if (and (= (state at:(last To)) 0) (or (is In (last To) (sites Mover ""Promotion"")) (is In (last From) (sites Mover ""Promotion"")))) (moveAgain))))) (piece ""DragonHorse"" (or (move Step Orthogonal (to if:(not (is Friend (who at:(to)))) (apply (remove (to))))) (move Slide Diagonal (to if:(is Enemy (who at:(to))) (apply (if (is Enemy (who at:(to))) (remove (to)))))) (then (if (and (= (state at:(last To)) 0) (or (is In (last To) (sites Mover ""Promotion"")) (is In (last From) (sites Mover ""Promotion"")))) (moveAgain))))) (piece ""DragonKing"" (or (move Step Diagonal (to if:(not (is Friend (who at:(to)))) (apply (remove (to))))) (move Slide Orthogonal (to if:(is Enemy (who at:(to))) (apply (if (is Enemy (who at:(to))) (remove (to)))))) (then (if (and (= (state at:(last To)) 0) (or (is In (last To) (sites Mover ""Promotion"")) (is In (last From) (sites Mover ""Promotion"")))) (moveAgain))))) (piece ""Bishop"" (move Slide Diagonal (to if:(is Enemy (who at:(to))) (apply (if (is Enemy (who at:(to))) (remove (to))))) (then (if (and (= (state at:(last To)) 0) (or (is In (last To) (sites Mover ""Promotion"")) (is In (last From) (sites Mover ""Promotion"")))) (moveAgain))))) (piece ""Rook"" (move Slide Orthogonal (to if:(is Enemy (who at:(to))) (apply (if (is Enemy (who at:(to))) (remove (to))))) (then (if (and (= (state at:(last To)) 0) (or (is In (last To) (sites Mover ""Promotion"")) (is In (last From) (sites Mover ""Promotion"")))) (moveAgain))))) (piece ""FerociousLeopard"" (move Step (directions {Backward Forward FL FR BR BL}) (to if:(not (is Friend (who at:(to)))) (apply (remove (to)))) (then (if (and (= (state at:(last To)) 0) (or (is In (last To) (sites Mover ""Promotion"")) (is In (last From) (sites Mover ""Promotion"")))) (moveAgain))))) (piece ""GoldGeneral"" (move Step (directions {Backward Forward FL FR Rightward Leftward}) (to if:(not (is Friend (who at:(to)))) (apply (remove (to)))) (then (if (and (= (state at:(last To)) 0) (or (is In (last To) (sites Mover ""Promotion"")) (is In (last From) (sites Mover ""Promotion"")))) (moveAgain))))) (piece ""FireDemon"" (or (if (not (is Prev Mover)) (move Slide (directions {FL FR BR BL Rightward Leftward}) (to if:(is Enemy (who at:(to))) (apply (if (is Enemy (who at:(to))) (remove (to))))) (then (remove (intersection (sites Around (last To)) (sites Occupied by:Next)))))) (move Step Adjacent (to if:(is Empty (to))) (then (if (!= 0 (count Sites in:(intersection (sites Around (last To)) (sites Occupied by:Next)))) (and (remove (intersection (sites Around (last To)) (sites Occupied by:Next))) (set Value Mover -1)) (if (< (value Player Mover) 1) (and (set Value Mover (+ 1 (value Player Mover))) (moveAgain)) (set Value Mover -1))))))) (piece ""HeavenlyTetrarch"" (or {(move Step N (to if:(not (is Friend (who at:(to)))) (apply (if (is Enemy (who at:(to))) (remove (to))))) (then (step (from (last To)) S (to if:(not (is Friend (who at:(to)))) (apply (if (is Enemy (who at:(to))) (remove (to)))))))) (move Step NE (to if:(not (is Friend (who at:(to)))) (apply (if (is Enemy (who at:(to))) (remove (to))))) (then (step (from (last To)) SW (to if:(not (is Friend (who at:(to)))) (apply (if (is Enemy (who at:(to))) (remove (to)))))))) (move Step E (to if:(not (is Friend (who at:(to)))) (apply (if (is Enemy (who at:(to))) (remove (to))))) (then (step (from (last To)) W (to if:(not (is Friend (who at:(to)))) (apply (if (is Enemy (who at:(to))) (remove (to)))))))) (move Step SE (to if:(not (is Friend (who at:(to)))) (apply (if (is Enemy (who at:(to))) (remove (to))))) (then (step (from (last To)) NW (to if:(not (is Friend (who at:(to)))) (apply (if (is Enemy (who at:(to))) (remove (to)))))))) (move Step S (to if:(not (is Friend (who at:(to)))) (apply (if (is Enemy (who at:(to))) (remove (to))))) (then (step (from (last To)) N (to if:(not (is Friend (who at:(to)))) (apply (if (is Enemy (who at:(to))) (remove (to)))))))) (move Step SW (to if:(not (is Friend (who at:(to)))) (apply (if (is Enemy (who at:(to))) (remove (to))))) (then (step (from (last To)) NE (to if:(not (is Friend (who at:(to)))) (apply (if (is Enemy (who at:(to))) (remove (to)))))))) (move Step W (to if:(not (is Friend (who at:(to)))) (apply (if (is Enemy (who at:(to))) (remove (to))))) (then (step (from (last To)) E (to if:(not (is Friend (who at:(to)))) (apply (if (is Enemy (who at:(to))) (remove (to)))))))) (move Step NW (to if:(not (is Friend (who at:(to)))) (apply (if (is Enemy (who at:(to))) (remove (to))))) (then (step (from (last To)) SE (to if:(not (is Friend (who at:(to)))) (apply (if (is Enemy (who at:(to))) (remove (to)))))))) (move Slide (directions {FR FL BR BL Forward Backward}) (between if:(or (is Empty (between)) (is In (between) (sites Around (from))))) (to if:(and (not (is In (to) (sites Around (from)))) (is Enemy (who at:(to)))) (apply if:(not (is In (to) (sites Around (from)))) (if (is Enemy (who at:(to))) (remove (to)))))) (move Slide (directions {Rightward Leftward}) (between (max 3) if:(or (is Empty (between)) (is In (between) (sites Around (from))))) (to if:(and (not (is In (to) (sites Around (from)))) (is Enemy (who at:(to)))) (apply if:(not (is In (to) (sites Around (from)))) (if (is Enemy (who at:(to))) (remove (to))))))})) (piece ""WaterBuffalo"" (or (move Slide (directions {FR FL BR BL Rightward Leftward}) (to if:(is Enemy (who at:(to))) (apply (if (is Enemy (who at:(to))) (remove (to)))))) (move Slide (directions {Forward Backward}) (between (max 2)) (to if:(is Enemy (who at:(to))) (apply (if (is Enemy (who at:(to))) (remove (to)))))) (then (if (and (= (state at:(last To)) 0) (or (is In (last To) (sites Mover ""Promotion"")) (is In (last From) (sites Mover ""Promotion"")))) (moveAgain))))) (piece ""ChariotSoldier"" (or (move Slide (directions {FR FL BR BL Forward Backward}) (to if:(is Enemy (who at:(to))) (apply (if (is Enemy (who at:(to))) (remove (to)))))) (move Slide (directions {Rightward Leftward}) (between (max 2)) (to if:(is Enemy (who at:(to))) (apply (if (is Enemy (who at:(to))) (remove (to)))))) (then (if (and (= (state at:(last To)) 0) (or (is In (last To) (sites Mover ""Promotion"")) (is In (last From) (sites Mover ""Promotion"")))) (moveAgain))))) (piece ""SideSoldier"" (or {(move Slide (directions {Rightward Leftward}) (to if:(is Enemy (who at:(to))) (apply (if (is Enemy (who at:(to))) (remove (to)))))) (move Slide Forward (between (max 2)) (to if:(is Enemy (who at:(to))) (apply (if (is Enemy (who at:(to))) (remove (to)))))) (move Step Backward (to if:(not (is Friend (who at:(to)))) (apply (remove (to)))))} (then (if (and (= (state at:(last To)) 0) (or (is In (last To) (sites Mover ""Promotion"")) (is In (last From) (sites Mover ""Promotion"")))) (moveAgain))))) (piece ""VerticalSoldier"" (or {(move Slide Forward (to if:(is Enemy (who at:(to))) (apply (if (is Enemy (who at:(to))) (remove (to)))))) (move Slide (directions {Rightward Leftward}) (between (max 2)) (to if:(is Enemy (who at:(to))) (apply (if (is Enemy (who at:(to))) (remove (to)))))) (move Step Backward (to if:(not (is Friend (who at:(to)))) (apply (remove (to)))))} (then (if (and (= (state at:(last To)) 0) (or (is In (last To) (sites Mover ""Promotion"")) (is In (last From) (sites Mover ""Promotion"")))) (moveAgain))))) (piece ""Knight"" (forEach Direction Forward (to if:True (apply (forEach Direction (from (to)) (directions {FR FL}) (if (not (is Friend (who at:(to)))) (move (from) (to (apply (if (is Enemy (who at:(to))) (remove (to)))))))))) (then (if (and (= (state at:(last To)) 0) (or (is In (last To) (sites Mover ""Promotion"")) (is In (last From) (sites Mover ""Promotion"")))) (moveAgain))))) (piece ""IronGeneral"" (move Step (directions {Forward FR FL}) (to if:(not (is Friend (who at:(to)))) (apply (remove (to)))) (then (if (and (= (state at:(last To)) 0) (or (is In (last To) (sites Mover ""Promotion"")) (is In (last From) (sites Mover ""Promotion"")))) (moveAgain))))) (piece ""FreeEagle"" (or {(move Slide Adjacent (to if:(is Enemy (who at:(to))) (apply (if (is Enemy (who at:(to))) (remove (to)))))) (move Step NE (to if:(not (is Friend (who at:(to)))) (apply (if (is Enemy (who at:(to))) (remove (to))))) (then (step (from (last To)) NE (to if:(not (is Friend (who at:(to)))) (apply (if (is Enemy (who at:(to))) (remove (to)))))))) (move Step NE (to if:(not (is Friend (who at:(to)))) (apply (if (is Enemy (who at:(to))) (remove (to))))) (then (step (from (last To)) NW (to if:(not (is Friend (who at:(to)))) (apply (if (is Enemy (who at:(to))) (remove (to)))))))) (move Step NE (to if:(not (is Friend (who at:(to)))) (apply (if (is Enemy (who at:(to))) (remove (to))))) (then (step (from (last To)) SE (to if:(not (is Friend (who at:(to)))) (apply (if (is Enemy (who at:(to))) (remove (to)))))))) (move Step SE (to if:(not (is Friend (who at:(to)))) (apply (if (is Enemy (who at:(to))) (remove (to))))) (then (step (from (last To)) SE (to if:(not (is Friend (who at:(to)))) (apply (if (is Enemy (who at:(to))) (remove (to)))))))) (move Step SE (to if:(not (is Friend (who at:(to)))) (apply (if (is Enemy (who at:(to))) (remove (to))))) (then (step (from (last To)) NE (to if:(not (is Friend (who at:(to)))) (apply (if (is Enemy (who at:(to))) (remove (to)))))))) (move Step SE (to if:(not (is Friend (who at:(to)))) (apply (if (is Enemy (who at:(to))) (remove (to))))) (then (step (from (last To)) SW (to if:(not (is Friend (who at:(to)))) (apply (if (is Enemy (who at:(to))) (remove (to)))))))) (move Step SW (to if:(not (is Friend (who at:(to)))) (apply (if (is Enemy (who at:(to))) (remove (to))))) (then (step (from (last To)) SW (to if:(not (is Friend (who at:(to)))) (apply (if (is Enemy (who at:(to))) (remove (to)))))))) (move Step SW (to if:(not (is Friend (who at:(to)))) (apply (if (is Enemy (who at:(to))) (remove (to))))) (then (step (from (last To)) NW (to if:(not (is Friend (who at:(to)))) (apply (if (is Enemy (who at:(to))) (remove (to)))))))) (move Step SW (to if:(not (is Friend (who at:(to)))) (apply (if (is Enemy (who at:(to))) (remove (to))))) (then (step (from (last To)) SE (to if:(not (is Friend (who at:(to)))) (apply (if (is Enemy (who at:(to))) (remove (to)))))))) (move Step NW (to if:(not (is Friend (who at:(to)))) (apply (if (is Enemy (who at:(to))) (remove (to))))) (then (step (from (last To)) NW (to if:(not (is Friend (who at:(to)))) (apply (if (is Enemy (who at:(to))) (remove (to)))))))) (move Step NW (to if:(not (is Friend (who at:(to)))) (apply (if (is Enemy (who at:(to))) (remove (to))))) (then (step (from (last To)) NE (to if:(not (is Friend (who at:(to)))) (apply (if (is Enemy (who at:(to))) (remove (to)))))))) (move Step NW (to if:(not (is Friend (who at:(to)))) (apply (if (is Enemy (who at:(to))) (remove (to))))) (then (step (from (last To)) SW (to if:(not (is Friend (who at:(to)))) (apply (if (is Enemy (who at:(to))) (remove (to))))))))})) (piece ""LionHawk"" (or {(move Slide Diagonal (to if:(is Enemy (who at:(to))) (apply (if (is Enemy (who at:(to))) (remove (to)))))) (move Step Adjacent (to if:(not (is Friend (who at:(to)))) (apply (if (is Enemy (who at:(to))) (remove (to))))) (then (step (from (last To)) N (to if:(not (is Friend (who at:(to)))) (apply (if (is Enemy (who at:(to))) (remove (to)))))))) (move Step Adjacent (to if:(not (is Friend (who at:(to)))) (apply (if (is Enemy (who at:(to))) (remove (to))))) (then (step (from (last To)) S (to if:(not (is Friend (who at:(to)))) (apply (if (is Enemy (who at:(to))) (remove (to)))))))) (move Step Adjacent (to if:(not (is Friend (who at:(to)))) (apply (if (is Enemy (who at:(to))) (remove (to))))) (then (step (from (last To)) E (to if:(not (is Friend (who at:(to)))) (apply (if (is Enemy (who at:(to))) (remove (to)))))))) (move Step Adjacent (to if:(not (is Friend (who at:(to)))) (apply (if (is Enemy (who at:(to))) (remove (to))))) (then (step (from (last To)) W (to if:(not (is Friend (who at:(to)))) (apply (if (is Enemy (who at:(to))) (remove (to)))))))) (move Step Adjacent (to if:(not (is Friend (who at:(to)))) (apply (if (is Enemy (who at:(to))) (remove (to))))) (then (step (from (last To)) NE (to if:(not (is Friend (who at:(to)))) (apply (if (is Enemy (who at:(to))) (remove (to)))))))) (move Step Adjacent (to if:(not (is Friend (who at:(to)))) (apply (if (is Enemy (who at:(to))) (remove (to))))) (then (step (from (last To)) NW (to if:(not (is Friend (who at:(to)))) (apply (if (is Enemy (who at:(to))) (remove (to)))))))) (move Step Adjacent (to if:(not (is Friend (who at:(to)))) (apply (if (is Enemy (who at:(to))) (remove (to))))) (then (step (from (last To)) SW (to if:(not (is Friend (who at:(to)))) (apply (if (is Enemy (who at:(to))) (remove (to)))))))) (move Step Adjacent (to if:(not (is Friend (who at:(to)))) (apply (if (is Enemy (who at:(to))) (remove (to))))) (then (step (from (last To)) SE (to if:(not (is Friend (who at:(to)))) (apply (if (is Enemy (who at:(to))) (remove (to)))))))) (move Hop Adjacent (between if:True) (to if:(not (is Friend (who at:(to)))) (apply (if (is Enemy (who at:(to))) (remove (to)))))) (move Leap {{F F R F} {F F L F}} (to if:(not (is Friend (who at:(to)))) (apply (if (is Enemy (who at:(to))) (remove (to))))))})) (piece ""Queen"" (move Slide Adjacent (to if:(is Enemy (who at:(to))) (apply (if (is Enemy (who at:(to))) (remove (to))))) (then (if (and (= (state at:(last To)) 0) (or (is In (last To) (sites Mover ""Promotion"")) (is In (last From) (sites Mover ""Promotion"")))) (moveAgain))))) (piece ""Phoenix"" (or (move Step Orthogonal (to if:(not (is Friend (who at:(to)))) (apply (remove (to))))) (move Hop Diagonal (between if:True) (to if:(not (is Friend (who at:(to)))) (apply (if (is Enemy (who at:(to))) (remove (to)))))) (then (if (and (= (state at:(last To)) 0) (or (is In (last To) (sites Mover ""Promotion"")) (is In (last From) (sites Mover ""Promotion"")))) (moveAgain))))) (piece ""Kirin"" (or (move Step Diagonal (to if:(not (is Friend (who at:(to)))) (apply (remove (to))))) (move Hop Orthogonal (between if:True) (to if:(not (is Friend (who at:(to)))) (apply (if (is Enemy (who at:(to))) (remove (to)))))) (then (if (and (= (state at:(last To)) 0) (or (is In (last To) (sites Mover ""Promotion"")) (is In (last From) (sites Mover ""Promotion"")))) (moveAgain))))) (piece ""FreeBoar"" (move Slide (directions {FR FL BR BL Rightward Leftward}) (to if:(is Enemy (who at:(to))) (apply (if (is Enemy (who at:(to))) (remove (to))))))) (piece ""FlyingOx"" (move Slide (directions {FR FL BR BL Forward Backward}) (to if:(is Enemy (who at:(to))) (apply (if (is Enemy (who at:(to))) (remove (to))))))) (piece ""SideMover"" (or (move Step (directions {Forward Backward}) (to if:(not (is Friend (who at:(to)))) (apply (remove (to))))) (move Slide (directions {Rightward Leftward}) (to if:(is Enemy (who at:(to))) (apply (if (is Enemy (who at:(to))) (remove (to)))))) (then (if (and (= (state at:(last To)) 0) (or (is In (last To) (sites Mover ""Promotion"")) (is In (last From) (sites Mover ""Promotion"")))) (moveAgain))))) (piece ""VerticalMover"" (or (move Step (directions {Rightward Leftward}) (to if:(not (is Friend (who at:(to)))) (apply (remove (to))))) (move Slide (directions {Forward Backward}) (to if:(is Enemy (who at:(to))) (apply (if (is Enemy (who at:(to))) (remove (to)))))) (then (if (and (= (state at:(last To)) 0) (or (is In (last To) (sites Mover ""Promotion"")) (is In (last From) (sites Mover ""Promotion"")))) (moveAgain))))) (piece ""CopperGeneral"" (move Step (directions {Forward Backward FR FL}) (to if:(not (is Friend (who at:(to)))) (apply (remove (to)))) (then (if (and (= (state at:(last To)) 0) (or (is In (last To) (sites Mover ""Promotion"")) (is In (last From) (sites Mover ""Promotion"")))) (moveAgain))))) (piece ""SilverGeneral"" (move Step (directions {Forward BR BL FR FL}) (to if:(not (is Friend (who at:(to)))) (apply (remove (to)))) (then (if (and (= (state at:(last To)) 0) (or (is In (last To) (sites Mover ""Promotion"")) (is In (last From) (sites Mover ""Promotion"")))) (moveAgain))))) (piece ""MultiGeneral"" (move Slide (directions {Forward BR BL}) (to if:(is Enemy (who at:(to))) (apply (if (is Enemy (who at:(to))) (remove (to))))))) (piece ""FlyingStag"" (or (move Slide (directions {Forward Backward}) (to if:(is Enemy (who at:(to))) (apply (if (is Enemy (who at:(to))) (remove (to)))))) (move Step (directions {Rightward Leftward BR BL FR FL}) (to if:(not (is Friend (who at:(to)))) (apply (remove (to))))))) (piece ""Dog"" (move Step (directions {BR BL Forward}) (to if:(not (is Friend (who at:(to)))) (apply (remove (to)))) (then (if (and (= (state at:(last To)) 0) (or (is In (last To) (sites Mover ""Promotion"")) (is In (last From) (sites Mover ""Promotion"")))) (moveAgain))))) (piece ""BlindTiger"" (move Step (difference Adjacent (directions {Forward})) (to if:(not (is Friend (who at:(to)))) (apply (remove (to)))) (then (if (and (= (state at:(last To)) 0) (or (is In (last To) (sites Mover ""Promotion"")) (is In (last From) (sites Mover ""Promotion"")))) (moveAgain))))) (piece ""WhiteHorse"" (move Slide (directions {Forward FR FL Backward}) (to if:(is Enemy (who at:(to))) (apply (if (is Enemy (who at:(to))) (remove (to))))))) (piece ""Whale"" (move Slide (directions {Forward BR BL Backward}) (to if:(is Enemy (who at:(to))) (apply (if (is Enemy (who at:(to))) (remove (to))))))) (piece ""Lance"" (move Slide Forward (to if:(is Enemy (who at:(to))) (apply (if (is Enemy (who at:(to))) (remove (to))))) (then (if (and (= (state at:(last To)) 0) (or (is In (last To) (sites Mover ""Promotion"")) (is In (last From) (sites Mover ""Promotion"")))) (moveAgain))))) (piece ""ReverseChariot"" (move Slide (directions {Forward Backward}) (to if:(is Enemy (who at:(to))) (apply (if (is Enemy (who at:(to))) (remove (to))))) (then (if (and (= (state at:(last To)) 0) (or (is In (last To) (sites Mover ""Promotion"")) (is In (last From) (sites Mover ""Promotion"")))) (moveAgain))))) (regions ""Promotion"" P1 (expand (sites Top) steps:4)) (regions ""Promotion"" P2 (expand (sites Bottom) steps:4)) (map ""Promoted"" {(pair (id ""FerociousLeopard"" P1) (id ""Bishop"" P1)) (pair (id ""FerociousLeopard"" P2) (id ""Bishop"" P2)) (pair (id ""Bishop"" P1) (id ""DragonHorse"" P1)) (pair (id ""Bishop"" P2) (id ""DragonHorse"" P2)) (pair (id ""DragonHorse"" P1) (id ""HornedFalcon"" P1)) (pair (id ""DragonHorse"" P2) (id ""HornedFalcon"" P2)) (pair (id ""HornedFalcon"" P1) (id ""BishopGeneral"" P1)) (pair (id ""HornedFalcon"" P2) (id ""BishopGeneral"" P2)) (pair (id ""BishopGeneral"" P1) (id ""ViceGeneral"" P1)) (pair (id ""BishopGeneral"" P2) (id ""ViceGeneral"" P2)) (pair (id ""Knight"" P1) (id ""SideSoldier"" P1)) (pair (id ""Knight"" P2) (id ""SideSoldier"" P2)) (pair (id ""SideSoldier"" P1) (id ""WaterBuffalo"" P1)) (pair (id ""SideSoldier"" P2) (id ""WaterBuffalo"" P2)) (pair (id ""WaterBuffalo"" P1) (id ""FireDemon"" P1)) (pair (id ""WaterBuffalo"" P2) (id ""FireDemon"" P2)) (pair (id ""Phoenix"" P1) (id ""Queen"" P1)) (pair (id ""Phoenix"" P2) (id ""Queen"" P2)) (pair (id ""Queen"" P1) (id ""FreeEagle"" P1)) (pair (id ""Queen"" P2) (id ""FreeEagle"" P2)) (pair (id ""CopperGeneral"" P1) (id ""SideMover"" P1)) (pair (id ""CopperGeneral"" P2) (id ""SideMover"" P2)) (pair (id ""SideMover"" P1) (id ""FreeBoar"" P1)) (pair (id ""SideMover"" P2) (id ""FreeBoar"" P2)) (pair (id ""Dog"" P1) (id ""MultiGeneral"" P1)) (pair (id ""Dog"" P2) (id ""MultiGeneral"" P2)) (pair (id ""Lance"" P1) (id ""WhiteHorse"" P1)) (pair (id ""Lance"" P2) (id ""WhiteHorse"" P2)) (pair (id ""DrunkenElephant"" P1) (id ""Prince"" P1)) (pair (id ""DrunkenElephant"" P2) (id ""Prince"" P2)) (pair (id ""Pawn"" P1) (id ""GoldGeneral"" P1)) (pair (id ""Pawn"" P2) (id ""GoldGeneral"" P2)) (pair (id ""GoldGeneral"" P1) (id ""Rook"" P1)) (pair (id ""GoldGeneral"" P2) (id ""Rook"" P2)) (pair (id ""Rook"" P1) (id ""DragonKing"" P1)) (pair (id ""Rook"" P2) (id ""DragonKing"" P2)) (pair (id ""DragonKing"" P1) (id ""SoaringEagle"" P1)) (pair (id ""DragonKing"" P2) (id ""SoaringEagle"" P2)) (pair (id ""SoaringEagle"" P1) (id ""RookGeneral"" P1)) (pair (id ""SoaringEagle"" P2) (id ""RookGeneral"" P2)) (pair (id ""RookGeneral"" P1) (id ""GreatGeneral"" P1)) (pair (id ""RookGeneral"" P2) (id ""GreatGeneral"" P2)) (pair (id ""IronGeneral"" P1) (id ""VerticalSoldier"" P1)) (pair (id ""IronGeneral"" P2) (id ""VerticalSoldier"" P2)) (pair (id ""VerticalSoldier"" P1) (id ""ChariotSoldier"" P1)) (pair (id ""VerticalSoldier"" P2) (id ""ChariotSoldier"" P2)) (pair (id ""ChariotSoldier"" P1) (id ""HeavenlyTetrarch"" P1)) (pair (id ""ChariotSoldier"" P2) (id ""HeavenlyTetrarch"" P2)) (pair (id ""Kirin"" P1) (id ""Lion"" P1)) (pair (id ""Kirin"" P2) (id ""Lion"" P2)) (pair (id ""Lion"" P1) (id ""LionHawk"" P1)) (pair (id ""Lion"" P2) (id ""LionHawk"" P2)) (pair (id ""SilverGeneral"" P1) (id ""VerticalMover"" P1)) (pair (id ""SilverGeneral"" P2) (id ""VerticalMover"" P2)) (pair (id ""VerticalMover"" P1) (id ""FlyingOx"" P1)) (pair (id ""VerticalMover"" P2) (id ""FlyingOx"" P2)) (pair (id ""BlindTiger"" P1) (id ""FlyingStag"" P1)) (pair (id ""BlindTiger"" P2) (id ""FlyingStag"" P2)) (pair (id ""ReverseChariot"" P1) (id ""Whale"" P1)) (pair (id ""ReverseChariot"" P2) (id ""Whale"" P2))})}) (rules (start {(place ""Lance1"" (sites {""A1"" ""P1""})) (place ""Lance2"" (sites {""A16"" ""P16""})) (place ""Knight1"" (sites {""B1"" ""O1""})) (place ""Knight2"" (sites {""B16"" ""O16""})) (place ""FerociousLeopard1"" (sites {""C1"" ""N1""})) (place ""FerociousLeopard2"" (sites {""C16"" ""N16""})) (place ""IronGeneral1"" (sites {""D1"" ""M1""})) (place ""IronGeneral2"" (sites {""D16"" ""M16""})) (place ""CopperGeneral1"" (sites {""E1"" ""L1""})) (place ""CopperGeneral2"" (sites {""E16"" ""L16""})) (place ""SilverGeneral1"" (sites {""F1"" ""K1""})) (place ""SilverGeneral2"" (sites {""F16"" ""K16""})) (place ""GoldGeneral1"" (sites {""G1"" ""J1""})) (place ""GoldGeneral2"" (sites {""G16"" ""J16""})) (place ""King1"" (sites {""H1""})) (place ""King2"" (sites {""I16""})) (place ""DrunkenElephant1"" (sites {""I1""})) (place ""DrunkenElephant2"" (sites {""H16""})) (place ""ReverseChariot1"" (sites {""A2"" ""P2""})) (place ""ReverseChariot2"" (sites {""A15"" ""P15""})) (place ""ChariotSoldier1"" (sites {""C2"" ""N2"" ""D2"" ""M2""})) (place ""ChariotSoldier2"" (sites {""C15"" ""N15"" ""D15"" ""M15""})) (place ""BlindTiger1"" (sites {""F2"" ""K2""})) (place ""BlindTiger2"" (sites {""F15"" ""K15""})) (place ""Kirin1"" (sites {""G2""})) (place ""Kirin2"" (sites {""J15""})) (place ""Lion1"" (sites {""H2""})) (place ""Lion2"" (sites {""I15""})) (place ""Queen1"" (sites {""I2""})) (place ""Queen2"" (sites {""H15""})) (place ""Phoenix1"" (sites {""J2""})) (place ""Phoenix2"" (sites {""G15""})) (place ""SideSoldier1"" (sites {""A3"" ""P3""})) (place ""SideSoldier2"" (sites {""A14"" ""P14""})) (place ""VerticalSoldier1"" (sites {""B3"" ""O3""})) (place ""VerticalSoldier2"" (sites {""B14"" ""O14""})) (place ""Bishop1"" (sites {""C3"" ""N3""})) (place ""Bishop2"" (sites {""C14"" ""N14""})) (place ""DragonHorse1"" (sites {""D3"" ""M3""})) (place ""DragonHorse2"" (sites {""D14"" ""M14""})) (place ""DragonKing1"" (sites {""E3"" ""L3""})) (place ""DragonKing2"" (sites {""E14"" ""L14""})) (place ""WaterBuffalo1"" (sites {""F3"" ""K3""})) (place ""WaterBuffalo2"" (sites {""F14"" ""K14""})) (place ""FireDemon1"" (sites {""G3"" ""J3""})) (place ""FireDemon2"" (sites {""G14"" ""J14""})) (place ""LionHawk1"" (sites {""H3""})) (place ""LionHawk2"" (sites {""I14""})) (place ""FreeEagle1"" (sites {""I3""})) (place ""FreeEagle2"" (sites {""H14""})) (place ""SideMover1"" (sites {""A4"" ""P4""})) (place ""SideMover2"" (sites {""A13"" ""P13""})) (place ""VerticalMover1"" (sites {""B4"" ""O4""})) (place ""VerticalMover2"" (sites {""B13"" ""O13""})) (place ""Rook1"" (sites {""C4"" ""N4""})) (place ""Rook2"" (sites {""C13"" ""N13""})) (place ""HornedFalcon1"" (sites {""D4"" ""M4""})) (place ""HornedFalcon2"" (sites {""D13"" ""M13""})) (place ""SoaringEagle1"" (sites {""E4"" ""L4""})) (place ""SoaringEagle2"" (sites {""E13"" ""L13""})) (place ""BishopGeneral1"" (sites {""F4"" ""K4""})) (place ""BishopGeneral2"" (sites {""F13"" ""K13""})) (place ""RookGeneral1"" (sites {""G4"" ""J4""})) (place ""RookGeneral2"" (sites {""G13"" ""J13""})) (place ""GreatGeneral1"" (sites {""H4""})) (place ""GreatGeneral2"" (sites {""I13""})) (place ""ViceGeneral1"" (sites {""I4""})) (place ""ViceGeneral2"" (sites {""H13""})) (place ""Pawn1"" (sites Row 4)) (place ""Pawn2"" (sites Row 11)) (place ""Dog1"" (sites {""E6"" ""L6""})) (place ""Dog2"" (sites {""E11"" ""L11""}))}) (play (if (is Prev Mover) (or (if (= (what at:(last To)) (id ""ViceGeneral"" Mover)) (forEach Piece ""ViceGeneral"") (if (= (what at:(last To)) (id ""FireDemon"" Mover)) (forEach Piece ""FireDemon"") (move Promote (last To) (piece (mapEntry ""Promoted"" (what at:(last To)))) (then (set State at:(last To) 1))))) (move Pass (then (set Value Mover -1)))) (forEach Piece) (then (if (!= 0 (count Sites in:(intersection (sites Around (last To)) (sites Occupied by:Next component:""FireDemon"")))) (and (remove (last To)) (set Value Mover -1)))))) (end (if (and {(not (is Mover Next)) (= (where ""King"" Next) -1) (= (where ""Prince"" Next) -1)}) (result Mover Win)))))","###Description -Rules in the Wikipedia page. The rules are describing from wikipedia. - -###Ludii -(game ""Tenjiku Shogi"" (players {(player N) (player S)}) (equipment {(board (square 16)) (piece ""Pawn"" (move Step Forward (to if:(not (is Friend (who at:(to)))) (apply (remove (to)))))) (piece ""King"" (move Step Adjacent (to if:(not (is Friend (who at:(to)))) (apply (remove (to)))))) (piece ""Prince"" (move Step Adjacent (to if:(not (is Friend (who at:(to)))) (apply (remove (to)))))) (piece ""DrunkenElephant"" (move Step (difference Adjacent (directions {Backward})) (to if:(not (is Friend (who at:(to)))) (apply (remove (to)))))) (piece ""ViceGeneral"" (or {(if (not (is Prev Mover)) (or (move Hop Diagonal (between (range 1 (count Columns)) if:(not (is In (what at:(between)) (sites {(id ""King1"") (id ""King2"") (id ""Prince1"") (id ""Prince2"") (id ""GreatGeneral1"") (id ""GreatGeneral2"") (id ""ViceGeneral1"") (id ""ViceGeneral2"")})))) (to if:(and (is Enemy (who at:(to))) (not (is In (what at:(to)) (sites {(id ""King"" Next) (id ""Prince"" Next)})))) (apply (if (is Enemy (who at:(to))) (remove (to)))))) (move Slide Diagonal (to if:(is Enemy (who at:(to))) (apply (if (is Enemy (who at:(to))) (remove (to)))))))) (move Step Adjacent (to if:(is Empty (to))) (then (if (< (value Player Mover) 1) (and (set Value Mover (+ 1 (value Player Mover))) (moveAgain)) (set Value Mover -1)))) (move Step Adjacent (to if:(is Enemy (who at:(to))) (apply (remove (to)))) (then (set Value Mover -1)))})) (piece ""GreatGeneral"" (or (move Hop Adjacent (between (range 1 (count Columns)) if:(not (is In (what at:(between)) (sites {(id ""King1"") (id ""King2"") (id ""Prince1"") (id ""Prince2"") (id ""GreatGeneral1"") (id ""GreatGeneral2"")})))) (to if:(and (is Enemy (who at:(to))) (not (is In (what at:(to)) (sites {(id ""King"" Next) (id ""Prince"" Next)})))) (apply (if (is Enemy (who at:(to))) (remove (to)))))) (move Slide Adjacent (to if:(is Enemy (who at:(to))) (apply (if (is Enemy (who at:(to))) (remove (to)))))))) (piece ""BishopGeneral"" (or (move Hop Diagonal (between (range 1 (count Columns)) if:(not (is In (what at:(between)) (sites {(id ""King1"") (id ""King2"") (id ""Prince1"") (id ""Prince2"") (id ""GreatGeneral1"") (id ""GreatGeneral2"") (id ""ViceGeneral1"") (id ""ViceGeneral2"") (id ""BishopGeneral1"") (id ""BishopGeneral2"") (id ""RookGeneral1"") (id ""RookGeneral2"")})))) (to if:(and (is Enemy (who at:(to))) (not (is In (what at:(to)) (sites {(id ""King"" Next) (id ""Prince"" Next)})))) (apply (if (is Enemy (who at:(to))) (remove (to)))))) (move Slide Diagonal (to if:(is Enemy (who at:(to))) (apply (if (is Enemy (who at:(to))) (remove (to)))))) (then (if (and (= (state at:(last To)) 0) (or (is In (last To) (sites Mover ""Promotion"")) (is In (last From) (sites Mover ""Promotion"")))) (moveAgain))))) (piece ""RookGeneral"" (or (move Hop Orthogonal (between (range 1 (count Columns)) if:(not (is In (what at:(between)) (sites {(id ""King1"") (id ""King2"") (id ""Prince1"") (id ""Prince2"") (id ""GreatGeneral1"") (id ""GreatGeneral2"") (id ""ViceGeneral1"") (id ""ViceGeneral2"") (id ""BishopGeneral1"") (id ""BishopGeneral2"") (id ""RookGeneral1"") (id ""RookGeneral2"")})))) (to if:(and (is Enemy (who at:(to))) (not (is In (what at:(to)) (sites {(id ""King"" Next) (id ""Prince"" Next)})))) (apply (if (is Enemy (who at:(to))) (remove (to)))))) (move Slide Orthogonal (to if:(is Enemy (who at:(to))) (apply (if (is Enemy (who at:(to))) (remove (to)))))) (then (if (and (= (state at:(last To)) 0) (or (is In (last To) (sites Mover ""Promotion"")) (is In (last From) (sites Mover ""Promotion"")))) (moveAgain))))) (piece ""Lion"" (or {(move Step Adjacent (to if:(not (is Friend (who at:(to)))) (apply (if (is Enemy (who at:(to))) (remove (to))))) (then (step (from (last To)) N (to if:(not (is Friend (who at:(to)))) (apply (if (is Enemy (who at:(to))) (remove (to)))))))) (move Step Adjacent (to if:(not (is Friend (who at:(to)))) (apply (if (is Enemy (who at:(to))) (remove (to))))) (then (step (from (last To)) S (to if:(not (is Friend (who at:(to)))) (apply (if (is Enemy (who at:(to))) (remove (to)))))))) (move Step Adjacent (to if:(not (is Friend (who at:(to)))) (apply (if (is Enemy (who at:(to))) (remove (to))))) (then (step (from (last To)) E (to if:(not (is Friend (who at:(to)))) (apply (if (is Enemy (who at:(to))) (remove (to)))))))) (move Step Adjacent (to if:(not (is Friend (who at:(to)))) (apply (if (is Enemy (who at:(to))) (remove (to))))) (then (step (from (last To)) W (to if:(not (is Friend (who at:(to)))) (apply (if (is Enemy (who at:(to))) (remove (to)))))))) (move Step Adjacent (to if:(not (is Friend (who at:(to)))) (apply (if (is Enemy (who at:(to))) (remove (to))))) (then (step (from (last To)) NE (to if:(not (is Friend (who at:(to)))) (apply (if (is Enemy (who at:(to))) (remove (to)))))))) (move Step Adjacent (to if:(not (is Friend (who at:(to)))) (apply (if (is Enemy (who at:(to))) (remove (to))))) (then (step (from (last To)) NW (to if:(not (is Friend (who at:(to)))) (apply (if (is Enemy (who at:(to))) (remove (to)))))))) (move Step Adjacent (to if:(not (is Friend (who at:(to)))) (apply (if (is Enemy (who at:(to))) (remove (to))))) (then (step (from (last To)) SW (to if:(not (is Friend (who at:(to)))) (apply (if (is Enemy (who at:(to))) (remove (to)))))))) (move Step Adjacent (to if:(not (is Friend (who at:(to)))) (apply (if (is Enemy (who at:(to))) (remove (to))))) (then (step (from (last To)) SE (to if:(not (is Friend (who at:(to)))) (apply (if (is Enemy (who at:(to))) (remove (to)))))))) (move Hop Adjacent (between if:True) (to if:(not (is Friend (who at:(to)))) (apply (if (is Enemy (who at:(to))) (remove (to)))))) (move Leap {{F F R F} {F F L F}} (to if:(not (is Friend (who at:(to)))) (apply (if (is Enemy (who at:(to))) (remove (to))))))} (then (if (and (= (state at:(last To)) 0) (or (is In (last To) (sites Mover ""Promotion"")) (is In (last From) (sites Mover ""Promotion"")))) (moveAgain))))) (piece ""HornedFalcon"" (or {(move Step Forward (to if:(not (is Friend (who at:(to)))) (apply (if (is Enemy (who at:(to))) (remove (to))))) (then (step (from (last To)) N (to if:(not (is Friend (who at:(to)))) (apply (if (is Enemy (who at:(to))) (remove (to)))))))) (move Step Forward (to if:(not (is Friend (who at:(to)))) (apply (if (is Enemy (who at:(to))) (remove (to))))) (then (step (from (last To)) S (to if:(not (is Friend (who at:(to)))) (apply (if (is Enemy (who at:(to))) (remove (to)))))))) (move Hop Forward (between if:True) (to if:(not (is Friend (who at:(to)))) (apply (if (is Enemy (who at:(to))) (remove (to)))))) (move Slide (difference Adjacent (directions {Forward})) (to if:(is Enemy (who at:(to))) (apply (if (is Enemy (who at:(to))) (remove (to))))))} (then (if (and (= (state at:(last To)) 0) (or (is In (last To) (sites Mover ""Promotion"")) (is In (last From) (sites Mover ""Promotion"")))) (moveAgain))))) (piece ""SoaringEagle"" (or {(move Step FL (to if:(not (is Friend (who at:(to)))) (apply (if (is Enemy (who at:(to))) (remove (to))))) (then (step (from (last To)) NW (to if:(not (is Friend (who at:(to)))) (apply (if (is Enemy (who at:(to))) (remove (to)))))))) (move Step FL (to if:(not (is Friend (who at:(to)))) (apply (if (is Enemy (who at:(to))) (remove (to))))) (then (step (from (last To)) SE (to if:(not (is Friend (who at:(to)))) (apply (if (is Enemy (who at:(to))) (remove (to)))))))) (move Step FR (to if:(not (is Friend (who at:(to)))) (apply (if (is Enemy (who at:(to))) (remove (to))))) (then (step (from (last To)) SW (to if:(not (is Friend (who at:(to)))) (apply (if (is Enemy (who at:(to))) (remove (to)))))))) (move Step FR (to if:(not (is Friend (who at:(to)))) (apply (if (is Enemy (who at:(to))) (remove (to))))) (then (step (from (last To)) NE (to if:(not (is Friend (who at:(to)))) (apply (if (is Enemy (who at:(to))) (remove (to)))))))) (move Hop (directions {FL FR}) (between if:True) (to if:(not (is Friend (who at:(to)))) (apply (if (is Enemy (who at:(to))) (remove (to)))))) (move Slide (difference Adjacent (directions {FL FR})) (to if:(is Enemy (who at:(to))) (apply (if (is Enemy (who at:(to))) (remove (to))))))} (then (if (and (= (state at:(last To)) 0) (or (is In (last To) (sites Mover ""Promotion"")) (is In (last From) (sites Mover ""Promotion"")))) (moveAgain))))) (piece ""DragonHorse"" (or (move Step Orthogonal (to if:(not (is Friend (who at:(to)))) (apply (remove (to))))) (move Slide Diagonal (to if:(is Enemy (who at:(to))) (apply (if (is Enemy (who at:(to))) (remove (to)))))) (then (if (and (= (state at:(last To)) 0) (or (is In (last To) (sites Mover ""Promotion"")) (is In (last From) (sites Mover ""Promotion"")))) (moveAgain))))) (piece ""DragonKing"" (or (move Step Diagonal (to if:(not (is Friend (who at:(to)))) (apply (remove (to))))) (move Slide Orthogonal (to if:(is Enemy (who at:(to))) (apply (if (is Enemy (who at:(to))) (remove (to)))))) (then (if (and (= (state at:(last To)) 0) (or (is In (last To) (sites Mover ""Promotion"")) (is In (last From) (sites Mover ""Promotion"")))) (moveAgain))))) (piece ""Bishop"" (move Slide Diagonal (to if:(is Enemy (who at:(to))) (apply (if (is Enemy (who at:(to))) (remove (to))))) (then (if (and (= (state at:(last To)) 0) (or (is In (last To) (sites Mover ""Promotion"")) (is In (last From) (sites Mover ""Promotion"")))) (moveAgain))))) (piece ""Rook"" (move Slide Orthogonal (to if:(is Enemy (who at:(to))) (apply (if (is Enemy (who at:(to))) (remove (to))))) (then (if (and (= (state at:(last To)) 0) (or (is In (last To) (sites Mover ""Promotion"")) (is In (last From) (sites Mover ""Promotion"")))) (moveAgain))))) (piece ""FerociousLeopard"" (move Step (directions {Backward Forward FL FR BR BL}) (to if:(not (is Friend (who at:(to)))) (apply (remove (to)))) (then (if (and (= (state at:(last To)) 0) (or (is In (last To) (sites Mover ""Promotion"")) (is In (last From) (sites Mover ""Promotion"")))) (moveAgain))))) (piece ""GoldGeneral"" (move Step (directions {Backward Forward FL FR Rightward Leftward}) (to if:(not (is Friend (who at:(to)))) (apply (remove (to)))) (then (if (and (= (state at:(last To)) 0) (or (is In (last To) (sites Mover ""Promotion"")) (is In (last From) (sites Mover ""Promotion"")))) (moveAgain))))) (piece ""FireDemon"" (or (if (not (is Prev Mover)) (move Slide (directions {FL FR BR BL Rightward Leftward}) (to if:(is Enemy (who at:(to))) (apply (if (is Enemy (who at:(to))) (remove (to))))) (then (remove (intersection (sites Around (last To)) (sites Occupied by:Next)))))) (move Step Adjacent (to if:(is Empty (to))) (then (if (!= 0 (count Sites in:(intersection (sites Around (last To)) (sites Occupied by:Next)))) (and (remove (intersection (sites Around (last To)) (sites Occupied by:Next))) (set Value Mover -1)) (if (< (value Player Mover) 1) (and (set Value Mover (+ 1 (value Player Mover))) (moveAgain)) (set Value Mover -1))))))) (piece ""HeavenlyTetrarch"" (or {(move Step N (to if:(not (is Friend (who at:(to)))) (apply (if (is Enemy (who at:(to))) (remove (to))))) (then (step (from (last To)) S (to if:(not (is Friend (who at:(to)))) (apply (if (is Enemy (who at:(to))) (remove (to)))))))) (move Step NE (to if:(not (is Friend (who at:(to)))) (apply (if (is Enemy (who at:(to))) (remove (to))))) (then (step (from (last To)) SW (to if:(not (is Friend (who at:(to)))) (apply (if (is Enemy (who at:(to))) (remove (to)))))))) (move Step E (to if:(not (is Friend (who at:(to)))) (apply (if (is Enemy (who at:(to))) (remove (to))))) (then (step (from (last To)) W (to if:(not (is Friend (who at:(to)))) (apply (if (is Enemy (who at:(to))) (remove (to)))))))) (move Step SE (to if:(not (is Friend (who at:(to)))) (apply (if (is Enemy (who at:(to))) (remove (to))))) (then (step (from (last To)) NW (to if:(not (is Friend (who at:(to)))) (apply (if (is Enemy (who at:(to))) (remove (to)))))))) (move Step S (to if:(not (is Friend (who at:(to)))) (apply (if (is Enemy (who at:(to))) (remove (to))))) (then (step (from (last To)) N (to if:(not (is Friend (who at:(to)))) (apply (if (is Enemy (who at:(to))) (remove (to)))))))) (move Step SW (to if:(not (is Friend (who at:(to)))) (apply (if (is Enemy (who at:(to))) (remove (to))))) (then (step (from (last To)) NE (to if:(not (is Friend (who at:(to)))) (apply (if (is Enemy (who at:(to))) (remove (to)))))))) (move Step W (to if:(not (is Friend (who at:(to)))) (apply (if (is Enemy (who at:(to))) (remove (to))))) (then (step (from (last To)) E (to if:(not (is Friend (who at:(to)))) (apply (if (is Enemy (who at:(to))) (remove (to)))))))) (move Step NW (to if:(not (is Friend (who at:(to)))) (apply (if (is Enemy (who at:(to))) (remove (to))))) (then (step (from (last To)) SE (to if:(not (is Friend (who at:(to)))) (apply (if (is Enemy (who at:(to))) (remove (to)))))))) (move Slide (directions {FR FL BR BL Forward Backward}) (between if:(or (is Empty (between)) (is In (between) (sites Around (from))))) (to if:(and (not (is In (to) (sites Around (from)))) (is Enemy (who at:(to)))) (apply if:(not (is In (to) (sites Around (from)))) (if (is Enemy (who at:(to))) (remove (to)))))) (move Slide (directions {Rightward Leftward}) (between (max 3) if:(or (is Empty (between)) (is In (between) (sites Around (from))))) (to if:(and (not (is In (to) (sites Around (from)))) (is Enemy (who at:(to)))) (apply if:(not (is In (to) (sites Around (from)))) (if (is Enemy (who at:(to))) (remove (to))))))})) (piece ""WaterBuffalo"" (or (move Slide (directions {FR FL BR BL Rightward Leftward}) (to if:(is Enemy (who at:(to))) (apply (if (is Enemy (who at:(to))) (remove (to)))))) (move Slide (directions {Forward Backward}) (between (max 2)) (to if:(is Enemy (who at:(to))) (apply (if (is Enemy (who at:(to))) (remove (to)))))) (then (if (and (= (state at:(last To)) 0) (or (is In (last To) (sites Mover ""Promotion"")) (is In (last From) (sites Mover ""Promotion"")))) (moveAgain))))) (piece ""ChariotSoldier"" (or (move Slide (directions {FR FL BR BL Forward Backward}) (to if:(is Enemy (who at:(to))) (apply (if (is Enemy (who at:(to))) (remove (to)))))) (move Slide (directions {Rightward Leftward}) (between (max 2)) (to if:(is Enemy (who at:(to))) (apply (if (is Enemy (who at:(to))) (remove (to)))))) (then (if (and (= (state at:(last To)) 0) (or (is In (last To) (sites Mover ""Promotion"")) (is In (last From) (sites Mover ""Promotion"")))) (moveAgain))))) (piece ""SideSoldier"" (or {(move Slide (directions {Rightward Leftward}) (to if:(is Enemy (who at:(to))) (apply (if (is Enemy (who at:(to))) (remove (to)))))) (move Slide Forward (between (max 2)) (to if:(is Enemy (who at:(to))) (apply (if (is Enemy (who at:(to))) (remove (to)))))) (move Step Backward (to if:(not (is Friend (who at:(to)))) (apply (remove (to)))))} (then (if (and (= (state at:(last To)) 0) (or (is In (last To) (sites Mover ""Promotion"")) (is In (last From) (sites Mover ""Promotion"")))) (moveAgain))))) (piece ""VerticalSoldier"" (or {(move Slide Forward (to if:(is Enemy (who at:(to))) (apply (if (is Enemy (who at:(to))) (remove (to)))))) (move Slide (directions {Rightward Leftward}) (between (max 2)) (to if:(is Enemy (who at:(to))) (apply (if (is Enemy (who at:(to))) (remove (to)))))) (move Step Backward (to if:(not (is Friend (who at:(to)))) (apply (remove (to)))))} (then (if (and (= (state at:(last To)) 0) (or (is In (last To) (sites Mover ""Promotion"")) (is In (last From) (sites Mover ""Promotion"")))) (moveAgain))))) (piece ""Knight"" (forEach Direction Forward (to if:True (apply (forEach Direction (from (to)) (directions {FR FL}) (if (not (is Friend (who at:(to)))) (move (from) (to (apply (if (is Enemy (who at:(to))) (remove (to)))))))))) (then (if (and (= (state at:(last To)) 0) (or (is In (last To) (sites Mover ""Promotion"")) (is In (last From) (sites Mover ""Promotion"")))) (moveAgain))))) (piece ""IronGeneral"" (move Step (directions {Forward FR FL}) (to if:(not (is Friend (who at:(to)))) (apply (remove (to)))) (then (if (and (= (state at:(last To)) 0) (or (is In (last To) (sites Mover ""Promotion"")) (is In (last From) (sites Mover ""Promotion"")))) (moveAgain))))) (piece ""FreeEagle"" (or {(move Slide Adjacent (to if:(is Enemy (who at:(to))) (apply (if (is Enemy (who at:(to))) (remove (to)))))) (move Step NE (to if:(not (is Friend (who at:(to)))) (apply (if (is Enemy (who at:(to))) (remove (to))))) (then (step (from (last To)) NE (to if:(not (is Friend (who at:(to)))) (apply (if (is Enemy (who at:(to))) (remove (to)))))))) (move Step NE (to if:(not (is Friend (who at:(to)))) (apply (if (is Enemy (who at:(to))) (remove (to))))) (then (step (from (last To)) NW (to if:(not (is Friend (who at:(to)))) (apply (if (is Enemy (who at:(to))) (remove (to)))))))) (move Step NE (to if:(not (is Friend (who at:(to)))) (apply (if (is Enemy (who at:(to))) (remove (to))))) (then (step (from (last To)) SE (to if:(not (is Friend (who at:(to)))) (apply (if (is Enemy (who at:(to))) (remove (to)))))))) (move Step SE (to if:(not (is Friend (who at:(to)))) (apply (if (is Enemy (who at:(to))) (remove (to))))) (then (step (from (last To)) SE (to if:(not (is Friend (who at:(to)))) (apply (if (is Enemy (who at:(to))) (remove (to)))))))) (move Step SE (to if:(not (is Friend (who at:(to)))) (apply (if (is Enemy (who at:(to))) (remove (to))))) (then (step (from (last To)) NE (to if:(not (is Friend (who at:(to)))) (apply (if (is Enemy (who at:(to))) (remove (to)))))))) (move Step SE (to if:(not (is Friend (who at:(to)))) (apply (if (is Enemy (who at:(to))) (remove (to))))) (then (step (from (last To)) SW (to if:(not (is Friend (who at:(to)))) (apply (if (is Enemy (who at:(to))) (remove (to)))))))) (move Step SW (to if:(not (is Friend (who at:(to)))) (apply (if (is Enemy (who at:(to))) (remove (to))))) (then (step (from (last To)) SW (to if:(not (is Friend (who at:(to)))) (apply (if (is Enemy (who at:(to))) (remove (to)))))))) (move Step SW (to if:(not (is Friend (who at:(to)))) (apply (if (is Enemy (who at:(to))) (remove (to))))) (then (step (from (last To)) NW (to if:(not (is Friend (who at:(to)))) (apply (if (is Enemy (who at:(to))) (remove (to)))))))) (move Step SW (to if:(not (is Friend (who at:(to)))) (apply (if (is Enemy (who at:(to))) (remove (to))))) (then (step (from (last To)) SE (to if:(not (is Friend (who at:(to)))) (apply (if (is Enemy (who at:(to))) (remove (to)))))))) (move Step NW (to if:(not (is Friend (who at:(to)))) (apply (if (is Enemy (who at:(to))) (remove (to))))) (then (step (from (last To)) NW (to if:(not (is Friend (who at:(to)))) (apply (if (is Enemy (who at:(to))) (remove (to)))))))) (move Step NW (to if:(not (is Friend (who at:(to)))) (apply (if (is Enemy (who at:(to))) (remove (to))))) (then (step (from (last To)) NE (to if:(not (is Friend (who at:(to)))) (apply (if (is Enemy (who at:(to))) (remove (to)))))))) (move Step NW (to if:(not (is Friend (who at:(to)))) (apply (if (is Enemy (who at:(to))) (remove (to))))) (then (step (from (last To)) SW (to if:(not (is Friend (who at:(to)))) (apply (if (is Enemy (who at:(to))) (remove (to))))))))})) (piece ""LionHawk"" (or {(move Slide Diagonal (to if:(is Enemy (who at:(to))) (apply (if (is Enemy (who at:(to))) (remove (to)))))) (move Step Adjacent (to if:(not (is Friend (who at:(to)))) (apply (if (is Enemy (who at:(to))) (remove (to))))) (then (step (from (last To)) N (to if:(not (is Friend (who at:(to)))) (apply (if (is Enemy (who at:(to))) (remove (to)))))))) (move Step Adjacent (to if:(not (is Friend (who at:(to)))) (apply (if (is Enemy (who at:(to))) (remove (to))))) (then (step (from (last To)) S (to if:(not (is Friend (who at:(to)))) (apply (if (is Enemy (who at:(to))) (remove (to)))))))) (move Step Adjacent (to if:(not (is Friend (who at:(to)))) (apply (if (is Enemy (who at:(to))) (remove (to))))) (then (step (from (last To)) E (to if:(not (is Friend (who at:(to)))) (apply (if (is Enemy (who at:(to))) (remove (to)))))))) (move Step Adjacent (to if:(not (is Friend (who at:(to)))) (apply (if (is Enemy (who at:(to))) (remove (to))))) (then (step (from (last To)) W (to if:(not (is Friend (who at:(to)))) (apply (if (is Enemy (who at:(to))) (remove (to)))))))) (move Step Adjacent (to if:(not (is Friend (who at:(to)))) (apply (if (is Enemy (who at:(to))) (remove (to))))) (then (step (from (last To)) NE (to if:(not (is Friend (who at:(to)))) (apply (if (is Enemy (who at:(to))) (remove (to)))))))) (move Step Adjacent (to if:(not (is Friend (who at:(to)))) (apply (if (is Enemy (who at:(to))) (remove (to))))) (then (step (from (last To)) NW (to if:(not (is Friend (who at:(to)))) (apply (if (is Enemy (who at:(to))) (remove (to)))))))) (move Step Adjacent (to if:(not (is Friend (who at:(to)))) (apply (if (is Enemy (who at:(to))) (remove (to))))) (then (step (from (last To)) SW (to if:(not (is Friend (who at:(to)))) (apply (if (is Enemy (who at:(to))) (remove (to)))))))) (move Step Adjacent (to if:(not (is Friend (who at:(to)))) (apply (if (is Enemy (who at:(to))) (remove (to))))) (then (step (from (last To)) SE (to if:(not (is Friend (who at:(to)))) (apply (if (is Enemy (who at:(to))) (remove (to)))))))) (move Hop Adjacent (between if:True) (to if:(not (is Friend (who at:(to)))) (apply (if (is Enemy (who at:(to))) (remove (to)))))) (move Leap {{F F R F} {F F L F}} (to if:(not (is Friend (who at:(to)))) (apply (if (is Enemy (who at:(to))) (remove (to))))))})) (piece ""Queen"" (move Slide Adjacent (to if:(is Enemy (who at:(to))) (apply (if (is Enemy (who at:(to))) (remove (to))))) (then (if (and (= (state at:(last To)) 0) (or (is In (last To) (sites Mover ""Promotion"")) (is In (last From) (sites Mover ""Promotion"")))) (moveAgain))))) (piece ""Phoenix"" (or (move Step Orthogonal (to if:(not (is Friend (who at:(to)))) (apply (remove (to))))) (move Hop Diagonal (between if:True) (to if:(not (is Friend (who at:(to)))) (apply (if (is Enemy (who at:(to))) (remove (to)))))) (then (if (and (= (state at:(last To)) 0) (or (is In (last To) (sites Mover ""Promotion"")) (is In (last From) (sites Mover ""Promotion"")))) (moveAgain))))) (piece ""Kirin"" (or (move Step Diagonal (to if:(not (is Friend (who at:(to)))) (apply (remove (to))))) (move Hop Orthogonal (between if:True) (to if:(not (is Friend (who at:(to)))) (apply (if (is Enemy (who at:(to))) (remove (to)))))) (then (if (and (= (state at:(last To)) 0) (or (is In (last To) (sites Mover ""Promotion"")) (is In (last From) (sites Mover ""Promotion"")))) (moveAgain))))) (piece ""FreeBoar"" (move Slide (directions {FR FL BR BL Rightward Leftward}) (to if:(is Enemy (who at:(to))) (apply (if (is Enemy (who at:(to))) (remove (to))))))) (piece ""FlyingOx"" (move Slide (directions {FR FL BR BL Forward Backward}) (to if:(is Enemy (who at:(to))) (apply (if (is Enemy (who at:(to))) (remove (to))))))) (piece ""SideMover"" (or (move Step (directions {Forward Backward}) (to if:(not (is Friend (who at:(to)))) (apply (remove (to))))) (move Slide (directions {Rightward Leftward}) (to if:(is Enemy (who at:(to))) (apply (if (is Enemy (who at:(to))) (remove (to)))))) (then (if (and (= (state at:(last To)) 0) (or (is In (last To) (sites Mover ""Promotion"")) (is In (last From) (sites Mover ""Promotion"")))) (moveAgain))))) (piece ""VerticalMover"" (or (move Step (directions {Rightward Leftward}) (to if:(not (is Friend (who at:(to)))) (apply (remove (to))))) (move Slide (directions {Forward Backward}) (to if:(is Enemy (who at:(to))) (apply (if (is Enemy (who at:(to))) (remove (to)))))) (then (if (and (= (state at:(last To)) 0) (or (is In (last To) (sites Mover ""Promotion"")) (is In (last From) (sites Mover ""Promotion"")))) (moveAgain))))) (piece ""CopperGeneral"" (move Step (directions {Forward Backward FR FL}) (to if:(not (is Friend (who at:(to)))) (apply (remove (to)))) (then (if (and (= (state at:(last To)) 0) (or (is In (last To) (sites Mover ""Promotion"")) (is In (last From) (sites Mover ""Promotion"")))) (moveAgain))))) (piece ""SilverGeneral"" (move Step (directions {Forward BR BL FR FL}) (to if:(not (is Friend (who at:(to)))) (apply (remove (to)))) (then (if (and (= (state at:(last To)) 0) (or (is In (last To) (sites Mover ""Promotion"")) (is In (last From) (sites Mover ""Promotion"")))) (moveAgain))))) (piece ""MultiGeneral"" (move Slide (directions {Forward BR BL}) (to if:(is Enemy (who at:(to))) (apply (if (is Enemy (who at:(to))) (remove (to))))))) (piece ""FlyingStag"" (or (move Slide (directions {Forward Backward}) (to if:(is Enemy (who at:(to))) (apply (if (is Enemy (who at:(to))) (remove (to)))))) (move Step (directions {Rightward Leftward BR BL FR FL}) (to if:(not (is Friend (who at:(to)))) (apply (remove (to))))))) (piece ""Dog"" (move Step (directions {BR BL Forward}) (to if:(not (is Friend (who at:(to)))) (apply (remove (to)))) (then (if (and (= (state at:(last To)) 0) (or (is In (last To) (sites Mover ""Promotion"")) (is In (last From) (sites Mover ""Promotion"")))) (moveAgain))))) (piece ""BlindTiger"" (move Step (difference Adjacent (directions {Forward})) (to if:(not (is Friend (who at:(to)))) (apply (remove (to)))) (then (if (and (= (state at:(last To)) 0) (or (is In (last To) (sites Mover ""Promotion"")) (is In (last From) (sites Mover ""Promotion"")))) (moveAgain))))) (piece ""WhiteHorse"" (move Slide (directions {Forward FR FL Backward}) (to if:(is Enemy (who at:(to))) (apply (if (is Enemy (who at:(to))) (remove (to))))))) (piece ""Whale"" (move Slide (directions {Forward BR BL Backward}) (to if:(is Enemy (who at:(to))) (apply (if (is Enemy (who at:(to))) (remove (to))))))) (piece ""Lance"" (move Slide Forward (to if:(is Enemy (who at:(to))) (apply (if (is Enemy (who at:(to))) (remove (to))))) (then (if (and (= (state at:(last To)) 0) (or (is In (last To) (sites Mover ""Promotion"")) (is In (last From) (sites Mover ""Promotion"")))) (moveAgain))))) (piece ""ReverseChariot"" (move Slide (directions {Forward Backward}) (to if:(is Enemy (who at:(to))) (apply (if (is Enemy (who at:(to))) (remove (to))))) (then (if (and (= (state at:(last To)) 0) (or (is In (last To) (sites Mover ""Promotion"")) (is In (last From) (sites Mover ""Promotion"")))) (moveAgain))))) (regions ""Promotion"" P1 (expand (sites Top) steps:4)) (regions ""Promotion"" P2 (expand (sites Bottom) steps:4)) (map ""Promoted"" {(pair (id ""FerociousLeopard"" P1) (id ""Bishop"" P1)) (pair (id ""FerociousLeopard"" P2) (id ""Bishop"" P2)) (pair (id ""Bishop"" P1) (id ""DragonHorse"" P1)) (pair (id ""Bishop"" P2) (id ""DragonHorse"" P2)) (pair (id ""DragonHorse"" P1) (id ""HornedFalcon"" P1)) (pair (id ""DragonHorse"" P2) (id ""HornedFalcon"" P2)) (pair (id ""HornedFalcon"" P1) (id ""BishopGeneral"" P1)) (pair (id ""HornedFalcon"" P2) (id ""BishopGeneral"" P2)) (pair (id ""BishopGeneral"" P1) (id ""ViceGeneral"" P1)) (pair (id ""BishopGeneral"" P2) (id ""ViceGeneral"" P2)) (pair (id ""Knight"" P1) (id ""SideSoldier"" P1)) (pair (id ""Knight"" P2) (id ""SideSoldier"" P2)) (pair (id ""SideSoldier"" P1) (id ""WaterBuffalo"" P1)) (pair (id ""SideSoldier"" P2) (id ""WaterBuffalo"" P2)) (pair (id ""WaterBuffalo"" P1) (id ""FireDemon"" P1)) (pair (id ""WaterBuffalo"" P2) (id ""FireDemon"" P2)) (pair (id ""Phoenix"" P1) (id ""Queen"" P1)) (pair (id ""Phoenix"" P2) (id ""Queen"" P2)) (pair (id ""Queen"" P1) (id ""FreeEagle"" P1)) (pair (id ""Queen"" P2) (id ""FreeEagle"" P2)) (pair (id ""CopperGeneral"" P1) (id ""SideMover"" P1)) (pair (id ""CopperGeneral"" P2) (id ""SideMover"" P2)) (pair (id ""SideMover"" P1) (id ""FreeBoar"" P1)) (pair (id ""SideMover"" P2) (id ""FreeBoar"" P2)) (pair (id ""Dog"" P1) (id ""MultiGeneral"" P1)) (pair (id ""Dog"" P2) (id ""MultiGeneral"" P2)) (pair (id ""Lance"" P1) (id ""WhiteHorse"" P1)) (pair (id ""Lance"" P2) (id ""WhiteHorse"" P2)) (pair (id ""DrunkenElephant"" P1) (id ""Prince"" P1)) (pair (id ""DrunkenElephant"" P2) (id ""Prince"" P2)) (pair (id ""Pawn"" P1) (id ""GoldGeneral"" P1)) (pair (id ""Pawn"" P2) (id ""GoldGeneral"" P2)) (pair (id ""GoldGeneral"" P1) (id ""Rook"" P1)) (pair (id ""GoldGeneral"" P2) (id ""Rook"" P2)) (pair (id ""Rook"" P1) (id ""DragonKing"" P1)) (pair (id ""Rook"" P2) (id ""DragonKing"" P2)) (pair (id ""DragonKing"" P1) (id ""SoaringEagle"" P1)) (pair (id ""DragonKing"" P2) (id ""SoaringEagle"" P2)) (pair (id ""SoaringEagle"" P1) (id ""RookGeneral"" P1)) (pair (id ""SoaringEagle"" P2) (id ""RookGeneral"" P2)) (pair (id ""RookGeneral"" P1) (id ""GreatGeneral"" P1)) (pair (id ""RookGeneral"" P2) (id ""GreatGeneral"" P2)) (pair (id ""IronGeneral"" P1) (id ""VerticalSoldier"" P1)) (pair (id ""IronGeneral"" P2) (id ""VerticalSoldier"" P2)) (pair (id ""VerticalSoldier"" P1) (id ""ChariotSoldier"" P1)) (pair (id ""VerticalSoldier"" P2) (id ""ChariotSoldier"" P2)) (pair (id ""ChariotSoldier"" P1) (id ""HeavenlyTetrarch"" P1)) (pair (id ""ChariotSoldier"" P2) (id ""HeavenlyTetrarch"" P2)) (pair (id ""Kirin"" P1) (id ""Lion"" P1)) (pair (id ""Kirin"" P2) (id ""Lion"" P2)) (pair (id ""Lion"" P1) (id ""LionHawk"" P1)) (pair (id ""Lion"" P2) (id ""LionHawk"" P2)) (pair (id ""SilverGeneral"" P1) (id ""VerticalMover"" P1)) (pair (id ""SilverGeneral"" P2) (id ""VerticalMover"" P2)) (pair (id ""VerticalMover"" P1) (id ""FlyingOx"" P1)) (pair (id ""VerticalMover"" P2) (id ""FlyingOx"" P2)) (pair (id ""BlindTiger"" P1) (id ""FlyingStag"" P1)) (pair (id ""BlindTiger"" P2) (id ""FlyingStag"" P2)) (pair (id ""ReverseChariot"" P1) (id ""Whale"" P1)) (pair (id ""ReverseChariot"" P2) (id ""Whale"" P2))})}) (rules (start {(place ""Lance1"" (sites {""A1"" ""P1""})) (place ""Lance2"" (sites {""A16"" ""P16""})) (place ""Knight1"" (sites {""B1"" ""O1""})) (place ""Knight2"" (sites {""B16"" ""O16""})) (place ""FerociousLeopard1"" (sites {""C1"" ""N1""})) (place ""FerociousLeopard2"" (sites {""C16"" ""N16""})) (place ""IronGeneral1"" (sites {""D1"" ""M1""})) (place ""IronGeneral2"" (sites {""D16"" ""M16""})) (place ""CopperGeneral1"" (sites {""E1"" ""L1""})) (place ""CopperGeneral2"" (sites {""E16"" ""L16""})) (place ""SilverGeneral1"" (sites {""F1"" ""K1""})) (place ""SilverGeneral2"" (sites {""F16"" ""K16""})) (place ""GoldGeneral1"" (sites {""G1"" ""J1""})) (place ""GoldGeneral2"" (sites {""G16"" ""J16""})) (place ""King1"" (sites {""H1""})) (place ""King2"" (sites {""I16""})) (place ""DrunkenElephant1"" (sites {""I1""})) (place ""DrunkenElephant2"" (sites {""H16""})) (place ""ReverseChariot1"" (sites {""A2"" ""P2""})) (place ""ReverseChariot2"" (sites {""A15"" ""P15""})) (place ""ChariotSoldier1"" (sites {""C2"" ""N2"" ""D2"" ""M2""})) (place ""ChariotSoldier2"" (sites {""C15"" ""N15"" ""D15"" ""M15""})) (place ""BlindTiger1"" (sites {""F2"" ""K2""})) (place ""BlindTiger2"" (sites {""F15"" ""K15""})) (place ""Kirin1"" (sites {""G2""})) (place ""Kirin2"" (sites {""J15""})) (place ""Lion1"" (sites {""H2""})) (place ""Lion2"" (sites {""I15""})) (place ""Queen1"" (sites {""I2""})) (place ""Queen2"" (sites {""H15""})) (place ""Phoenix1"" (sites {""J2""})) (place ""Phoenix2"" (sites {""G15""})) (place ""SideSoldier1"" (sites {""A3"" ""P3""})) (place ""SideSoldier2"" (sites {""A14"" ""P14""})) (place ""VerticalSoldier1"" (sites {""B3"" ""O3""})) (place ""VerticalSoldier2"" (sites {""B14"" ""O14""})) (place ""Bishop1"" (sites {""C3"" ""N3""})) (place ""Bishop2"" (sites {""C14"" ""N14""})) (place ""DragonHorse1"" (sites {""D3"" ""M3""})) (place ""DragonHorse2"" (sites {""D14"" ""M14""})) (place ""DragonKing1"" (sites {""E3"" ""L3""})) (place ""DragonKing2"" (sites {""E14"" ""L14""})) (place ""WaterBuffalo1"" (sites {""F3"" ""K3""})) (place ""WaterBuffalo2"" (sites {""F14"" ""K14""})) (place ""FireDemon1"" (sites {""G3"" ""J3""})) (place ""FireDemon2"" (sites {""G14"" ""J14""})) (place ""LionHawk1"" (sites {""H3""})) (place ""LionHawk2"" (sites {""I14""})) (place ""FreeEagle1"" (sites {""I3""})) (place ""FreeEagle2"" (sites {""H14""})) (place ""SideMover1"" (sites {""A4"" ""P4""})) (place ""SideMover2"" (sites {""A13"" ""P13""})) (place ""VerticalMover1"" (sites {""B4"" ""O4""})) (place ""VerticalMover2"" (sites {""B13"" ""O13""})) (place ""Rook1"" (sites {""C4"" ""N4""})) (place ""Rook2"" (sites {""C13"" ""N13""})) (place ""HornedFalcon1"" (sites {""D4"" ""M4""})) (place ""HornedFalcon2"" (sites {""D13"" ""M13""})) (place ""SoaringEagle1"" (sites {""E4"" ""L4""})) (place ""SoaringEagle2"" (sites {""E13"" ""L13""})) (place ""BishopGeneral1"" (sites {""F4"" ""K4""})) (place ""BishopGeneral2"" (sites {""F13"" ""K13""})) (place ""RookGeneral1"" (sites {""G4"" ""J4""})) (place ""RookGeneral2"" (sites {""G13"" ""J13""})) (place ""GreatGeneral1"" (sites {""H4""})) (place ""GreatGeneral2"" (sites {""I13""})) (place ""ViceGeneral1"" (sites {""I4""})) (place ""ViceGeneral2"" (sites {""H13""})) (place ""Pawn1"" (sites Row 4)) (place ""Pawn2"" (sites Row 11)) (place ""Dog1"" (sites {""E6"" ""L6""})) (place ""Dog2"" (sites {""E11"" ""L11""}))}) (play (if (is Prev Mover) (or (if (= (what at:(last To)) (id ""ViceGeneral"" Mover)) (forEach Piece ""ViceGeneral"") (if (= (what at:(last To)) (id ""FireDemon"" Mover)) (forEach Piece ""FireDemon"") (move Promote (last To) (piece (mapEntry ""Promoted"" (what at:(last To)))) (then (set State at:(last To) 1))))) (move Pass (then (set Value Mover -1)))) (forEach Piece) (then (if (!= 0 (count Sites in:(intersection (sites Around (last To)) (sites Occupied by:Next component:""FireDemon"")))) (and (remove (last To)) (set Value Mover -1)))))) (end (if (and {(not (is Mover Next)) (= (where ""King"" Next) -1) (= (where ""Prince"" Next) -1)}) (result Mover Win)))))" "9x9 board. Played with the full complement of Shogi pieces, placed in the first and second rows. All pieces move only one space orthogonally forward or laterally. Pieces capture by hopping over an opponent's piece. The player to capture all of the opponent's pieces wins.","(game ""Tobi Shogi"" (players {(player N) (player S)}) (equipment {(board (square 9)) (piece ""Osho"" Each (or (move Step (directions {Forward Rightward Leftward}) (to if:(is Empty (to)))) (move Hop (directions {Forward Rightward Leftward}) (between if:(is Enemy (who at:(between))) (apply (remove (between)))) (to if:(is Empty (to)))))) (piece ""Kinsho"" Each (or (move Step (directions {Forward Rightward Leftward}) (to if:(is Empty (to)))) (move Hop (directions {Forward Rightward Leftward}) (between if:(is Enemy (who at:(between))) (apply (remove (between)))) (to if:(is Empty (to)))))) (piece ""Ginsho"" Each (or (move Step (directions {Forward Rightward Leftward}) (to if:(is Empty (to)))) (move Hop (directions {Forward Rightward Leftward}) (between if:(is Enemy (who at:(between))) (apply (remove (between)))) (to if:(is Empty (to)))))) (piece ""Keima"" Each (or (move Step (directions {Forward Rightward Leftward}) (to if:(is Empty (to)))) (move Hop (directions {Forward Rightward Leftward}) (between if:(is Enemy (who at:(between))) (apply (remove (between)))) (to if:(is Empty (to)))))) (piece ""Kyosha"" Each (or (move Step (directions {Forward Rightward Leftward}) (to if:(is Empty (to)))) (move Hop (directions {Forward Rightward Leftward}) (between if:(is Enemy (who at:(between))) (apply (remove (between)))) (to if:(is Empty (to)))))) (piece ""Fuhyo"" Each (or (move Step (directions {Forward Rightward Leftward}) (to if:(is Empty (to)))) (move Hop (directions {Forward Rightward Leftward}) (between if:(is Enemy (who at:(between))) (apply (remove (between)))) (to if:(is Empty (to))))))}) (rules (start {(place ""Osho1"" coord:""E1"") (place ""Kinsho1"" {""D1"" ""F1""}) (place ""Ginsho1"" {""C1"" ""G1""}) (place ""Keima1"" {""B1"" ""H1""}) (place ""Kyosha1"" {""A1"" ""I1""}) (place ""Fuhyo1"" (sites Row 1)) (place ""Osho2"" coord:""E9"") (place ""Kinsho2"" {""D9"" ""F9""}) (place ""Ginsho2"" {""C9"" ""G9""}) (place ""Keima2"" {""B9"" ""H9""}) (place ""Kyosha2"" {""A9"" ""I9""}) (place ""Fuhyo2"" (sites Row 7))}) (play (forEach Piece)) (end (if (no Pieces Next) (result Next Loss)))))","###Description 9x9 board. Played with the full complement of Shogi pieces, placed in the first and second rows. All pieces move only one space orthogonally forward or laterally. Pieces capture by hopping over an opponent's piece. The player to capture all of the opponent's pieces wins. ###Ludii (game ""Tobi Shogi"" (players {(player N) (player S)}) (equipment {(board (square 9)) (piece ""Osho"" Each (or (move Step (directions {Forward Rightward Leftward}) (to if:(is Empty (to)))) (move Hop (directions {Forward Rightward Leftward}) (between if:(is Enemy (who at:(between))) (apply (remove (between)))) (to if:(is Empty (to)))))) (piece ""Kinsho"" Each (or (move Step (directions {Forward Rightward Leftward}) (to if:(is Empty (to)))) (move Hop (directions {Forward Rightward Leftward}) (between if:(is Enemy (who at:(between))) (apply (remove (between)))) (to if:(is Empty (to)))))) (piece ""Ginsho"" Each (or (move Step (directions {Forward Rightward Leftward}) (to if:(is Empty (to)))) (move Hop (directions {Forward Rightward Leftward}) (between if:(is Enemy (who at:(between))) (apply (remove (between)))) (to if:(is Empty (to)))))) (piece ""Keima"" Each (or (move Step (directions {Forward Rightward Leftward}) (to if:(is Empty (to)))) (move Hop (directions {Forward Rightward Leftward}) (between if:(is Enemy (who at:(between))) (apply (remove (between)))) (to if:(is Empty (to)))))) (piece ""Kyosha"" Each (or (move Step (directions {Forward Rightward Leftward}) (to if:(is Empty (to)))) (move Hop (directions {Forward Rightward Leftward}) (between if:(is Enemy (who at:(between))) (apply (remove (between)))) (to if:(is Empty (to)))))) (piece ""Fuhyo"" Each (or (move Step (directions {Forward Rightward Leftward}) (to if:(is Empty (to)))) (move Hop (directions {Forward Rightward Leftward}) (between if:(is Enemy (who at:(between))) (apply (remove (between)))) (to if:(is Empty (to))))))}) (rules (start {(place ""Osho1"" coord:""E1"") (place ""Kinsho1"" {""D1"" ""F1""}) (place ""Ginsho1"" {""C1"" ""G1""}) (place ""Keima1"" {""B1"" ""H1""}) (place ""Kyosha1"" {""A1"" ""I1""}) (place ""Fuhyo1"" (sites Row 1)) (place ""Osho2"" coord:""E9"") (place ""Kinsho2"" {""D9"" ""F9""}) (place ""Ginsho2"" {""C9"" ""G9""}) (place ""Keima2"" {""B9"" ""H9""}) (place ""Kyosha2"" {""A9"" ""I9""}) (place ""Fuhyo2"" (sites Row 7))}) (play (forEach Piece)) (end (if (no Pieces Next) (result Next Loss)))))" -"Same as standard Shogi except: 1. The board is initially empty and each player has the normal complement of 20 pieces in reserve. 2. During a turn, a player must do one of three things: --- place a piece from the reserve on an empty square on the board --- move a previously placed piece to an empty square --- move a piece to a square occupied by an opposing piece, capturing it. 3. A player may not make a capture until her/his own king is on the board. Your pieces have no real power of check on the opposing king until your own king is placed. Your opponent can legally place his or her king right next to your promoted Rook if your king is still in hand. There is no additional rule governing when you must enter your king. If a piece is checking the opposing king, but the friendly king has not been placed, that is called quasi-check. A player is under no compulsion to move out of quasi-check.","(game ""Unashogi"" (players {(player N) (player S)}) (equipment {(board (square 9)) (piece ""Osho"" Each (move Step (to if:(and (not (is Friend (who at:(to)))) (or (not (is Enemy (who at:(to)))) (= (count Pieces Mover ""Osho"" in:(sites Board)) 1))) (apply (if (is Enemy (who at:(to))) (add (piece (mapEntry ""Captured"" (what at:(to)))) (to (mapEntry ""Where"" (what at:(to)))))))))) (piece ""Fuhyo"" Each (move Step Forward (to if:(and (not (is Friend (who at:(to)))) (or (not (is Enemy (who at:(to)))) (= (count Pieces Mover ""Osho"" in:(sites Board)) 1))) (apply (if (is Enemy (who at:(to))) (add (piece (mapEntry ""Captured"" (what at:(to)))) (to (mapEntry ""Where"" (what at:(to)))))))) (then (if (is In (last To) (sites Mover ""Promotion"")) (if (is In (last To) (sites Mover ""LastRank"")) (move Promote (last To) (piece (mapEntry ""Promoted"" (what at:(last To))))) (moveAgain)))))) (piece ""Ginsho"" Each (move Step (directions {Forward BL BR FL FR}) (to if:(and (not (is Friend (who at:(to)))) (or (not (is Enemy (who at:(to)))) (= (count Pieces Mover ""Osho"" in:(sites Board)) 1))) (apply (if (is Enemy (who at:(to))) (add (piece (mapEntry ""Captured"" (what at:(to)))) (to (mapEntry ""Where"" (what at:(to)))))))) (then (if (or (is In (last To) (sites Mover ""Promotion"")) (is In (last From) (sites Mover ""Promotion""))) (moveAgain))))) (piece ""Hisha"" Each (move Slide Orthogonal (to if:(and (is Enemy (who at:(to))) (= (count Pieces Mover ""Osho"" in:(sites Board)) 1)) (apply (if (is Enemy (who at:(to))) (add (piece (mapEntry ""Captured"" (what at:(to)))) (to (mapEntry ""Where"" (what at:(to)))))))) (then (if (or (is In (last To) (sites Mover ""Promotion"")) (is In (last From) (sites Mover ""Promotion""))) (moveAgain))))) (piece ""Kakugyo"" Each (move Slide Diagonal (to if:(and (is Enemy (who at:(to))) (= (count Pieces Mover ""Osho"" in:(sites Board)) 1)) (apply (if (is Enemy (who at:(to))) (add (piece (mapEntry ""Captured"" (what at:(to)))) (to (mapEntry ""Where"" (what at:(to)))))))) (then (if (or (is In (last To) (sites Mover ""Promotion"")) (is In (last From) (sites Mover ""Promotion""))) (moveAgain))))) (piece ""Keima"" Each (forEach Direction Forward (to if:True (apply (forEach Direction (from (to)) (directions {FR FL}) (if (not (is Friend (who at:(to)))) (move (from) (to (apply if:(is Enemy (who at:(to))) (add (piece (mapEntry ""Captured"" (what at:(to)))) (to (mapEntry ""Where"" (what at:(to)))))))))))) (then (if (is In (last To) (sites Mover ""Promotion"")) (if (is In (last To) (sites Mover ""TwoFurthestRank"")) (move Promote (last To) (piece (mapEntry ""Promoted"" (what at:(last To))))) (moveAgain)))))) (piece ""Kyosha"" Each (move Slide Forward (to if:(and (is Enemy (who at:(to))) (= (count Pieces Mover ""Osho"" in:(sites Board)) 1)) (apply (if (is Enemy (who at:(to))) (add (piece (mapEntry ""Captured"" (what at:(to)))) (to (mapEntry ""Where"" (what at:(to)))))))) (then (if (is In (last To) (sites Mover ""Promotion"")) (if (is In (last To) (sites Mover ""LastRank"")) (move Promote (last To) (piece (mapEntry ""Promoted"" (what at:(last To))))) (moveAgain)))))) (piece ""Kinsho"" Each (move Step (directions {Forward Backward Rightward Leftward FL FR}) (to if:(not (is Friend (who at:(to)))) (apply (if (is Enemy (who at:(to))) (add (piece (mapEntry ""Captured"" (what at:(to)))) (to (mapEntry ""Where"" (what at:(to)))))))))) (piece ""Tokin"" Each (move Step (directions {Forward Backward Rightward Leftward FL FR}) (to if:(not (is Friend (who at:(to)))) (apply (if (is Enemy (who at:(to))) (add (piece (mapEntry ""Captured"" (what at:(to)))) (to (mapEntry ""Where"" (what at:(to)))))))))) (piece ""Narigin"" Each (move Step (directions {Forward Backward Rightward Leftward FL FR}) (to if:(not (is Friend (who at:(to)))) (apply (if (is Enemy (who at:(to))) (add (piece (mapEntry ""Captured"" (what at:(to)))) (to (mapEntry ""Where"" (what at:(to)))))))))) (piece ""Ryuo"" Each (or (move Slide Orthogonal (to if:(and (is Enemy (who at:(to))) (= (count Pieces Mover ""Osho"" in:(sites Board)) 1)) (apply (if (is Enemy (who at:(to))) (add (piece (mapEntry ""Captured"" (what at:(to)))) (to (mapEntry ""Where"" (what at:(to))))))))) (move Step Diagonal (to if:(and (not (is Friend (who at:(to)))) (or (not (is Enemy (who at:(to)))) (= (count Pieces Mover ""Osho"" in:(sites Board)) 1))) (apply (if (is Enemy (who at:(to))) (add (piece (mapEntry ""Captured"" (what at:(to)))) (to (mapEntry ""Where"" (what at:(to))))))))))) (piece ""Ryuma"" Each (or (move Slide Diagonal (to if:(and (is Enemy (who at:(to))) (= (count Pieces Mover ""Osho"" in:(sites Board)) 1)) (apply (if (is Enemy (who at:(to))) (add (piece (mapEntry ""Captured"" (what at:(to)))) (to (mapEntry ""Where"" (what at:(to))))))))) (move Step Orthogonal (to if:(and (not (is Friend (who at:(to)))) (or (not (is Enemy (who at:(to)))) (= (count Pieces Mover ""Osho"" in:(sites Board)) 1))) (apply (if (is Enemy (who at:(to))) (add (piece (mapEntry ""Captured"" (what at:(to)))) (to (mapEntry ""Where"" (what at:(to))))))))))) (piece ""Narikei"" Each (move Step (directions {Forward Backward Rightward Leftward FL FR}) (to if:(not (is Friend (who at:(to)))) (apply (if (is Enemy (who at:(to))) (add (piece (mapEntry ""Captured"" (what at:(to)))) (to (mapEntry ""Where"" (what at:(to)))))))))) (piece ""Narikyo"" Each (move Step (directions {Forward Backward Rightward Leftward FL FR}) (to if:(not (is Friend (who at:(to)))) (apply (if (is Enemy (who at:(to))) (add (piece (mapEntry ""Captured"" (what at:(to)))) (to (mapEntry ""Where"" (what at:(to)))))))))) (regions ""LastRankP1"" P1 (sites Top)) (regions ""LastRankP2"" P2 (sites Bottom)) (regions ""TwoFurthestRankP1"" P1 (expand (sites Top))) (regions ""TwoFurthestRankP2"" P2 (expand (sites Bottom))) (regions ""Promotion"" P1 (expand (sites Top) steps:2)) (regions ""Promotion"" P2 (expand (sites Bottom) steps:2)) (map ""Where"" {(pair (id ""Fuhyo"" P1) (handSite P2)) (pair (id ""Fuhyo"" P2) (handSite P1)) (pair (id ""Ginsho"" P1) (handSite P2 1)) (pair (id ""Ginsho"" P2) (handSite P1 1)) (pair (id ""Hisha"" P1) (handSite P2 2)) (pair (id ""Hisha"" P2) (handSite P1 2)) (pair (id ""Kakugyo"" P1) (handSite P2 3)) (pair (id ""Kakugyo"" P2) (handSite P1 3)) (pair (id ""Keima"" P1) (handSite P2 4)) (pair (id ""Keima"" P2) (handSite P1 4)) (pair (id ""Kyosha"" P1) (handSite P2 5)) (pair (id ""Kyosha"" P2) (handSite P1 5)) (pair (id ""Kinsho"" P1) (handSite P2 6)) (pair (id ""Kinsho"" P2) (handSite P1 6)) (pair (id ""Tokin"" P1) (handSite P2)) (pair (id ""Tokin"" P2) (handSite P1)) (pair (id ""Narigin"" P1) (handSite P2 1)) (pair (id ""Narigin"" P2) (handSite P1 1)) (pair (id ""Ryuo"" P1) (handSite P2 2)) (pair (id ""Ryuo"" P2) (handSite P1 2)) (pair (id ""Ryuma"" P1) (handSite P2 3)) (pair (id ""Ryuma"" P2) (handSite P1 3)) (pair (id ""Narikei"" P1) (handSite P2 4)) (pair (id ""Narikei"" P2) (handSite P1 4)) (pair (id ""Narikyo"" P1) (handSite P2 5)) (pair (id ""Narikyo"" P2) (handSite P1 5))}) (map ""Captured"" {(pair (id ""Fuhyo"" P1) (id ""Fuhyo"" P2)) (pair (id ""Fuhyo"" P2) (id ""Fuhyo"" P1)) (pair (id ""Ginsho"" P1) (id ""Ginsho"" P2)) (pair (id ""Ginsho"" P2) (id ""Ginsho"" P1)) (pair (id ""Hisha"" P1) (id ""Hisha"" P2)) (pair (id ""Hisha"" P2) (id ""Hisha"" P1)) (pair (id ""Kakugyo"" P1) (id ""Kakugyo"" P2)) (pair (id ""Kakugyo"" P2) (id ""Kakugyo"" P1)) (pair (id ""Keima"" P1) (id ""Keima"" P2)) (pair (id ""Keima"" P2) (id ""Keima"" P1)) (pair (id ""Kyosha"" P1) (id ""Kyosha"" P2)) (pair (id ""Kyosha"" P2) (id ""Kyosha"" P1)) (pair (id ""Kinsho"" P1) (id ""Kinsho"" P2)) (pair (id ""Kinsho"" P2) (id ""Kinsho"" P1)) (pair (id ""Tokin"" P1) (id ""Fuhyo"" P2)) (pair (id ""Tokin"" P2) (id ""Fuhyo"" P1)) (pair (id ""Narigin"" P1) (id ""Ginsho"" P2)) (pair (id ""Narigin"" P2) (id ""Ginsho"" P1)) (pair (id ""Ryuo"" P1) (id ""Hisha"" P2)) (pair (id ""Ryuo"" P2) (id ""Hisha"" P1)) (pair (id ""Ryuma"" P1) (id ""Kakugyo"" P2)) (pair (id ""Ryuma"" P2) (id ""Kakugyo"" P1)) (pair (id ""Narikei"" P1) (id ""Keima"" P2)) (pair (id ""Narikei"" P2) (id ""Keima"" P1)) (pair (id ""Narikyo"" P1) (id ""Kyosha"" P2)) (pair (id ""Narikyo"" P2) (id ""Kyosha"" P1))}) (map ""Promoted"" {(pair (id ""Fuhyo"" P1) (id ""Tokin"" P1)) (pair (id ""Fuhyo"" P2) (id ""Tokin"" P2)) (pair (id ""Ginsho"" P1) (id ""Narigin"" P1)) (pair (id ""Ginsho"" P2) (id ""Narigin"" P2)) (pair (id ""Hisha"" P1) (id ""Ryuo"" P1)) (pair (id ""Hisha"" P2) (id ""Ryuo"" P2)) (pair (id ""Kakugyo"" P1) (id ""Ryuma"" P1)) (pair (id ""Kakugyo"" P2) (id ""Ryuma"" P2)) (pair (id ""Keima"" P1) (id ""Narikei"" P1)) (pair (id ""Keima"" P2) (id ""Narikei"" P2)) (pair (id ""Kyosha"" P1) (id ""Narikyo"" P1)) (pair (id ""Kyosha"" P2) (id ""Narikyo"" P2))}) (hand Each size:8)}) (rules (start {(place ""Osho1"" (handSite P1 7)) (place ""Kinsho1"" (handSite P1 6) count:2) (place ""Ginsho1"" (handSite P1 1) count:2) (place ""Keima1"" (handSite P1 4) count:2) (place ""Kyosha1"" (handSite P1 5) count:2) (place ""Kakugyo1"" (handSite P1 3)) (place ""Hisha1"" (handSite P1 2)) (place ""Fuhyo1"" (handSite P1) count:9) (place ""Osho2"" (handSite P2 7)) (place ""Kinsho2"" (handSite P2 6) count:2) (place ""Ginsho2"" (handSite P2 1) count:2) (place ""Keima2"" (handSite P2 4) count:2) (place ""Kyosha2"" (handSite P2 5) count:2) (place ""Kakugyo2"" (handSite P2 3)) (place ""Hisha2"" (handSite P2 2)) (place ""Fuhyo2"" (handSite P2) count:9)}) (play (if (is Prev Mover) (or (move Promote (last To) (piece (mapEntry ""Promoted"" (what at:(last To))))) (move Pass)) (do (or {(move (from (sites Occupied by:Mover container:""Hand"" components:{""Kakugyo"" ""Ginsho"" ""Hisha"" ""Kinsho"" ""Osho""})) (to (sites Empty))) (do (move (from (sites Occupied by:Mover container:""Hand"" component:""Fuhyo"")) (to (difference (sites Empty) (sites Mover ""LastRank"")) if:(= (count Sites in:(sites Occupied by:Mover container:""Board"" component:""Fuhyo"")) (count Sites in:(difference (sites Occupied by:Mover container:""Board"" component:""Fuhyo"") (sites Column (column of:(to)))))))) ifAfterwards:(or (not (and (is Threatened (id ""Osho"" Next)) (not (can Move (do (or {(move (from (sites Occupied by:Next container:""Hand"" components:{""Kakugyo"" ""Ginsho"" ""Hisha"" ""Kinsho""})) (to (sites Empty))) (do (move (from (sites Occupied by:Next container:""Hand"" component:""Fuhyo"")) (to (difference (sites Empty) (sites Next ""LastRank"")) if:(= (count Sites in:(sites Occupied by:Next container:""Board"" component:""Fuhyo"")) (count Sites in:(difference (sites Occupied by:Next container:""Board"" component:""Fuhyo"") (sites Column (column of:(to)))))))) ifAfterwards:(or (not (is Threatened (id ""Osho"" Mover))) (no Pieces Next ""Osho"" in:(sites Board)))) (move (from (sites Occupied by:Next container:""Hand"" component:""Kyosha"")) (to (difference (sites Empty) (sites Next ""LastRank"")))) (move (from (sites Occupied by:Next container:""Hand"" component:""Keima"")) (to (difference (sites Empty) (sites Next ""TwoFurthestRank"")))) (forEach Piece Next)}) ifAfterwards:(or (not (is Threatened (id ""Osho"" Mover))) (no Pieces Next ""Osho"" in:(sites Board)))))))) (no Pieces Mover ""Osho"" in:(sites Board)))) (move (from (sites Occupied by:Mover container:""Hand"" component:""Kyosha"")) (to (difference (sites Empty) (sites Mover ""LastRank"")))) (move (from (sites Occupied by:Mover container:""Hand"" component:""Keima"")) (to (difference (sites Empty) (sites Mover ""TwoFurthestRank"")))) (forEach Piece)}) ifAfterwards:(or (not (is Threatened (id ""Osho"" Mover))) (no Pieces Next ""Osho"" in:(sites Board)))))) (end {(if (and {(is Threatened (id ""Osho"" Next)) (not (can Move (do (or {(move (from (sites Occupied by:Next container:""Hand"" components:{""Kakugyo"" ""Ginsho"" ""Hisha"" ""Kinsho""})) (to (sites Empty))) (do (move (from (sites Occupied by:Next container:""Hand"" component:""Fuhyo"")) (to (difference (sites Empty) (sites Next ""LastRank"")) if:(= (count Sites in:(sites Occupied by:Next container:""Board"" component:""Fuhyo"")) (count Sites in:(difference (sites Occupied by:Next container:""Board"" component:""Fuhyo"") (sites Column (column of:(to)))))))) ifAfterwards:(or (not (is Threatened (id ""Osho"" Mover))) (no Pieces Next ""Osho"" in:(sites Board)))) (move (from (sites Occupied by:Next container:""Hand"" component:""Kyosha"")) (to (difference (sites Empty) (sites Next ""LastRank"")))) (move (from (sites Occupied by:Next container:""Hand"" component:""Keima"")) (to (difference (sites Empty) (sites Next ""TwoFurthestRank"")))) (forEach Piece Next)}) ifAfterwards:(or (not (is Threatened (id ""Osho"" Mover))) (no Pieces Next ""Osho"" in:(sites Board)))))) (= (count Pieces Mover ""Osho"" in:(sites Board)) 1)}) (result Mover Win)) (if (no Moves Next) (result Mover Win))})))","###Description -Same as standard Shogi except: 1. The board is initially empty and each player has the normal complement of 20 pieces in reserve. 2. During a turn, a player must do one of three things: --- place a piece from the reserve on an empty square on the board --- move a previously placed piece to an empty square --- move a piece to a square occupied by an opposing piece, capturing it. 3. A player may not make a capture until her/his own king is on the board. Your pieces have no real power of check on the opposing king until your own king is placed. Your opponent can legally place his or her king right next to your promoted Rook if your king is still in hand. There is no additional rule governing when you must enter your king. If a piece is checking the opposing king, but the friendly king has not been placed, that is called quasi-check. A player is under no compulsion to move out of quasi-check. - -###Ludii -(game ""Unashogi"" (players {(player N) (player S)}) (equipment {(board (square 9)) (piece ""Osho"" Each (move Step (to if:(and (not (is Friend (who at:(to)))) (or (not (is Enemy (who at:(to)))) (= (count Pieces Mover ""Osho"" in:(sites Board)) 1))) (apply (if (is Enemy (who at:(to))) (add (piece (mapEntry ""Captured"" (what at:(to)))) (to (mapEntry ""Where"" (what at:(to)))))))))) (piece ""Fuhyo"" Each (move Step Forward (to if:(and (not (is Friend (who at:(to)))) (or (not (is Enemy (who at:(to)))) (= (count Pieces Mover ""Osho"" in:(sites Board)) 1))) (apply (if (is Enemy (who at:(to))) (add (piece (mapEntry ""Captured"" (what at:(to)))) (to (mapEntry ""Where"" (what at:(to)))))))) (then (if (is In (last To) (sites Mover ""Promotion"")) (if (is In (last To) (sites Mover ""LastRank"")) (move Promote (last To) (piece (mapEntry ""Promoted"" (what at:(last To))))) (moveAgain)))))) (piece ""Ginsho"" Each (move Step (directions {Forward BL BR FL FR}) (to if:(and (not (is Friend (who at:(to)))) (or (not (is Enemy (who at:(to)))) (= (count Pieces Mover ""Osho"" in:(sites Board)) 1))) (apply (if (is Enemy (who at:(to))) (add (piece (mapEntry ""Captured"" (what at:(to)))) (to (mapEntry ""Where"" (what at:(to)))))))) (then (if (or (is In (last To) (sites Mover ""Promotion"")) (is In (last From) (sites Mover ""Promotion""))) (moveAgain))))) (piece ""Hisha"" Each (move Slide Orthogonal (to if:(and (is Enemy (who at:(to))) (= (count Pieces Mover ""Osho"" in:(sites Board)) 1)) (apply (if (is Enemy (who at:(to))) (add (piece (mapEntry ""Captured"" (what at:(to)))) (to (mapEntry ""Where"" (what at:(to)))))))) (then (if (or (is In (last To) (sites Mover ""Promotion"")) (is In (last From) (sites Mover ""Promotion""))) (moveAgain))))) (piece ""Kakugyo"" Each (move Slide Diagonal (to if:(and (is Enemy (who at:(to))) (= (count Pieces Mover ""Osho"" in:(sites Board)) 1)) (apply (if (is Enemy (who at:(to))) (add (piece (mapEntry ""Captured"" (what at:(to)))) (to (mapEntry ""Where"" (what at:(to)))))))) (then (if (or (is In (last To) (sites Mover ""Promotion"")) (is In (last From) (sites Mover ""Promotion""))) (moveAgain))))) (piece ""Keima"" Each (forEach Direction Forward (to if:True (apply (forEach Direction (from (to)) (directions {FR FL}) (if (not (is Friend (who at:(to)))) (move (from) (to (apply if:(is Enemy (who at:(to))) (add (piece (mapEntry ""Captured"" (what at:(to)))) (to (mapEntry ""Where"" (what at:(to)))))))))))) (then (if (is In (last To) (sites Mover ""Promotion"")) (if (is In (last To) (sites Mover ""TwoFurthestRank"")) (move Promote (last To) (piece (mapEntry ""Promoted"" (what at:(last To))))) (moveAgain)))))) (piece ""Kyosha"" Each (move Slide Forward (to if:(and (is Enemy (who at:(to))) (= (count Pieces Mover ""Osho"" in:(sites Board)) 1)) (apply (if (is Enemy (who at:(to))) (add (piece (mapEntry ""Captured"" (what at:(to)))) (to (mapEntry ""Where"" (what at:(to)))))))) (then (if (is In (last To) (sites Mover ""Promotion"")) (if (is In (last To) (sites Mover ""LastRank"")) (move Promote (last To) (piece (mapEntry ""Promoted"" (what at:(last To))))) (moveAgain)))))) (piece ""Kinsho"" Each (move Step (directions {Forward Backward Rightward Leftward FL FR}) (to if:(not (is Friend (who at:(to)))) (apply (if (is Enemy (who at:(to))) (add (piece (mapEntry ""Captured"" (what at:(to)))) (to (mapEntry ""Where"" (what at:(to)))))))))) (piece ""Tokin"" Each (move Step (directions {Forward Backward Rightward Leftward FL FR}) (to if:(not (is Friend (who at:(to)))) (apply (if (is Enemy (who at:(to))) (add (piece (mapEntry ""Captured"" (what at:(to)))) (to (mapEntry ""Where"" (what at:(to)))))))))) (piece ""Narigin"" Each (move Step (directions {Forward Backward Rightward Leftward FL FR}) (to if:(not (is Friend (who at:(to)))) (apply (if (is Enemy (who at:(to))) (add (piece (mapEntry ""Captured"" (what at:(to)))) (to (mapEntry ""Where"" (what at:(to)))))))))) (piece ""Ryuo"" Each (or (move Slide Orthogonal (to if:(and (is Enemy (who at:(to))) (= (count Pieces Mover ""Osho"" in:(sites Board)) 1)) (apply (if (is Enemy (who at:(to))) (add (piece (mapEntry ""Captured"" (what at:(to)))) (to (mapEntry ""Where"" (what at:(to))))))))) (move Step Diagonal (to if:(and (not (is Friend (who at:(to)))) (or (not (is Enemy (who at:(to)))) (= (count Pieces Mover ""Osho"" in:(sites Board)) 1))) (apply (if (is Enemy (who at:(to))) (add (piece (mapEntry ""Captured"" (what at:(to)))) (to (mapEntry ""Where"" (what at:(to))))))))))) (piece ""Ryuma"" Each (or (move Slide Diagonal (to if:(and (is Enemy (who at:(to))) (= (count Pieces Mover ""Osho"" in:(sites Board)) 1)) (apply (if (is Enemy (who at:(to))) (add (piece (mapEntry ""Captured"" (what at:(to)))) (to (mapEntry ""Where"" (what at:(to))))))))) (move Step Orthogonal (to if:(and (not (is Friend (who at:(to)))) (or (not (is Enemy (who at:(to)))) (= (count Pieces Mover ""Osho"" in:(sites Board)) 1))) (apply (if (is Enemy (who at:(to))) (add (piece (mapEntry ""Captured"" (what at:(to)))) (to (mapEntry ""Where"" (what at:(to))))))))))) (piece ""Narikei"" Each (move Step (directions {Forward Backward Rightward Leftward FL FR}) (to if:(not (is Friend (who at:(to)))) (apply (if (is Enemy (who at:(to))) (add (piece (mapEntry ""Captured"" (what at:(to)))) (to (mapEntry ""Where"" (what at:(to)))))))))) (piece ""Narikyo"" Each (move Step (directions {Forward Backward Rightward Leftward FL FR}) (to if:(not (is Friend (who at:(to)))) (apply (if (is Enemy (who at:(to))) (add (piece (mapEntry ""Captured"" (what at:(to)))) (to (mapEntry ""Where"" (what at:(to)))))))))) (regions ""LastRankP1"" P1 (sites Top)) (regions ""LastRankP2"" P2 (sites Bottom)) (regions ""TwoFurthestRankP1"" P1 (expand (sites Top))) (regions ""TwoFurthestRankP2"" P2 (expand (sites Bottom))) (regions ""Promotion"" P1 (expand (sites Top) steps:2)) (regions ""Promotion"" P2 (expand (sites Bottom) steps:2)) (map ""Where"" {(pair (id ""Fuhyo"" P1) (handSite P2)) (pair (id ""Fuhyo"" P2) (handSite P1)) (pair (id ""Ginsho"" P1) (handSite P2 1)) (pair (id ""Ginsho"" P2) (handSite P1 1)) (pair (id ""Hisha"" P1) (handSite P2 2)) (pair (id ""Hisha"" P2) (handSite P1 2)) (pair (id ""Kakugyo"" P1) (handSite P2 3)) (pair (id ""Kakugyo"" P2) (handSite P1 3)) (pair (id ""Keima"" P1) (handSite P2 4)) (pair (id ""Keima"" P2) (handSite P1 4)) (pair (id ""Kyosha"" P1) (handSite P2 5)) (pair (id ""Kyosha"" P2) (handSite P1 5)) (pair (id ""Kinsho"" P1) (handSite P2 6)) (pair (id ""Kinsho"" P2) (handSite P1 6)) (pair (id ""Tokin"" P1) (handSite P2)) (pair (id ""Tokin"" P2) (handSite P1)) (pair (id ""Narigin"" P1) (handSite P2 1)) (pair (id ""Narigin"" P2) (handSite P1 1)) (pair (id ""Ryuo"" P1) (handSite P2 2)) (pair (id ""Ryuo"" P2) (handSite P1 2)) (pair (id ""Ryuma"" P1) (handSite P2 3)) (pair (id ""Ryuma"" P2) (handSite P1 3)) (pair (id ""Narikei"" P1) (handSite P2 4)) (pair (id ""Narikei"" P2) (handSite P1 4)) (pair (id ""Narikyo"" P1) (handSite P2 5)) (pair (id ""Narikyo"" P2) (handSite P1 5))}) (map ""Captured"" {(pair (id ""Fuhyo"" P1) (id ""Fuhyo"" P2)) (pair (id ""Fuhyo"" P2) (id ""Fuhyo"" P1)) (pair (id ""Ginsho"" P1) (id ""Ginsho"" P2)) (pair (id ""Ginsho"" P2) (id ""Ginsho"" P1)) (pair (id ""Hisha"" P1) (id ""Hisha"" P2)) (pair (id ""Hisha"" P2) (id ""Hisha"" P1)) (pair (id ""Kakugyo"" P1) (id ""Kakugyo"" P2)) (pair (id ""Kakugyo"" P2) (id ""Kakugyo"" P1)) (pair (id ""Keima"" P1) (id ""Keima"" P2)) (pair (id ""Keima"" P2) (id ""Keima"" P1)) (pair (id ""Kyosha"" P1) (id ""Kyosha"" P2)) (pair (id ""Kyosha"" P2) (id ""Kyosha"" P1)) (pair (id ""Kinsho"" P1) (id ""Kinsho"" P2)) (pair (id ""Kinsho"" P2) (id ""Kinsho"" P1)) (pair (id ""Tokin"" P1) (id ""Fuhyo"" P2)) (pair (id ""Tokin"" P2) (id ""Fuhyo"" P1)) (pair (id ""Narigin"" P1) (id ""Ginsho"" P2)) (pair (id ""Narigin"" P2) (id ""Ginsho"" P1)) (pair (id ""Ryuo"" P1) (id ""Hisha"" P2)) (pair (id ""Ryuo"" P2) (id ""Hisha"" P1)) (pair (id ""Ryuma"" P1) (id ""Kakugyo"" P2)) (pair (id ""Ryuma"" P2) (id ""Kakugyo"" P1)) (pair (id ""Narikei"" P1) (id ""Keima"" P2)) (pair (id ""Narikei"" P2) (id ""Keima"" P1)) (pair (id ""Narikyo"" P1) (id ""Kyosha"" P2)) (pair (id ""Narikyo"" P2) (id ""Kyosha"" P1))}) (map ""Promoted"" {(pair (id ""Fuhyo"" P1) (id ""Tokin"" P1)) (pair (id ""Fuhyo"" P2) (id ""Tokin"" P2)) (pair (id ""Ginsho"" P1) (id ""Narigin"" P1)) (pair (id ""Ginsho"" P2) (id ""Narigin"" P2)) (pair (id ""Hisha"" P1) (id ""Ryuo"" P1)) (pair (id ""Hisha"" P2) (id ""Ryuo"" P2)) (pair (id ""Kakugyo"" P1) (id ""Ryuma"" P1)) (pair (id ""Kakugyo"" P2) (id ""Ryuma"" P2)) (pair (id ""Keima"" P1) (id ""Narikei"" P1)) (pair (id ""Keima"" P2) (id ""Narikei"" P2)) (pair (id ""Kyosha"" P1) (id ""Narikyo"" P1)) (pair (id ""Kyosha"" P2) (id ""Narikyo"" P2))}) (hand Each size:8)}) (rules (start {(place ""Osho1"" (handSite P1 7)) (place ""Kinsho1"" (handSite P1 6) count:2) (place ""Ginsho1"" (handSite P1 1) count:2) (place ""Keima1"" (handSite P1 4) count:2) (place ""Kyosha1"" (handSite P1 5) count:2) (place ""Kakugyo1"" (handSite P1 3)) (place ""Hisha1"" (handSite P1 2)) (place ""Fuhyo1"" (handSite P1) count:9) (place ""Osho2"" (handSite P2 7)) (place ""Kinsho2"" (handSite P2 6) count:2) (place ""Ginsho2"" (handSite P2 1) count:2) (place ""Keima2"" (handSite P2 4) count:2) (place ""Kyosha2"" (handSite P2 5) count:2) (place ""Kakugyo2"" (handSite P2 3)) (place ""Hisha2"" (handSite P2 2)) (place ""Fuhyo2"" (handSite P2) count:9)}) (play (if (is Prev Mover) (or (move Promote (last To) (piece (mapEntry ""Promoted"" (what at:(last To))))) (move Pass)) (do (or {(move (from (sites Occupied by:Mover container:""Hand"" components:{""Kakugyo"" ""Ginsho"" ""Hisha"" ""Kinsho"" ""Osho""})) (to (sites Empty))) (do (move (from (sites Occupied by:Mover container:""Hand"" component:""Fuhyo"")) (to (difference (sites Empty) (sites Mover ""LastRank"")) if:(= (count Sites in:(sites Occupied by:Mover container:""Board"" component:""Fuhyo"")) (count Sites in:(difference (sites Occupied by:Mover container:""Board"" component:""Fuhyo"") (sites Column (column of:(to)))))))) ifAfterwards:(or (not (and (is Threatened (id ""Osho"" Next)) (not (can Move (do (or {(move (from (sites Occupied by:Next container:""Hand"" components:{""Kakugyo"" ""Ginsho"" ""Hisha"" ""Kinsho""})) (to (sites Empty))) (do (move (from (sites Occupied by:Next container:""Hand"" component:""Fuhyo"")) (to (difference (sites Empty) (sites Next ""LastRank"")) if:(= (count Sites in:(sites Occupied by:Next container:""Board"" component:""Fuhyo"")) (count Sites in:(difference (sites Occupied by:Next container:""Board"" component:""Fuhyo"") (sites Column (column of:(to)))))))) ifAfterwards:(or (not (is Threatened (id ""Osho"" Mover))) (no Pieces Next ""Osho"" in:(sites Board)))) (move (from (sites Occupied by:Next container:""Hand"" component:""Kyosha"")) (to (difference (sites Empty) (sites Next ""LastRank"")))) (move (from (sites Occupied by:Next container:""Hand"" component:""Keima"")) (to (difference (sites Empty) (sites Next ""TwoFurthestRank"")))) (forEach Piece Next)}) ifAfterwards:(or (not (is Threatened (id ""Osho"" Mover))) (no Pieces Next ""Osho"" in:(sites Board)))))))) (no Pieces Mover ""Osho"" in:(sites Board)))) (move (from (sites Occupied by:Mover container:""Hand"" component:""Kyosha"")) (to (difference (sites Empty) (sites Mover ""LastRank"")))) (move (from (sites Occupied by:Mover container:""Hand"" component:""Keima"")) (to (difference (sites Empty) (sites Mover ""TwoFurthestRank"")))) (forEach Piece)}) ifAfterwards:(or (not (is Threatened (id ""Osho"" Mover))) (no Pieces Next ""Osho"" in:(sites Board)))))) (end {(if (and {(is Threatened (id ""Osho"" Next)) (not (can Move (do (or {(move (from (sites Occupied by:Next container:""Hand"" components:{""Kakugyo"" ""Ginsho"" ""Hisha"" ""Kinsho""})) (to (sites Empty))) (do (move (from (sites Occupied by:Next container:""Hand"" component:""Fuhyo"")) (to (difference (sites Empty) (sites Next ""LastRank"")) if:(= (count Sites in:(sites Occupied by:Next container:""Board"" component:""Fuhyo"")) (count Sites in:(difference (sites Occupied by:Next container:""Board"" component:""Fuhyo"") (sites Column (column of:(to)))))))) ifAfterwards:(or (not (is Threatened (id ""Osho"" Mover))) (no Pieces Next ""Osho"" in:(sites Board)))) (move (from (sites Occupied by:Next container:""Hand"" component:""Kyosha"")) (to (difference (sites Empty) (sites Next ""LastRank"")))) (move (from (sites Occupied by:Next container:""Hand"" component:""Keima"")) (to (difference (sites Empty) (sites Next ""TwoFurthestRank"")))) (forEach Piece Next)}) ifAfterwards:(or (not (is Threatened (id ""Osho"" Mover))) (no Pieces Next ""Osho"" in:(sites Board)))))) (= (count Pieces Mover ""Osho"" in:(sites Board)) 1)}) (result Mover Win)) (if (no Moves Next) (result Mover Win))})))" "The board has nine vertical lines and ten horizontal rows, and the pieces are placed on the intersections of these lines. Centreed along the back lines of each side is a three by three square with diagonals known as the palace. Pieces have special movement values: Janggun (general): May move one spot along the lines within the palace but cannot leave it. Sa (guards): Same movement as the Janggun. Ma (horses): Move one spot forward orthogonally and then one forward diagonally. Sang (elephants): Move one spot orthogonally forward then two spots diagonally forward. A Ma and Sang can be switched in the initial setup. Cha (chariots): Move like a rook in Chess, but also diagonally within the palace. Po (cannons): Jump over exactly one piece, over any distance horizontally or vertically, but cannot jump over or capture another cannon. Byeong/Jol (soldiers): Move and capture one point forward or sideways. Play continues until Woetong (checkmate) of the Janggun.","(game ""Janggi"" (players 2) (equipment {(board (rectangle 10 9) use:Vertex) (piece ""Han"" P1 (move Step (if (is In (from) (sites Mover ""PalaceOrtho"")) Orthogonal All) (to if:(and (is In (to) (sites Mover ""Palace"")) (not (is Friend (who at:(to))))) (apply (remove (to)))))) (piece ""Cho"" P2 (move Step (if (is In (from) (sites Mover ""PalaceOrtho"")) Orthogonal All) (to if:(and (is In (to) (sites Mover ""Palace"")) (not (is Friend (who at:(to))))) (apply (remove (to)))))) (piece ""Sa"" Each (move Step (if (is In (from) (sites Mover ""PalaceOrtho"")) Orthogonal All) (to if:(and (is In (to) (sites Mover ""Palace"")) (not (is Friend (who at:(to))))) (apply (remove (to)))))) (piece ""Sang"" Each (forEach Direction Orthogonal (to if:(is Empty (to)) (apply (forEach Direction (from (to)) (directions {FR FL} of:All) (between (exact 2) if:(is Empty (between))) (if (not (is Friend (who at:(to)))) (move (from) (to (apply if:(is Enemy (who at:(to))) (remove (to))))))))))) (piece ""Ma"" Each (forEach Direction Orthogonal (to if:(is Empty (to)) (apply (forEach Direction (from (to)) (directions {FR FL} of:All) (if (not (is Friend (who at:(to)))) (move (from) (to (apply if:(is Enemy (who at:(to))) (remove (to))))))))))) (piece ""Cha"" Each (or {(move Slide Orthogonal (to if:(is Enemy (who at:(to))) (apply (remove (to))))) (if (is In (from) (union (sites P1 ""Palace"") (sites P2 ""Palace""))) (move Slide Diagonal (between (max 2) if:(and (is Empty (between)) (is In (between) (union (sites P1 ""Palace"") (sites P2 ""Palace""))))) (to if:(is Enemy (who at:(to))) (apply (remove (to))))))})) (piece ""Po"" Each (or {(move Hop Orthogonal (between before:(count Rows) after:(count Rows) if:(and {(not (= (what at:(between)) (id ""Po"" P1))) (not (= (what at:(between)) (id ""Po"" P2))) (is Occupied (between))})) (to if:(is Empty (to)) (apply if:(and (not (= (what at:(to)) (id ""Po"" Next))) (not (is Friend (who at:(to))))) (remove (to))))) (move Hop Orthogonal (between before:(count Rows) after:(count Rows) if:(and {(not (= (what at:(between)) (id ""Po"" P1))) (not (= (what at:(between)) (id ""Po"" P2))) (is Occupied (between))})) (to if:(is Empty (to)))) (if (is In (from) (union (sites P1 ""Palace"") (sites P2 ""Palace""))) (move Hop Diagonal (between if:(and {(not (= (what at:(between)) (id ""Po"" P1))) (not (= (what at:(between)) (id ""Po"" P2))) (is Occupied (between))})) (to if:(and (and (not (= (what at:(to)) (id ""Po"" Next))) (not (is Friend (who at:(to))))) (is In (to) (union (sites P1 ""Palace"") (sites P2 ""Palace"")))) (apply (remove (to))))))})) (piece ""Byeong"" P1 N (move Step (directions {Forward Rightward Leftward}) (to if:(not (is Friend (who at:(to)))) (apply (remove (to)))))) (piece ""Jol"" P2 S (move Step (directions {Forward Rightward Leftward}) (to if:(not (is Friend (who at:(to)))) (apply (remove (to)))))) (regions ""PalaceP1"" P1 {3 4 5 12 13 14 21 22 23}) (regions ""PalaceOrthoP1"" P1 {4 12 14 22}) (regions ""PalaceP2"" P2 {66 67 68 75 76 77 84 85 86}) (regions ""PalaceOrthoP2"" P2 {67 75 77 85})}) (rules (start {(place ""Han1"" coord:""E2"") (place ""Sa1"" {""D1"" ""F1""}) (place ""Sang1"" {""C1"" ""G1""}) (place ""Ma1"" {""B1"" ""H1""}) (place ""Cha1"" {""A1"" ""I1""}) (place ""Po1"" {""B3"" ""H3""}) (place ""Byeong1"" {""A4"" ""C4"" ""E4"" ""G4"" ""I4""}) (place ""Cho2"" coord:""E9"") (place ""Sa2"" {""D10"" ""F10""}) (place ""Sang2"" {""C10"" ""G10""}) (place ""Ma2"" {""B10"" ""H10""}) (place ""Cha2"" {""A10"" ""I10""}) (place ""Po2"" {""B8"" ""H8""}) (place ""Jol2"" {""A7"" ""C7"" ""E7"" ""G7"" ""I7""})}) (play (do (forEach Piece) ifAfterwards:(not (is Threatened (if (is Mover P2) (id ""Cho2"") (id ""Han1"")))) (then (if (if (= (column of:(where ""Han"" P1)) (column of:(where ""Cho"" P2))) (= (count Sites in:(forEach (sites Direction from:(where ""Han"" P1) N stop:(= (to) (where ""Cho"" P2))) if:(is Occupied (site)))) 0) False) (if (!= (var) 1) (set Var 1) (set Var 0)) (set Var 0))))) (end {(if (and (is Threatened (if (is Next P2) (id ""Cho2"") (id ""Han1""))) (not (can Move (do (forEach Piece Next) ifAfterwards:(not (is Threatened (if (is Next P2) (id ""Cho2"") (id ""Han1"")))))))) (result Mover Win)) (if (and (if (= (column of:(where ""Han"" P1)) (column of:(where ""Cho"" P2))) (= (count Sites in:(forEach (sites Direction from:(where ""Han"" P1) N stop:(= (to) (where ""Cho"" P2))) if:(is Occupied (site)))) 0) False) (= (var) 0)) (result Mover Draw))})))","###Description The board has nine vertical lines and ten horizontal rows, and the pieces are placed on the intersections of these lines. Centreed along the back lines of each side is a three by three square with diagonals known as the palace. Pieces have special movement values: Janggun (general): May move one spot along the lines within the palace but cannot leave it. Sa (guards): Same movement as the Janggun. Ma (horses): Move one spot forward orthogonally and then one forward diagonally. Sang (elephants): Move one spot orthogonally forward then two spots diagonally forward. A Ma and Sang can be switched in the initial setup. Cha (chariots): Move like a rook in Chess, but also diagonally within the palace. Po (cannons): Jump over exactly one piece, over any distance horizontally or vertically, but cannot jump over or capture another cannon. Byeong/Jol (soldiers): Move and capture one point forward or sideways. Play continues until Woetong (checkmate) of the Janggun. @@ -4769,11 +4624,6 @@ The rules for pieces are the same as regular Xiangqi, except pawns start with th ###Ludii (game ""MiniXiangqi"" (players {(player N) (player S)}) (equipment {(board (rectangle 7 7) use:Vertex) (piece ""Jiang"" Each (move Step Orthogonal (to if:(and (is In (to) (sites Mover ""Palace"")) (not (is Friend (who at:(to))))) (apply (remove (to)))))) (piece ""Ma"" Each (forEach Direction Orthogonal (to if:(is Empty (to)) (apply (forEach Direction (from (to)) (directions {FR FL} of:All) (if (not (is Friend (who at:(to)))) (move (from) (to (apply if:(is Enemy (who at:(to))) (remove (to))))))))))) (piece ""Ju"" Each (move Slide Orthogonal (to if:(is Enemy (who at:(to))) (apply (remove (to)))))) (piece ""Pao"" Each (or (move Slide Orthogonal) (move Hop Orthogonal (between before:(count Rows) after:(count Rows) if:(is Occupied (between))) (to if:(is Empty (to)) (apply if:(is Enemy (who at:(to))) (remove (to))))))) (piece ""Zu"" Each (move Step (directions {Forward Rightward Leftward}) (to if:(not (is Friend (who at:(to)))) (apply (remove (to)))))) (regions ""PalaceP1"" P1 {2 3 4 9 10 11 16 17 18}) (regions ""PalaceP2"" P2 {30 31 32 37 38 39 44 45 46})}) (rules (start {(place ""Jiang1"" coord:""D1"") (place ""Ma1"" {""C1"" ""E1""}) (place ""Ju1"" {""A1"" ""G1""}) (place ""Pao1"" {""B1"" ""F1""}) (place ""Zu1"" {""A2"" ""C2"" ""D2"" ""E2"" ""G2""}) (place ""Jiang2"" coord:""D7"") (place ""Ma2"" {""C7"" ""E7""}) (place ""Ju2"" {""A7"" ""G7""}) (place ""Pao2"" {""B7"" ""F7""}) (place ""Zu2"" {""A6"" ""C6"" ""D6"" ""E6"" ""G6""})}) (play (do (forEach Piece) ifAfterwards:(and (if (= (column of:(where ""Jiang"" P1)) (column of:(where ""Jiang"" P2))) (not (= (count Sites in:(forEach (sites Direction from:(where ""Jiang"" P1) N stop:(= (to) (where ""Jiang"" P2))) if:(is Occupied (site)))) 0)) True) (not (is Threatened (id ""Jiang"" Mover)))))) (end {(if (and (is Threatened (id ""Jiang"" Next)) (not (can Move (do (forEach Piece Next) ifAfterwards:(not (is Threatened (id ""Jiang"" Next))))))) (result Mover Win)) (if (no Moves Next) (result Mover Win))})))" -"19x19 lines, pieces are played on the intersections of the lines. Seventeen pieces per player, each with special moves, as follows: Jiang (General) x1: moves orthogonally or diagonally any distance; Pian (Deputy General) x1: Moves orthogonally any distance; Bai (Officer) x1: moves diagonally any distance; Ren (Emissary) x1: moves orthogonally or diagonally any distance, but cannot capture or be captured; Pao (Catapult) x1: moves orthogonally any distance, but can only capture by jumping over one of the player's own pieces first; Gong (Bow) x1: moves orthogonally or diagonally four spaces; Nu (Crossbow) x1: moves orthogonally or diagonally five spaces; Dao (Knife) x2: moves one space diagonally; Jian (Sword) x4: moves one space orthogonally; Qi (Mounted riders) x4: moves one space in a straight line then three diagonally, does not jump. Seven players. Players play as seven states: Ch'in (white), Ch'u (red), Han (orange), Ch'i (dark blue), Wei (green), Chao (purple), and Yen (black). They play in that order. One piece, the Chou (King, which is yellow), is placed in the central spot and does not move and pieces cannot enter that space. Pieces capture an enemy piece by moving to the spot it occupies. A player is eliminated when their general or ten of their pieces are captured, and their remaining pieces are removed from the board. Play continues until one player remains, one player captures two generals, or one player captures thirty pieces. The player with the most captured pieces wins.","(game ""Qi Guo Xiangxi"" (players 7) (equipment {(board (square 19) use:Vertex) (piece ""King"" Shared) (piece ""General"" Each (move Slide All (between if:(and {(is Empty (between)) (!= (who at:(between)) Shared) (not (= (what at:(between)) (id ""Diplomat"" P1))) (not (= (what at:(between)) (id ""Diplomat"" P2))) (not (= (what at:(between)) (id ""Diplomat"" P3))) (not (= (what at:(between)) (id ""Diplomat"" P4))) (not (= (what at:(between)) (id ""Diplomat"" P5))) (not (= (what at:(between)) (id ""Diplomat"" P6))) (not (= (what at:(between)) (id ""Diplomat"" P7)))})) (to if:(and {(is Enemy (who at:(to))) (!= (who at:(to)) Shared) (not (= (what at:(to)) (id ""Diplomat"" P1))) (not (= (what at:(to)) (id ""Diplomat"" P2))) (not (= (what at:(to)) (id ""Diplomat"" P3))) (not (= (what at:(to)) (id ""Diplomat"" P4))) (not (= (what at:(to)) (id ""Diplomat"" P5))) (not (= (what at:(to)) (id ""Diplomat"" P6))) (not (= (what at:(to)) (id ""Diplomat"" P7)))}) (apply (if (is Enemy (who at:(to))) (do (if (or {(= (what at:(to)) (id ""General"" P1)) (= (what at:(to)) (id ""General"" P2)) (= (what at:(to)) (id ""General"" P3)) (= (what at:(to)) (id ""General"" P4)) (= (what at:(to)) (id ""General"" P5)) (= (what at:(to)) (id ""General"" P6)) (= (what at:(to)) (id ""General"" P7))}) (add (piece (id ""General"" Mover)) (to (handSite Mover)))) next:(remove (to) (then (addScore Mover 1))))))))) (piece ""Deputy General"" Each (move Slide Orthogonal (between if:(and {(is Empty (between)) (!= (who at:(between)) Shared) (not (= (what at:(between)) (id ""Diplomat"" P1))) (not (= (what at:(between)) (id ""Diplomat"" P2))) (not (= (what at:(between)) (id ""Diplomat"" P3))) (not (= (what at:(between)) (id ""Diplomat"" P4))) (not (= (what at:(between)) (id ""Diplomat"" P5))) (not (= (what at:(between)) (id ""Diplomat"" P6))) (not (= (what at:(between)) (id ""Diplomat"" P7)))})) (to if:(and {(is Enemy (who at:(to))) (!= (who at:(to)) Shared) (not (= (what at:(to)) (id ""Diplomat"" P1))) (not (= (what at:(to)) (id ""Diplomat"" P2))) (not (= (what at:(to)) (id ""Diplomat"" P3))) (not (= (what at:(to)) (id ""Diplomat"" P4))) (not (= (what at:(to)) (id ""Diplomat"" P5))) (not (= (what at:(to)) (id ""Diplomat"" P6))) (not (= (what at:(to)) (id ""Diplomat"" P7)))}) (apply (if (is Enemy (who at:(to))) (do (if (or {(= (what at:(to)) (id ""General"" P1)) (= (what at:(to)) (id ""General"" P2)) (= (what at:(to)) (id ""General"" P3)) (= (what at:(to)) (id ""General"" P4)) (= (what at:(to)) (id ""General"" P5)) (= (what at:(to)) (id ""General"" P6)) (= (what at:(to)) (id ""General"" P7))}) (add (piece (id ""General"" Mover)) (to (handSite Mover)))) next:(remove (to) (then (addScore Mover 1))))))))) (piece ""Officer"" Each (move Slide Diagonal (between if:(and {(is Empty (between)) (!= (who at:(between)) Shared) (not (= (what at:(between)) (id ""Diplomat"" P1))) (not (= (what at:(between)) (id ""Diplomat"" P2))) (not (= (what at:(between)) (id ""Diplomat"" P3))) (not (= (what at:(between)) (id ""Diplomat"" P4))) (not (= (what at:(between)) (id ""Diplomat"" P5))) (not (= (what at:(between)) (id ""Diplomat"" P6))) (not (= (what at:(between)) (id ""Diplomat"" P7)))})) (to if:(and {(is Enemy (who at:(to))) (!= (who at:(to)) Shared) (not (= (what at:(to)) (id ""Diplomat"" P1))) (not (= (what at:(to)) (id ""Diplomat"" P2))) (not (= (what at:(to)) (id ""Diplomat"" P3))) (not (= (what at:(to)) (id ""Diplomat"" P4))) (not (= (what at:(to)) (id ""Diplomat"" P5))) (not (= (what at:(to)) (id ""Diplomat"" P6))) (not (= (what at:(to)) (id ""Diplomat"" P7)))}) (apply (if (is Enemy (who at:(to))) (do (if (or {(= (what at:(to)) (id ""General"" P1)) (= (what at:(to)) (id ""General"" P2)) (= (what at:(to)) (id ""General"" P3)) (= (what at:(to)) (id ""General"" P4)) (= (what at:(to)) (id ""General"" P5)) (= (what at:(to)) (id ""General"" P6)) (= (what at:(to)) (id ""General"" P7))}) (add (piece (id ""General"" Mover)) (to (handSite Mover)))) next:(remove (to) (then (addScore Mover 1))))))))) (piece ""Diplomat"" Each (move Slide All)) (piece ""Archer"" Each (move Hop All (between (exact 3) if:(is Empty (between))) (to if:(or (is Empty (to)) (and {(is Enemy (who at:(to))) (!= (who at:(to)) Shared) (not (= (what at:(to)) (id ""Diplomat"" P1))) (not (= (what at:(to)) (id ""Diplomat"" P2))) (not (= (what at:(to)) (id ""Diplomat"" P3))) (not (= (what at:(to)) (id ""Diplomat"" P4))) (not (= (what at:(to)) (id ""Diplomat"" P5))) (not (= (what at:(to)) (id ""Diplomat"" P6))) (not (= (what at:(to)) (id ""Diplomat"" P7)))})) (apply (if (is Enemy (who at:(to))) (do (if (or {(= (what at:(to)) (id ""General"" P1)) (= (what at:(to)) (id ""General"" P2)) (= (what at:(to)) (id ""General"" P3)) (= (what at:(to)) (id ""General"" P4)) (= (what at:(to)) (id ""General"" P5)) (= (what at:(to)) (id ""General"" P6)) (= (what at:(to)) (id ""General"" P7))}) (add (piece (id ""General"" Mover)) (to (handSite Mover)))) next:(remove (to) (then (addScore Mover 1))))))))) (piece ""CrossBow"" Each (move Hop All (between (exact 4) if:(is Empty (between))) (to if:(or (is Empty (to)) (and {(is Enemy (who at:(to))) (!= (who at:(to)) Shared) (not (= (what at:(to)) (id ""Diplomat"" P1))) (not (= (what at:(to)) (id ""Diplomat"" P2))) (not (= (what at:(to)) (id ""Diplomat"" P3))) (not (= (what at:(to)) (id ""Diplomat"" P4))) (not (= (what at:(to)) (id ""Diplomat"" P5))) (not (= (what at:(to)) (id ""Diplomat"" P6))) (not (= (what at:(to)) (id ""Diplomat"" P7)))})) (apply (if (is Enemy (who at:(to))) (do (if (or {(= (what at:(to)) (id ""General"" P1)) (= (what at:(to)) (id ""General"" P2)) (= (what at:(to)) (id ""General"" P3)) (= (what at:(to)) (id ""General"" P4)) (= (what at:(to)) (id ""General"" P5)) (= (what at:(to)) (id ""General"" P6)) (= (what at:(to)) (id ""General"" P7))}) (add (piece (id ""General"" Mover)) (to (handSite Mover)))) next:(remove (to) (then (addScore Mover 1))))))))) (piece ""Knife"" Each (move Step Diagonal (to if:(or (is Empty (to)) (and {(is Enemy (who at:(to))) (!= (who at:(to)) Shared) (not (= (what at:(to)) (id ""Diplomat"" P1))) (not (= (what at:(to)) (id ""Diplomat"" P2))) (not (= (what at:(to)) (id ""Diplomat"" P3))) (not (= (what at:(to)) (id ""Diplomat"" P4))) (not (= (what at:(to)) (id ""Diplomat"" P5))) (not (= (what at:(to)) (id ""Diplomat"" P6))) (not (= (what at:(to)) (id ""Diplomat"" P7)))})) (apply (if (is Enemy (who at:(to))) (do (if (or {(= (what at:(to)) (id ""General"" P1)) (= (what at:(to)) (id ""General"" P2)) (= (what at:(to)) (id ""General"" P3)) (= (what at:(to)) (id ""General"" P4)) (= (what at:(to)) (id ""General"" P5)) (= (what at:(to)) (id ""General"" P6)) (= (what at:(to)) (id ""General"" P7))}) (add (piece (id ""General"" Mover)) (to (handSite Mover)))) next:(remove (to) (then (addScore Mover 1))))))))) (piece ""Broadsword"" Each (move Step Orthogonal (to if:(or (is Empty (to)) (and {(is Enemy (who at:(to))) (!= (who at:(to)) Shared) (not (= (what at:(to)) (id ""Diplomat"" P1))) (not (= (what at:(to)) (id ""Diplomat"" P2))) (not (= (what at:(to)) (id ""Diplomat"" P3))) (not (= (what at:(to)) (id ""Diplomat"" P4))) (not (= (what at:(to)) (id ""Diplomat"" P5))) (not (= (what at:(to)) (id ""Diplomat"" P6))) (not (= (what at:(to)) (id ""Diplomat"" P7)))})) (apply (if (is Enemy (who at:(to))) (do (if (or {(= (what at:(to)) (id ""General"" P1)) (= (what at:(to)) (id ""General"" P2)) (= (what at:(to)) (id ""General"" P3)) (= (what at:(to)) (id ""General"" P4)) (= (what at:(to)) (id ""General"" P5)) (= (what at:(to)) (id ""General"" P6)) (= (what at:(to)) (id ""General"" P7))}) (add (piece (id ""General"" Mover)) (to (handSite Mover)))) next:(remove (to) (then (addScore Mover 1))))))))) (piece ""Catapult"" Each (or (move Slide Orthogonal) (move Hop Orthogonal (between before:(count Rows) after:(count Rows) if:(is Friend (who at:(between)))) (to if:(is Empty (to)) (apply if:(and {(is Enemy (who at:(to))) (!= (who at:(to)) Shared) (not (= (what at:(to)) (id ""Diplomat"" P1))) (not (= (what at:(to)) (id ""Diplomat"" P2))) (not (= (what at:(to)) (id ""Diplomat"" P3))) (not (= (what at:(to)) (id ""Diplomat"" P4))) (not (= (what at:(to)) (id ""Diplomat"" P5))) (not (= (what at:(to)) (id ""Diplomat"" P6))) (not (= (what at:(to)) (id ""Diplomat"" P7)))}) (do (if (or {(= (what at:(to)) (id ""General"" P1)) (= (what at:(to)) (id ""General"" P2)) (= (what at:(to)) (id ""General"" P3)) (= (what at:(to)) (id ""General"" P4)) (= (what at:(to)) (id ""General"" P5)) (= (what at:(to)) (id ""General"" P6)) (= (what at:(to)) (id ""General"" P7))}) (add (piece (id ""General"" Mover)) (to (handSite Mover)))) next:(remove (to) (then (addScore Mover 1))))))))) (piece ""Knight"" Each (forEach Direction Orthogonal (to if:(is Empty (to)) (apply (forEach Direction (from (to)) (directions {FR FL} of:All) (between (exact 3) if:(is Empty (between))) (if (or (is Empty (to)) (and {(is Enemy (who at:(to))) (!= (who at:(to)) Shared) (not (= (what at:(to)) (id ""Diplomat"" P1))) (not (= (what at:(to)) (id ""Diplomat"" P2))) (not (= (what at:(to)) (id ""Diplomat"" P3))) (not (= (what at:(to)) (id ""Diplomat"" P4))) (not (= (what at:(to)) (id ""Diplomat"" P5))) (not (= (what at:(to)) (id ""Diplomat"" P6))) (not (= (what at:(to)) (id ""Diplomat"" P7)))})) (move (from) (to (apply if:(is Enemy (who at:(to))) (do (if (or {(= (what at:(to)) (id ""General"" P1)) (= (what at:(to)) (id ""General"" P2)) (= (what at:(to)) (id ""General"" P3)) (= (what at:(to)) (id ""General"" P4)) (= (what at:(to)) (id ""General"" P5)) (= (what at:(to)) (id ""General"" P6)) (= (what at:(to)) (id ""General"" P7))}) (add (piece (id ""General"" Mover)) (to (handSite Mover)))) next:(remove (to) (then (addScore Mover 1))))))))))))) (hand Each)}) (rules (start {(place ""King"" (centrePoint)) (place ""General1"" coord:""A10"") (place ""General2"" coord:""F1"") (place ""General3"" coord:""N1"") (place ""General4"" coord:""S6"") (place ""General5"" coord:""S14"") (place ""General6"" coord:""N19"") (place ""General7"" coord:""F19"") (place ""Deputy General1"" coord:""A11"") (place ""Deputy General2"" coord:""E1"") (place ""Deputy General3"" coord:""M1"") (place ""Deputy General4"" coord:""S5"") (place ""Deputy General5"" coord:""S13"") (place ""Deputy General6"" coord:""O19"") (place ""Deputy General7"" coord:""G19"") (place ""Officer1"" coord:""A9"") (place ""Officer2"" coord:""G1"") (place ""Officer3"" coord:""O1"") (place ""Officer4"" coord:""S7"") (place ""Officer5"" coord:""S15"") (place ""Officer6"" coord:""M19"") (place ""Officer7"" coord:""E19"") (place ""Catapult1"" coord:""B10"") (place ""Catapult2"" coord:""F2"") (place ""Catapult3"" coord:""N2"") (place ""Catapult4"" coord:""R6"") (place ""Catapult5"" coord:""R14"") (place ""Catapult6"" coord:""N18"") (place ""Catapult7"" coord:""F18"") (place ""Broadsword1"" {""A12"" ""B11"" ""B9"" ""A8""}) (place ""Broadsword2"" {""D1"" ""E2"" ""G2"" ""H1""}) (place ""Broadsword3"" {""L1"" ""M2"" ""O2"" ""P1""}) (place ""Broadsword4"" {""S4"" ""R5"" ""R7"" ""S8""}) (place ""Broadsword5"" {""S12"" ""R13"" ""R15"" ""S16""}) (place ""Broadsword6"" {""P19"" ""O18"" ""M18"" ""L19""}) (place ""Broadsword7"" {""H19"" ""G18"" ""E18"" ""D19""}) (place ""Knight1"" {""A13"" ""B12"" ""B8"" ""A7""}) (place ""Knight2"" {""C1"" ""D2"" ""H2"" ""I1""}) (place ""Knight3"" {""K1"" ""L2"" ""P2"" ""Q1""}) (place ""Knight4"" {""S3"" ""R4"" ""R8"" ""S9""}) (place ""Knight5"" {""S11"" ""R12"" ""R16"" ""S17""}) (place ""Knight6"" {""P18"" ""Q19"" ""L18"" ""K19""}) (place ""Knight7"" {""H18"" ""I19"" ""D18"" ""C19""}) (place ""CrossBow1"" coord:""C10"") (place ""CrossBow2"" coord:""F3"") (place ""CrossBow3"" coord:""N3"") (place ""CrossBow4"" coord:""Q6"") (place ""CrossBow5"" coord:""Q14"") (place ""CrossBow6"" coord:""N17"") (place ""CrossBow7"" coord:""F17"") (place ""Knife1"" {""C9"" ""C11""}) (place ""Knife2"" {""E3"" ""G3""}) (place ""Knife3"" {""M3"" ""O3""}) (place ""Knife4"" {""Q5"" ""Q7""}) (place ""Knife5"" {""Q13"" ""Q15""}) (place ""Knife6"" {""O17"" ""M17""}) (place ""Knife7"" {""G17"" ""E17""}) (place ""Archer1"" coord:""D10"") (place ""Archer2"" coord:""F4"") (place ""Archer3"" coord:""N4"") (place ""Archer4"" coord:""P6"") (place ""Archer5"" coord:""P14"") (place ""Archer6"" coord:""N16"") (place ""Archer7"" coord:""F16"") (place ""Diplomat1"" coord:""E10"") (place ""Diplomat2"" coord:""F5"") (place ""Diplomat3"" coord:""N5"") (place ""Diplomat4"" coord:""O6"") (place ""Diplomat5"" coord:""O14"") (place ""Diplomat6"" coord:""N15"") (place ""Diplomat7"" coord:""F15"")}) (play (forEach Piece (then (and {(if (and (is Active P1) (or (<= (count Pieces P1 in:(sites Board)) 7) (= (where ""General"" P1) -1))) (remove (sites Occupied by:P1 container:""Board""))) (if (and (is Active P2) (or (<= (count Pieces P2 in:(sites Board)) 7) (= (where ""General"" P2) -1))) (remove (sites Occupied by:P2 container:""Board""))) (if (and (is Active P3) (or (<= (count Pieces P3 in:(sites Board)) 7) (= (where ""General"" P3) -1))) (remove (sites Occupied by:P3 container:""Board""))) (if (and (is Active P4) (or (<= (count Pieces P4 in:(sites Board)) 7) (= (where ""General"" P4) -1))) (remove (sites Occupied by:P4 container:""Board""))) (if (and (is Active P5) (or (<= (count Pieces P5 in:(sites Board)) 7) (= (where ""General"" P5) -1))) (remove (sites Occupied by:P5 container:""Board""))) (if (and (is Active P6) (or (<= (count Pieces P6 in:(sites Board)) 7) (= (where ""General"" P6) -1))) (remove (sites Occupied by:P6 container:""Board""))) (if (and (is Active P7) (or (<= (count Pieces P7 in:(sites Board)) 7) (= (where ""General"" P7) -1))) (remove (sites Occupied by:P7 container:""Board"")))})))) (end {(if (= (count Pieces P1 in:(sites Board)) 0) (result P1 Loss)) (if (= (count Pieces P2 in:(sites Board)) 0) (result P2 Loss)) (if (= (count Pieces P3 in:(sites Board)) 0) (result P3 Loss)) (if (= (count Pieces P4 in:(sites Board)) 0) (result P4 Loss)) (if (= (count Pieces P5 in:(sites Board)) 0) (result P5 Loss)) (if (= (count Pieces P6 in:(sites Board)) 0) (result P6 Loss)) (if (= (count Pieces P7 in:(sites Board)) 0) (result P7 Loss)) (if (or (= (score Mover) 30) (= 2 (count Cell at:(handSite Mover)))) (byScore))})))","###Description -19x19 lines, pieces are played on the intersections of the lines. Seventeen pieces per player, each with special moves, as follows: Jiang (General) x1: moves orthogonally or diagonally any distance; Pian (Deputy General) x1: Moves orthogonally any distance; Bai (Officer) x1: moves diagonally any distance; Ren (Emissary) x1: moves orthogonally or diagonally any distance, but cannot capture or be captured; Pao (Catapult) x1: moves orthogonally any distance, but can only capture by jumping over one of the player's own pieces first; Gong (Bow) x1: moves orthogonally or diagonally four spaces; Nu (Crossbow) x1: moves orthogonally or diagonally five spaces; Dao (Knife) x2: moves one space diagonally; Jian (Sword) x4: moves one space orthogonally; Qi (Mounted riders) x4: moves one space in a straight line then three diagonally, does not jump. Seven players. Players play as seven states: Ch'in (white), Ch'u (red), Han (orange), Ch'i (dark blue), Wei (green), Chao (purple), and Yen (black). They play in that order. One piece, the Chou (King, which is yellow), is placed in the central spot and does not move and pieces cannot enter that space. Pieces capture an enemy piece by moving to the spot it occupies. A player is eliminated when their general or ten of their pieces are captured, and their remaining pieces are removed from the board. Play continues until one player remains, one player captures two generals, or one player captures thirty pieces. The player with the most captured pieces wins. - -###Ludii -(game ""Qi Guo Xiangxi"" (players 7) (equipment {(board (square 19) use:Vertex) (piece ""King"" Shared) (piece ""General"" Each (move Slide All (between if:(and {(is Empty (between)) (!= (who at:(between)) Shared) (not (= (what at:(between)) (id ""Diplomat"" P1))) (not (= (what at:(between)) (id ""Diplomat"" P2))) (not (= (what at:(between)) (id ""Diplomat"" P3))) (not (= (what at:(between)) (id ""Diplomat"" P4))) (not (= (what at:(between)) (id ""Diplomat"" P5))) (not (= (what at:(between)) (id ""Diplomat"" P6))) (not (= (what at:(between)) (id ""Diplomat"" P7)))})) (to if:(and {(is Enemy (who at:(to))) (!= (who at:(to)) Shared) (not (= (what at:(to)) (id ""Diplomat"" P1))) (not (= (what at:(to)) (id ""Diplomat"" P2))) (not (= (what at:(to)) (id ""Diplomat"" P3))) (not (= (what at:(to)) (id ""Diplomat"" P4))) (not (= (what at:(to)) (id ""Diplomat"" P5))) (not (= (what at:(to)) (id ""Diplomat"" P6))) (not (= (what at:(to)) (id ""Diplomat"" P7)))}) (apply (if (is Enemy (who at:(to))) (do (if (or {(= (what at:(to)) (id ""General"" P1)) (= (what at:(to)) (id ""General"" P2)) (= (what at:(to)) (id ""General"" P3)) (= (what at:(to)) (id ""General"" P4)) (= (what at:(to)) (id ""General"" P5)) (= (what at:(to)) (id ""General"" P6)) (= (what at:(to)) (id ""General"" P7))}) (add (piece (id ""General"" Mover)) (to (handSite Mover)))) next:(remove (to) (then (addScore Mover 1))))))))) (piece ""Deputy General"" Each (move Slide Orthogonal (between if:(and {(is Empty (between)) (!= (who at:(between)) Shared) (not (= (what at:(between)) (id ""Diplomat"" P1))) (not (= (what at:(between)) (id ""Diplomat"" P2))) (not (= (what at:(between)) (id ""Diplomat"" P3))) (not (= (what at:(between)) (id ""Diplomat"" P4))) (not (= (what at:(between)) (id ""Diplomat"" P5))) (not (= (what at:(between)) (id ""Diplomat"" P6))) (not (= (what at:(between)) (id ""Diplomat"" P7)))})) (to if:(and {(is Enemy (who at:(to))) (!= (who at:(to)) Shared) (not (= (what at:(to)) (id ""Diplomat"" P1))) (not (= (what at:(to)) (id ""Diplomat"" P2))) (not (= (what at:(to)) (id ""Diplomat"" P3))) (not (= (what at:(to)) (id ""Diplomat"" P4))) (not (= (what at:(to)) (id ""Diplomat"" P5))) (not (= (what at:(to)) (id ""Diplomat"" P6))) (not (= (what at:(to)) (id ""Diplomat"" P7)))}) (apply (if (is Enemy (who at:(to))) (do (if (or {(= (what at:(to)) (id ""General"" P1)) (= (what at:(to)) (id ""General"" P2)) (= (what at:(to)) (id ""General"" P3)) (= (what at:(to)) (id ""General"" P4)) (= (what at:(to)) (id ""General"" P5)) (= (what at:(to)) (id ""General"" P6)) (= (what at:(to)) (id ""General"" P7))}) (add (piece (id ""General"" Mover)) (to (handSite Mover)))) next:(remove (to) (then (addScore Mover 1))))))))) (piece ""Officer"" Each (move Slide Diagonal (between if:(and {(is Empty (between)) (!= (who at:(between)) Shared) (not (= (what at:(between)) (id ""Diplomat"" P1))) (not (= (what at:(between)) (id ""Diplomat"" P2))) (not (= (what at:(between)) (id ""Diplomat"" P3))) (not (= (what at:(between)) (id ""Diplomat"" P4))) (not (= (what at:(between)) (id ""Diplomat"" P5))) (not (= (what at:(between)) (id ""Diplomat"" P6))) (not (= (what at:(between)) (id ""Diplomat"" P7)))})) (to if:(and {(is Enemy (who at:(to))) (!= (who at:(to)) Shared) (not (= (what at:(to)) (id ""Diplomat"" P1))) (not (= (what at:(to)) (id ""Diplomat"" P2))) (not (= (what at:(to)) (id ""Diplomat"" P3))) (not (= (what at:(to)) (id ""Diplomat"" P4))) (not (= (what at:(to)) (id ""Diplomat"" P5))) (not (= (what at:(to)) (id ""Diplomat"" P6))) (not (= (what at:(to)) (id ""Diplomat"" P7)))}) (apply (if (is Enemy (who at:(to))) (do (if (or {(= (what at:(to)) (id ""General"" P1)) (= (what at:(to)) (id ""General"" P2)) (= (what at:(to)) (id ""General"" P3)) (= (what at:(to)) (id ""General"" P4)) (= (what at:(to)) (id ""General"" P5)) (= (what at:(to)) (id ""General"" P6)) (= (what at:(to)) (id ""General"" P7))}) (add (piece (id ""General"" Mover)) (to (handSite Mover)))) next:(remove (to) (then (addScore Mover 1))))))))) (piece ""Diplomat"" Each (move Slide All)) (piece ""Archer"" Each (move Hop All (between (exact 3) if:(is Empty (between))) (to if:(or (is Empty (to)) (and {(is Enemy (who at:(to))) (!= (who at:(to)) Shared) (not (= (what at:(to)) (id ""Diplomat"" P1))) (not (= (what at:(to)) (id ""Diplomat"" P2))) (not (= (what at:(to)) (id ""Diplomat"" P3))) (not (= (what at:(to)) (id ""Diplomat"" P4))) (not (= (what at:(to)) (id ""Diplomat"" P5))) (not (= (what at:(to)) (id ""Diplomat"" P6))) (not (= (what at:(to)) (id ""Diplomat"" P7)))})) (apply (if (is Enemy (who at:(to))) (do (if (or {(= (what at:(to)) (id ""General"" P1)) (= (what at:(to)) (id ""General"" P2)) (= (what at:(to)) (id ""General"" P3)) (= (what at:(to)) (id ""General"" P4)) (= (what at:(to)) (id ""General"" P5)) (= (what at:(to)) (id ""General"" P6)) (= (what at:(to)) (id ""General"" P7))}) (add (piece (id ""General"" Mover)) (to (handSite Mover)))) next:(remove (to) (then (addScore Mover 1))))))))) (piece ""CrossBow"" Each (move Hop All (between (exact 4) if:(is Empty (between))) (to if:(or (is Empty (to)) (and {(is Enemy (who at:(to))) (!= (who at:(to)) Shared) (not (= (what at:(to)) (id ""Diplomat"" P1))) (not (= (what at:(to)) (id ""Diplomat"" P2))) (not (= (what at:(to)) (id ""Diplomat"" P3))) (not (= (what at:(to)) (id ""Diplomat"" P4))) (not (= (what at:(to)) (id ""Diplomat"" P5))) (not (= (what at:(to)) (id ""Diplomat"" P6))) (not (= (what at:(to)) (id ""Diplomat"" P7)))})) (apply (if (is Enemy (who at:(to))) (do (if (or {(= (what at:(to)) (id ""General"" P1)) (= (what at:(to)) (id ""General"" P2)) (= (what at:(to)) (id ""General"" P3)) (= (what at:(to)) (id ""General"" P4)) (= (what at:(to)) (id ""General"" P5)) (= (what at:(to)) (id ""General"" P6)) (= (what at:(to)) (id ""General"" P7))}) (add (piece (id ""General"" Mover)) (to (handSite Mover)))) next:(remove (to) (then (addScore Mover 1))))))))) (piece ""Knife"" Each (move Step Diagonal (to if:(or (is Empty (to)) (and {(is Enemy (who at:(to))) (!= (who at:(to)) Shared) (not (= (what at:(to)) (id ""Diplomat"" P1))) (not (= (what at:(to)) (id ""Diplomat"" P2))) (not (= (what at:(to)) (id ""Diplomat"" P3))) (not (= (what at:(to)) (id ""Diplomat"" P4))) (not (= (what at:(to)) (id ""Diplomat"" P5))) (not (= (what at:(to)) (id ""Diplomat"" P6))) (not (= (what at:(to)) (id ""Diplomat"" P7)))})) (apply (if (is Enemy (who at:(to))) (do (if (or {(= (what at:(to)) (id ""General"" P1)) (= (what at:(to)) (id ""General"" P2)) (= (what at:(to)) (id ""General"" P3)) (= (what at:(to)) (id ""General"" P4)) (= (what at:(to)) (id ""General"" P5)) (= (what at:(to)) (id ""General"" P6)) (= (what at:(to)) (id ""General"" P7))}) (add (piece (id ""General"" Mover)) (to (handSite Mover)))) next:(remove (to) (then (addScore Mover 1))))))))) (piece ""Broadsword"" Each (move Step Orthogonal (to if:(or (is Empty (to)) (and {(is Enemy (who at:(to))) (!= (who at:(to)) Shared) (not (= (what at:(to)) (id ""Diplomat"" P1))) (not (= (what at:(to)) (id ""Diplomat"" P2))) (not (= (what at:(to)) (id ""Diplomat"" P3))) (not (= (what at:(to)) (id ""Diplomat"" P4))) (not (= (what at:(to)) (id ""Diplomat"" P5))) (not (= (what at:(to)) (id ""Diplomat"" P6))) (not (= (what at:(to)) (id ""Diplomat"" P7)))})) (apply (if (is Enemy (who at:(to))) (do (if (or {(= (what at:(to)) (id ""General"" P1)) (= (what at:(to)) (id ""General"" P2)) (= (what at:(to)) (id ""General"" P3)) (= (what at:(to)) (id ""General"" P4)) (= (what at:(to)) (id ""General"" P5)) (= (what at:(to)) (id ""General"" P6)) (= (what at:(to)) (id ""General"" P7))}) (add (piece (id ""General"" Mover)) (to (handSite Mover)))) next:(remove (to) (then (addScore Mover 1))))))))) (piece ""Catapult"" Each (or (move Slide Orthogonal) (move Hop Orthogonal (between before:(count Rows) after:(count Rows) if:(is Friend (who at:(between)))) (to if:(is Empty (to)) (apply if:(and {(is Enemy (who at:(to))) (!= (who at:(to)) Shared) (not (= (what at:(to)) (id ""Diplomat"" P1))) (not (= (what at:(to)) (id ""Diplomat"" P2))) (not (= (what at:(to)) (id ""Diplomat"" P3))) (not (= (what at:(to)) (id ""Diplomat"" P4))) (not (= (what at:(to)) (id ""Diplomat"" P5))) (not (= (what at:(to)) (id ""Diplomat"" P6))) (not (= (what at:(to)) (id ""Diplomat"" P7)))}) (do (if (or {(= (what at:(to)) (id ""General"" P1)) (= (what at:(to)) (id ""General"" P2)) (= (what at:(to)) (id ""General"" P3)) (= (what at:(to)) (id ""General"" P4)) (= (what at:(to)) (id ""General"" P5)) (= (what at:(to)) (id ""General"" P6)) (= (what at:(to)) (id ""General"" P7))}) (add (piece (id ""General"" Mover)) (to (handSite Mover)))) next:(remove (to) (then (addScore Mover 1))))))))) (piece ""Knight"" Each (forEach Direction Orthogonal (to if:(is Empty (to)) (apply (forEach Direction (from (to)) (directions {FR FL} of:All) (between (exact 3) if:(is Empty (between))) (if (or (is Empty (to)) (and {(is Enemy (who at:(to))) (!= (who at:(to)) Shared) (not (= (what at:(to)) (id ""Diplomat"" P1))) (not (= (what at:(to)) (id ""Diplomat"" P2))) (not (= (what at:(to)) (id ""Diplomat"" P3))) (not (= (what at:(to)) (id ""Diplomat"" P4))) (not (= (what at:(to)) (id ""Diplomat"" P5))) (not (= (what at:(to)) (id ""Diplomat"" P6))) (not (= (what at:(to)) (id ""Diplomat"" P7)))})) (move (from) (to (apply if:(is Enemy (who at:(to))) (do (if (or {(= (what at:(to)) (id ""General"" P1)) (= (what at:(to)) (id ""General"" P2)) (= (what at:(to)) (id ""General"" P3)) (= (what at:(to)) (id ""General"" P4)) (= (what at:(to)) (id ""General"" P5)) (= (what at:(to)) (id ""General"" P6)) (= (what at:(to)) (id ""General"" P7))}) (add (piece (id ""General"" Mover)) (to (handSite Mover)))) next:(remove (to) (then (addScore Mover 1))))))))))))) (hand Each)}) (rules (start {(place ""King"" (centrePoint)) (place ""General1"" coord:""A10"") (place ""General2"" coord:""F1"") (place ""General3"" coord:""N1"") (place ""General4"" coord:""S6"") (place ""General5"" coord:""S14"") (place ""General6"" coord:""N19"") (place ""General7"" coord:""F19"") (place ""Deputy General1"" coord:""A11"") (place ""Deputy General2"" coord:""E1"") (place ""Deputy General3"" coord:""M1"") (place ""Deputy General4"" coord:""S5"") (place ""Deputy General5"" coord:""S13"") (place ""Deputy General6"" coord:""O19"") (place ""Deputy General7"" coord:""G19"") (place ""Officer1"" coord:""A9"") (place ""Officer2"" coord:""G1"") (place ""Officer3"" coord:""O1"") (place ""Officer4"" coord:""S7"") (place ""Officer5"" coord:""S15"") (place ""Officer6"" coord:""M19"") (place ""Officer7"" coord:""E19"") (place ""Catapult1"" coord:""B10"") (place ""Catapult2"" coord:""F2"") (place ""Catapult3"" coord:""N2"") (place ""Catapult4"" coord:""R6"") (place ""Catapult5"" coord:""R14"") (place ""Catapult6"" coord:""N18"") (place ""Catapult7"" coord:""F18"") (place ""Broadsword1"" {""A12"" ""B11"" ""B9"" ""A8""}) (place ""Broadsword2"" {""D1"" ""E2"" ""G2"" ""H1""}) (place ""Broadsword3"" {""L1"" ""M2"" ""O2"" ""P1""}) (place ""Broadsword4"" {""S4"" ""R5"" ""R7"" ""S8""}) (place ""Broadsword5"" {""S12"" ""R13"" ""R15"" ""S16""}) (place ""Broadsword6"" {""P19"" ""O18"" ""M18"" ""L19""}) (place ""Broadsword7"" {""H19"" ""G18"" ""E18"" ""D19""}) (place ""Knight1"" {""A13"" ""B12"" ""B8"" ""A7""}) (place ""Knight2"" {""C1"" ""D2"" ""H2"" ""I1""}) (place ""Knight3"" {""K1"" ""L2"" ""P2"" ""Q1""}) (place ""Knight4"" {""S3"" ""R4"" ""R8"" ""S9""}) (place ""Knight5"" {""S11"" ""R12"" ""R16"" ""S17""}) (place ""Knight6"" {""P18"" ""Q19"" ""L18"" ""K19""}) (place ""Knight7"" {""H18"" ""I19"" ""D18"" ""C19""}) (place ""CrossBow1"" coord:""C10"") (place ""CrossBow2"" coord:""F3"") (place ""CrossBow3"" coord:""N3"") (place ""CrossBow4"" coord:""Q6"") (place ""CrossBow5"" coord:""Q14"") (place ""CrossBow6"" coord:""N17"") (place ""CrossBow7"" coord:""F17"") (place ""Knife1"" {""C9"" ""C11""}) (place ""Knife2"" {""E3"" ""G3""}) (place ""Knife3"" {""M3"" ""O3""}) (place ""Knife4"" {""Q5"" ""Q7""}) (place ""Knife5"" {""Q13"" ""Q15""}) (place ""Knife6"" {""O17"" ""M17""}) (place ""Knife7"" {""G17"" ""E17""}) (place ""Archer1"" coord:""D10"") (place ""Archer2"" coord:""F4"") (place ""Archer3"" coord:""N4"") (place ""Archer4"" coord:""P6"") (place ""Archer5"" coord:""P14"") (place ""Archer6"" coord:""N16"") (place ""Archer7"" coord:""F16"") (place ""Diplomat1"" coord:""E10"") (place ""Diplomat2"" coord:""F5"") (place ""Diplomat3"" coord:""N5"") (place ""Diplomat4"" coord:""O6"") (place ""Diplomat5"" coord:""O14"") (place ""Diplomat6"" coord:""N15"") (place ""Diplomat7"" coord:""F15"")}) (play (forEach Piece (then (and {(if (and (is Active P1) (or (<= (count Pieces P1 in:(sites Board)) 7) (= (where ""General"" P1) -1))) (remove (sites Occupied by:P1 container:""Board""))) (if (and (is Active P2) (or (<= (count Pieces P2 in:(sites Board)) 7) (= (where ""General"" P2) -1))) (remove (sites Occupied by:P2 container:""Board""))) (if (and (is Active P3) (or (<= (count Pieces P3 in:(sites Board)) 7) (= (where ""General"" P3) -1))) (remove (sites Occupied by:P3 container:""Board""))) (if (and (is Active P4) (or (<= (count Pieces P4 in:(sites Board)) 7) (= (where ""General"" P4) -1))) (remove (sites Occupied by:P4 container:""Board""))) (if (and (is Active P5) (or (<= (count Pieces P5 in:(sites Board)) 7) (= (where ""General"" P5) -1))) (remove (sites Occupied by:P5 container:""Board""))) (if (and (is Active P6) (or (<= (count Pieces P6 in:(sites Board)) 7) (= (where ""General"" P6) -1))) (remove (sites Occupied by:P6 container:""Board""))) (if (and (is Active P7) (or (<= (count Pieces P7 in:(sites Board)) 7) (= (where ""General"" P7) -1))) (remove (sites Occupied by:P7 container:""Board"")))})))) (end {(if (= (count Pieces P1 in:(sites Board)) 0) (result P1 Loss)) (if (= (count Pieces P2 in:(sites Board)) 0) (result P2 Loss)) (if (= (count Pieces P3 in:(sites Board)) 0) (result P3 Loss)) (if (= (count Pieces P4 in:(sites Board)) 0) (result P4 Loss)) (if (= (count Pieces P5 in:(sites Board)) 0) (result P5 Loss)) (if (= (count Pieces P6 in:(sites Board)) 0) (result P6 Loss)) (if (= (count Pieces P7 in:(sites Board)) 0) (result P7 Loss)) (if (or (= (score Mover) 30) (= 2 (count Cell at:(handSite Mover)))) (byScore))})))" All rules are the same as regular Xiangqi.,"(game ""Xiang Hex"" (players {(player N) (player S)}) (equipment {(board (renumber Cell (rotate 90 (remove (hex Rectangle 9 11) cells:{0 1 11 21 63 74 85 84 94 93 83 73 31 20 9 10})))) (piece ""Jiang"" Each (move Step Orthogonal (to if:(and (is In (to) (sites Mover ""Palace"")) (not (is Friend (who at:(to))))) (apply (remove (to)))))) (piece ""Shi"" Each (move Step Diagonal (to if:(and (is In (to) (sites Mover ""Palace"")) (not (is Friend (who at:(to))))) (apply (remove (to)))))) (piece ""Xiang"" Each (move Slide Diagonal (between (exact 2) if:(and {(is In (between) (sites Mover ""Home"")) (is Empty (between))})) (to if:(is Enemy (who at:(to))) (apply (remove (to)))))) (piece ""Ma"" Each (forEach Direction Orthogonal (to if:(is Empty (to)) (apply (forEach Direction (from (to)) (directions {FR FL} of:All) (if (not (is Friend (who at:(to)))) (move (from) (to (apply if:(is Enemy (who at:(to))) (remove (to))))))))))) (piece ""Ju"" Each (move Slide Orthogonal (to if:(is Enemy (who at:(to))) (apply (remove (to)))))) (piece ""Pao"" Each (or (move Slide Orthogonal) (move Hop Orthogonal (between before:(count Rows) after:(count Rows) if:(is Occupied (between))) (to if:(is Empty (to)) (apply if:(is Enemy (who at:(to))) (remove (to))))))) (piece ""Zu"" Each (move Step (if (is In (from) (sites Mover ""Home"")) Forward (union (directions {Forward FL FR}) (directions {W E}))) (to if:(not (is Friend (who at:(to)))) (apply (remove (to)))))) (regions ""PalaceP1"" P1 {0 1 2 4 7 8 12}) (regions ""PalaceP2"" P2 {66 70 71 74 76 77 78}) (regions ""Home"" P1 (forEach (sites Board) if:(< (site) 37))) (regions ""Home"" P2 (forEach (sites Board) if:(> (site) 41)))}) (rules (start {(place ""Jiang1"" coord:""A1"") (place ""Shi1"" {""A2"" ""B1""}) (place ""Xiang1"" {""A3"" ""C1""}) (place ""Ma1"" {""A4"" ""D1""}) (place ""Ju1"" {""A5"" ""E1""}) (place ""Pao1"" {""B5"" ""E2""}) (place ""Zu1"" {""B6"" ""C5"" ""D4"" ""E3"" ""F2""}) (place ""Jiang2"" coord:""K11"") (place ""Shi2"" {""J11"" ""K10""}) (place ""Xiang2"" {""I11"" ""K9""}) (place ""Ma2"" {""H11"" ""K8""}) (place ""Ju2"" {""G11"" ""K7""}) (place ""Pao2"" {""G10"" ""J7""}) (place ""Zu2"" {""F10"" ""G9"" ""H8"" ""I7"" ""J6""})}) (play (do (forEach Piece) ifAfterwards:(and (if (= (column of:(where ""Jiang"" P1)) (column of:(where ""Jiang"" P2))) (not (= (count Sites in:(forEach (sites Direction from:(where ""Jiang"" P1) N stop:(= (to) (where ""Jiang"" P2))) if:(is Occupied (site)))) 0)) True) (not (is Threatened (id ""Jiang"" Mover)))))) (end {(if (and (is Threatened (id ""Jiang"" Next)) (not (can Move (do (forEach Piece Next) ifAfterwards:(not (is Threatened (id ""Jiang"" Next))))))) (result Mover Win)) (if (no Moves Next) (result Mover Win))})))","###Description All rules are the same as regular Xiangqi. @@ -4864,11 +4714,6 @@ Six or more players (even number), played on two teams. The games Aj Sayil, Aj T ###Ludii (game ""Chaturaji"" (players {(player N) (player W) (player S) (player E)}) (equipment {(board (square 8)) (dice d:4 from:2 num:1) (piece ""Pawn"" Each (or (move Step Forward (to if:(is Empty (to)))) (move Step (directions {FR FL}) (to if:(is Enemy (who at:(to))) (apply (if (is Occupied (to)) (and (addScore Mover (value Piece at:(to))) (remove (to))))))) (then (if (is In (last To) (sites Mover ""Promotion"")) (and (moveAgain) (set Pending)))))) (piece ""Boat"" Each (move Hop Diagonal (to if:(not (is Friend (who at:(to)))) (apply (if (is Occupied (to)) (and (addScore Mover (value Piece at:(to))) (remove (to)))))))) (piece ""Knight"" Each (move Leap {{F F R F} {F F L F}} (to if:(not (is Friend (who at:(to)))) (apply (if (is Occupied (to)) (and (addScore Mover (value Piece at:(to))) (remove (to)))))))) (piece ""Elephant"" Each (move Slide Orthogonal (between if:(is Empty (between))) (to if:(is Enemy (who at:(to))) (apply (if (is Occupied (to)) (and (addScore Mover (value Piece at:(to))) (remove (to)))))))) (piece ""King_noCross"" Each (move Step (to if:(not (is Friend (who at:(to)))) (apply (if (is Occupied (to)) (and (addScore Mover (value Piece at:(to))) (remove (to)))))))) (regions ""Promotion"" P1 (sites Top)) (regions ""Promotion"" P2 (sites Left)) (regions ""Promotion"" P3 (sites Bottom)) (regions ""Promotion"" P4 (sites Right))}) (rules (start {(place ""Pawn1"" {""A2"" ""B2"" ""C2"" ""D2""} value:1) (place ""Pawn2"" {""G1"" ""G2"" ""G3"" ""G4""} value:1) (place ""Pawn3"" {""H7"" ""G7"" ""E7"" ""F7""} value:1) (place ""Pawn4"" {""B5"" ""B6"" ""B7"" ""B8""} value:1) (place ""Boat1"" coord:""A1"" value:2) (place ""Boat2"" coord:""H1"" value:2) (place ""Boat3"" coord:""H8"" value:2) (place ""Boat4"" coord:""A8"" value:2) (place ""Knight1"" coord:""B1"" value:3) (place ""Knight2"" coord:""H2"" value:3) (place ""Knight3"" coord:""G8"" value:3) (place ""Knight4"" coord:""A7"" value:3) (place ""Elephant1"" coord:""C1"" value:4) (place ""Elephant2"" coord:""H3"" value:4) (place ""Elephant3"" coord:""F8"" value:4) (place ""Elephant4"" coord:""A6"" value:4) (place ""King_noCross1"" coord:""D1"" value:5) (place ""King_noCross2"" coord:""H4"" value:5) (place ""King_noCross3"" coord:""E8"" value:5) (place ""King_noCross4"" coord:""A5"" value:5)}) (play (do (if (not (is Prev Mover)) (roll)) next:(if (and (is Prev Mover) (is Pending)) (or {(if (= (where ""Boat"" Mover) -1) (move Promote (last To) (piece ""Boat"") Mover (then (set Value at:(last To) 2)))) (if (= (where ""Knight"" Mover) -1) (move Promote (last To) (piece ""Knight"") Mover (then (set Value at:(last To) 3)))) (if (= (where ""Elephant"" Mover) -1) (move Promote (last To) (piece ""Elephant"") Mover (then (set Value at:(last To) 4)))) (if (= (where ""King_noCross"" Mover) -1) (move Promote (last To) (piece ""King_noCross"") Mover (then (set Value at:(last To) 5))))}) (forEach Die (if (= (pips) 5) (or (forEach Piece ""Pawn"") (forEach Piece ""King_noCross"")) (if (= (pips) 4) (forEach Piece ""Elephant"") (if (= (pips) 3) (forEach Piece ""Knight"") (if (= (pips) 2) (forEach Piece ""Boat"")))))) (then (if (can Move (forEach Die (if (= (pips) 5) (or (forEach Piece ""Pawn"") (forEach Piece ""King_noCross"")) (if (= (pips) 4) (forEach Piece ""Elephant"") (if (= (pips) 3) (forEach Piece ""Knight"") (if (= (pips) 2) (forEach Piece ""Boat""))))))) (moveAgain)))))) (end (if (= (count Pieces Mover) (- (count Pieces All) 1)) (byScore)))))" -"Twenty-three spaces are arranged in a line: the outer space on each side and the central space are a circular holes, the intervening spaces are vertically-oriented trenches. A stick is laid in each trench, and a stick is stuck into the ground in each end hole, one belonging to each player. They move their sticks toward the opposite end of the track and then go back to their starting point, according to the throw of four stick dice, with one flat and one convex side. The values of the throws are as follows: 4 convex sides up = 4, 3=0, 2=1, 1=0, 0=2. Players continue to throw and move until obtaining a result of 0. When the player passes the central hole, they remove the sticks from the trenches in which they land. If the player lands in the central hole, and throws a 0 on their next throw, they must then return to the space nearest to their home still containing a stick. If the player lands on the same place as the opponent, the opponent is sent back to the space nearest their home which still has a stick in it, thus eliminating this stick. The goal is to eliminate all of the sticks from the opponent's side of the board and then to land on the same space as the opponent's playing stick. If both players are in the end stage and trying to land on each other, and a player lands in the central space and then throws a 0, the game is a draw.","(game ""Chukaray"" (players 2) (equipment {(board (rectangle 1 25) {(track ""Track1"" {0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23} loop:True P1) (track ""Track2"" {23 22 21 20 19 18 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0} loop:True P2)} use:Edge) (dice d:2 from:0 num:4) (piece ""Stick"" Each (move (from (from) level:(level)) (to (trackSite Move from:(from) steps:(mapEntry ""Throw"" (count Pips))) if:True (apply (and (if (is Enemy (who at:(to))) (if (= (if (= (who at:(to)) P1) (if (= (id ""Stick"" Neutral) (what at:1)) 1 (if (= (id ""Stick"" Neutral) (what at:2)) 2 (if (= (id ""Stick"" Neutral) (what at:3)) 3 (if (= (id ""Stick"" Neutral) (what at:4)) 4 (if (= (id ""Stick"" Neutral) (what at:5)) 5 (if (= (id ""Stick"" Neutral) (what at:6)) 6 (if (= (id ""Stick"" Neutral) (what at:7)) 7 (if (= (id ""Stick"" Neutral) (what at:8)) 8 (if (= (id ""Stick"" Neutral) (what at:9)) 9 (if (= (id ""Stick"" Neutral) (what at:10)) 10 (if (= (id ""Stick"" Neutral) (what at:11)) 11 -1))))))))))) (if (= (id ""Stick"" Neutral) (what at:22)) 22 (if (= (id ""Stick"" Neutral) (what at:21)) 21 (if (= (id ""Stick"" Neutral) (what at:20)) 20 (if (= (id ""Stick"" Neutral) (what at:19)) 19 (if (= (id ""Stick"" Neutral) (what at:18)) 18 (if (= (id ""Stick"" Neutral) (what at:17)) 17 (if (= (id ""Stick"" Neutral) (what at:16)) 16 (if (= (id ""Stick"" Neutral) (what at:15)) 15 (if (= (id ""Stick"" Neutral) (what at:14)) 14 (if (= (id ""Stick"" Neutral) (what at:13)) 13 (if (= (id ""Stick"" Neutral) (what at:12)) 12 -1)))))))))))) -1) (remove (to)) (fromTo (from (to)) (to (if (= (who at:(to)) P1) (if (= (id ""Stick"" Neutral) (what at:1)) 1 (if (= (id ""Stick"" Neutral) (what at:2)) 2 (if (= (id ""Stick"" Neutral) (what at:3)) 3 (if (= (id ""Stick"" Neutral) (what at:4)) 4 (if (= (id ""Stick"" Neutral) (what at:5)) 5 (if (= (id ""Stick"" Neutral) (what at:6)) 6 (if (= (id ""Stick"" Neutral) (what at:7)) 7 (if (= (id ""Stick"" Neutral) (what at:8)) 8 (if (= (id ""Stick"" Neutral) (what at:9)) 9 (if (= (id ""Stick"" Neutral) (what at:10)) 10 (if (= (id ""Stick"" Neutral) (what at:11)) 11 -1))))))))))) (if (= (id ""Stick"" Neutral) (what at:22)) 22 (if (= (id ""Stick"" Neutral) (what at:21)) 21 (if (= (id ""Stick"" Neutral) (what at:20)) 20 (if (= (id ""Stick"" Neutral) (what at:19)) 19 (if (= (id ""Stick"" Neutral) (what at:18)) 18 (if (= (id ""Stick"" Neutral) (what at:17)) 17 (if (= (id ""Stick"" Neutral) (what at:16)) 16 (if (= (id ""Stick"" Neutral) (what at:15)) 15 (if (= (id ""Stick"" Neutral) (what at:14)) 14 (if (= (id ""Stick"" Neutral) (what at:13)) 13 (if (= (id ""Stick"" Neutral) (what at:12)) 12 -1)))))))))))))))) (if (and {(is Occupied (to)) (= (what at:(to) level:0) (id ""Stick"" Neutral)) (is In (to) (sites Next ""Side""))}) (remove (to) level:0))))))) (piece ""Stick"" Neutral) (map ""Throw"" {(pair 0 2) (pair 1 0) (pair 2 1) (pair 3 0) (pair 4 4)}) (regions ""Side"" P1 (sites {0 1 2 3 4 5 6 7 8 9 10 11})) (regions ""Side"" P2 (sites {13 14 15 16 17 18 19 20 21 22 23}))}) (rules (start {(place Stack ""Stick1"" 0) (place Stack ""Stick2"" 23) (place Stack ""Stick0"" (sites {1 2 3 4 5 6 7 8 9 10 11 13 14 15 16 17 18 19 20 21 22}))}) (play (do (roll) next:(if (!= 0 (mapEntry ""Throw"" (count Pips))) (forEach Piece) (if (= 12 (where ""Stick"" Mover)) (if (!= (if (= (mover) P1) (if (= (id ""Stick"" Neutral) (what at:1)) 1 (if (= (id ""Stick"" Neutral) (what at:2)) 2 (if (= (id ""Stick"" Neutral) (what at:3)) 3 (if (= (id ""Stick"" Neutral) (what at:4)) 4 (if (= (id ""Stick"" Neutral) (what at:5)) 5 (if (= (id ""Stick"" Neutral) (what at:6)) 6 (if (= (id ""Stick"" Neutral) (what at:7)) 7 (if (= (id ""Stick"" Neutral) (what at:8)) 8 (if (= (id ""Stick"" Neutral) (what at:9)) 9 (if (= (id ""Stick"" Neutral) (what at:10)) 10 (if (= (id ""Stick"" Neutral) (what at:11)) 11 -1))))))))))) (if (= (id ""Stick"" Neutral) (what at:22)) 22 (if (= (id ""Stick"" Neutral) (what at:21)) 21 (if (= (id ""Stick"" Neutral) (what at:20)) 20 (if (= (id ""Stick"" Neutral) (what at:19)) 19 (if (= (id ""Stick"" Neutral) (what at:18)) 18 (if (= (id ""Stick"" Neutral) (what at:17)) 17 (if (= (id ""Stick"" Neutral) (what at:16)) 16 (if (= (id ""Stick"" Neutral) (what at:15)) 15 (if (= (id ""Stick"" Neutral) (what at:14)) 14 (if (= (id ""Stick"" Neutral) (what at:13)) 13 (if (= (id ""Stick"" Neutral) (what at:12)) 12 -1)))))))))))) -1) (move (from (where ""Stick"" Mover)) (to (if (= (mover) P1) (if (= (id ""Stick"" Neutral) (what at:1)) 1 (if (= (id ""Stick"" Neutral) (what at:2)) 2 (if (= (id ""Stick"" Neutral) (what at:3)) 3 (if (= (id ""Stick"" Neutral) (what at:4)) 4 (if (= (id ""Stick"" Neutral) (what at:5)) 5 (if (= (id ""Stick"" Neutral) (what at:6)) 6 (if (= (id ""Stick"" Neutral) (what at:7)) 7 (if (= (id ""Stick"" Neutral) (what at:8)) 8 (if (= (id ""Stick"" Neutral) (what at:9)) 9 (if (= (id ""Stick"" Neutral) (what at:10)) 10 (if (= (id ""Stick"" Neutral) (what at:11)) 11 -1))))))))))) (if (= (id ""Stick"" Neutral) (what at:22)) 22 (if (= (id ""Stick"" Neutral) (what at:21)) 21 (if (= (id ""Stick"" Neutral) (what at:20)) 20 (if (= (id ""Stick"" Neutral) (what at:19)) 19 (if (= (id ""Stick"" Neutral) (what at:18)) 18 (if (= (id ""Stick"" Neutral) (what at:17)) 17 (if (= (id ""Stick"" Neutral) (what at:16)) 16 (if (= (id ""Stick"" Neutral) (what at:15)) 15 (if (= (id ""Stick"" Neutral) (what at:14)) 14 (if (= (id ""Stick"" Neutral) (what at:13)) 13 (if (= (id ""Stick"" Neutral) (what at:12)) 12 -1)))))))))))))) (if (and (= (if (= (mover) P1) (if (= (id ""Stick"" Neutral) (what at:1)) 1 (if (= (id ""Stick"" Neutral) (what at:2)) 2 (if (= (id ""Stick"" Neutral) (what at:3)) 3 (if (= (id ""Stick"" Neutral) (what at:4)) 4 (if (= (id ""Stick"" Neutral) (what at:5)) 5 (if (= (id ""Stick"" Neutral) (what at:6)) 6 (if (= (id ""Stick"" Neutral) (what at:7)) 7 (if (= (id ""Stick"" Neutral) (what at:8)) 8 (if (= (id ""Stick"" Neutral) (what at:9)) 9 (if (= (id ""Stick"" Neutral) (what at:10)) 10 (if (= (id ""Stick"" Neutral) (what at:11)) 11 -1))))))))))) (if (= (id ""Stick"" Neutral) (what at:22)) 22 (if (= (id ""Stick"" Neutral) (what at:21)) 21 (if (= (id ""Stick"" Neutral) (what at:20)) 20 (if (= (id ""Stick"" Neutral) (what at:19)) 19 (if (= (id ""Stick"" Neutral) (what at:18)) 18 (if (= (id ""Stick"" Neutral) (what at:17)) 17 (if (= (id ""Stick"" Neutral) (what at:16)) 16 (if (= (id ""Stick"" Neutral) (what at:15)) 15 (if (= (id ""Stick"" Neutral) (what at:14)) 14 (if (= (id ""Stick"" Neutral) (what at:13)) 13 (if (= (id ""Stick"" Neutral) (what at:12)) 12 -1)))))))))))) -1) (= (if (= (next) P1) (if (= (id ""Stick"" Neutral) (what at:1)) 1 (if (= (id ""Stick"" Neutral) (what at:2)) 2 (if (= (id ""Stick"" Neutral) (what at:3)) 3 (if (= (id ""Stick"" Neutral) (what at:4)) 4 (if (= (id ""Stick"" Neutral) (what at:5)) 5 (if (= (id ""Stick"" Neutral) (what at:6)) 6 (if (= (id ""Stick"" Neutral) (what at:7)) 7 (if (= (id ""Stick"" Neutral) (what at:8)) 8 (if (= (id ""Stick"" Neutral) (what at:9)) 9 (if (= (id ""Stick"" Neutral) (what at:10)) 10 (if (= (id ""Stick"" Neutral) (what at:11)) 11 -1))))))))))) (if (= (id ""Stick"" Neutral) (what at:22)) 22 (if (= (id ""Stick"" Neutral) (what at:21)) 21 (if (= (id ""Stick"" Neutral) (what at:20)) 20 (if (= (id ""Stick"" Neutral) (what at:19)) 19 (if (= (id ""Stick"" Neutral) (what at:18)) 18 (if (= (id ""Stick"" Neutral) (what at:17)) 17 (if (= (id ""Stick"" Neutral) (what at:16)) 16 (if (= (id ""Stick"" Neutral) (what at:15)) 15 (if (= (id ""Stick"" Neutral) (what at:14)) 14 (if (= (id ""Stick"" Neutral) (what at:13)) 13 (if (= (id ""Stick"" Neutral) (what at:12)) 12 -1)))))))))))) -1)) (move Pass (then (trigger ""Draw"" Mover))))))) (then (if (!= 0 (mapEntry ""Throw"" (count Pips))) (moveAgain))))) (end {(if (no Pieces Next) (result Next Loss)) (if (is Triggered ""Draw"" Mover) (result Mover Draw))})))","###Description -Twenty-three spaces are arranged in a line: the outer space on each side and the central space are a circular holes, the intervening spaces are vertically-oriented trenches. A stick is laid in each trench, and a stick is stuck into the ground in each end hole, one belonging to each player. They move their sticks toward the opposite end of the track and then go back to their starting point, according to the throw of four stick dice, with one flat and one convex side. The values of the throws are as follows: 4 convex sides up = 4, 3=0, 2=1, 1=0, 0=2. Players continue to throw and move until obtaining a result of 0. When the player passes the central hole, they remove the sticks from the trenches in which they land. If the player lands in the central hole, and throws a 0 on their next throw, they must then return to the space nearest to their home still containing a stick. If the player lands on the same place as the opponent, the opponent is sent back to the space nearest their home which still has a stick in it, thus eliminating this stick. The goal is to eliminate all of the sticks from the opponent's side of the board and then to land on the same space as the opponent's playing stick. If both players are in the end stage and trying to land on each other, and a player lands in the central space and then throws a 0, the game is a draw. - -###Ludii -(game ""Chukaray"" (players 2) (equipment {(board (rectangle 1 25) {(track ""Track1"" {0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23} loop:True P1) (track ""Track2"" {23 22 21 20 19 18 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0} loop:True P2)} use:Edge) (dice d:2 from:0 num:4) (piece ""Stick"" Each (move (from (from) level:(level)) (to (trackSite Move from:(from) steps:(mapEntry ""Throw"" (count Pips))) if:True (apply (and (if (is Enemy (who at:(to))) (if (= (if (= (who at:(to)) P1) (if (= (id ""Stick"" Neutral) (what at:1)) 1 (if (= (id ""Stick"" Neutral) (what at:2)) 2 (if (= (id ""Stick"" Neutral) (what at:3)) 3 (if (= (id ""Stick"" Neutral) (what at:4)) 4 (if (= (id ""Stick"" Neutral) (what at:5)) 5 (if (= (id ""Stick"" Neutral) (what at:6)) 6 (if (= (id ""Stick"" Neutral) (what at:7)) 7 (if (= (id ""Stick"" Neutral) (what at:8)) 8 (if (= (id ""Stick"" Neutral) (what at:9)) 9 (if (= (id ""Stick"" Neutral) (what at:10)) 10 (if (= (id ""Stick"" Neutral) (what at:11)) 11 -1))))))))))) (if (= (id ""Stick"" Neutral) (what at:22)) 22 (if (= (id ""Stick"" Neutral) (what at:21)) 21 (if (= (id ""Stick"" Neutral) (what at:20)) 20 (if (= (id ""Stick"" Neutral) (what at:19)) 19 (if (= (id ""Stick"" Neutral) (what at:18)) 18 (if (= (id ""Stick"" Neutral) (what at:17)) 17 (if (= (id ""Stick"" Neutral) (what at:16)) 16 (if (= (id ""Stick"" Neutral) (what at:15)) 15 (if (= (id ""Stick"" Neutral) (what at:14)) 14 (if (= (id ""Stick"" Neutral) (what at:13)) 13 (if (= (id ""Stick"" Neutral) (what at:12)) 12 -1)))))))))))) -1) (remove (to)) (fromTo (from (to)) (to (if (= (who at:(to)) P1) (if (= (id ""Stick"" Neutral) (what at:1)) 1 (if (= (id ""Stick"" Neutral) (what at:2)) 2 (if (= (id ""Stick"" Neutral) (what at:3)) 3 (if (= (id ""Stick"" Neutral) (what at:4)) 4 (if (= (id ""Stick"" Neutral) (what at:5)) 5 (if (= (id ""Stick"" Neutral) (what at:6)) 6 (if (= (id ""Stick"" Neutral) (what at:7)) 7 (if (= (id ""Stick"" Neutral) (what at:8)) 8 (if (= (id ""Stick"" Neutral) (what at:9)) 9 (if (= (id ""Stick"" Neutral) (what at:10)) 10 (if (= (id ""Stick"" Neutral) (what at:11)) 11 -1))))))))))) (if (= (id ""Stick"" Neutral) (what at:22)) 22 (if (= (id ""Stick"" Neutral) (what at:21)) 21 (if (= (id ""Stick"" Neutral) (what at:20)) 20 (if (= (id ""Stick"" Neutral) (what at:19)) 19 (if (= (id ""Stick"" Neutral) (what at:18)) 18 (if (= (id ""Stick"" Neutral) (what at:17)) 17 (if (= (id ""Stick"" Neutral) (what at:16)) 16 (if (= (id ""Stick"" Neutral) (what at:15)) 15 (if (= (id ""Stick"" Neutral) (what at:14)) 14 (if (= (id ""Stick"" Neutral) (what at:13)) 13 (if (= (id ""Stick"" Neutral) (what at:12)) 12 -1)))))))))))))))) (if (and {(is Occupied (to)) (= (what at:(to) level:0) (id ""Stick"" Neutral)) (is In (to) (sites Next ""Side""))}) (remove (to) level:0))))))) (piece ""Stick"" Neutral) (map ""Throw"" {(pair 0 2) (pair 1 0) (pair 2 1) (pair 3 0) (pair 4 4)}) (regions ""Side"" P1 (sites {0 1 2 3 4 5 6 7 8 9 10 11})) (regions ""Side"" P2 (sites {13 14 15 16 17 18 19 20 21 22 23}))}) (rules (start {(place Stack ""Stick1"" 0) (place Stack ""Stick2"" 23) (place Stack ""Stick0"" (sites {1 2 3 4 5 6 7 8 9 10 11 13 14 15 16 17 18 19 20 21 22}))}) (play (do (roll) next:(if (!= 0 (mapEntry ""Throw"" (count Pips))) (forEach Piece) (if (= 12 (where ""Stick"" Mover)) (if (!= (if (= (mover) P1) (if (= (id ""Stick"" Neutral) (what at:1)) 1 (if (= (id ""Stick"" Neutral) (what at:2)) 2 (if (= (id ""Stick"" Neutral) (what at:3)) 3 (if (= (id ""Stick"" Neutral) (what at:4)) 4 (if (= (id ""Stick"" Neutral) (what at:5)) 5 (if (= (id ""Stick"" Neutral) (what at:6)) 6 (if (= (id ""Stick"" Neutral) (what at:7)) 7 (if (= (id ""Stick"" Neutral) (what at:8)) 8 (if (= (id ""Stick"" Neutral) (what at:9)) 9 (if (= (id ""Stick"" Neutral) (what at:10)) 10 (if (= (id ""Stick"" Neutral) (what at:11)) 11 -1))))))))))) (if (= (id ""Stick"" Neutral) (what at:22)) 22 (if (= (id ""Stick"" Neutral) (what at:21)) 21 (if (= (id ""Stick"" Neutral) (what at:20)) 20 (if (= (id ""Stick"" Neutral) (what at:19)) 19 (if (= (id ""Stick"" Neutral) (what at:18)) 18 (if (= (id ""Stick"" Neutral) (what at:17)) 17 (if (= (id ""Stick"" Neutral) (what at:16)) 16 (if (= (id ""Stick"" Neutral) (what at:15)) 15 (if (= (id ""Stick"" Neutral) (what at:14)) 14 (if (= (id ""Stick"" Neutral) (what at:13)) 13 (if (= (id ""Stick"" Neutral) (what at:12)) 12 -1)))))))))))) -1) (move (from (where ""Stick"" Mover)) (to (if (= (mover) P1) (if (= (id ""Stick"" Neutral) (what at:1)) 1 (if (= (id ""Stick"" Neutral) (what at:2)) 2 (if (= (id ""Stick"" Neutral) (what at:3)) 3 (if (= (id ""Stick"" Neutral) (what at:4)) 4 (if (= (id ""Stick"" Neutral) (what at:5)) 5 (if (= (id ""Stick"" Neutral) (what at:6)) 6 (if (= (id ""Stick"" Neutral) (what at:7)) 7 (if (= (id ""Stick"" Neutral) (what at:8)) 8 (if (= (id ""Stick"" Neutral) (what at:9)) 9 (if (= (id ""Stick"" Neutral) (what at:10)) 10 (if (= (id ""Stick"" Neutral) (what at:11)) 11 -1))))))))))) (if (= (id ""Stick"" Neutral) (what at:22)) 22 (if (= (id ""Stick"" Neutral) (what at:21)) 21 (if (= (id ""Stick"" Neutral) (what at:20)) 20 (if (= (id ""Stick"" Neutral) (what at:19)) 19 (if (= (id ""Stick"" Neutral) (what at:18)) 18 (if (= (id ""Stick"" Neutral) (what at:17)) 17 (if (= (id ""Stick"" Neutral) (what at:16)) 16 (if (= (id ""Stick"" Neutral) (what at:15)) 15 (if (= (id ""Stick"" Neutral) (what at:14)) 14 (if (= (id ""Stick"" Neutral) (what at:13)) 13 (if (= (id ""Stick"" Neutral) (what at:12)) 12 -1)))))))))))))) (if (and (= (if (= (mover) P1) (if (= (id ""Stick"" Neutral) (what at:1)) 1 (if (= (id ""Stick"" Neutral) (what at:2)) 2 (if (= (id ""Stick"" Neutral) (what at:3)) 3 (if (= (id ""Stick"" Neutral) (what at:4)) 4 (if (= (id ""Stick"" Neutral) (what at:5)) 5 (if (= (id ""Stick"" Neutral) (what at:6)) 6 (if (= (id ""Stick"" Neutral) (what at:7)) 7 (if (= (id ""Stick"" Neutral) (what at:8)) 8 (if (= (id ""Stick"" Neutral) (what at:9)) 9 (if (= (id ""Stick"" Neutral) (what at:10)) 10 (if (= (id ""Stick"" Neutral) (what at:11)) 11 -1))))))))))) (if (= (id ""Stick"" Neutral) (what at:22)) 22 (if (= (id ""Stick"" Neutral) (what at:21)) 21 (if (= (id ""Stick"" Neutral) (what at:20)) 20 (if (= (id ""Stick"" Neutral) (what at:19)) 19 (if (= (id ""Stick"" Neutral) (what at:18)) 18 (if (= (id ""Stick"" Neutral) (what at:17)) 17 (if (= (id ""Stick"" Neutral) (what at:16)) 16 (if (= (id ""Stick"" Neutral) (what at:15)) 15 (if (= (id ""Stick"" Neutral) (what at:14)) 14 (if (= (id ""Stick"" Neutral) (what at:13)) 13 (if (= (id ""Stick"" Neutral) (what at:12)) 12 -1)))))))))))) -1) (= (if (= (next) P1) (if (= (id ""Stick"" Neutral) (what at:1)) 1 (if (= (id ""Stick"" Neutral) (what at:2)) 2 (if (= (id ""Stick"" Neutral) (what at:3)) 3 (if (= (id ""Stick"" Neutral) (what at:4)) 4 (if (= (id ""Stick"" Neutral) (what at:5)) 5 (if (= (id ""Stick"" Neutral) (what at:6)) 6 (if (= (id ""Stick"" Neutral) (what at:7)) 7 (if (= (id ""Stick"" Neutral) (what at:8)) 8 (if (= (id ""Stick"" Neutral) (what at:9)) 9 (if (= (id ""Stick"" Neutral) (what at:10)) 10 (if (= (id ""Stick"" Neutral) (what at:11)) 11 -1))))))))))) (if (= (id ""Stick"" Neutral) (what at:22)) 22 (if (= (id ""Stick"" Neutral) (what at:21)) 21 (if (= (id ""Stick"" Neutral) (what at:20)) 20 (if (= (id ""Stick"" Neutral) (what at:19)) 19 (if (= (id ""Stick"" Neutral) (what at:18)) 18 (if (= (id ""Stick"" Neutral) (what at:17)) 17 (if (= (id ""Stick"" Neutral) (what at:16)) 16 (if (= (id ""Stick"" Neutral) (what at:15)) 15 (if (= (id ""Stick"" Neutral) (what at:14)) 14 (if (= (id ""Stick"" Neutral) (what at:13)) 13 (if (= (id ""Stick"" Neutral) (what at:12)) 12 -1)))))))))))) -1)) (move Pass (then (trigger ""Draw"" Mover))))))) (then (if (!= 0 (mapEntry ""Throw"" (count Pips))) (moveAgain))))) (end {(if (no Pieces Next) (result Next Loss)) (if (is Triggered ""Draw"" Mover) (result Mover Draw))})))" "Each stone must move to any adjacent(orthogonal or diagonal) cell, which is occupied by an enemy stone. This stone is captured by replacement. After that, all adjacent enemy stones (orthogonal or diagonal) are converted to friendly ones. There are fewer and fewer stones on the board as the game proceeds, which is a major difference with Othello and Ataxx. The player which has more stones, after there is no valid move left, wins the game.","(game ""Crusade"" (players 2) (equipment {(board (square 8)) (piece ""Ball"" Each (move Step (to if:(is Enemy (who at:(to))) (apply (remove (to)))) (then (forEach Site (sites Around (last To)) (if (is Enemy (who at:(site))) (and (remove (site)) (add (piece (id ""Ball"" Mover)) (to (site)))))))))}) (rules (start {(place ""Ball1"" (sites Phase 1)) (place ""Ball2"" (sites Phase 0))}) (play (forEach Piece)) (end (if (no Moves Next) (byScore {(score P1 (count Pieces P1)) (score P2 (count Pieces P2))})))))","###Description Each stone must move to any adjacent(orthogonal or diagonal) cell, which is occupied by an enemy stone. This stone is captured by replacement. After that, all adjacent enemy stones (orthogonal or diagonal) are converted to friendly ones. There are fewer and fewer stones on the board as the game proceeds, which is a major difference with Othello and Ataxx. The player which has more stones, after there is no valid move left, wins the game. @@ -4949,11 +4794,6 @@ The main track of the board is a row of eleven squares, with both end squares an ###Ludii (game ""Mehen"" (players 2) (equipment {(board (spiral turns:5 sites:88) {(track ""NormalTrack"" {87 86 85 84 83 82 81 80 79 78 77 76 75 74 73 72 71 70 69 68 67 66 65 64 63 62 61 60 59 58 57 56 55 54 53 52 51 50 49 48 47 46 45 44 43 42 41 40 39 38 37 36 35 34 33 32 31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 -2} directed:True) (track ""OppositeTrack"" {0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 -2} directed:True)} use:Vertex) (dice d:2 from:0 num:4) (hand Each size:2) (piece ""Disc"" Each (if (and (= (trackSite Move steps:(count Pips)) -2) (is Empty 0)) (move Select (from) (then (and (remove (last To)) (add (piece (id ""Marker"" Mover)) (to 0))))) (if (!= (trackSite Move ""NormalTrack"" steps:(count Pips)) -1) (if (is In (trackSite Move ""NormalTrack"" steps:(count Pips)) (sites Empty)) (move (from) (to (trackSite Move ""NormalTrack"" steps:(count Pips)))))))) (piece ""Marker"" Each (if (= (trackSite Move ""OppositeTrack"" steps:(count Pips)) -2) (move Select (from) (then (and (remove (last To)) (add (piece (id ""Lion"" Mover)) (to (handSite Mover 1)))))) (if (!= (trackSite Move ""OppositeTrack"" steps:(count Pips)) -1) (if (is In (trackSite Move ""OppositeTrack"" steps:(count Pips)) (sites Empty)) (move (from) (to (trackSite Move ""OppositeTrack"" steps:(count Pips)))))))) (piece ""Lion"" Each (or (if (and (!= (trackSite Move ""OppositeTrack"" steps:(* (count Pips) 2)) -1) (!= (trackSite Move ""OppositeTrack"" steps:(* (count Pips) 2)) -2)) (if (not (is Friend (who at:(trackSite Move ""OppositeTrack"" steps:(mul (count Pips) 2))))) (move (from) (to (trackSite Move ""OppositeTrack"" steps:(mul (count Pips) 2)))))) (if (and (!= (trackSite Move ""NormalTrack"" steps:(* (count Pips) 2)) -1) (!= (trackSite Move ""NormalTrack"" steps:(* (count Pips) 2)) -2)) (if (not (is Friend (who at:(trackSite Move ""NormalTrack"" steps:(mul (count Pips) 2))))) (move (from) (to (trackSite Move ""NormalTrack"" steps:(mul (count Pips) 2))))))))}) (rules (start {(place ""Disc1"" (handSite P1) count:6) (place ""Disc2"" (handSite P2) count:6)}) (play (do (roll) next:(or {(if (and {(= (count Pips) 1) (is Empty 87) (is Occupied (handSite Mover))}) (move (from (handSite Mover)) (to 87))) (if (and {(= (count Pips) 1) (not (is Friend (who at:87))) (is Occupied (handSite Mover 1))}) (move (from (handSite Mover 1)) (to 87))) (forEach Piece)}))) (end (if (no Pieces Next) (result Next Loss)))))" -"Pieces start from the centers of the rings to the colored positions and later move orthogonal forward, left or right. The total STEP-length is equal to the sum of the pips of a players color on all the positions occupied by their pieces. If you can move you have to do so, even if it is a bad move. If you stalemate yourself, the other player can move until you can move again. STARTER-generation: If you reach the same color of one of your own pieces in the opposite ring, you get a new starter to your base (center of the rings) from your reserve. This also works from the base with a start-move (base to own ring). To CAPTURE an enemy, you need to be able to reach the same color of the enemy-piece in the opposite ring, then the possibility to directly capture the enemy on its board-position will be available. Capturing is not mandatory, you can also just go to the opposite-color position (move 'into the shadow'). Capturing with a start-move from the base is not possible. RingCapture: with steplenght 8 you could theoretically move in a circle to your own position, but as normal move this is not allowed. But if there is an enemy-piece on the opposite same color, the (ring-)capture-move ist allowed! For steplengths of 12 or 14 etc this is also possible from some other positions. The captured pieces remain under the attacker in a stack and have to be brought to the Transmitter (field in the middle of the board) with the according steplength. If you reach the transmitter, your pieces in the stack go back to base as starters, and the enemies land in your prison. First player to make 3 prisoners wins. Only pieces with a captured enemy can land on the Transmitter for prisonertransport. (Exception: #LastMan) Single pieces just step over it. With high steplength you can move in circles or to the other side and back, but not turn 180 degrees. Special Rules to balance the Start: From the Start-situation (or later, when there are temporarily no picese on colored positions) you cannot copy the move of the enemy, ie move to the same color with your first piece. #CounterAttack: If your first starter is attacked immediately (by the first enemy move), you are allowed to start also to the colors in the enemy-ring with your second starter. In this case, there is no Starter generation, if you move to the opposite color of your first piece (to protect it from capturing). Special Rules for Endgame: #LastMan: If you are left with just a single piece on the colored board positions (and no starter on your base), you may enter the Transmitter to move the piece to your base and get a second starter (if you still have one in your reserve)! #PrisonerExchange: Move a prisoner to your (empty) homebase, and you get an additional Starter taken from your reserve & the prisoner goes back to his reserve. You have to move this new starter immediately: the PrisonerExchange itself counts not as a full move. History : 'Mensa Spiel' invented by Andreas Pichler (Mensa Austria). Ludii file implemented by Franz Pichler. (June 2022) Strategy : Early starter-generation is important to have more options. Indirect or dynamic defense is sometimes best: if you are captured, to be able to capture back or dominate the opponent with controlling many positions is vital. In general, a move that attacks an enemy-piece and would make possible a Starter-Generation in the next move simultaneously, is good. But be aware: almost all moves change the steplength and attack & defence-patterns, ie. the whole situation. This makes it complicated to calculate, but entertaining to play. White player starts the game. Transfer 3 enemy-pieces to your prison-cell.","(game ""MensaSpiel"" (players 2) (equipment {(board (remove (rectangle 5 7) cells:{2 4 7 8 9 11 12 13 17 31})) (regions ""Base"" P1 {13}) (regions ""Base"" P2 {17}) (regions ""Prison"" P1 {0}) (regions ""Prison"" P2 {4}) (regions ""Reserve"" P1 {1}) (regions ""Reserve"" P2 {3}) (regions ""HomeRing"" P1 {6 7 8 12 14 19 20 21}) (regions ""HomeRing"" P2 {9 10 11 16 18 22 23 24}) (regions ""SitesLastMan"" P1 {6 9 16 21 22}) (regions ""SitesLastMan"" P2 {7 9 14 21 22}) (regions ""Rings"" {6 7 8 9 10 11 12 14 16 18 19 20 21 22 23 24}) (regions ""RingsplusT"" {6 7 8 9 10 11 12 14 15 16 18 19 20 21 22 23 24}) (regions ""RingsplusBase"" {6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24}) (map ""PipsP1"" {6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24} {4 1 3 2 2 1 2 0 3 0 1 0 1 3 2 2 2 0 3}) (map ""PipsP2"" {6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24} {0 3 1 2 2 3 2 0 1 0 3 0 3 1 2 2 2 4 1}) (map ""Attacks1"" {6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24} {10 23 9 12 8 6 9 0 16 0 7 0 12 11 11 16 7 21 6}) (map ""Attacks2"" {6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24} {10 18 22 14 19 19 24 0 23 0 14 0 20 24 22 18 20 21 8}) (map ""SameColor"" {6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24} {23 24 18 20 21 14 22 0 11 0 19 0 8 16 9 10 12 6 7}) (map ""Step1c"" {14 16} {15 15}) (map ""Step2a"" {6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24} {19 14 6 22 18 24 20 0 20 0 23 0 23 21 14 19 24 18 11}) (map ""Step2b"" {6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24} {8 12 21 11 16 9 7 0 7 0 10 0 10 6 12 8 9 16 22}) (map ""Step2c"" {8 14 21 16 9 22} {15 16 15 14 15 15}) (map ""Step3a"" {6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24} {20 19 12 23 22 23 21 0 19 0 24 0 9 14 8 12 10 9 10}) (map ""Step3b"" {6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24} {14 21 20 18 24 16 8 0 6 0 11 0 22 7 6 7 18 11 16}) (map ""Step3c"" {7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23} {15 16 14 15 0 0 0 22 0 8 0 0 0 15 16 14 15}) (map ""Step3d"" {14 16} {9 21}) (map ""Step4a"" {6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24} {21 20 19 24 23 22 14 0 12 0 18 0 16 8 7 6 11 10 9}) (map ""Step4b"" {6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24} {15 16 9 8 14 15 0 0 10 0 7 0 0 15 16 9 8 14 15}) (map ""Step4c"" {8 14 21 9 16 22} {22 23 22 21 20 21}) (map ""Step5c"" {6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24} {16 9 10 7 8 14 15 0 11 0 6 0 15 16 9 10 7 8 14}) (map ""Step5d"" {7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23} {22 23 20 21 0 0 0 24 0 19 0 0 0 22 23 20 21}) (map ""Step6c"" {6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24} {9 10 11 6 7 8 16 0 18 0 12 0 14 9 10 11 6 7 8}) (map ""Step6d"" {6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24} {22 23 24 19 20 21 0 0 0 0 0 0 0 22 23 24 19 20 21}) (map ""Step6e"" {6 19 11 24} {15 15 15 15}) (map ""Step7a"" {6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24} {7 8 14 10 11 18 6 0 8 0 9 0 11 12 19 14 16 22 18}) (map ""Step7b"" {6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24} {12 6 7 16 9 10 19 0 21 0 22 0 24 20 21 20 23 24 23}) (map ""Step7c"" {6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24} {10 11 18 12 6 7 9 0 11 0 6 0 8 10 11 18 12 6 7}) (map ""Step7d"" {6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24} {23 24 0 0 19 20 22 0 24 0 19 0 21 23 24 0 0 19 20}) (map ""Step7e"" {6 19 7 20 10 23 11 24} {16 16 15 15 15 15 14 14}) (map ""Step8a"" {6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24} {11 18 11 6 12 6 10 0 10 0 7 0 7 11 18 11 6 12 6}) (map ""Step8b"" {6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24} {24 16 24 19 14 19 23 0 23 0 20 0 20 24 16 24 19 14 19}) (map ""Step8c"" {6 19 8 21 9 22 11 24} {9 9 15 15 15 15 8 8}) (map ""Step8d"" {6 19 11 24} {22 22 21 21}) (map ""Step9c"" {6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24} {18 11 10 7 6 12 11 0 9 0 8 0 6 18 11 10 7 6 12}) (map ""Step9d"" {6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24} {10 24 23 20 19 7 24 0 22 0 21 0 19 23 24 23 20 19 7}) (map ""Step9e"" {6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24} {23 9 16 14 8 20 0 0 15 0 15 0 0 10 9 16 14 8 20}) (map ""Step9f"" {20 7 10 23} {22 22 21 21}) (map ""Step10c"" {6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24} {11 10 9 8 7 6 18 0 16 0 14 0 12 11 10 9 8 7 6}) (map ""Step10d"" {6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24} {24 23 22 21 20 19 0 0 0 0 0 0 0 24 23 22 21 20 19}) (map ""Step10e"" {21 8 9 22} {15 15 15 15}) (map ""Step11c"" {6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24} {10 11 10 7 6 7 11 0 9 0 8 0 6 10 11 10 7 6 7}) (map ""Step11d"" {6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24} {23 24 23 20 19 20 24 0 22 0 21 0 19 23 24 23 20 19 20}) (map ""Step11e"" {6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24} {18 9 16 14 8 12 0 0 15 0 15 0 0 18 9 16 14 8 12}) (map ""Step11f"" {7 10 20 23} {22 21 22 21}) (map ""Step11g"" {7 10 20 23} {15 15 15 15}) (map ""Step12b"" {6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24} {11 18 11 6 12 6 10 0 10 0 7 0 7 11 18 11 6 12 6}) (map ""Step12c"" {6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24} {24 16 24 19 14 19 23 0 23 0 20 0 20 24 16 24 19 14 19}) (map ""Step12d"" {6 19 8 21 9 22 11 24} {9 9 9 9 8 8 8 8}) (map ""Step12e"" {6 19 8 21 9 22 11 24} {22 22 22 22 21 21 21 21}) (map ""Step12f"" {6 19 8 21 9 22 11 24} {15 15 15 15 15 15 15 15}) (map ""Step12g"" {14 16} {11 19}) (map ""Step13c"" {6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24} {10 11 10 7 6 7 9 0 11 0 6 0 8 10 11 10 7 6 7}) (map ""Step13d"" {6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24} {23 24 23 20 19 20 22 0 24 0 19 0 21 23 24 23 20 19 20}) (map ""Step13e"" {6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24} {16 9 14 16 8 14 15 0 8 0 9 0 15 16 9 14 16 8 14}) (map ""Step13f"" {7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23} {22 18 12 21 0 0 0 21 0 22 0 0 0 22 18 12 21}) (map ""Step14c"" {6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24} {9 10 11 6 7 8 16 0 18 0 12 0 14 9 10 11 6 7 8}) (map ""Step14d"" {6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24} {22 23 24 19 20 21 0 0 0 0 0 0 0 22 23 24 19 20 21}) (map ""Step14e"" {6 19 11 24} {15 15 15 15}) (map ""Step14f"" {8 9 21 22} {18 20 10 12}) (map ""Step15c"" {6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24} {10 11 18 12 6 7 9 0 11 0 11 0 8 10 11 18 12 6 7}) (map ""Step15d"" {6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24} {23 24 20 23 19 20 22 0 24 0 24 0 21 23 24 7 10 19 20}) (map ""Step15e"" {6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24} {16 21 10 7 22 16 15 0 6 0 6 0 15 16 8 10 7 9 16}) (map ""Step15f"" {6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24} {14 9 23 20 8 14 0 0 19 0 19 0 0 14 9 23 20 8 14}) (map ""Step16c"" {6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24} {9 20 15 15 23 8 14 0 12 0 18 0 16 9 7 15 15 10 8}) (map ""Step16d"" {6 19 8 21 9 22 11 24} {22 22 6 6 11 11 21 21}) (map ""Step16e"" {6 19 8 21 9 22 11 24} {8 8 9 9 8 8 9 9}) (map ""Step16f"" {6 19 8 21 9 22 11 24} {21 21 19 19 21 21 22 22}) (map ""Step16g"" {6 19 8 21 9 22 11 24} {15 15 22 22 24 24 15 15}) (map ""Step17c"" {6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24} {10 11 10 7 6 7 8 0 6 0 11 0 6 10 6 10 7 6 7}) (map ""Step17d"" {6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24} {23 9 12 14 8 12 11 0 9 0 8 0 9 23 9 12 14 8 10}) (map ""Step17e"" {6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24} {18 15 16 18 15 16 21 0 15 0 15 0 19 18 11 16 18 11 16}) (map ""Step17f"" {6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24} {14 19 23 20 19 20 24 0 19 0 21 0 22 14 15 23 20 15 12}) (map ""Step17g"" {6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24} {20 22 0 0 21 23 0 0 22 0 24 0 0 7 22 0 0 19 20}) (map ""Step17h"" {7 10 20 23} {24 24 24 21}) (map ""Step18c"" {6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24} {11 10 9 8 7 6 18 0 16 0 14 0 12 8 10 6 8 7 6}) (map ""Step18d"" {6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24} {21 23 15 15 20 19 0 0 0 0 0 0 0 11 23 9 11 20 9}) (map ""Step18e"" {6 19 8 21 22 9 11 24} {24 24 19 15 15 21 22 19}) (map ""Step18f"" {8 21 22 9} {22 22 21 24}) (map ""Step18g"" {6 19 11 24} {23 16 14 7}) (map ""Step19c"" {6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24} {7 6 7 7 6 7 6 0 8 0 8 0 6 10 9 10 7 6 7}) (map ""Step19d"" {6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24} {10 8 10 10 8 10 11 0 9 0 9 0 11 12 11 14 14 8 12}) (map ""Step19e"" {6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24} {12 9 14 14 9 12 19 0 15 0 15 0 19 18 15 16 16 15 18}) (map ""Step19f"" {6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24} {18 11 16 16 11 18 24 0 21 0 21 0 24 20 19 20 20 19 20}) (map ""Step19g"" {6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24} {23 15 23 20 15 20 0 0 22 0 22 0 0 23 21 23 23 21 23}) (map ""Step19h"" {7 10 20 23} {22 19 22 22}) (map ""Step19i"" {7 10 20 23} {24 21 24 24}) (map ""Step20b"" {6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24} {9 16 9 6 12 6 10 0 10 0 7 0 7 6 16 8 6 12 6}) (map ""Step20c"" {6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24} {11 18 11 8 14 8 23 0 23 0 20 0 20 9 18 9 8 14 8}) (map ""Step20d"" {6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24} {15 0 15 15 0 15 0 0 0 0 0 0 0 11 0 11 9 0 11}) (map ""Step20e"" {6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24} {19 0 21 19 0 19 0 0 0 0 0 0 0 15 0 15 15 0 15}) (map ""Step20f"" {6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24} {22 0 22 21 0 21 0 0 0 0 0 0 0 22 0 22 19 0 19}) (map ""Step20g"" {6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24} {24 0 24 22 0 24 0 0 0 0 0 0 0 24 0 24 21 0 21}) (piece ""Prisoner"" Each (if (and (no Pieces in:(sites Mover ""Base"")) (not (no Pieces in:(sites Mover ""Reserve"")))) (move (from) (to (sites Mover ""Base""))) (then (and {(promote (last To) (piece ""Starter"") Mover) (remove (sites Mover ""Reserve"")) (add (piece (id ""Reserve"" Next)) (to (sites Next ""Reserve"")) stack:True) (moveAgain)})))) (piece ""Starter"" Each (if (= 1 (var ""StartS"")) (move (from (sites Mover ""Base"")) (to (difference (sites Mover ""HomeRing"") (mapEntry ""SameColor"" (last To)))) (then (and {(promote (last To) (piece {""Cone""}) Mover) (set Var ""StartS"" (+ 1 (var ""StartS""))) (if (= 0 (var ""StartS"")) (set Var ""St1Pos"" (last To))) (if (and (= 1 (var ""StartS"")) (or (= (mapEntry ""Attacks1"" (last To)) (var ""St1Pos"")) (= (mapEntry ""Attacks2"" (last To)) (var ""St1Pos"")))) (set Var ""CntrAttack"" 1)) (if (> (var ""StartS"") 2) (set Var ""CntrAttack"" 0)) (if (and {(is Friend (who at:(mapEntry ""SameColor"" (last To)))) (!= 1 (var ""CntrAttack"")) (not (no Pieces in:(sites Mover ""Reserve"")))}) (and (add (piece (id ""Starter"" Mover)) (to (sites Mover ""Base"")) stack:True) (remove (sites Mover ""Reserve"")))) (set Value at:(last To) 1) (addScore Mover (if (= (id Mover) 1) (mapEntry ""PipsP1"" (last To)) (mapEntry ""PipsP2"" (last To))))}))) (if (and (= 2 (var ""StartS"")) (= 1 (var ""CntrAttack""))) (move (from (sites Mover ""Base"")) (to (intersection (sites ""Rings"") (sites Empty))) (then (and {(promote (last To) (piece {""Cone""}) Mover) (set Var ""StartS"" (+ 1 (var ""StartS""))) (if (= 0 (var ""StartS"")) (set Var ""St1Pos"" (last To))) (if (and (= 1 (var ""StartS"")) (or (= (mapEntry ""Attacks1"" (last To)) (var ""St1Pos"")) (= (mapEntry ""Attacks2"" (last To)) (var ""St1Pos"")))) (set Var ""CntrAttack"" 1)) (if (> (var ""StartS"") 2) (set Var ""CntrAttack"" 0)) (if (and {(is Friend (who at:(mapEntry ""SameColor"" (last To)))) (!= 1 (var ""CntrAttack"")) (not (no Pieces in:(sites Mover ""Reserve"")))}) (and (add (piece (id ""Starter"" Mover)) (to (sites Mover ""Base"")) stack:True) (remove (sites Mover ""Reserve"")))) (set Value at:(last To) 1) (addScore Mover (if (= (id Mover) 1) (mapEntry ""PipsP1"" (last To)) (mapEntry ""PipsP2"" (last To))))}))) (move (from (sites Mover ""Base"")) (to (intersection (sites Mover ""HomeRing"") (sites Empty))) (then (and {(promote (last To) (piece {""Cone""}) Mover) (set Var ""StartS"" (+ 1 (var ""StartS""))) (if (= 0 (var ""StartS"")) (set Var ""St1Pos"" (last To))) (if (and (= 1 (var ""StartS"")) (or (= (mapEntry ""Attacks1"" (last To)) (var ""St1Pos"")) (= (mapEntry ""Attacks2"" (last To)) (var ""St1Pos"")))) (set Var ""CntrAttack"" 1)) (if (> (var ""StartS"") 2) (set Var ""CntrAttack"" 0)) (if (and {(is Friend (who at:(mapEntry ""SameColor"" (last To)))) (!= 1 (var ""CntrAttack"")) (not (no Pieces in:(sites Mover ""Reserve"")))}) (and (add (piece (id ""Starter"" Mover)) (to (sites Mover ""Base"")) stack:True) (remove (sites Mover ""Reserve"")))) (set Value at:(last To) 1) (addScore Mover (if (= (id Mover) 1) (mapEntry ""PipsP1"" (last To)) (mapEntry ""PipsP2"" (last To))))})))))) (piece ""Reserve"" Each) (piece ""Cone"" Each (if (and {(no Pieces in:(sites Mover ""Base"")) (= 1 (count Pieces in:(intersection (sites ""Rings"") (sites Occupied by:Mover)))) (= 1 (size Stack at:(regionSite (intersection (sites Occupied by:Mover) (sites Mover ""SitesLastMan"")) index:0))) (not (no Pieces in:(sites Mover ""Reserve"")))}) (or (move (from) (to 15) (then (and {(set Var ""CntrAttack"" 0) (set Score Mover 0) (remove 15) (remove (sites Mover ""Reserve"")) (add (piece (id ""Starter"" Mover)) (to (sites Mover ""Base"")) count:2 stack:True)}))) (if (< (score Mover) 16) (if (< (score Mover) 8) (if (< (score Mover) 4) (if (< (score Mover) 2) (if (= (score Mover) 1) (move (from) (to (union {(intersection {(difference (if (= 1 (size Stack at:(from))) (sites ""Rings"") (sites ""RingsplusT"")) (from)) (sites Empty) (sites {(mapEntry ""Step7a"" (from)) (mapEntry ""Step7b"" (from)) (mapEntry ""Step1c"" (from)) (mapEntry (from)) (mapEntry (from)) (mapEntry (from)) (mapEntry (from)) (mapEntry (from))})}) (intersection {(sites ""Rings"") (sites Occupied by:Next) (sites {(mapEntry ""SameColor"" (arrayValue (intersection (array (sites Empty)) (array {(mapEntry ""Step7a"" (from))})) index:0)) (mapEntry ""SameColor"" (arrayValue (intersection (array (sites Empty)) (array {(mapEntry ""Step7b"" (from))})) index:0)) (mapEntry ""SameColor"" (arrayValue (intersection (array (sites Empty)) (array {(mapEntry ""Step1c"" (from))})) index:0)) (mapEntry ""SameColor"" (arrayValue (intersection (array (sites Empty)) (array {(mapEntry (from))})) index:0)) (mapEntry ""SameColor"" (arrayValue (intersection (array (sites Empty)) (array {(mapEntry (from))})) index:0)) (mapEntry ""SameColor"" (arrayValue (intersection (array (sites Empty)) (array {(mapEntry (from))})) index:0)) (mapEntry ""SameColor"" (arrayValue (intersection (array (sites Empty)) (array {(mapEntry (from))})) index:0)) (mapEntry ""SameColor"" (arrayValue (intersection (array (sites Empty)) (array {(mapEntry (from))})) index:0)) (mapEntry (from))})})})) stack:True (then (and {(set Var ""StartS"" 3) (set Var ""CntrAttack"" 0) (if (= 15 (last To)) (and {(add (piece (id ""Starter"" Mover)) (to (sites Mover ""Base"")) count:(count Stack at:(last To) if:(= (id ""Cone"" Mover) (what at:(to) level:(level)))) stack:True) (add (piece (id ""Prisoner"" Mover)) (to (sites Mover ""Prison"")) count:(count Stack at:(last To) if:(= (id ""Cone"" Next) (what at:(to) level:(level)))) stack:True) (remove 15 count:(count Stack at:(last To)))}) (if (and (is Friend (who at:(mapEntry ""SameColor"" (last To)))) (not (no Pieces in:(sites Mover ""Reserve"")))) (and (remove (sites Mover ""Reserve"")) (add (piece (id ""Starter"" Mover)) (to (sites Mover ""Base"")) stack:True)))) (set Value at:(last To) (count Stack at:(last To))) (addScore Mover (- (if (= (id Mover) 1) (mapEntry ""PipsP1"" (last To)) (mapEntry ""PipsP2"" (last To))) (if (= (id Mover) 1) (mapEntry ""PipsP1"" (last From)) (mapEntry ""PipsP2"" (last From))))) (if (> (size Stack at:(last To)) (value Piece at:(last To))) (addScore Next (- 0 (if (= (id Mover) 1) (mapEntry ""PipsP2"" (last To)) (mapEntry ""PipsP1"" (last To))))))})))) (if (= (score Mover) 2) (move (from) (to (union {(intersection {(difference (if (= 1 (size Stack at:(from))) (sites ""Rings"") (sites ""RingsplusT"")) (from)) (sites Empty) (sites {(mapEntry ""Step2a"" (from)) (mapEntry ""Step2b"" (from)) (mapEntry ""Step2c"" (from)) (mapEntry (from)) (mapEntry (from)) (mapEntry (from)) (mapEntry (from)) (mapEntry (from))})}) (intersection {(sites ""Rings"") (sites Occupied by:Next) (sites {(mapEntry ""SameColor"" (arrayValue (intersection (array (sites Empty)) (array {(mapEntry ""Step2a"" (from))})) index:0)) (mapEntry ""SameColor"" (arrayValue (intersection (array (sites Empty)) (array {(mapEntry ""Step2b"" (from))})) index:0)) (mapEntry ""SameColor"" (arrayValue (intersection (array (sites Empty)) (array {(mapEntry ""Step2c"" (from))})) index:0)) (mapEntry ""SameColor"" (arrayValue (intersection (array (sites Empty)) (array {(mapEntry (from))})) index:0)) (mapEntry ""SameColor"" (arrayValue (intersection (array (sites Empty)) (array {(mapEntry (from))})) index:0)) (mapEntry ""SameColor"" (arrayValue (intersection (array (sites Empty)) (array {(mapEntry (from))})) index:0)) (mapEntry ""SameColor"" (arrayValue (intersection (array (sites Empty)) (array {(mapEntry (from))})) index:0)) (mapEntry ""SameColor"" (arrayValue (intersection (array (sites Empty)) (array {(mapEntry (from))})) index:0)) (mapEntry (from))})})})) stack:True (then (and {(set Var ""StartS"" 3) (set Var ""CntrAttack"" 0) (if (= 15 (last To)) (and {(add (piece (id ""Starter"" Mover)) (to (sites Mover ""Base"")) count:(count Stack at:(last To) if:(= (id ""Cone"" Mover) (what at:(to) level:(level)))) stack:True) (add (piece (id ""Prisoner"" Mover)) (to (sites Mover ""Prison"")) count:(count Stack at:(last To) if:(= (id ""Cone"" Next) (what at:(to) level:(level)))) stack:True) (remove 15 count:(count Stack at:(last To)))}) (if (and (is Friend (who at:(mapEntry ""SameColor"" (last To)))) (not (no Pieces in:(sites Mover ""Reserve"")))) (and (remove (sites Mover ""Reserve"")) (add (piece (id ""Starter"" Mover)) (to (sites Mover ""Base"")) stack:True)))) (set Value at:(last To) (count Stack at:(last To))) (addScore Mover (- (if (= (id Mover) 1) (mapEntry ""PipsP1"" (last To)) (mapEntry ""PipsP2"" (last To))) (if (= (id Mover) 1) (mapEntry ""PipsP1"" (last From)) (mapEntry ""PipsP2"" (last From))))) (if (> (size Stack at:(last To)) (value Piece at:(last To))) (addScore Next (- 0 (if (= (id Mover) 1) (mapEntry ""PipsP2"" (last To)) (mapEntry ""PipsP1"" (last To))))))}))) (move (from) (to (union {(intersection {(difference (if (= 1 (size Stack at:(from))) (sites ""Rings"") (sites ""RingsplusT"")) (from)) (sites Empty) (sites {(mapEntry ""Step3a"" (from)) (mapEntry ""Step3b"" (from)) (mapEntry ""Step3c"" (from)) (mapEntry ""Step3d"" (from)) (mapEntry (from)) (mapEntry (from)) (mapEntry (from)) (mapEntry (from))})}) (intersection {(sites ""Rings"") (sites Occupied by:Next) (sites {(mapEntry ""SameColor"" (arrayValue (intersection (array (sites Empty)) (array {(mapEntry ""Step3a"" (from))})) index:0)) (mapEntry ""SameColor"" (arrayValue (intersection (array (sites Empty)) (array {(mapEntry ""Step3b"" (from))})) index:0)) (mapEntry ""SameColor"" (arrayValue (intersection (array (sites Empty)) (array {(mapEntry ""Step3c"" (from))})) index:0)) (mapEntry ""SameColor"" (arrayValue (intersection (array (sites Empty)) (array {(mapEntry ""Step3d"" (from))})) index:0)) (mapEntry ""SameColor"" (arrayValue (intersection (array (sites Empty)) (array {(mapEntry (from))})) index:0)) (mapEntry ""SameColor"" (arrayValue (intersection (array (sites Empty)) (array {(mapEntry (from))})) index:0)) (mapEntry ""SameColor"" (arrayValue (intersection (array (sites Empty)) (array {(mapEntry (from))})) index:0)) (mapEntry ""SameColor"" (arrayValue (intersection (array (sites Empty)) (array {(mapEntry (from))})) index:0)) (mapEntry (from))})})})) stack:True (then (and {(set Var ""StartS"" 3) (set Var ""CntrAttack"" 0) (if (= 15 (last To)) (and {(add (piece (id ""Starter"" Mover)) (to (sites Mover ""Base"")) count:(count Stack at:(last To) if:(= (id ""Cone"" Mover) (what at:(to) level:(level)))) stack:True) (add (piece (id ""Prisoner"" Mover)) (to (sites Mover ""Prison"")) count:(count Stack at:(last To) if:(= (id ""Cone"" Next) (what at:(to) level:(level)))) stack:True) (remove 15 count:(count Stack at:(last To)))}) (if (and (is Friend (who at:(mapEntry ""SameColor"" (last To)))) (not (no Pieces in:(sites Mover ""Reserve"")))) (and (remove (sites Mover ""Reserve"")) (add (piece (id ""Starter"" Mover)) (to (sites Mover ""Base"")) stack:True)))) (set Value at:(last To) (count Stack at:(last To))) (addScore Mover (- (if (= (id Mover) 1) (mapEntry ""PipsP1"" (last To)) (mapEntry ""PipsP2"" (last To))) (if (= (id Mover) 1) (mapEntry ""PipsP1"" (last From)) (mapEntry ""PipsP2"" (last From))))) (if (> (size Stack at:(last To)) (value Piece at:(last To))) (addScore Next (- 0 (if (= (id Mover) 1) (mapEntry ""PipsP2"" (last To)) (mapEntry ""PipsP1"" (last To))))))}))))) (if (< (score Mover) 6) (if (= (score Mover) 4) (move (from) (to (union {(intersection {(difference (if (= 1 (size Stack at:(from))) (sites ""Rings"") (sites ""RingsplusT"")) (from)) (sites Empty) (sites {(mapEntry ""Step4a"" (from)) (mapEntry ""Step4b"" (from)) (mapEntry ""Step4c"" (from)) (mapEntry (from)) (mapEntry (from)) (mapEntry (from)) (mapEntry (from)) (mapEntry (from))})}) (intersection {(sites ""Rings"") (sites Occupied by:Next) (sites {(mapEntry ""SameColor"" (arrayValue (intersection (array (sites Empty)) (array {(mapEntry ""Step4a"" (from))})) index:0)) (mapEntry ""SameColor"" (arrayValue (intersection (array (sites Empty)) (array {(mapEntry ""Step4b"" (from))})) index:0)) (mapEntry ""SameColor"" (arrayValue (intersection (array (sites Empty)) (array {(mapEntry ""Step4c"" (from))})) index:0)) (mapEntry ""SameColor"" (arrayValue (intersection (array (sites Empty)) (array {(mapEntry (from))})) index:0)) (mapEntry ""SameColor"" (arrayValue (intersection (array (sites Empty)) (array {(mapEntry (from))})) index:0)) (mapEntry ""SameColor"" (arrayValue (intersection (array (sites Empty)) (array {(mapEntry (from))})) index:0)) (mapEntry ""SameColor"" (arrayValue (intersection (array (sites Empty)) (array {(mapEntry (from))})) index:0)) (mapEntry ""SameColor"" (arrayValue (intersection (array (sites Empty)) (array {(mapEntry (from))})) index:0)) (mapEntry (from))})})})) stack:True (then (and {(set Var ""StartS"" 3) (set Var ""CntrAttack"" 0) (if (= 15 (last To)) (and {(add (piece (id ""Starter"" Mover)) (to (sites Mover ""Base"")) count:(count Stack at:(last To) if:(= (id ""Cone"" Mover) (what at:(to) level:(level)))) stack:True) (add (piece (id ""Prisoner"" Mover)) (to (sites Mover ""Prison"")) count:(count Stack at:(last To) if:(= (id ""Cone"" Next) (what at:(to) level:(level)))) stack:True) (remove 15 count:(count Stack at:(last To)))}) (if (and (is Friend (who at:(mapEntry ""SameColor"" (last To)))) (not (no Pieces in:(sites Mover ""Reserve"")))) (and (remove (sites Mover ""Reserve"")) (add (piece (id ""Starter"" Mover)) (to (sites Mover ""Base"")) stack:True)))) (set Value at:(last To) (count Stack at:(last To))) (addScore Mover (- (if (= (id Mover) 1) (mapEntry ""PipsP1"" (last To)) (mapEntry ""PipsP2"" (last To))) (if (= (id Mover) 1) (mapEntry ""PipsP1"" (last From)) (mapEntry ""PipsP2"" (last From))))) (if (> (size Stack at:(last To)) (value Piece at:(last To))) (addScore Next (- 0 (if (= (id Mover) 1) (mapEntry ""PipsP2"" (last To)) (mapEntry ""PipsP1"" (last To))))))}))) (move (from) (to (union {(intersection {(difference (if (= 1 (size Stack at:(from))) (sites ""Rings"") (sites ""RingsplusT"")) (from)) (sites Empty) (sites {(mapEntry ""Step3a"" (from)) (mapEntry ""Step3b"" (from)) (mapEntry ""Step5c"" (from)) (mapEntry ""Step5d"" (from)) (mapEntry (from)) (mapEntry (from)) (mapEntry (from)) (mapEntry (from))})}) (intersection {(sites ""Rings"") (sites Occupied by:Next) (sites {(mapEntry ""SameColor"" (arrayValue (intersection (array (sites Empty)) (array {(mapEntry ""Step3a"" (from))})) index:0)) (mapEntry ""SameColor"" (arrayValue (intersection (array (sites Empty)) (array {(mapEntry ""Step3b"" (from))})) index:0)) (mapEntry ""SameColor"" (arrayValue (intersection (array (sites Empty)) (array {(mapEntry ""Step5c"" (from))})) index:0)) (mapEntry ""SameColor"" (arrayValue (intersection (array (sites Empty)) (array {(mapEntry ""Step5d"" (from))})) index:0)) (mapEntry ""SameColor"" (arrayValue (intersection (array (sites Empty)) (array {(mapEntry (from))})) index:0)) (mapEntry ""SameColor"" (arrayValue (intersection (array (sites Empty)) (array {(mapEntry (from))})) index:0)) (mapEntry ""SameColor"" (arrayValue (intersection (array (sites Empty)) (array {(mapEntry (from))})) index:0)) (mapEntry ""SameColor"" (arrayValue (intersection (array (sites Empty)) (array {(mapEntry (from))})) index:0)) (mapEntry (from))})})})) stack:True (then (and {(set Var ""StartS"" 3) (set Var ""CntrAttack"" 0) (if (= 15 (last To)) (and {(add (piece (id ""Starter"" Mover)) (to (sites Mover ""Base"")) count:(count Stack at:(last To) if:(= (id ""Cone"" Mover) (what at:(to) level:(level)))) stack:True) (add (piece (id ""Prisoner"" Mover)) (to (sites Mover ""Prison"")) count:(count Stack at:(last To) if:(= (id ""Cone"" Next) (what at:(to) level:(level)))) stack:True) (remove 15 count:(count Stack at:(last To)))}) (if (and (is Friend (who at:(mapEntry ""SameColor"" (last To)))) (not (no Pieces in:(sites Mover ""Reserve"")))) (and (remove (sites Mover ""Reserve"")) (add (piece (id ""Starter"" Mover)) (to (sites Mover ""Base"")) stack:True)))) (set Value at:(last To) (count Stack at:(last To))) (addScore Mover (- (if (= (id Mover) 1) (mapEntry ""PipsP1"" (last To)) (mapEntry ""PipsP2"" (last To))) (if (= (id Mover) 1) (mapEntry ""PipsP1"" (last From)) (mapEntry ""PipsP2"" (last From))))) (if (> (size Stack at:(last To)) (value Piece at:(last To))) (addScore Next (- 0 (if (= (id Mover) 1) (mapEntry ""PipsP2"" (last To)) (mapEntry ""PipsP1"" (last To))))))})))) (if (= (score Mover) 6) (move (from) (to (union {(intersection {(difference (if (= 1 (size Stack at:(from))) (sites ""Rings"") (sites ""RingsplusT"")) (from)) (sites Empty) (sites {(mapEntry ""Step2a"" (from)) (mapEntry ""Step2b"" (from)) (mapEntry ""Step6c"" (from)) (mapEntry ""Step6d"" (from)) (mapEntry ""Step6e"" (from)) (mapEntry (from)) (mapEntry (from)) (mapEntry (from))})}) (intersection {(sites ""Rings"") (sites Occupied by:Next) (sites {(mapEntry ""SameColor"" (arrayValue (intersection (array (sites Empty)) (array {(mapEntry ""Step2a"" (from))})) index:0)) (mapEntry ""SameColor"" (arrayValue (intersection (array (sites Empty)) (array {(mapEntry ""Step2b"" (from))})) index:0)) (mapEntry ""SameColor"" (arrayValue (intersection (array (sites Empty)) (array {(mapEntry ""Step6c"" (from))})) index:0)) (mapEntry ""SameColor"" (arrayValue (intersection (array (sites Empty)) (array {(mapEntry ""Step6d"" (from))})) index:0)) (mapEntry ""SameColor"" (arrayValue (intersection (array (sites Empty)) (array {(mapEntry ""Step6e"" (from))})) index:0)) (mapEntry ""SameColor"" (arrayValue (intersection (array (sites Empty)) (array {(mapEntry (from))})) index:0)) (mapEntry ""SameColor"" (arrayValue (intersection (array (sites Empty)) (array {(mapEntry (from))})) index:0)) (mapEntry ""SameColor"" (arrayValue (intersection (array (sites Empty)) (array {(mapEntry (from))})) index:0)) (mapEntry (from))})})})) stack:True (then (and {(set Var ""StartS"" 3) (set Var ""CntrAttack"" 0) (if (= 15 (last To)) (and {(add (piece (id ""Starter"" Mover)) (to (sites Mover ""Base"")) count:(count Stack at:(last To) if:(= (id ""Cone"" Mover) (what at:(to) level:(level)))) stack:True) (add (piece (id ""Prisoner"" Mover)) (to (sites Mover ""Prison"")) count:(count Stack at:(last To) if:(= (id ""Cone"" Next) (what at:(to) level:(level)))) stack:True) (remove 15 count:(count Stack at:(last To)))}) (if (and (is Friend (who at:(mapEntry ""SameColor"" (last To)))) (not (no Pieces in:(sites Mover ""Reserve"")))) (and (remove (sites Mover ""Reserve"")) (add (piece (id ""Starter"" Mover)) (to (sites Mover ""Base"")) stack:True)))) (set Value at:(last To) (count Stack at:(last To))) (addScore Mover (- (if (= (id Mover) 1) (mapEntry ""PipsP1"" (last To)) (mapEntry ""PipsP2"" (last To))) (if (= (id Mover) 1) (mapEntry ""PipsP1"" (last From)) (mapEntry ""PipsP2"" (last From))))) (if (> (size Stack at:(last To)) (value Piece at:(last To))) (addScore Next (- 0 (if (= (id Mover) 1) (mapEntry ""PipsP2"" (last To)) (mapEntry ""PipsP1"" (last To))))))}))) (move (from) (to (union {(intersection {(difference (if (= 1 (size Stack at:(from))) (sites ""Rings"") (sites ""RingsplusT"")) (from)) (sites Empty) (sites {(mapEntry ""Step7a"" (from)) (mapEntry ""Step7b"" (from)) (mapEntry ""Step7c"" (from)) (mapEntry ""Step7d"" (from)) (mapEntry ""Step7e"" (from)) (mapEntry (from)) (mapEntry (from)) (mapEntry (from))})}) (intersection {(sites ""Rings"") (sites Occupied by:Next) (sites {(mapEntry ""SameColor"" (arrayValue (intersection (array (sites Empty)) (array {(mapEntry ""Step7a"" (from))})) index:0)) (mapEntry ""SameColor"" (arrayValue (intersection (array (sites Empty)) (array {(mapEntry ""Step7b"" (from))})) index:0)) (mapEntry ""SameColor"" (arrayValue (intersection (array (sites Empty)) (array {(mapEntry ""Step7c"" (from))})) index:0)) (mapEntry ""SameColor"" (arrayValue (intersection (array (sites Empty)) (array {(mapEntry ""Step7d"" (from))})) index:0)) (mapEntry ""SameColor"" (arrayValue (intersection (array (sites Empty)) (array {(mapEntry ""Step7e"" (from))})) index:0)) (mapEntry ""SameColor"" (arrayValue (intersection (array (sites Empty)) (array {(mapEntry (from))})) index:0)) (mapEntry ""SameColor"" (arrayValue (intersection (array (sites Empty)) (array {(mapEntry (from))})) index:0)) (mapEntry ""SameColor"" (arrayValue (intersection (array (sites Empty)) (array {(mapEntry (from))})) index:0)) (mapEntry (from))})})})) stack:True (then (and {(set Var ""StartS"" 3) (set Var ""CntrAttack"" 0) (if (= 15 (last To)) (and {(add (piece (id ""Starter"" Mover)) (to (sites Mover ""Base"")) count:(count Stack at:(last To) if:(= (id ""Cone"" Mover) (what at:(to) level:(level)))) stack:True) (add (piece (id ""Prisoner"" Mover)) (to (sites Mover ""Prison"")) count:(count Stack at:(last To) if:(= (id ""Cone"" Next) (what at:(to) level:(level)))) stack:True) (remove 15 count:(count Stack at:(last To)))}) (if (and (is Friend (who at:(mapEntry ""SameColor"" (last To)))) (not (no Pieces in:(sites Mover ""Reserve"")))) (and (remove (sites Mover ""Reserve"")) (add (piece (id ""Starter"" Mover)) (to (sites Mover ""Base"")) stack:True)))) (set Value at:(last To) (count Stack at:(last To))) (addScore Mover (- (if (= (id Mover) 1) (mapEntry ""PipsP1"" (last To)) (mapEntry ""PipsP2"" (last To))) (if (= (id Mover) 1) (mapEntry ""PipsP1"" (last From)) (mapEntry ""PipsP2"" (last From))))) (if (> (size Stack at:(last To)) (value Piece at:(last To))) (addScore Next (- 0 (if (= (id Mover) 1) (mapEntry ""PipsP2"" (last To)) (mapEntry ""PipsP1"" (last To))))))})))))) (if (< (score Mover) 12) (if (< (score Mover) 10) (if (= (score Mover) 8) (move (from) (to (union {(intersection {(difference (if (= 1 (size Stack at:(from))) (sites ""Rings"") (sites ""RingsplusT"")) (from)) (sites Empty) (sites {(mapEntry ""Step8a"" (from)) (mapEntry ""Step8b"" (from)) (mapEntry ""Step8c"" (from)) (mapEntry ""Step8d"" (from)) (mapEntry (from)) (mapEntry (from)) (mapEntry (from)) (mapEntry (from))})}) (intersection {(sites ""Rings"") (sites Occupied by:Next) (sites {(mapEntry ""SameColor"" (arrayValue (intersection (array (sites Empty)) (array {(mapEntry ""Step8a"" (from))})) index:0)) (mapEntry ""SameColor"" (arrayValue (intersection (array (sites Empty)) (array {(mapEntry ""Step8b"" (from))})) index:0)) (mapEntry ""SameColor"" (arrayValue (intersection (array (sites Empty)) (array {(mapEntry ""Step8c"" (from))})) index:0)) (mapEntry ""SameColor"" (arrayValue (intersection (array (sites Empty)) (array {(mapEntry ""Step8d"" (from))})) index:0)) (mapEntry ""SameColor"" (arrayValue (intersection (array (sites Empty)) (array {(mapEntry (from))})) index:0)) (mapEntry ""SameColor"" (arrayValue (intersection (array (sites Empty)) (array {(mapEntry (from))})) index:0)) (mapEntry ""SameColor"" (arrayValue (intersection (array (sites Empty)) (array {(mapEntry (from))})) index:0)) (mapEntry ""SameColor"" (arrayValue (intersection (array (sites Empty)) (array {(mapEntry (from))})) index:0)) (mapEntry ""SameColor"" (from))})})})) stack:True (then (and {(set Var ""StartS"" 3) (set Var ""CntrAttack"" 0) (if (= 15 (last To)) (and {(add (piece (id ""Starter"" Mover)) (to (sites Mover ""Base"")) count:(count Stack at:(last To) if:(= (id ""Cone"" Mover) (what at:(to) level:(level)))) stack:True) (add (piece (id ""Prisoner"" Mover)) (to (sites Mover ""Prison"")) count:(count Stack at:(last To) if:(= (id ""Cone"" Next) (what at:(to) level:(level)))) stack:True) (remove 15 count:(count Stack at:(last To)))}) (if (and (is Friend (who at:(mapEntry ""SameColor"" (last To)))) (not (no Pieces in:(sites Mover ""Reserve"")))) (and (remove (sites Mover ""Reserve"")) (add (piece (id ""Starter"" Mover)) (to (sites Mover ""Base"")) stack:True)))) (set Value at:(last To) (count Stack at:(last To))) (addScore Mover (- (if (= (id Mover) 1) (mapEntry ""PipsP1"" (last To)) (mapEntry ""PipsP2"" (last To))) (if (= (id Mover) 1) (mapEntry ""PipsP1"" (last From)) (mapEntry ""PipsP2"" (last From))))) (if (> (size Stack at:(last To)) (value Piece at:(last To))) (addScore Next (- 0 (if (= (id Mover) 1) (mapEntry ""PipsP2"" (last To)) (mapEntry ""PipsP1"" (last To))))))}))) (move (from) (to (union {(intersection {(difference (if (= 1 (size Stack at:(from))) (sites ""Rings"") (sites ""RingsplusT"")) (from)) (sites Empty) (sites {(mapEntry ""Step7a"" (from)) (mapEntry ""Step7b"" (from)) (mapEntry ""Step9c"" (from)) (mapEntry ""Step9d"" (from)) (mapEntry ""Step9e"" (from)) (mapEntry ""Step9f"" (from)) (mapEntry (from)) (mapEntry (from))})}) (intersection {(sites ""Rings"") (sites Occupied by:Next) (sites {(mapEntry ""SameColor"" (arrayValue (intersection (array (sites Empty)) (array {(mapEntry ""Step7a"" (from))})) index:0)) (mapEntry ""SameColor"" (arrayValue (intersection (array (sites Empty)) (array {(mapEntry ""Step7b"" (from))})) index:0)) (mapEntry ""SameColor"" (arrayValue (intersection (array (sites Empty)) (array {(mapEntry ""Step9c"" (from))})) index:0)) (mapEntry ""SameColor"" (arrayValue (intersection (array (sites Empty)) (array {(mapEntry ""Step9d"" (from))})) index:0)) (mapEntry ""SameColor"" (arrayValue (intersection (array (sites Empty)) (array {(mapEntry ""Step9e"" (from))})) index:0)) (mapEntry ""SameColor"" (arrayValue (intersection (array (sites Empty)) (array {(mapEntry ""Step9f"" (from))})) index:0)) (mapEntry ""SameColor"" (arrayValue (intersection (array (sites Empty)) (array {(mapEntry (from))})) index:0)) (mapEntry ""SameColor"" (arrayValue (intersection (array (sites Empty)) (array {(mapEntry (from))})) index:0)) (mapEntry (from))})})})) stack:True (then (and {(set Var ""StartS"" 3) (set Var ""CntrAttack"" 0) (if (= 15 (last To)) (and {(add (piece (id ""Starter"" Mover)) (to (sites Mover ""Base"")) count:(count Stack at:(last To) if:(= (id ""Cone"" Mover) (what at:(to) level:(level)))) stack:True) (add (piece (id ""Prisoner"" Mover)) (to (sites Mover ""Prison"")) count:(count Stack at:(last To) if:(= (id ""Cone"" Next) (what at:(to) level:(level)))) stack:True) (remove 15 count:(count Stack at:(last To)))}) (if (and (is Friend (who at:(mapEntry ""SameColor"" (last To)))) (not (no Pieces in:(sites Mover ""Reserve"")))) (and (remove (sites Mover ""Reserve"")) (add (piece (id ""Starter"" Mover)) (to (sites Mover ""Base"")) stack:True)))) (set Value at:(last To) (count Stack at:(last To))) (addScore Mover (- (if (= (id Mover) 1) (mapEntry ""PipsP1"" (last To)) (mapEntry ""PipsP2"" (last To))) (if (= (id Mover) 1) (mapEntry ""PipsP1"" (last From)) (mapEntry ""PipsP2"" (last From))))) (if (> (size Stack at:(last To)) (value Piece at:(last To))) (addScore Next (- 0 (if (= (id Mover) 1) (mapEntry ""PipsP2"" (last To)) (mapEntry ""PipsP1"" (last To))))))})))) (if (= (score Mover) 10) (move (from) (to (union {(intersection {(difference (if (= 1 (size Stack at:(from))) (sites ""Rings"") (sites ""RingsplusT"")) (from)) (sites Empty) (sites {(mapEntry ""Step2a"" (from)) (mapEntry ""Step2b"" (from)) (mapEntry ""Step10c"" (from)) (mapEntry ""Step10d"" (from)) (mapEntry ""Step10e"" (from)) (mapEntry (from)) (mapEntry (from)) (mapEntry (from))})}) (intersection {(sites ""Rings"") (sites Occupied by:Next) (sites {(mapEntry ""SameColor"" (arrayValue (intersection (array (sites Empty)) (array {(mapEntry ""Step2a"" (from))})) index:0)) (mapEntry ""SameColor"" (arrayValue (intersection (array (sites Empty)) (array {(mapEntry ""Step2b"" (from))})) index:0)) (mapEntry ""SameColor"" (arrayValue (intersection (array (sites Empty)) (array {(mapEntry ""Step10c"" (from))})) index:0)) (mapEntry ""SameColor"" (arrayValue (intersection (array (sites Empty)) (array {(mapEntry ""Step10d"" (from))})) index:0)) (mapEntry ""SameColor"" (arrayValue (intersection (array (sites Empty)) (array {(mapEntry ""Step10e"" (from))})) index:0)) (mapEntry ""SameColor"" (arrayValue (intersection (array (sites Empty)) (array {(mapEntry (from))})) index:0)) (mapEntry ""SameColor"" (arrayValue (intersection (array (sites Empty)) (array {(mapEntry (from))})) index:0)) (mapEntry ""SameColor"" (arrayValue (intersection (array (sites Empty)) (array {(mapEntry (from))})) index:0)) (mapEntry (from))})})})) stack:True (then (and {(set Var ""StartS"" 3) (set Var ""CntrAttack"" 0) (if (= 15 (last To)) (and {(add (piece (id ""Starter"" Mover)) (to (sites Mover ""Base"")) count:(count Stack at:(last To) if:(= (id ""Cone"" Mover) (what at:(to) level:(level)))) stack:True) (add (piece (id ""Prisoner"" Mover)) (to (sites Mover ""Prison"")) count:(count Stack at:(last To) if:(= (id ""Cone"" Next) (what at:(to) level:(level)))) stack:True) (remove 15 count:(count Stack at:(last To)))}) (if (and (is Friend (who at:(mapEntry ""SameColor"" (last To)))) (not (no Pieces in:(sites Mover ""Reserve"")))) (and (remove (sites Mover ""Reserve"")) (add (piece (id ""Starter"" Mover)) (to (sites Mover ""Base"")) stack:True)))) (set Value at:(last To) (count Stack at:(last To))) (addScore Mover (- (if (= (id Mover) 1) (mapEntry ""PipsP1"" (last To)) (mapEntry ""PipsP2"" (last To))) (if (= (id Mover) 1) (mapEntry ""PipsP1"" (last From)) (mapEntry ""PipsP2"" (last From))))) (if (> (size Stack at:(last To)) (value Piece at:(last To))) (addScore Next (- 0 (if (= (id Mover) 1) (mapEntry ""PipsP2"" (last To)) (mapEntry ""PipsP1"" (last To))))))}))) (move (from) (to (union {(intersection {(difference (if (= 1 (size Stack at:(from))) (sites ""Rings"") (sites ""RingsplusT"")) (from)) (sites Empty) (sites {(mapEntry ""Step3a"" (from)) (mapEntry ""Step3b"" (from)) (mapEntry ""Step11c"" (from)) (mapEntry ""Step11d"" (from)) (mapEntry ""Step11e"" (from)) (mapEntry ""Step11f"" (from)) (mapEntry ""Step11g"" (from)) (mapEntry (from))})}) (intersection {(sites ""Rings"") (sites Occupied by:Next) (sites {(mapEntry ""SameColor"" (arrayValue (intersection (array (sites Empty)) (array {(mapEntry ""Step3a"" (from))})) index:0)) (mapEntry ""SameColor"" (arrayValue (intersection (array (sites Empty)) (array {(mapEntry ""Step3b"" (from))})) index:0)) (mapEntry ""SameColor"" (arrayValue (intersection (array (sites Empty)) (array {(mapEntry ""Step11c"" (from))})) index:0)) (mapEntry ""SameColor"" (arrayValue (intersection (array (sites Empty)) (array {(mapEntry ""Step11d"" (from))})) index:0)) (mapEntry ""SameColor"" (arrayValue (intersection (array (sites Empty)) (array {(mapEntry ""Step11e"" (from))})) index:0)) (mapEntry ""SameColor"" (arrayValue (intersection (array (sites Empty)) (array {(mapEntry ""Step11f"" (from))})) index:0)) (mapEntry ""SameColor"" (arrayValue (intersection (array (sites Empty)) (array {(mapEntry ""Step11g"" (from))})) index:0)) (mapEntry ""SameColor"" (arrayValue (intersection (array (sites Empty)) (array {(mapEntry (from))})) index:0)) (mapEntry (from))})})})) stack:True (then (and {(set Var ""StartS"" 3) (set Var ""CntrAttack"" 0) (if (= 15 (last To)) (and {(add (piece (id ""Starter"" Mover)) (to (sites Mover ""Base"")) count:(count Stack at:(last To) if:(= (id ""Cone"" Mover) (what at:(to) level:(level)))) stack:True) (add (piece (id ""Prisoner"" Mover)) (to (sites Mover ""Prison"")) count:(count Stack at:(last To) if:(= (id ""Cone"" Next) (what at:(to) level:(level)))) stack:True) (remove 15 count:(count Stack at:(last To)))}) (if (and (is Friend (who at:(mapEntry ""SameColor"" (last To)))) (not (no Pieces in:(sites Mover ""Reserve"")))) (and (remove (sites Mover ""Reserve"")) (add (piece (id ""Starter"" Mover)) (to (sites Mover ""Base"")) stack:True)))) (set Value at:(last To) (count Stack at:(last To))) (addScore Mover (- (if (= (id Mover) 1) (mapEntry ""PipsP1"" (last To)) (mapEntry ""PipsP2"" (last To))) (if (= (id Mover) 1) (mapEntry ""PipsP1"" (last From)) (mapEntry ""PipsP2"" (last From))))) (if (> (size Stack at:(last To)) (value Piece at:(last To))) (addScore Next (- 0 (if (= (id Mover) 1) (mapEntry ""PipsP2"" (last To)) (mapEntry ""PipsP1"" (last To))))))}))))) (if (< (score Mover) 14) (if (= (score Mover) 12) (move (from) (to (union {(intersection {(difference (if (= 1 (size Stack at:(from))) (sites ""Rings"") (sites ""RingsplusT"")) (from)) (sites Empty) (sites {(mapEntry ""Step4a"" (from)) (mapEntry ""Step12b"" (from)) (mapEntry ""Step12c"" (from)) (mapEntry ""Step12d"" (from)) (mapEntry ""Step12e"" (from)) (mapEntry ""Step12f"" (from)) (mapEntry (from)) (mapEntry (from))})}) (intersection {(sites ""Rings"") (sites Occupied by:Next) (sites {(mapEntry ""SameColor"" (arrayValue (intersection (array (sites Empty)) (array {(mapEntry ""Step4a"" (from))})) index:0)) (mapEntry ""SameColor"" (arrayValue (intersection (array (sites Empty)) (array {(mapEntry ""Step12b"" (from))})) index:0)) (mapEntry ""SameColor"" (arrayValue (intersection (array (sites Empty)) (array {(mapEntry ""Step12c"" (from))})) index:0)) (mapEntry ""SameColor"" (arrayValue (intersection (array (sites Empty)) (array {(mapEntry ""Step12d"" (from))})) index:0)) (mapEntry ""SameColor"" (arrayValue (intersection (array (sites Empty)) (array {(mapEntry ""Step12e"" (from))})) index:0)) (mapEntry ""SameColor"" (arrayValue (intersection (array (sites Empty)) (array {(mapEntry ""Step12f"" (from))})) index:0)) (mapEntry ""SameColor"" (arrayValue (intersection (array (sites Empty)) (array {(mapEntry (from))})) index:0)) (mapEntry ""SameColor"" (arrayValue (intersection (array (sites Empty)) (array {(mapEntry (from))})) index:0)) (mapEntry ""Step12g"" (from))})})})) stack:True (then (and {(set Var ""StartS"" 3) (set Var ""CntrAttack"" 0) (if (= 15 (last To)) (and {(add (piece (id ""Starter"" Mover)) (to (sites Mover ""Base"")) count:(count Stack at:(last To) if:(= (id ""Cone"" Mover) (what at:(to) level:(level)))) stack:True) (add (piece (id ""Prisoner"" Mover)) (to (sites Mover ""Prison"")) count:(count Stack at:(last To) if:(= (id ""Cone"" Next) (what at:(to) level:(level)))) stack:True) (remove 15 count:(count Stack at:(last To)))}) (if (and (is Friend (who at:(mapEntry ""SameColor"" (last To)))) (not (no Pieces in:(sites Mover ""Reserve"")))) (and (remove (sites Mover ""Reserve"")) (add (piece (id ""Starter"" Mover)) (to (sites Mover ""Base"")) stack:True)))) (set Value at:(last To) (count Stack at:(last To))) (addScore Mover (- (if (= (id Mover) 1) (mapEntry ""PipsP1"" (last To)) (mapEntry ""PipsP2"" (last To))) (if (= (id Mover) 1) (mapEntry ""PipsP1"" (last From)) (mapEntry ""PipsP2"" (last From))))) (if (> (size Stack at:(last To)) (value Piece at:(last To))) (addScore Next (- 0 (if (= (id Mover) 1) (mapEntry ""PipsP2"" (last To)) (mapEntry ""PipsP1"" (last To))))))}))) (move (from) (to (union {(intersection {(difference (if (= 1 (size Stack at:(from))) (sites ""Rings"") (sites ""RingsplusT"")) (from)) (sites Empty) (sites {(mapEntry ""Step3a"" (from)) (mapEntry ""Step3b"" (from)) (mapEntry ""Step13c"" (from)) (mapEntry ""Step13d"" (from)) (mapEntry ""Step13e"" (from)) (mapEntry ""Step13f"" (from)) (mapEntry ""Step11g"" (from)) (mapEntry (from))})}) (intersection {(sites ""Rings"") (sites Occupied by:Next) (sites {(mapEntry ""SameColor"" (arrayValue (intersection (array (sites Empty)) (array {(mapEntry ""Step3a"" (from))})) index:0)) (mapEntry ""SameColor"" (arrayValue (intersection (array (sites Empty)) (array {(mapEntry ""Step3b"" (from))})) index:0)) (mapEntry ""SameColor"" (arrayValue (intersection (array (sites Empty)) (array {(mapEntry ""Step13c"" (from))})) index:0)) (mapEntry ""SameColor"" (arrayValue (intersection (array (sites Empty)) (array {(mapEntry ""Step13d"" (from))})) index:0)) (mapEntry ""SameColor"" (arrayValue (intersection (array (sites Empty)) (array {(mapEntry ""Step13e"" (from))})) index:0)) (mapEntry ""SameColor"" (arrayValue (intersection (array (sites Empty)) (array {(mapEntry ""Step13f"" (from))})) index:0)) (mapEntry ""SameColor"" (arrayValue (intersection (array (sites Empty)) (array {(mapEntry ""Step11g"" (from))})) index:0)) (mapEntry ""SameColor"" (arrayValue (intersection (array (sites Empty)) (array {(mapEntry (from))})) index:0)) (mapEntry (from))})})})) stack:True (then (and {(set Var ""StartS"" 3) (set Var ""CntrAttack"" 0) (if (= 15 (last To)) (and {(add (piece (id ""Starter"" Mover)) (to (sites Mover ""Base"")) count:(count Stack at:(last To) if:(= (id ""Cone"" Mover) (what at:(to) level:(level)))) stack:True) (add (piece (id ""Prisoner"" Mover)) (to (sites Mover ""Prison"")) count:(count Stack at:(last To) if:(= (id ""Cone"" Next) (what at:(to) level:(level)))) stack:True) (remove 15 count:(count Stack at:(last To)))}) (if (and (is Friend (who at:(mapEntry ""SameColor"" (last To)))) (not (no Pieces in:(sites Mover ""Reserve"")))) (and (remove (sites Mover ""Reserve"")) (add (piece (id ""Starter"" Mover)) (to (sites Mover ""Base"")) stack:True)))) (set Value at:(last To) (count Stack at:(last To))) (addScore Mover (- (if (= (id Mover) 1) (mapEntry ""PipsP1"" (last To)) (mapEntry ""PipsP2"" (last To))) (if (= (id Mover) 1) (mapEntry ""PipsP1"" (last From)) (mapEntry ""PipsP2"" (last From))))) (if (> (size Stack at:(last To)) (value Piece at:(last To))) (addScore Next (- 0 (if (= (id Mover) 1) (mapEntry ""PipsP2"" (last To)) (mapEntry ""PipsP1"" (last To))))))})))) (if (= (score Mover) 14) (move (from) (to (union {(intersection {(difference (if (= 1 (size Stack at:(from))) (sites ""Rings"") (sites ""RingsplusT"")) (from)) (sites Empty) (sites {(mapEntry ""Step2a"" (from)) (mapEntry ""Step2b"" (from)) (mapEntry ""Step14c"" (from)) (mapEntry ""Step14d"" (from)) (mapEntry ""Step14e"" (from)) (mapEntry (from)) (mapEntry (from)) (mapEntry (from))})}) (intersection {(sites ""Rings"") (sites Occupied by:Next) (sites {(mapEntry ""SameColor"" (arrayValue (intersection (array (sites Empty)) (array {(mapEntry ""Step2a"" (from))})) index:0)) (mapEntry ""SameColor"" (arrayValue (intersection (array (sites Empty)) (array {(mapEntry ""Step2b"" (from))})) index:0)) (mapEntry ""SameColor"" (arrayValue (intersection (array (sites Empty)) (array {(mapEntry ""Step14c"" (from))})) index:0)) (mapEntry ""SameColor"" (arrayValue (intersection (array (sites Empty)) (array {(mapEntry ""Step14d"" (from))})) index:0)) (mapEntry ""SameColor"" (arrayValue (intersection (array (sites Empty)) (array {(mapEntry ""Step14e"" (from))})) index:0)) (mapEntry ""SameColor"" (arrayValue (intersection (array (sites Empty)) (array {(mapEntry (from))})) index:0)) (mapEntry ""SameColor"" (arrayValue (intersection (array (sites Empty)) (array {(mapEntry (from))})) index:0)) (mapEntry ""SameColor"" (arrayValue (intersection (array (sites Empty)) (array {(mapEntry (from))})) index:0)) (mapEntry ""Step14f"" (from))})})})) stack:True (then (and {(set Var ""StartS"" 3) (set Var ""CntrAttack"" 0) (if (= 15 (last To)) (and {(add (piece (id ""Starter"" Mover)) (to (sites Mover ""Base"")) count:(count Stack at:(last To) if:(= (id ""Cone"" Mover) (what at:(to) level:(level)))) stack:True) (add (piece (id ""Prisoner"" Mover)) (to (sites Mover ""Prison"")) count:(count Stack at:(last To) if:(= (id ""Cone"" Next) (what at:(to) level:(level)))) stack:True) (remove 15 count:(count Stack at:(last To)))}) (if (and (is Friend (who at:(mapEntry ""SameColor"" (last To)))) (not (no Pieces in:(sites Mover ""Reserve"")))) (and (remove (sites Mover ""Reserve"")) (add (piece (id ""Starter"" Mover)) (to (sites Mover ""Base"")) stack:True)))) (set Value at:(last To) (count Stack at:(last To))) (addScore Mover (- (if (= (id Mover) 1) (mapEntry ""PipsP1"" (last To)) (mapEntry ""PipsP2"" (last To))) (if (= (id Mover) 1) (mapEntry ""PipsP1"" (last From)) (mapEntry ""PipsP2"" (last From))))) (if (> (size Stack at:(last To)) (value Piece at:(last To))) (addScore Next (- 0 (if (= (id Mover) 1) (mapEntry ""PipsP2"" (last To)) (mapEntry ""PipsP1"" (last To))))))}))) (move (from) (to (union {(intersection {(difference (if (= 1 (size Stack at:(from))) (sites ""Rings"") (sites ""RingsplusT"")) (from)) (sites Empty) (sites {(mapEntry ""Step7a"" (from)) (mapEntry ""Step7b"" (from)) (mapEntry ""Step15c"" (from)) (mapEntry ""Step15d"" (from)) (mapEntry ""Step15e"" (from)) (mapEntry ""Step15f"" (from)) (mapEntry ""Step11f"" (from)) (mapEntry ""Step11g"" (from))})}) (intersection {(sites ""Rings"") (sites Occupied by:Next) (sites {(mapEntry ""SameColor"" (arrayValue (intersection (array (sites Empty)) (array {(mapEntry ""Step7a"" (from))})) index:0)) (mapEntry ""SameColor"" (arrayValue (intersection (array (sites Empty)) (array {(mapEntry ""Step7b"" (from))})) index:0)) (mapEntry ""SameColor"" (arrayValue (intersection (array (sites Empty)) (array {(mapEntry ""Step15c"" (from))})) index:0)) (mapEntry ""SameColor"" (arrayValue (intersection (array (sites Empty)) (array {(mapEntry ""Step15d"" (from))})) index:0)) (mapEntry ""SameColor"" (arrayValue (intersection (array (sites Empty)) (array {(mapEntry ""Step15e"" (from))})) index:0)) (mapEntry ""SameColor"" (arrayValue (intersection (array (sites Empty)) (array {(mapEntry ""Step15f"" (from))})) index:0)) (mapEntry ""SameColor"" (arrayValue (intersection (array (sites Empty)) (array {(mapEntry ""Step11f"" (from))})) index:0)) (mapEntry ""SameColor"" (arrayValue (intersection (array (sites Empty)) (array {(mapEntry ""Step11g"" (from))})) index:0)) (mapEntry (from))})})})) stack:True (then (and {(set Var ""StartS"" 3) (set Var ""CntrAttack"" 0) (if (= 15 (last To)) (and {(add (piece (id ""Starter"" Mover)) (to (sites Mover ""Base"")) count:(count Stack at:(last To) if:(= (id ""Cone"" Mover) (what at:(to) level:(level)))) stack:True) (add (piece (id ""Prisoner"" Mover)) (to (sites Mover ""Prison"")) count:(count Stack at:(last To) if:(= (id ""Cone"" Next) (what at:(to) level:(level)))) stack:True) (remove 15 count:(count Stack at:(last To)))}) (if (and (is Friend (who at:(mapEntry ""SameColor"" (last To)))) (not (no Pieces in:(sites Mover ""Reserve"")))) (and (remove (sites Mover ""Reserve"")) (add (piece (id ""Starter"" Mover)) (to (sites Mover ""Base"")) stack:True)))) (set Value at:(last To) (count Stack at:(last To))) (addScore Mover (- (if (= (id Mover) 1) (mapEntry ""PipsP1"" (last To)) (mapEntry ""PipsP2"" (last To))) (if (= (id Mover) 1) (mapEntry ""PipsP1"" (last From)) (mapEntry ""PipsP2"" (last From))))) (if (> (size Stack at:(last To)) (value Piece at:(last To))) (addScore Next (- 0 (if (= (id Mover) 1) (mapEntry ""PipsP2"" (last To)) (mapEntry ""PipsP1"" (last To))))))}))))))) (if (< (score Mover) 20) (if (< (score Mover) 18) (if (= (score Mover) 16) (move (from) (to (union {(intersection {(difference (if (= 1 (size Stack at:(from))) (sites ""Rings"") (sites ""RingsplusT"")) (from)) (sites Empty) (sites {(mapEntry ""Step8a"" (from)) (mapEntry ""Step8b"" (from)) (mapEntry ""Step16c"" (from)) (mapEntry ""Step16d"" (from)) (mapEntry ""Step16e"" (from)) (mapEntry ""Step16f"" (from)) (mapEntry ""Step16g"" (from)) (mapEntry (from))})}) (intersection {(sites ""Rings"") (sites Occupied by:Next) (sites {(mapEntry ""SameColor"" (arrayValue (intersection (array (sites Empty)) (array {(mapEntry ""Step8a"" (from))})) index:0)) (mapEntry ""SameColor"" (arrayValue (intersection (array (sites Empty)) (array {(mapEntry ""Step8b"" (from))})) index:0)) (mapEntry ""SameColor"" (arrayValue (intersection (array (sites Empty)) (array {(mapEntry ""Step16c"" (from))})) index:0)) (mapEntry ""SameColor"" (arrayValue (intersection (array (sites Empty)) (array {(mapEntry ""Step16d"" (from))})) index:0)) (mapEntry ""SameColor"" (arrayValue (intersection (array (sites Empty)) (array {(mapEntry ""Step16e"" (from))})) index:0)) (mapEntry ""SameColor"" (arrayValue (intersection (array (sites Empty)) (array {(mapEntry ""Step16f"" (from))})) index:0)) (mapEntry ""SameColor"" (arrayValue (intersection (array (sites Empty)) (array {(mapEntry ""Step16g"" (from))})) index:0)) (mapEntry ""SameColor"" (arrayValue (intersection (array (sites Empty)) (array {(mapEntry (from))})) index:0)) (mapEntry ""SameColor"" (from))})})})) stack:True (then (and {(set Var ""StartS"" 3) (set Var ""CntrAttack"" 0) (if (= 15 (last To)) (and {(add (piece (id ""Starter"" Mover)) (to (sites Mover ""Base"")) count:(count Stack at:(last To) if:(= (id ""Cone"" Mover) (what at:(to) level:(level)))) stack:True) (add (piece (id ""Prisoner"" Mover)) (to (sites Mover ""Prison"")) count:(count Stack at:(last To) if:(= (id ""Cone"" Next) (what at:(to) level:(level)))) stack:True) (remove 15 count:(count Stack at:(last To)))}) (if (and (is Friend (who at:(mapEntry ""SameColor"" (last To)))) (not (no Pieces in:(sites Mover ""Reserve"")))) (and (remove (sites Mover ""Reserve"")) (add (piece (id ""Starter"" Mover)) (to (sites Mover ""Base"")) stack:True)))) (set Value at:(last To) (count Stack at:(last To))) (addScore Mover (- (if (= (id Mover) 1) (mapEntry ""PipsP1"" (last To)) (mapEntry ""PipsP2"" (last To))) (if (= (id Mover) 1) (mapEntry ""PipsP1"" (last From)) (mapEntry ""PipsP2"" (last From))))) (if (> (size Stack at:(last To)) (value Piece at:(last To))) (addScore Next (- 0 (if (= (id Mover) 1) (mapEntry ""PipsP2"" (last To)) (mapEntry ""PipsP1"" (last To))))))}))) (move (from) (to (union {(intersection {(difference (if (= 1 (size Stack at:(from))) (sites ""Rings"") (sites ""RingsplusT"")) (from)) (sites Empty) (sites {(mapEntry ""Step7a"" (from)) (mapEntry ""Step7b"" (from)) (mapEntry ""Step17c"" (from)) (mapEntry ""Step17d"" (from)) (mapEntry ""Step17e"" (from)) (mapEntry ""Step17f"" (from)) (mapEntry ""Step17g"" (from)) (mapEntry ""Step17h"" (from))})}) (intersection {(sites ""Rings"") (sites Occupied by:Next) (sites {(mapEntry ""SameColor"" (arrayValue (intersection (array (sites Empty)) (array {(mapEntry ""Step7a"" (from))})) index:0)) (mapEntry ""SameColor"" (arrayValue (intersection (array (sites Empty)) (array {(mapEntry ""Step7b"" (from))})) index:0)) (mapEntry ""SameColor"" (arrayValue (intersection (array (sites Empty)) (array {(mapEntry ""Step17c"" (from))})) index:0)) (mapEntry ""SameColor"" (arrayValue (intersection (array (sites Empty)) (array {(mapEntry ""Step17d"" (from))})) index:0)) (mapEntry ""SameColor"" (arrayValue (intersection (array (sites Empty)) (array {(mapEntry ""Step17e"" (from))})) index:0)) (mapEntry ""SameColor"" (arrayValue (intersection (array (sites Empty)) (array {(mapEntry ""Step17f"" (from))})) index:0)) (mapEntry ""SameColor"" (arrayValue (intersection (array (sites Empty)) (array {(mapEntry ""Step17g"" (from))})) index:0)) (mapEntry ""SameColor"" (arrayValue (intersection (array (sites Empty)) (array {(mapEntry ""Step17h"" (from))})) index:0)) (mapEntry (from))})})})) stack:True (then (and {(set Var ""StartS"" 3) (set Var ""CntrAttack"" 0) (if (= 15 (last To)) (and {(add (piece (id ""Starter"" Mover)) (to (sites Mover ""Base"")) count:(count Stack at:(last To) if:(= (id ""Cone"" Mover) (what at:(to) level:(level)))) stack:True) (add (piece (id ""Prisoner"" Mover)) (to (sites Mover ""Prison"")) count:(count Stack at:(last To) if:(= (id ""Cone"" Next) (what at:(to) level:(level)))) stack:True) (remove 15 count:(count Stack at:(last To)))}) (if (and (is Friend (who at:(mapEntry ""SameColor"" (last To)))) (not (no Pieces in:(sites Mover ""Reserve"")))) (and (remove (sites Mover ""Reserve"")) (add (piece (id ""Starter"" Mover)) (to (sites Mover ""Base"")) stack:True)))) (set Value at:(last To) (count Stack at:(last To))) (addScore Mover (- (if (= (id Mover) 1) (mapEntry ""PipsP1"" (last To)) (mapEntry ""PipsP2"" (last To))) (if (= (id Mover) 1) (mapEntry ""PipsP1"" (last From)) (mapEntry ""PipsP2"" (last From))))) (if (> (size Stack at:(last To)) (value Piece at:(last To))) (addScore Next (- 0 (if (= (id Mover) 1) (mapEntry ""PipsP2"" (last To)) (mapEntry ""PipsP1"" (last To))))))})))) (if (= (score Mover) 18) (move (from) (to (union {(intersection {(difference (if (= 1 (size Stack at:(from))) (sites ""Rings"") (sites ""RingsplusT"")) (from)) (sites Empty) (sites {(mapEntry ""Step2a"" (from)) (mapEntry ""Step2b"" (from)) (mapEntry ""Step18c"" (from)) (mapEntry ""Step18d"" (from)) (mapEntry ""Step18e"" (from)) (mapEntry ""Step18f"" (from)) (mapEntry (from)) (mapEntry (from))})}) (intersection {(sites ""Rings"") (sites Occupied by:Next) (sites {(mapEntry ""SameColor"" (arrayValue (intersection (array (sites Empty)) (array {(mapEntry ""Step2a"" (from))})) index:0)) (mapEntry ""SameColor"" (arrayValue (intersection (array (sites Empty)) (array {(mapEntry ""Step2b"" (from))})) index:0)) (mapEntry ""SameColor"" (arrayValue (intersection (array (sites Empty)) (array {(mapEntry ""Step18c"" (from))})) index:0)) (mapEntry ""SameColor"" (arrayValue (intersection (array (sites Empty)) (array {(mapEntry ""Step18d"" (from))})) index:0)) (mapEntry ""SameColor"" (arrayValue (intersection (array (sites Empty)) (array {(mapEntry ""Step18e"" (from))})) index:0)) (mapEntry ""SameColor"" (arrayValue (intersection (array (sites Empty)) (array {(mapEntry ""Step18f"" (from))})) index:0)) (mapEntry ""SameColor"" (arrayValue (intersection (array (sites Empty)) (array {(mapEntry (from))})) index:0)) (mapEntry ""SameColor"" (arrayValue (intersection (array (sites Empty)) (array {(mapEntry (from))})) index:0)) (mapEntry ""Step18g"" (from))})})})) stack:True (then (and {(set Var ""StartS"" 3) (set Var ""CntrAttack"" 0) (if (= 15 (last To)) (and {(add (piece (id ""Starter"" Mover)) (to (sites Mover ""Base"")) count:(count Stack at:(last To) if:(= (id ""Cone"" Mover) (what at:(to) level:(level)))) stack:True) (add (piece (id ""Prisoner"" Mover)) (to (sites Mover ""Prison"")) count:(count Stack at:(last To) if:(= (id ""Cone"" Next) (what at:(to) level:(level)))) stack:True) (remove 15 count:(count Stack at:(last To)))}) (if (and (is Friend (who at:(mapEntry ""SameColor"" (last To)))) (not (no Pieces in:(sites Mover ""Reserve"")))) (and (remove (sites Mover ""Reserve"")) (add (piece (id ""Starter"" Mover)) (to (sites Mover ""Base"")) stack:True)))) (set Value at:(last To) (count Stack at:(last To))) (addScore Mover (- (if (= (id Mover) 1) (mapEntry ""PipsP1"" (last To)) (mapEntry ""PipsP2"" (last To))) (if (= (id Mover) 1) (mapEntry ""PipsP1"" (last From)) (mapEntry ""PipsP2"" (last From))))) (if (> (size Stack at:(last To)) (value Piece at:(last To))) (addScore Next (- 0 (if (= (id Mover) 1) (mapEntry ""PipsP2"" (last To)) (mapEntry ""PipsP1"" (last To))))))}))) (and (move (from) (to (union {(intersection {(difference (if (= 1 (size Stack at:(from))) (sites ""Rings"") (sites ""RingsplusT"")) (from)) (sites Empty) (sites {(mapEntry ""Step3a"" (from)) (mapEntry ""Step3b"" (from)) (mapEntry ""Step19c"" (from)) (mapEntry ""Step19d"" (from)) (mapEntry ""Step19e"" (from)) (mapEntry ""Step19f"" (from)) (mapEntry ""Step19g"" (from)) (mapEntry ""Step19h"" (from))})}) (intersection {(sites ""Rings"") (sites Occupied by:Next) (sites {(mapEntry ""SameColor"" (arrayValue (intersection (array (sites Empty)) (array {(mapEntry ""Step3a"" (from))})) index:0)) (mapEntry ""SameColor"" (arrayValue (intersection (array (sites Empty)) (array {(mapEntry ""Step3b"" (from))})) index:0)) (mapEntry ""SameColor"" (arrayValue (intersection (array (sites Empty)) (array {(mapEntry ""Step19c"" (from))})) index:0)) (mapEntry ""SameColor"" (arrayValue (intersection (array (sites Empty)) (array {(mapEntry ""Step19d"" (from))})) index:0)) (mapEntry ""SameColor"" (arrayValue (intersection (array (sites Empty)) (array {(mapEntry ""Step19e"" (from))})) index:0)) (mapEntry ""SameColor"" (arrayValue (intersection (array (sites Empty)) (array {(mapEntry ""Step19f"" (from))})) index:0)) (mapEntry ""SameColor"" (arrayValue (intersection (array (sites Empty)) (array {(mapEntry ""Step19g"" (from))})) index:0)) (mapEntry ""SameColor"" (arrayValue (intersection (array (sites Empty)) (array {(mapEntry ""Step19h"" (from))})) index:0)) (mapEntry (from))})})})) stack:True (then (and {(set Var ""StartS"" 3) (set Var ""CntrAttack"" 0) (if (= 15 (last To)) (and {(add (piece (id ""Starter"" Mover)) (to (sites Mover ""Base"")) count:(count Stack at:(last To) if:(= (id ""Cone"" Mover) (what at:(to) level:(level)))) stack:True) (add (piece (id ""Prisoner"" Mover)) (to (sites Mover ""Prison"")) count:(count Stack at:(last To) if:(= (id ""Cone"" Next) (what at:(to) level:(level)))) stack:True) (remove 15 count:(count Stack at:(last To)))}) (if (and (is Friend (who at:(mapEntry ""SameColor"" (last To)))) (not (no Pieces in:(sites Mover ""Reserve"")))) (and (remove (sites Mover ""Reserve"")) (add (piece (id ""Starter"" Mover)) (to (sites Mover ""Base"")) stack:True)))) (set Value at:(last To) (count Stack at:(last To))) (addScore Mover (- (if (= (id Mover) 1) (mapEntry ""PipsP1"" (last To)) (mapEntry ""PipsP2"" (last To))) (if (= (id Mover) 1) (mapEntry ""PipsP1"" (last From)) (mapEntry ""PipsP2"" (last From))))) (if (> (size Stack at:(last To)) (value Piece at:(last To))) (addScore Next (- 0 (if (= (id Mover) 1) (mapEntry ""PipsP2"" (last To)) (mapEntry ""PipsP1"" (last To))))))}))) (move (from) (to (union {(intersection {(difference (if (= 1 (size Stack at:(from))) (sites ""Rings"") (sites ""RingsplusT"")) (from)) (sites Empty) (sites {(mapEntry ""Step19i"" (from)) (mapEntry (from)) (mapEntry (from)) (mapEntry (from)) (mapEntry (from)) (mapEntry (from)) (mapEntry (from)) (mapEntry (from))})}) (intersection {(sites ""Rings"") (sites Occupied by:Next) (sites {(mapEntry ""SameColor"" (arrayValue (intersection (array (sites Empty)) (array {(mapEntry ""Step19i"" (from))})) index:0)) (mapEntry ""SameColor"" (arrayValue (intersection (array (sites Empty)) (array {(mapEntry (from))})) index:0)) (mapEntry ""SameColor"" (arrayValue (intersection (array (sites Empty)) (array {(mapEntry (from))})) index:0)) (mapEntry ""SameColor"" (arrayValue (intersection (array (sites Empty)) (array {(mapEntry (from))})) index:0)) (mapEntry ""SameColor"" (arrayValue (intersection (array (sites Empty)) (array {(mapEntry (from))})) index:0)) (mapEntry ""SameColor"" (arrayValue (intersection (array (sites Empty)) (array {(mapEntry (from))})) index:0)) (mapEntry ""SameColor"" (arrayValue (intersection (array (sites Empty)) (array {(mapEntry (from))})) index:0)) (mapEntry ""SameColor"" (arrayValue (intersection (array (sites Empty)) (array {(mapEntry (from))})) index:0)) (mapEntry (from))})})})) stack:True (then (and {(set Var ""StartS"" 3) (set Var ""CntrAttack"" 0) (if (= 15 (last To)) (and {(add (piece (id ""Starter"" Mover)) (to (sites Mover ""Base"")) count:(count Stack at:(last To) if:(= (id ""Cone"" Mover) (what at:(to) level:(level)))) stack:True) (add (piece (id ""Prisoner"" Mover)) (to (sites Mover ""Prison"")) count:(count Stack at:(last To) if:(= (id ""Cone"" Next) (what at:(to) level:(level)))) stack:True) (remove 15 count:(count Stack at:(last To)))}) (if (and (is Friend (who at:(mapEntry ""SameColor"" (last To)))) (not (no Pieces in:(sites Mover ""Reserve"")))) (and (remove (sites Mover ""Reserve"")) (add (piece (id ""Starter"" Mover)) (to (sites Mover ""Base"")) stack:True)))) (set Value at:(last To) (count Stack at:(last To))) (addScore Mover (- (if (= (id Mover) 1) (mapEntry ""PipsP1"" (last To)) (mapEntry ""PipsP2"" (last To))) (if (= (id Mover) 1) (mapEntry ""PipsP1"" (last From)) (mapEntry ""PipsP2"" (last From))))) (if (> (size Stack at:(last To)) (value Piece at:(last To))) (addScore Next (- 0 (if (= (id Mover) 1) (mapEntry ""PipsP2"" (last To)) (mapEntry ""PipsP1"" (last To))))))})))))) (if (= 20 (score Mover)) (move (from) (to (union {(intersection {(difference (if (= 1 (size Stack at:(from))) (sites ""Rings"") (sites ""RingsplusT"")) (from)) (sites Empty) (sites {(mapEntry ""Step4a"" (from)) (mapEntry ""Step20b"" (from)) (mapEntry ""Step20c"" (from)) (mapEntry ""Step20d"" (from)) (mapEntry ""Step20e"" (from)) (mapEntry ""Step20f"" (from)) (mapEntry ""Step20g"" (from)) (mapEntry (from))})}) (intersection {(sites ""Rings"") (sites Occupied by:Next) (sites {(mapEntry ""SameColor"" (arrayValue (intersection (array (sites Empty)) (array {(mapEntry ""Step4a"" (from))})) index:0)) (mapEntry ""SameColor"" (arrayValue (intersection (array (sites Empty)) (array {(mapEntry ""Step20b"" (from))})) index:0)) (mapEntry ""SameColor"" (arrayValue (intersection (array (sites Empty)) (array {(mapEntry ""Step20c"" (from))})) index:0)) (mapEntry ""SameColor"" (arrayValue (intersection (array (sites Empty)) (array {(mapEntry ""Step20d"" (from))})) index:0)) (mapEntry ""SameColor"" (arrayValue (intersection (array (sites Empty)) (array {(mapEntry ""Step20e"" (from))})) index:0)) (mapEntry ""SameColor"" (arrayValue (intersection (array (sites Empty)) (array {(mapEntry ""Step20f"" (from))})) index:0)) (mapEntry ""SameColor"" (arrayValue (intersection (array (sites Empty)) (array {(mapEntry ""Step20g"" (from))})) index:0)) (mapEntry ""SameColor"" (arrayValue (intersection (array (sites Empty)) (array {(mapEntry (from))})) index:0)) (mapEntry ""SameColor"" (from))})})})) stack:True (then (and {(set Var ""StartS"" 3) (set Var ""CntrAttack"" 0) (if (= 15 (last To)) (and {(add (piece (id ""Starter"" Mover)) (to (sites Mover ""Base"")) count:(count Stack at:(last To) if:(= (id ""Cone"" Mover) (what at:(to) level:(level)))) stack:True) (add (piece (id ""Prisoner"" Mover)) (to (sites Mover ""Prison"")) count:(count Stack at:(last To) if:(= (id ""Cone"" Next) (what at:(to) level:(level)))) stack:True) (remove 15 count:(count Stack at:(last To)))}) (if (and (is Friend (who at:(mapEntry ""SameColor"" (last To)))) (not (no Pieces in:(sites Mover ""Reserve"")))) (and (remove (sites Mover ""Reserve"")) (add (piece (id ""Starter"" Mover)) (to (sites Mover ""Base"")) stack:True)))) (set Value at:(last To) (count Stack at:(last To))) (addScore Mover (- (if (= (id Mover) 1) (mapEntry ""PipsP1"" (last To)) (mapEntry ""PipsP2"" (last To))) (if (= (id Mover) 1) (mapEntry ""PipsP1"" (last From)) (mapEntry ""PipsP2"" (last From))))) (if (> (size Stack at:(last To)) (value Piece at:(last To))) (addScore Next (- 0 (if (= (id Mover) 1) (mapEntry ""PipsP2"" (last To)) (mapEntry ""PipsP1"" (last To))))))}))))))) (if (< (score Mover) 16) (if (< (score Mover) 8) (if (< (score Mover) 4) (if (< (score Mover) 2) (if (= (score Mover) 1) (move (from) (to (union {(intersection {(difference (if (= 1 (size Stack at:(from))) (sites ""Rings"") (sites ""RingsplusT"")) (from)) (sites Empty) (sites {(mapEntry ""Step7a"" (from)) (mapEntry ""Step7b"" (from)) (mapEntry ""Step1c"" (from)) (mapEntry (from)) (mapEntry (from)) (mapEntry (from)) (mapEntry (from)) (mapEntry (from))})}) (intersection {(sites ""Rings"") (sites Occupied by:Next) (sites {(mapEntry ""SameColor"" (arrayValue (intersection (array (sites Empty)) (array {(mapEntry ""Step7a"" (from))})) index:0)) (mapEntry ""SameColor"" (arrayValue (intersection (array (sites Empty)) (array {(mapEntry ""Step7b"" (from))})) index:0)) (mapEntry ""SameColor"" (arrayValue (intersection (array (sites Empty)) (array {(mapEntry ""Step1c"" (from))})) index:0)) (mapEntry ""SameColor"" (arrayValue (intersection (array (sites Empty)) (array {(mapEntry (from))})) index:0)) (mapEntry ""SameColor"" (arrayValue (intersection (array (sites Empty)) (array {(mapEntry (from))})) index:0)) (mapEntry ""SameColor"" (arrayValue (intersection (array (sites Empty)) (array {(mapEntry (from))})) index:0)) (mapEntry ""SameColor"" (arrayValue (intersection (array (sites Empty)) (array {(mapEntry (from))})) index:0)) (mapEntry ""SameColor"" (arrayValue (intersection (array (sites Empty)) (array {(mapEntry (from))})) index:0)) (mapEntry (from))})})})) stack:True (then (and {(set Var ""StartS"" 3) (set Var ""CntrAttack"" 0) (if (= 15 (last To)) (and {(add (piece (id ""Starter"" Mover)) (to (sites Mover ""Base"")) count:(count Stack at:(last To) if:(= (id ""Cone"" Mover) (what at:(to) level:(level)))) stack:True) (add (piece (id ""Prisoner"" Mover)) (to (sites Mover ""Prison"")) count:(count Stack at:(last To) if:(= (id ""Cone"" Next) (what at:(to) level:(level)))) stack:True) (remove 15 count:(count Stack at:(last To)))}) (if (and (is Friend (who at:(mapEntry ""SameColor"" (last To)))) (not (no Pieces in:(sites Mover ""Reserve"")))) (and (remove (sites Mover ""Reserve"")) (add (piece (id ""Starter"" Mover)) (to (sites Mover ""Base"")) stack:True)))) (set Value at:(last To) (count Stack at:(last To))) (addScore Mover (- (if (= (id Mover) 1) (mapEntry ""PipsP1"" (last To)) (mapEntry ""PipsP2"" (last To))) (if (= (id Mover) 1) (mapEntry ""PipsP1"" (last From)) (mapEntry ""PipsP2"" (last From))))) (if (> (size Stack at:(last To)) (value Piece at:(last To))) (addScore Next (- 0 (if (= (id Mover) 1) (mapEntry ""PipsP2"" (last To)) (mapEntry ""PipsP1"" (last To))))))})))) (if (= (score Mover) 2) (move (from) (to (union {(intersection {(difference (if (= 1 (size Stack at:(from))) (sites ""Rings"") (sites ""RingsplusT"")) (from)) (sites Empty) (sites {(mapEntry ""Step2a"" (from)) (mapEntry ""Step2b"" (from)) (mapEntry ""Step2c"" (from)) (mapEntry (from)) (mapEntry (from)) (mapEntry (from)) (mapEntry (from)) (mapEntry (from))})}) (intersection {(sites ""Rings"") (sites Occupied by:Next) (sites {(mapEntry ""SameColor"" (arrayValue (intersection (array (sites Empty)) (array {(mapEntry ""Step2a"" (from))})) index:0)) (mapEntry ""SameColor"" (arrayValue (intersection (array (sites Empty)) (array {(mapEntry ""Step2b"" (from))})) index:0)) (mapEntry ""SameColor"" (arrayValue (intersection (array (sites Empty)) (array {(mapEntry ""Step2c"" (from))})) index:0)) (mapEntry ""SameColor"" (arrayValue (intersection (array (sites Empty)) (array {(mapEntry (from))})) index:0)) (mapEntry ""SameColor"" (arrayValue (intersection (array (sites Empty)) (array {(mapEntry (from))})) index:0)) (mapEntry ""SameColor"" (arrayValue (intersection (array (sites Empty)) (array {(mapEntry (from))})) index:0)) (mapEntry ""SameColor"" (arrayValue (intersection (array (sites Empty)) (array {(mapEntry (from))})) index:0)) (mapEntry ""SameColor"" (arrayValue (intersection (array (sites Empty)) (array {(mapEntry (from))})) index:0)) (mapEntry (from))})})})) stack:True (then (and {(set Var ""StartS"" 3) (set Var ""CntrAttack"" 0) (if (= 15 (last To)) (and {(add (piece (id ""Starter"" Mover)) (to (sites Mover ""Base"")) count:(count Stack at:(last To) if:(= (id ""Cone"" Mover) (what at:(to) level:(level)))) stack:True) (add (piece (id ""Prisoner"" Mover)) (to (sites Mover ""Prison"")) count:(count Stack at:(last To) if:(= (id ""Cone"" Next) (what at:(to) level:(level)))) stack:True) (remove 15 count:(count Stack at:(last To)))}) (if (and (is Friend (who at:(mapEntry ""SameColor"" (last To)))) (not (no Pieces in:(sites Mover ""Reserve"")))) (and (remove (sites Mover ""Reserve"")) (add (piece (id ""Starter"" Mover)) (to (sites Mover ""Base"")) stack:True)))) (set Value at:(last To) (count Stack at:(last To))) (addScore Mover (- (if (= (id Mover) 1) (mapEntry ""PipsP1"" (last To)) (mapEntry ""PipsP2"" (last To))) (if (= (id Mover) 1) (mapEntry ""PipsP1"" (last From)) (mapEntry ""PipsP2"" (last From))))) (if (> (size Stack at:(last To)) (value Piece at:(last To))) (addScore Next (- 0 (if (= (id Mover) 1) (mapEntry ""PipsP2"" (last To)) (mapEntry ""PipsP1"" (last To))))))}))) (move (from) (to (union {(intersection {(difference (if (= 1 (size Stack at:(from))) (sites ""Rings"") (sites ""RingsplusT"")) (from)) (sites Empty) (sites {(mapEntry ""Step3a"" (from)) (mapEntry ""Step3b"" (from)) (mapEntry ""Step3c"" (from)) (mapEntry ""Step3d"" (from)) (mapEntry (from)) (mapEntry (from)) (mapEntry (from)) (mapEntry (from))})}) (intersection {(sites ""Rings"") (sites Occupied by:Next) (sites {(mapEntry ""SameColor"" (arrayValue (intersection (array (sites Empty)) (array {(mapEntry ""Step3a"" (from))})) index:0)) (mapEntry ""SameColor"" (arrayValue (intersection (array (sites Empty)) (array {(mapEntry ""Step3b"" (from))})) index:0)) (mapEntry ""SameColor"" (arrayValue (intersection (array (sites Empty)) (array {(mapEntry ""Step3c"" (from))})) index:0)) (mapEntry ""SameColor"" (arrayValue (intersection (array (sites Empty)) (array {(mapEntry ""Step3d"" (from))})) index:0)) (mapEntry ""SameColor"" (arrayValue (intersection (array (sites Empty)) (array {(mapEntry (from))})) index:0)) (mapEntry ""SameColor"" (arrayValue (intersection (array (sites Empty)) (array {(mapEntry (from))})) index:0)) (mapEntry ""SameColor"" (arrayValue (intersection (array (sites Empty)) (array {(mapEntry (from))})) index:0)) (mapEntry ""SameColor"" (arrayValue (intersection (array (sites Empty)) (array {(mapEntry (from))})) index:0)) (mapEntry (from))})})})) stack:True (then (and {(set Var ""StartS"" 3) (set Var ""CntrAttack"" 0) (if (= 15 (last To)) (and {(add (piece (id ""Starter"" Mover)) (to (sites Mover ""Base"")) count:(count Stack at:(last To) if:(= (id ""Cone"" Mover) (what at:(to) level:(level)))) stack:True) (add (piece (id ""Prisoner"" Mover)) (to (sites Mover ""Prison"")) count:(count Stack at:(last To) if:(= (id ""Cone"" Next) (what at:(to) level:(level)))) stack:True) (remove 15 count:(count Stack at:(last To)))}) (if (and (is Friend (who at:(mapEntry ""SameColor"" (last To)))) (not (no Pieces in:(sites Mover ""Reserve"")))) (and (remove (sites Mover ""Reserve"")) (add (piece (id ""Starter"" Mover)) (to (sites Mover ""Base"")) stack:True)))) (set Value at:(last To) (count Stack at:(last To))) (addScore Mover (- (if (= (id Mover) 1) (mapEntry ""PipsP1"" (last To)) (mapEntry ""PipsP2"" (last To))) (if (= (id Mover) 1) (mapEntry ""PipsP1"" (last From)) (mapEntry ""PipsP2"" (last From))))) (if (> (size Stack at:(last To)) (value Piece at:(last To))) (addScore Next (- 0 (if (= (id Mover) 1) (mapEntry ""PipsP2"" (last To)) (mapEntry ""PipsP1"" (last To))))))}))))) (if (< (score Mover) 6) (if (= (score Mover) 4) (move (from) (to (union {(intersection {(difference (if (= 1 (size Stack at:(from))) (sites ""Rings"") (sites ""RingsplusT"")) (from)) (sites Empty) (sites {(mapEntry ""Step4a"" (from)) (mapEntry ""Step4b"" (from)) (mapEntry ""Step4c"" (from)) (mapEntry (from)) (mapEntry (from)) (mapEntry (from)) (mapEntry (from)) (mapEntry (from))})}) (intersection {(sites ""Rings"") (sites Occupied by:Next) (sites {(mapEntry ""SameColor"" (arrayValue (intersection (array (sites Empty)) (array {(mapEntry ""Step4a"" (from))})) index:0)) (mapEntry ""SameColor"" (arrayValue (intersection (array (sites Empty)) (array {(mapEntry ""Step4b"" (from))})) index:0)) (mapEntry ""SameColor"" (arrayValue (intersection (array (sites Empty)) (array {(mapEntry ""Step4c"" (from))})) index:0)) (mapEntry ""SameColor"" (arrayValue (intersection (array (sites Empty)) (array {(mapEntry (from))})) index:0)) (mapEntry ""SameColor"" (arrayValue (intersection (array (sites Empty)) (array {(mapEntry (from))})) index:0)) (mapEntry ""SameColor"" (arrayValue (intersection (array (sites Empty)) (array {(mapEntry (from))})) index:0)) (mapEntry ""SameColor"" (arrayValue (intersection (array (sites Empty)) (array {(mapEntry (from))})) index:0)) (mapEntry ""SameColor"" (arrayValue (intersection (array (sites Empty)) (array {(mapEntry (from))})) index:0)) (mapEntry (from))})})})) stack:True (then (and {(set Var ""StartS"" 3) (set Var ""CntrAttack"" 0) (if (= 15 (last To)) (and {(add (piece (id ""Starter"" Mover)) (to (sites Mover ""Base"")) count:(count Stack at:(last To) if:(= (id ""Cone"" Mover) (what at:(to) level:(level)))) stack:True) (add (piece (id ""Prisoner"" Mover)) (to (sites Mover ""Prison"")) count:(count Stack at:(last To) if:(= (id ""Cone"" Next) (what at:(to) level:(level)))) stack:True) (remove 15 count:(count Stack at:(last To)))}) (if (and (is Friend (who at:(mapEntry ""SameColor"" (last To)))) (not (no Pieces in:(sites Mover ""Reserve"")))) (and (remove (sites Mover ""Reserve"")) (add (piece (id ""Starter"" Mover)) (to (sites Mover ""Base"")) stack:True)))) (set Value at:(last To) (count Stack at:(last To))) (addScore Mover (- (if (= (id Mover) 1) (mapEntry ""PipsP1"" (last To)) (mapEntry ""PipsP2"" (last To))) (if (= (id Mover) 1) (mapEntry ""PipsP1"" (last From)) (mapEntry ""PipsP2"" (last From))))) (if (> (size Stack at:(last To)) (value Piece at:(last To))) (addScore Next (- 0 (if (= (id Mover) 1) (mapEntry ""PipsP2"" (last To)) (mapEntry ""PipsP1"" (last To))))))}))) (move (from) (to (union {(intersection {(difference (if (= 1 (size Stack at:(from))) (sites ""Rings"") (sites ""RingsplusT"")) (from)) (sites Empty) (sites {(mapEntry ""Step3a"" (from)) (mapEntry ""Step3b"" (from)) (mapEntry ""Step5c"" (from)) (mapEntry ""Step5d"" (from)) (mapEntry (from)) (mapEntry (from)) (mapEntry (from)) (mapEntry (from))})}) (intersection {(sites ""Rings"") (sites Occupied by:Next) (sites {(mapEntry ""SameColor"" (arrayValue (intersection (array (sites Empty)) (array {(mapEntry ""Step3a"" (from))})) index:0)) (mapEntry ""SameColor"" (arrayValue (intersection (array (sites Empty)) (array {(mapEntry ""Step3b"" (from))})) index:0)) (mapEntry ""SameColor"" (arrayValue (intersection (array (sites Empty)) (array {(mapEntry ""Step5c"" (from))})) index:0)) (mapEntry ""SameColor"" (arrayValue (intersection (array (sites Empty)) (array {(mapEntry ""Step5d"" (from))})) index:0)) (mapEntry ""SameColor"" (arrayValue (intersection (array (sites Empty)) (array {(mapEntry (from))})) index:0)) (mapEntry ""SameColor"" (arrayValue (intersection (array (sites Empty)) (array {(mapEntry (from))})) index:0)) (mapEntry ""SameColor"" (arrayValue (intersection (array (sites Empty)) (array {(mapEntry (from))})) index:0)) (mapEntry ""SameColor"" (arrayValue (intersection (array (sites Empty)) (array {(mapEntry (from))})) index:0)) (mapEntry (from))})})})) stack:True (then (and {(set Var ""StartS"" 3) (set Var ""CntrAttack"" 0) (if (= 15 (last To)) (and {(add (piece (id ""Starter"" Mover)) (to (sites Mover ""Base"")) count:(count Stack at:(last To) if:(= (id ""Cone"" Mover) (what at:(to) level:(level)))) stack:True) (add (piece (id ""Prisoner"" Mover)) (to (sites Mover ""Prison"")) count:(count Stack at:(last To) if:(= (id ""Cone"" Next) (what at:(to) level:(level)))) stack:True) (remove 15 count:(count Stack at:(last To)))}) (if (and (is Friend (who at:(mapEntry ""SameColor"" (last To)))) (not (no Pieces in:(sites Mover ""Reserve"")))) (and (remove (sites Mover ""Reserve"")) (add (piece (id ""Starter"" Mover)) (to (sites Mover ""Base"")) stack:True)))) (set Value at:(last To) (count Stack at:(last To))) (addScore Mover (- (if (= (id Mover) 1) (mapEntry ""PipsP1"" (last To)) (mapEntry ""PipsP2"" (last To))) (if (= (id Mover) 1) (mapEntry ""PipsP1"" (last From)) (mapEntry ""PipsP2"" (last From))))) (if (> (size Stack at:(last To)) (value Piece at:(last To))) (addScore Next (- 0 (if (= (id Mover) 1) (mapEntry ""PipsP2"" (last To)) (mapEntry ""PipsP1"" (last To))))))})))) (if (= (score Mover) 6) (move (from) (to (union {(intersection {(difference (if (= 1 (size Stack at:(from))) (sites ""Rings"") (sites ""RingsplusT"")) (from)) (sites Empty) (sites {(mapEntry ""Step2a"" (from)) (mapEntry ""Step2b"" (from)) (mapEntry ""Step6c"" (from)) (mapEntry ""Step6d"" (from)) (mapEntry ""Step6e"" (from)) (mapEntry (from)) (mapEntry (from)) (mapEntry (from))})}) (intersection {(sites ""Rings"") (sites Occupied by:Next) (sites {(mapEntry ""SameColor"" (arrayValue (intersection (array (sites Empty)) (array {(mapEntry ""Step2a"" (from))})) index:0)) (mapEntry ""SameColor"" (arrayValue (intersection (array (sites Empty)) (array {(mapEntry ""Step2b"" (from))})) index:0)) (mapEntry ""SameColor"" (arrayValue (intersection (array (sites Empty)) (array {(mapEntry ""Step6c"" (from))})) index:0)) (mapEntry ""SameColor"" (arrayValue (intersection (array (sites Empty)) (array {(mapEntry ""Step6d"" (from))})) index:0)) (mapEntry ""SameColor"" (arrayValue (intersection (array (sites Empty)) (array {(mapEntry ""Step6e"" (from))})) index:0)) (mapEntry ""SameColor"" (arrayValue (intersection (array (sites Empty)) (array {(mapEntry (from))})) index:0)) (mapEntry ""SameColor"" (arrayValue (intersection (array (sites Empty)) (array {(mapEntry (from))})) index:0)) (mapEntry ""SameColor"" (arrayValue (intersection (array (sites Empty)) (array {(mapEntry (from))})) index:0)) (mapEntry (from))})})})) stack:True (then (and {(set Var ""StartS"" 3) (set Var ""CntrAttack"" 0) (if (= 15 (last To)) (and {(add (piece (id ""Starter"" Mover)) (to (sites Mover ""Base"")) count:(count Stack at:(last To) if:(= (id ""Cone"" Mover) (what at:(to) level:(level)))) stack:True) (add (piece (id ""Prisoner"" Mover)) (to (sites Mover ""Prison"")) count:(count Stack at:(last To) if:(= (id ""Cone"" Next) (what at:(to) level:(level)))) stack:True) (remove 15 count:(count Stack at:(last To)))}) (if (and (is Friend (who at:(mapEntry ""SameColor"" (last To)))) (not (no Pieces in:(sites Mover ""Reserve"")))) (and (remove (sites Mover ""Reserve"")) (add (piece (id ""Starter"" Mover)) (to (sites Mover ""Base"")) stack:True)))) (set Value at:(last To) (count Stack at:(last To))) (addScore Mover (- (if (= (id Mover) 1) (mapEntry ""PipsP1"" (last To)) (mapEntry ""PipsP2"" (last To))) (if (= (id Mover) 1) (mapEntry ""PipsP1"" (last From)) (mapEntry ""PipsP2"" (last From))))) (if (> (size Stack at:(last To)) (value Piece at:(last To))) (addScore Next (- 0 (if (= (id Mover) 1) (mapEntry ""PipsP2"" (last To)) (mapEntry ""PipsP1"" (last To))))))}))) (move (from) (to (union {(intersection {(difference (if (= 1 (size Stack at:(from))) (sites ""Rings"") (sites ""RingsplusT"")) (from)) (sites Empty) (sites {(mapEntry ""Step7a"" (from)) (mapEntry ""Step7b"" (from)) (mapEntry ""Step7c"" (from)) (mapEntry ""Step7d"" (from)) (mapEntry ""Step7e"" (from)) (mapEntry (from)) (mapEntry (from)) (mapEntry (from))})}) (intersection {(sites ""Rings"") (sites Occupied by:Next) (sites {(mapEntry ""SameColor"" (arrayValue (intersection (array (sites Empty)) (array {(mapEntry ""Step7a"" (from))})) index:0)) (mapEntry ""SameColor"" (arrayValue (intersection (array (sites Empty)) (array {(mapEntry ""Step7b"" (from))})) index:0)) (mapEntry ""SameColor"" (arrayValue (intersection (array (sites Empty)) (array {(mapEntry ""Step7c"" (from))})) index:0)) (mapEntry ""SameColor"" (arrayValue (intersection (array (sites Empty)) (array {(mapEntry ""Step7d"" (from))})) index:0)) (mapEntry ""SameColor"" (arrayValue (intersection (array (sites Empty)) (array {(mapEntry ""Step7e"" (from))})) index:0)) (mapEntry ""SameColor"" (arrayValue (intersection (array (sites Empty)) (array {(mapEntry (from))})) index:0)) (mapEntry ""SameColor"" (arrayValue (intersection (array (sites Empty)) (array {(mapEntry (from))})) index:0)) (mapEntry ""SameColor"" (arrayValue (intersection (array (sites Empty)) (array {(mapEntry (from))})) index:0)) (mapEntry (from))})})})) stack:True (then (and {(set Var ""StartS"" 3) (set Var ""CntrAttack"" 0) (if (= 15 (last To)) (and {(add (piece (id ""Starter"" Mover)) (to (sites Mover ""Base"")) count:(count Stack at:(last To) if:(= (id ""Cone"" Mover) (what at:(to) level:(level)))) stack:True) (add (piece (id ""Prisoner"" Mover)) (to (sites Mover ""Prison"")) count:(count Stack at:(last To) if:(= (id ""Cone"" Next) (what at:(to) level:(level)))) stack:True) (remove 15 count:(count Stack at:(last To)))}) (if (and (is Friend (who at:(mapEntry ""SameColor"" (last To)))) (not (no Pieces in:(sites Mover ""Reserve"")))) (and (remove (sites Mover ""Reserve"")) (add (piece (id ""Starter"" Mover)) (to (sites Mover ""Base"")) stack:True)))) (set Value at:(last To) (count Stack at:(last To))) (addScore Mover (- (if (= (id Mover) 1) (mapEntry ""PipsP1"" (last To)) (mapEntry ""PipsP2"" (last To))) (if (= (id Mover) 1) (mapEntry ""PipsP1"" (last From)) (mapEntry ""PipsP2"" (last From))))) (if (> (size Stack at:(last To)) (value Piece at:(last To))) (addScore Next (- 0 (if (= (id Mover) 1) (mapEntry ""PipsP2"" (last To)) (mapEntry ""PipsP1"" (last To))))))})))))) (if (< (score Mover) 12) (if (< (score Mover) 10) (if (= (score Mover) 8) (move (from) (to (union {(intersection {(difference (if (= 1 (size Stack at:(from))) (sites ""Rings"") (sites ""RingsplusT"")) (from)) (sites Empty) (sites {(mapEntry ""Step8a"" (from)) (mapEntry ""Step8b"" (from)) (mapEntry ""Step8c"" (from)) (mapEntry ""Step8d"" (from)) (mapEntry (from)) (mapEntry (from)) (mapEntry (from)) (mapEntry (from))})}) (intersection {(sites ""Rings"") (sites Occupied by:Next) (sites {(mapEntry ""SameColor"" (arrayValue (intersection (array (sites Empty)) (array {(mapEntry ""Step8a"" (from))})) index:0)) (mapEntry ""SameColor"" (arrayValue (intersection (array (sites Empty)) (array {(mapEntry ""Step8b"" (from))})) index:0)) (mapEntry ""SameColor"" (arrayValue (intersection (array (sites Empty)) (array {(mapEntry ""Step8c"" (from))})) index:0)) (mapEntry ""SameColor"" (arrayValue (intersection (array (sites Empty)) (array {(mapEntry ""Step8d"" (from))})) index:0)) (mapEntry ""SameColor"" (arrayValue (intersection (array (sites Empty)) (array {(mapEntry (from))})) index:0)) (mapEntry ""SameColor"" (arrayValue (intersection (array (sites Empty)) (array {(mapEntry (from))})) index:0)) (mapEntry ""SameColor"" (arrayValue (intersection (array (sites Empty)) (array {(mapEntry (from))})) index:0)) (mapEntry ""SameColor"" (arrayValue (intersection (array (sites Empty)) (array {(mapEntry (from))})) index:0)) (mapEntry ""SameColor"" (from))})})})) stack:True (then (and {(set Var ""StartS"" 3) (set Var ""CntrAttack"" 0) (if (= 15 (last To)) (and {(add (piece (id ""Starter"" Mover)) (to (sites Mover ""Base"")) count:(count Stack at:(last To) if:(= (id ""Cone"" Mover) (what at:(to) level:(level)))) stack:True) (add (piece (id ""Prisoner"" Mover)) (to (sites Mover ""Prison"")) count:(count Stack at:(last To) if:(= (id ""Cone"" Next) (what at:(to) level:(level)))) stack:True) (remove 15 count:(count Stack at:(last To)))}) (if (and (is Friend (who at:(mapEntry ""SameColor"" (last To)))) (not (no Pieces in:(sites Mover ""Reserve"")))) (and (remove (sites Mover ""Reserve"")) (add (piece (id ""Starter"" Mover)) (to (sites Mover ""Base"")) stack:True)))) (set Value at:(last To) (count Stack at:(last To))) (addScore Mover (- (if (= (id Mover) 1) (mapEntry ""PipsP1"" (last To)) (mapEntry ""PipsP2"" (last To))) (if (= (id Mover) 1) (mapEntry ""PipsP1"" (last From)) (mapEntry ""PipsP2"" (last From))))) (if (> (size Stack at:(last To)) (value Piece at:(last To))) (addScore Next (- 0 (if (= (id Mover) 1) (mapEntry ""PipsP2"" (last To)) (mapEntry ""PipsP1"" (last To))))))}))) (move (from) (to (union {(intersection {(difference (if (= 1 (size Stack at:(from))) (sites ""Rings"") (sites ""RingsplusT"")) (from)) (sites Empty) (sites {(mapEntry ""Step7a"" (from)) (mapEntry ""Step7b"" (from)) (mapEntry ""Step9c"" (from)) (mapEntry ""Step9d"" (from)) (mapEntry ""Step9e"" (from)) (mapEntry ""Step9f"" (from)) (mapEntry (from)) (mapEntry (from))})}) (intersection {(sites ""Rings"") (sites Occupied by:Next) (sites {(mapEntry ""SameColor"" (arrayValue (intersection (array (sites Empty)) (array {(mapEntry ""Step7a"" (from))})) index:0)) (mapEntry ""SameColor"" (arrayValue (intersection (array (sites Empty)) (array {(mapEntry ""Step7b"" (from))})) index:0)) (mapEntry ""SameColor"" (arrayValue (intersection (array (sites Empty)) (array {(mapEntry ""Step9c"" (from))})) index:0)) (mapEntry ""SameColor"" (arrayValue (intersection (array (sites Empty)) (array {(mapEntry ""Step9d"" (from))})) index:0)) (mapEntry ""SameColor"" (arrayValue (intersection (array (sites Empty)) (array {(mapEntry ""Step9e"" (from))})) index:0)) (mapEntry ""SameColor"" (arrayValue (intersection (array (sites Empty)) (array {(mapEntry ""Step9f"" (from))})) index:0)) (mapEntry ""SameColor"" (arrayValue (intersection (array (sites Empty)) (array {(mapEntry (from))})) index:0)) (mapEntry ""SameColor"" (arrayValue (intersection (array (sites Empty)) (array {(mapEntry (from))})) index:0)) (mapEntry (from))})})})) stack:True (then (and {(set Var ""StartS"" 3) (set Var ""CntrAttack"" 0) (if (= 15 (last To)) (and {(add (piece (id ""Starter"" Mover)) (to (sites Mover ""Base"")) count:(count Stack at:(last To) if:(= (id ""Cone"" Mover) (what at:(to) level:(level)))) stack:True) (add (piece (id ""Prisoner"" Mover)) (to (sites Mover ""Prison"")) count:(count Stack at:(last To) if:(= (id ""Cone"" Next) (what at:(to) level:(level)))) stack:True) (remove 15 count:(count Stack at:(last To)))}) (if (and (is Friend (who at:(mapEntry ""SameColor"" (last To)))) (not (no Pieces in:(sites Mover ""Reserve"")))) (and (remove (sites Mover ""Reserve"")) (add (piece (id ""Starter"" Mover)) (to (sites Mover ""Base"")) stack:True)))) (set Value at:(last To) (count Stack at:(last To))) (addScore Mover (- (if (= (id Mover) 1) (mapEntry ""PipsP1"" (last To)) (mapEntry ""PipsP2"" (last To))) (if (= (id Mover) 1) (mapEntry ""PipsP1"" (last From)) (mapEntry ""PipsP2"" (last From))))) (if (> (size Stack at:(last To)) (value Piece at:(last To))) (addScore Next (- 0 (if (= (id Mover) 1) (mapEntry ""PipsP2"" (last To)) (mapEntry ""PipsP1"" (last To))))))})))) (if (= (score Mover) 10) (move (from) (to (union {(intersection {(difference (if (= 1 (size Stack at:(from))) (sites ""Rings"") (sites ""RingsplusT"")) (from)) (sites Empty) (sites {(mapEntry ""Step2a"" (from)) (mapEntry ""Step2b"" (from)) (mapEntry ""Step10c"" (from)) (mapEntry ""Step10d"" (from)) (mapEntry ""Step10e"" (from)) (mapEntry (from)) (mapEntry (from)) (mapEntry (from))})}) (intersection {(sites ""Rings"") (sites Occupied by:Next) (sites {(mapEntry ""SameColor"" (arrayValue (intersection (array (sites Empty)) (array {(mapEntry ""Step2a"" (from))})) index:0)) (mapEntry ""SameColor"" (arrayValue (intersection (array (sites Empty)) (array {(mapEntry ""Step2b"" (from))})) index:0)) (mapEntry ""SameColor"" (arrayValue (intersection (array (sites Empty)) (array {(mapEntry ""Step10c"" (from))})) index:0)) (mapEntry ""SameColor"" (arrayValue (intersection (array (sites Empty)) (array {(mapEntry ""Step10d"" (from))})) index:0)) (mapEntry ""SameColor"" (arrayValue (intersection (array (sites Empty)) (array {(mapEntry ""Step10e"" (from))})) index:0)) (mapEntry ""SameColor"" (arrayValue (intersection (array (sites Empty)) (array {(mapEntry (from))})) index:0)) (mapEntry ""SameColor"" (arrayValue (intersection (array (sites Empty)) (array {(mapEntry (from))})) index:0)) (mapEntry ""SameColor"" (arrayValue (intersection (array (sites Empty)) (array {(mapEntry (from))})) index:0)) (mapEntry (from))})})})) stack:True (then (and {(set Var ""StartS"" 3) (set Var ""CntrAttack"" 0) (if (= 15 (last To)) (and {(add (piece (id ""Starter"" Mover)) (to (sites Mover ""Base"")) count:(count Stack at:(last To) if:(= (id ""Cone"" Mover) (what at:(to) level:(level)))) stack:True) (add (piece (id ""Prisoner"" Mover)) (to (sites Mover ""Prison"")) count:(count Stack at:(last To) if:(= (id ""Cone"" Next) (what at:(to) level:(level)))) stack:True) (remove 15 count:(count Stack at:(last To)))}) (if (and (is Friend (who at:(mapEntry ""SameColor"" (last To)))) (not (no Pieces in:(sites Mover ""Reserve"")))) (and (remove (sites Mover ""Reserve"")) (add (piece (id ""Starter"" Mover)) (to (sites Mover ""Base"")) stack:True)))) (set Value at:(last To) (count Stack at:(last To))) (addScore Mover (- (if (= (id Mover) 1) (mapEntry ""PipsP1"" (last To)) (mapEntry ""PipsP2"" (last To))) (if (= (id Mover) 1) (mapEntry ""PipsP1"" (last From)) (mapEntry ""PipsP2"" (last From))))) (if (> (size Stack at:(last To)) (value Piece at:(last To))) (addScore Next (- 0 (if (= (id Mover) 1) (mapEntry ""PipsP2"" (last To)) (mapEntry ""PipsP1"" (last To))))))}))) (move (from) (to (union {(intersection {(difference (if (= 1 (size Stack at:(from))) (sites ""Rings"") (sites ""RingsplusT"")) (from)) (sites Empty) (sites {(mapEntry ""Step3a"" (from)) (mapEntry ""Step3b"" (from)) (mapEntry ""Step11c"" (from)) (mapEntry ""Step11d"" (from)) (mapEntry ""Step11e"" (from)) (mapEntry ""Step11f"" (from)) (mapEntry ""Step11g"" (from)) (mapEntry (from))})}) (intersection {(sites ""Rings"") (sites Occupied by:Next) (sites {(mapEntry ""SameColor"" (arrayValue (intersection (array (sites Empty)) (array {(mapEntry ""Step3a"" (from))})) index:0)) (mapEntry ""SameColor"" (arrayValue (intersection (array (sites Empty)) (array {(mapEntry ""Step3b"" (from))})) index:0)) (mapEntry ""SameColor"" (arrayValue (intersection (array (sites Empty)) (array {(mapEntry ""Step11c"" (from))})) index:0)) (mapEntry ""SameColor"" (arrayValue (intersection (array (sites Empty)) (array {(mapEntry ""Step11d"" (from))})) index:0)) (mapEntry ""SameColor"" (arrayValue (intersection (array (sites Empty)) (array {(mapEntry ""Step11e"" (from))})) index:0)) (mapEntry ""SameColor"" (arrayValue (intersection (array (sites Empty)) (array {(mapEntry ""Step11f"" (from))})) index:0)) (mapEntry ""SameColor"" (arrayValue (intersection (array (sites Empty)) (array {(mapEntry ""Step11g"" (from))})) index:0)) (mapEntry ""SameColor"" (arrayValue (intersection (array (sites Empty)) (array {(mapEntry (from))})) index:0)) (mapEntry (from))})})})) stack:True (then (and {(set Var ""StartS"" 3) (set Var ""CntrAttack"" 0) (if (= 15 (last To)) (and {(add (piece (id ""Starter"" Mover)) (to (sites Mover ""Base"")) count:(count Stack at:(last To) if:(= (id ""Cone"" Mover) (what at:(to) level:(level)))) stack:True) (add (piece (id ""Prisoner"" Mover)) (to (sites Mover ""Prison"")) count:(count Stack at:(last To) if:(= (id ""Cone"" Next) (what at:(to) level:(level)))) stack:True) (remove 15 count:(count Stack at:(last To)))}) (if (and (is Friend (who at:(mapEntry ""SameColor"" (last To)))) (not (no Pieces in:(sites Mover ""Reserve"")))) (and (remove (sites Mover ""Reserve"")) (add (piece (id ""Starter"" Mover)) (to (sites Mover ""Base"")) stack:True)))) (set Value at:(last To) (count Stack at:(last To))) (addScore Mover (- (if (= (id Mover) 1) (mapEntry ""PipsP1"" (last To)) (mapEntry ""PipsP2"" (last To))) (if (= (id Mover) 1) (mapEntry ""PipsP1"" (last From)) (mapEntry ""PipsP2"" (last From))))) (if (> (size Stack at:(last To)) (value Piece at:(last To))) (addScore Next (- 0 (if (= (id Mover) 1) (mapEntry ""PipsP2"" (last To)) (mapEntry ""PipsP1"" (last To))))))}))))) (if (< (score Mover) 14) (if (= (score Mover) 12) (move (from) (to (union {(intersection {(difference (if (= 1 (size Stack at:(from))) (sites ""Rings"") (sites ""RingsplusT"")) (from)) (sites Empty) (sites {(mapEntry ""Step4a"" (from)) (mapEntry ""Step12b"" (from)) (mapEntry ""Step12c"" (from)) (mapEntry ""Step12d"" (from)) (mapEntry ""Step12e"" (from)) (mapEntry ""Step12f"" (from)) (mapEntry (from)) (mapEntry (from))})}) (intersection {(sites ""Rings"") (sites Occupied by:Next) (sites {(mapEntry ""SameColor"" (arrayValue (intersection (array (sites Empty)) (array {(mapEntry ""Step4a"" (from))})) index:0)) (mapEntry ""SameColor"" (arrayValue (intersection (array (sites Empty)) (array {(mapEntry ""Step12b"" (from))})) index:0)) (mapEntry ""SameColor"" (arrayValue (intersection (array (sites Empty)) (array {(mapEntry ""Step12c"" (from))})) index:0)) (mapEntry ""SameColor"" (arrayValue (intersection (array (sites Empty)) (array {(mapEntry ""Step12d"" (from))})) index:0)) (mapEntry ""SameColor"" (arrayValue (intersection (array (sites Empty)) (array {(mapEntry ""Step12e"" (from))})) index:0)) (mapEntry ""SameColor"" (arrayValue (intersection (array (sites Empty)) (array {(mapEntry ""Step12f"" (from))})) index:0)) (mapEntry ""SameColor"" (arrayValue (intersection (array (sites Empty)) (array {(mapEntry (from))})) index:0)) (mapEntry ""SameColor"" (arrayValue (intersection (array (sites Empty)) (array {(mapEntry (from))})) index:0)) (mapEntry ""Step12g"" (from))})})})) stack:True (then (and {(set Var ""StartS"" 3) (set Var ""CntrAttack"" 0) (if (= 15 (last To)) (and {(add (piece (id ""Starter"" Mover)) (to (sites Mover ""Base"")) count:(count Stack at:(last To) if:(= (id ""Cone"" Mover) (what at:(to) level:(level)))) stack:True) (add (piece (id ""Prisoner"" Mover)) (to (sites Mover ""Prison"")) count:(count Stack at:(last To) if:(= (id ""Cone"" Next) (what at:(to) level:(level)))) stack:True) (remove 15 count:(count Stack at:(last To)))}) (if (and (is Friend (who at:(mapEntry ""SameColor"" (last To)))) (not (no Pieces in:(sites Mover ""Reserve"")))) (and (remove (sites Mover ""Reserve"")) (add (piece (id ""Starter"" Mover)) (to (sites Mover ""Base"")) stack:True)))) (set Value at:(last To) (count Stack at:(last To))) (addScore Mover (- (if (= (id Mover) 1) (mapEntry ""PipsP1"" (last To)) (mapEntry ""PipsP2"" (last To))) (if (= (id Mover) 1) (mapEntry ""PipsP1"" (last From)) (mapEntry ""PipsP2"" (last From))))) (if (> (size Stack at:(last To)) (value Piece at:(last To))) (addScore Next (- 0 (if (= (id Mover) 1) (mapEntry ""PipsP2"" (last To)) (mapEntry ""PipsP1"" (last To))))))}))) (move (from) (to (union {(intersection {(difference (if (= 1 (size Stack at:(from))) (sites ""Rings"") (sites ""RingsplusT"")) (from)) (sites Empty) (sites {(mapEntry ""Step3a"" (from)) (mapEntry ""Step3b"" (from)) (mapEntry ""Step13c"" (from)) (mapEntry ""Step13d"" (from)) (mapEntry ""Step13e"" (from)) (mapEntry ""Step13f"" (from)) (mapEntry ""Step11g"" (from)) (mapEntry (from))})}) (intersection {(sites ""Rings"") (sites Occupied by:Next) (sites {(mapEntry ""SameColor"" (arrayValue (intersection (array (sites Empty)) (array {(mapEntry ""Step3a"" (from))})) index:0)) (mapEntry ""SameColor"" (arrayValue (intersection (array (sites Empty)) (array {(mapEntry ""Step3b"" (from))})) index:0)) (mapEntry ""SameColor"" (arrayValue (intersection (array (sites Empty)) (array {(mapEntry ""Step13c"" (from))})) index:0)) (mapEntry ""SameColor"" (arrayValue (intersection (array (sites Empty)) (array {(mapEntry ""Step13d"" (from))})) index:0)) (mapEntry ""SameColor"" (arrayValue (intersection (array (sites Empty)) (array {(mapEntry ""Step13e"" (from))})) index:0)) (mapEntry ""SameColor"" (arrayValue (intersection (array (sites Empty)) (array {(mapEntry ""Step13f"" (from))})) index:0)) (mapEntry ""SameColor"" (arrayValue (intersection (array (sites Empty)) (array {(mapEntry ""Step11g"" (from))})) index:0)) (mapEntry ""SameColor"" (arrayValue (intersection (array (sites Empty)) (array {(mapEntry (from))})) index:0)) (mapEntry (from))})})})) stack:True (then (and {(set Var ""StartS"" 3) (set Var ""CntrAttack"" 0) (if (= 15 (last To)) (and {(add (piece (id ""Starter"" Mover)) (to (sites Mover ""Base"")) count:(count Stack at:(last To) if:(= (id ""Cone"" Mover) (what at:(to) level:(level)))) stack:True) (add (piece (id ""Prisoner"" Mover)) (to (sites Mover ""Prison"")) count:(count Stack at:(last To) if:(= (id ""Cone"" Next) (what at:(to) level:(level)))) stack:True) (remove 15 count:(count Stack at:(last To)))}) (if (and (is Friend (who at:(mapEntry ""SameColor"" (last To)))) (not (no Pieces in:(sites Mover ""Reserve"")))) (and (remove (sites Mover ""Reserve"")) (add (piece (id ""Starter"" Mover)) (to (sites Mover ""Base"")) stack:True)))) (set Value at:(last To) (count Stack at:(last To))) (addScore Mover (- (if (= (id Mover) 1) (mapEntry ""PipsP1"" (last To)) (mapEntry ""PipsP2"" (last To))) (if (= (id Mover) 1) (mapEntry ""PipsP1"" (last From)) (mapEntry ""PipsP2"" (last From))))) (if (> (size Stack at:(last To)) (value Piece at:(last To))) (addScore Next (- 0 (if (= (id Mover) 1) (mapEntry ""PipsP2"" (last To)) (mapEntry ""PipsP1"" (last To))))))})))) (if (= (score Mover) 14) (move (from) (to (union {(intersection {(difference (if (= 1 (size Stack at:(from))) (sites ""Rings"") (sites ""RingsplusT"")) (from)) (sites Empty) (sites {(mapEntry ""Step2a"" (from)) (mapEntry ""Step2b"" (from)) (mapEntry ""Step14c"" (from)) (mapEntry ""Step14d"" (from)) (mapEntry ""Step14e"" (from)) (mapEntry (from)) (mapEntry (from)) (mapEntry (from))})}) (intersection {(sites ""Rings"") (sites Occupied by:Next) (sites {(mapEntry ""SameColor"" (arrayValue (intersection (array (sites Empty)) (array {(mapEntry ""Step2a"" (from))})) index:0)) (mapEntry ""SameColor"" (arrayValue (intersection (array (sites Empty)) (array {(mapEntry ""Step2b"" (from))})) index:0)) (mapEntry ""SameColor"" (arrayValue (intersection (array (sites Empty)) (array {(mapEntry ""Step14c"" (from))})) index:0)) (mapEntry ""SameColor"" (arrayValue (intersection (array (sites Empty)) (array {(mapEntry ""Step14d"" (from))})) index:0)) (mapEntry ""SameColor"" (arrayValue (intersection (array (sites Empty)) (array {(mapEntry ""Step14e"" (from))})) index:0)) (mapEntry ""SameColor"" (arrayValue (intersection (array (sites Empty)) (array {(mapEntry (from))})) index:0)) (mapEntry ""SameColor"" (arrayValue (intersection (array (sites Empty)) (array {(mapEntry (from))})) index:0)) (mapEntry ""SameColor"" (arrayValue (intersection (array (sites Empty)) (array {(mapEntry (from))})) index:0)) (mapEntry ""Step14f"" (from))})})})) stack:True (then (and {(set Var ""StartS"" 3) (set Var ""CntrAttack"" 0) (if (= 15 (last To)) (and {(add (piece (id ""Starter"" Mover)) (to (sites Mover ""Base"")) count:(count Stack at:(last To) if:(= (id ""Cone"" Mover) (what at:(to) level:(level)))) stack:True) (add (piece (id ""Prisoner"" Mover)) (to (sites Mover ""Prison"")) count:(count Stack at:(last To) if:(= (id ""Cone"" Next) (what at:(to) level:(level)))) stack:True) (remove 15 count:(count Stack at:(last To)))}) (if (and (is Friend (who at:(mapEntry ""SameColor"" (last To)))) (not (no Pieces in:(sites Mover ""Reserve"")))) (and (remove (sites Mover ""Reserve"")) (add (piece (id ""Starter"" Mover)) (to (sites Mover ""Base"")) stack:True)))) (set Value at:(last To) (count Stack at:(last To))) (addScore Mover (- (if (= (id Mover) 1) (mapEntry ""PipsP1"" (last To)) (mapEntry ""PipsP2"" (last To))) (if (= (id Mover) 1) (mapEntry ""PipsP1"" (last From)) (mapEntry ""PipsP2"" (last From))))) (if (> (size Stack at:(last To)) (value Piece at:(last To))) (addScore Next (- 0 (if (= (id Mover) 1) (mapEntry ""PipsP2"" (last To)) (mapEntry ""PipsP1"" (last To))))))}))) (move (from) (to (union {(intersection {(difference (if (= 1 (size Stack at:(from))) (sites ""Rings"") (sites ""RingsplusT"")) (from)) (sites Empty) (sites {(mapEntry ""Step7a"" (from)) (mapEntry ""Step7b"" (from)) (mapEntry ""Step15c"" (from)) (mapEntry ""Step15d"" (from)) (mapEntry ""Step15e"" (from)) (mapEntry ""Step15f"" (from)) (mapEntry ""Step11f"" (from)) (mapEntry ""Step11g"" (from))})}) (intersection {(sites ""Rings"") (sites Occupied by:Next) (sites {(mapEntry ""SameColor"" (arrayValue (intersection (array (sites Empty)) (array {(mapEntry ""Step7a"" (from))})) index:0)) (mapEntry ""SameColor"" (arrayValue (intersection (array (sites Empty)) (array {(mapEntry ""Step7b"" (from))})) index:0)) (mapEntry ""SameColor"" (arrayValue (intersection (array (sites Empty)) (array {(mapEntry ""Step15c"" (from))})) index:0)) (mapEntry ""SameColor"" (arrayValue (intersection (array (sites Empty)) (array {(mapEntry ""Step15d"" (from))})) index:0)) (mapEntry ""SameColor"" (arrayValue (intersection (array (sites Empty)) (array {(mapEntry ""Step15e"" (from))})) index:0)) (mapEntry ""SameColor"" (arrayValue (intersection (array (sites Empty)) (array {(mapEntry ""Step15f"" (from))})) index:0)) (mapEntry ""SameColor"" (arrayValue (intersection (array (sites Empty)) (array {(mapEntry ""Step11f"" (from))})) index:0)) (mapEntry ""SameColor"" (arrayValue (intersection (array (sites Empty)) (array {(mapEntry ""Step11g"" (from))})) index:0)) (mapEntry (from))})})})) stack:True (then (and {(set Var ""StartS"" 3) (set Var ""CntrAttack"" 0) (if (= 15 (last To)) (and {(add (piece (id ""Starter"" Mover)) (to (sites Mover ""Base"")) count:(count Stack at:(last To) if:(= (id ""Cone"" Mover) (what at:(to) level:(level)))) stack:True) (add (piece (id ""Prisoner"" Mover)) (to (sites Mover ""Prison"")) count:(count Stack at:(last To) if:(= (id ""Cone"" Next) (what at:(to) level:(level)))) stack:True) (remove 15 count:(count Stack at:(last To)))}) (if (and (is Friend (who at:(mapEntry ""SameColor"" (last To)))) (not (no Pieces in:(sites Mover ""Reserve"")))) (and (remove (sites Mover ""Reserve"")) (add (piece (id ""Starter"" Mover)) (to (sites Mover ""Base"")) stack:True)))) (set Value at:(last To) (count Stack at:(last To))) (addScore Mover (- (if (= (id Mover) 1) (mapEntry ""PipsP1"" (last To)) (mapEntry ""PipsP2"" (last To))) (if (= (id Mover) 1) (mapEntry ""PipsP1"" (last From)) (mapEntry ""PipsP2"" (last From))))) (if (> (size Stack at:(last To)) (value Piece at:(last To))) (addScore Next (- 0 (if (= (id Mover) 1) (mapEntry ""PipsP2"" (last To)) (mapEntry ""PipsP1"" (last To))))))}))))))) (if (< (score Mover) 20) (if (< (score Mover) 18) (if (= (score Mover) 16) (move (from) (to (union {(intersection {(difference (if (= 1 (size Stack at:(from))) (sites ""Rings"") (sites ""RingsplusT"")) (from)) (sites Empty) (sites {(mapEntry ""Step8a"" (from)) (mapEntry ""Step8b"" (from)) (mapEntry ""Step16c"" (from)) (mapEntry ""Step16d"" (from)) (mapEntry ""Step16e"" (from)) (mapEntry ""Step16f"" (from)) (mapEntry ""Step16g"" (from)) (mapEntry (from))})}) (intersection {(sites ""Rings"") (sites Occupied by:Next) (sites {(mapEntry ""SameColor"" (arrayValue (intersection (array (sites Empty)) (array {(mapEntry ""Step8a"" (from))})) index:0)) (mapEntry ""SameColor"" (arrayValue (intersection (array (sites Empty)) (array {(mapEntry ""Step8b"" (from))})) index:0)) (mapEntry ""SameColor"" (arrayValue (intersection (array (sites Empty)) (array {(mapEntry ""Step16c"" (from))})) index:0)) (mapEntry ""SameColor"" (arrayValue (intersection (array (sites Empty)) (array {(mapEntry ""Step16d"" (from))})) index:0)) (mapEntry ""SameColor"" (arrayValue (intersection (array (sites Empty)) (array {(mapEntry ""Step16e"" (from))})) index:0)) (mapEntry ""SameColor"" (arrayValue (intersection (array (sites Empty)) (array {(mapEntry ""Step16f"" (from))})) index:0)) (mapEntry ""SameColor"" (arrayValue (intersection (array (sites Empty)) (array {(mapEntry ""Step16g"" (from))})) index:0)) (mapEntry ""SameColor"" (arrayValue (intersection (array (sites Empty)) (array {(mapEntry (from))})) index:0)) (mapEntry ""SameColor"" (from))})})})) stack:True (then (and {(set Var ""StartS"" 3) (set Var ""CntrAttack"" 0) (if (= 15 (last To)) (and {(add (piece (id ""Starter"" Mover)) (to (sites Mover ""Base"")) count:(count Stack at:(last To) if:(= (id ""Cone"" Mover) (what at:(to) level:(level)))) stack:True) (add (piece (id ""Prisoner"" Mover)) (to (sites Mover ""Prison"")) count:(count Stack at:(last To) if:(= (id ""Cone"" Next) (what at:(to) level:(level)))) stack:True) (remove 15 count:(count Stack at:(last To)))}) (if (and (is Friend (who at:(mapEntry ""SameColor"" (last To)))) (not (no Pieces in:(sites Mover ""Reserve"")))) (and (remove (sites Mover ""Reserve"")) (add (piece (id ""Starter"" Mover)) (to (sites Mover ""Base"")) stack:True)))) (set Value at:(last To) (count Stack at:(last To))) (addScore Mover (- (if (= (id Mover) 1) (mapEntry ""PipsP1"" (last To)) (mapEntry ""PipsP2"" (last To))) (if (= (id Mover) 1) (mapEntry ""PipsP1"" (last From)) (mapEntry ""PipsP2"" (last From))))) (if (> (size Stack at:(last To)) (value Piece at:(last To))) (addScore Next (- 0 (if (= (id Mover) 1) (mapEntry ""PipsP2"" (last To)) (mapEntry ""PipsP1"" (last To))))))}))) (move (from) (to (union {(intersection {(difference (if (= 1 (size Stack at:(from))) (sites ""Rings"") (sites ""RingsplusT"")) (from)) (sites Empty) (sites {(mapEntry ""Step7a"" (from)) (mapEntry ""Step7b"" (from)) (mapEntry ""Step17c"" (from)) (mapEntry ""Step17d"" (from)) (mapEntry ""Step17e"" (from)) (mapEntry ""Step17f"" (from)) (mapEntry ""Step17g"" (from)) (mapEntry ""Step17h"" (from))})}) (intersection {(sites ""Rings"") (sites Occupied by:Next) (sites {(mapEntry ""SameColor"" (arrayValue (intersection (array (sites Empty)) (array {(mapEntry ""Step7a"" (from))})) index:0)) (mapEntry ""SameColor"" (arrayValue (intersection (array (sites Empty)) (array {(mapEntry ""Step7b"" (from))})) index:0)) (mapEntry ""SameColor"" (arrayValue (intersection (array (sites Empty)) (array {(mapEntry ""Step17c"" (from))})) index:0)) (mapEntry ""SameColor"" (arrayValue (intersection (array (sites Empty)) (array {(mapEntry ""Step17d"" (from))})) index:0)) (mapEntry ""SameColor"" (arrayValue (intersection (array (sites Empty)) (array {(mapEntry ""Step17e"" (from))})) index:0)) (mapEntry ""SameColor"" (arrayValue (intersection (array (sites Empty)) (array {(mapEntry ""Step17f"" (from))})) index:0)) (mapEntry ""SameColor"" (arrayValue (intersection (array (sites Empty)) (array {(mapEntry ""Step17g"" (from))})) index:0)) (mapEntry ""SameColor"" (arrayValue (intersection (array (sites Empty)) (array {(mapEntry ""Step17h"" (from))})) index:0)) (mapEntry (from))})})})) stack:True (then (and {(set Var ""StartS"" 3) (set Var ""CntrAttack"" 0) (if (= 15 (last To)) (and {(add (piece (id ""Starter"" Mover)) (to (sites Mover ""Base"")) count:(count Stack at:(last To) if:(= (id ""Cone"" Mover) (what at:(to) level:(level)))) stack:True) (add (piece (id ""Prisoner"" Mover)) (to (sites Mover ""Prison"")) count:(count Stack at:(last To) if:(= (id ""Cone"" Next) (what at:(to) level:(level)))) stack:True) (remove 15 count:(count Stack at:(last To)))}) (if (and (is Friend (who at:(mapEntry ""SameColor"" (last To)))) (not (no Pieces in:(sites Mover ""Reserve"")))) (and (remove (sites Mover ""Reserve"")) (add (piece (id ""Starter"" Mover)) (to (sites Mover ""Base"")) stack:True)))) (set Value at:(last To) (count Stack at:(last To))) (addScore Mover (- (if (= (id Mover) 1) (mapEntry ""PipsP1"" (last To)) (mapEntry ""PipsP2"" (last To))) (if (= (id Mover) 1) (mapEntry ""PipsP1"" (last From)) (mapEntry ""PipsP2"" (last From))))) (if (> (size Stack at:(last To)) (value Piece at:(last To))) (addScore Next (- 0 (if (= (id Mover) 1) (mapEntry ""PipsP2"" (last To)) (mapEntry ""PipsP1"" (last To))))))})))) (if (= (score Mover) 18) (move (from) (to (union {(intersection {(difference (if (= 1 (size Stack at:(from))) (sites ""Rings"") (sites ""RingsplusT"")) (from)) (sites Empty) (sites {(mapEntry ""Step2a"" (from)) (mapEntry ""Step2b"" (from)) (mapEntry ""Step18c"" (from)) (mapEntry ""Step18d"" (from)) (mapEntry ""Step18e"" (from)) (mapEntry ""Step18f"" (from)) (mapEntry (from)) (mapEntry (from))})}) (intersection {(sites ""Rings"") (sites Occupied by:Next) (sites {(mapEntry ""SameColor"" (arrayValue (intersection (array (sites Empty)) (array {(mapEntry ""Step2a"" (from))})) index:0)) (mapEntry ""SameColor"" (arrayValue (intersection (array (sites Empty)) (array {(mapEntry ""Step2b"" (from))})) index:0)) (mapEntry ""SameColor"" (arrayValue (intersection (array (sites Empty)) (array {(mapEntry ""Step18c"" (from))})) index:0)) (mapEntry ""SameColor"" (arrayValue (intersection (array (sites Empty)) (array {(mapEntry ""Step18d"" (from))})) index:0)) (mapEntry ""SameColor"" (arrayValue (intersection (array (sites Empty)) (array {(mapEntry ""Step18e"" (from))})) index:0)) (mapEntry ""SameColor"" (arrayValue (intersection (array (sites Empty)) (array {(mapEntry ""Step18f"" (from))})) index:0)) (mapEntry ""SameColor"" (arrayValue (intersection (array (sites Empty)) (array {(mapEntry (from))})) index:0)) (mapEntry ""SameColor"" (arrayValue (intersection (array (sites Empty)) (array {(mapEntry (from))})) index:0)) (mapEntry ""Step18g"" (from))})})})) stack:True (then (and {(set Var ""StartS"" 3) (set Var ""CntrAttack"" 0) (if (= 15 (last To)) (and {(add (piece (id ""Starter"" Mover)) (to (sites Mover ""Base"")) count:(count Stack at:(last To) if:(= (id ""Cone"" Mover) (what at:(to) level:(level)))) stack:True) (add (piece (id ""Prisoner"" Mover)) (to (sites Mover ""Prison"")) count:(count Stack at:(last To) if:(= (id ""Cone"" Next) (what at:(to) level:(level)))) stack:True) (remove 15 count:(count Stack at:(last To)))}) (if (and (is Friend (who at:(mapEntry ""SameColor"" (last To)))) (not (no Pieces in:(sites Mover ""Reserve"")))) (and (remove (sites Mover ""Reserve"")) (add (piece (id ""Starter"" Mover)) (to (sites Mover ""Base"")) stack:True)))) (set Value at:(last To) (count Stack at:(last To))) (addScore Mover (- (if (= (id Mover) 1) (mapEntry ""PipsP1"" (last To)) (mapEntry ""PipsP2"" (last To))) (if (= (id Mover) 1) (mapEntry ""PipsP1"" (last From)) (mapEntry ""PipsP2"" (last From))))) (if (> (size Stack at:(last To)) (value Piece at:(last To))) (addScore Next (- 0 (if (= (id Mover) 1) (mapEntry ""PipsP2"" (last To)) (mapEntry ""PipsP1"" (last To))))))}))) (and (move (from) (to (union {(intersection {(difference (if (= 1 (size Stack at:(from))) (sites ""Rings"") (sites ""RingsplusT"")) (from)) (sites Empty) (sites {(mapEntry ""Step3a"" (from)) (mapEntry ""Step3b"" (from)) (mapEntry ""Step19c"" (from)) (mapEntry ""Step19d"" (from)) (mapEntry ""Step19e"" (from)) (mapEntry ""Step19f"" (from)) (mapEntry ""Step19g"" (from)) (mapEntry ""Step19h"" (from))})}) (intersection {(sites ""Rings"") (sites Occupied by:Next) (sites {(mapEntry ""SameColor"" (arrayValue (intersection (array (sites Empty)) (array {(mapEntry ""Step3a"" (from))})) index:0)) (mapEntry ""SameColor"" (arrayValue (intersection (array (sites Empty)) (array {(mapEntry ""Step3b"" (from))})) index:0)) (mapEntry ""SameColor"" (arrayValue (intersection (array (sites Empty)) (array {(mapEntry ""Step19c"" (from))})) index:0)) (mapEntry ""SameColor"" (arrayValue (intersection (array (sites Empty)) (array {(mapEntry ""Step19d"" (from))})) index:0)) (mapEntry ""SameColor"" (arrayValue (intersection (array (sites Empty)) (array {(mapEntry ""Step19e"" (from))})) index:0)) (mapEntry ""SameColor"" (arrayValue (intersection (array (sites Empty)) (array {(mapEntry ""Step19f"" (from))})) index:0)) (mapEntry ""SameColor"" (arrayValue (intersection (array (sites Empty)) (array {(mapEntry ""Step19g"" (from))})) index:0)) (mapEntry ""SameColor"" (arrayValue (intersection (array (sites Empty)) (array {(mapEntry ""Step19h"" (from))})) index:0)) (mapEntry (from))})})})) stack:True (then (and {(set Var ""StartS"" 3) (set Var ""CntrAttack"" 0) (if (= 15 (last To)) (and {(add (piece (id ""Starter"" Mover)) (to (sites Mover ""Base"")) count:(count Stack at:(last To) if:(= (id ""Cone"" Mover) (what at:(to) level:(level)))) stack:True) (add (piece (id ""Prisoner"" Mover)) (to (sites Mover ""Prison"")) count:(count Stack at:(last To) if:(= (id ""Cone"" Next) (what at:(to) level:(level)))) stack:True) (remove 15 count:(count Stack at:(last To)))}) (if (and (is Friend (who at:(mapEntry ""SameColor"" (last To)))) (not (no Pieces in:(sites Mover ""Reserve"")))) (and (remove (sites Mover ""Reserve"")) (add (piece (id ""Starter"" Mover)) (to (sites Mover ""Base"")) stack:True)))) (set Value at:(last To) (count Stack at:(last To))) (addScore Mover (- (if (= (id Mover) 1) (mapEntry ""PipsP1"" (last To)) (mapEntry ""PipsP2"" (last To))) (if (= (id Mover) 1) (mapEntry ""PipsP1"" (last From)) (mapEntry ""PipsP2"" (last From))))) (if (> (size Stack at:(last To)) (value Piece at:(last To))) (addScore Next (- 0 (if (= (id Mover) 1) (mapEntry ""PipsP2"" (last To)) (mapEntry ""PipsP1"" (last To))))))}))) (move (from) (to (union {(intersection {(difference (if (= 1 (size Stack at:(from))) (sites ""Rings"") (sites ""RingsplusT"")) (from)) (sites Empty) (sites {(mapEntry ""Step19i"" (from)) (mapEntry (from)) (mapEntry (from)) (mapEntry (from)) (mapEntry (from)) (mapEntry (from)) (mapEntry (from)) (mapEntry (from))})}) (intersection {(sites ""Rings"") (sites Occupied by:Next) (sites {(mapEntry ""SameColor"" (arrayValue (intersection (array (sites Empty)) (array {(mapEntry ""Step19i"" (from))})) index:0)) (mapEntry ""SameColor"" (arrayValue (intersection (array (sites Empty)) (array {(mapEntry (from))})) index:0)) (mapEntry ""SameColor"" (arrayValue (intersection (array (sites Empty)) (array {(mapEntry (from))})) index:0)) (mapEntry ""SameColor"" (arrayValue (intersection (array (sites Empty)) (array {(mapEntry (from))})) index:0)) (mapEntry ""SameColor"" (arrayValue (intersection (array (sites Empty)) (array {(mapEntry (from))})) index:0)) (mapEntry ""SameColor"" (arrayValue (intersection (array (sites Empty)) (array {(mapEntry (from))})) index:0)) (mapEntry ""SameColor"" (arrayValue (intersection (array (sites Empty)) (array {(mapEntry (from))})) index:0)) (mapEntry ""SameColor"" (arrayValue (intersection (array (sites Empty)) (array {(mapEntry (from))})) index:0)) (mapEntry (from))})})})) stack:True (then (and {(set Var ""StartS"" 3) (set Var ""CntrAttack"" 0) (if (= 15 (last To)) (and {(add (piece (id ""Starter"" Mover)) (to (sites Mover ""Base"")) count:(count Stack at:(last To) if:(= (id ""Cone"" Mover) (what at:(to) level:(level)))) stack:True) (add (piece (id ""Prisoner"" Mover)) (to (sites Mover ""Prison"")) count:(count Stack at:(last To) if:(= (id ""Cone"" Next) (what at:(to) level:(level)))) stack:True) (remove 15 count:(count Stack at:(last To)))}) (if (and (is Friend (who at:(mapEntry ""SameColor"" (last To)))) (not (no Pieces in:(sites Mover ""Reserve"")))) (and (remove (sites Mover ""Reserve"")) (add (piece (id ""Starter"" Mover)) (to (sites Mover ""Base"")) stack:True)))) (set Value at:(last To) (count Stack at:(last To))) (addScore Mover (- (if (= (id Mover) 1) (mapEntry ""PipsP1"" (last To)) (mapEntry ""PipsP2"" (last To))) (if (= (id Mover) 1) (mapEntry ""PipsP1"" (last From)) (mapEntry ""PipsP2"" (last From))))) (if (> (size Stack at:(last To)) (value Piece at:(last To))) (addScore Next (- 0 (if (= (id Mover) 1) (mapEntry ""PipsP2"" (last To)) (mapEntry ""PipsP1"" (last To))))))})))))) (if (= 20 (score Mover)) (move (from) (to (union {(intersection {(difference (if (= 1 (size Stack at:(from))) (sites ""Rings"") (sites ""RingsplusT"")) (from)) (sites Empty) (sites {(mapEntry ""Step4a"" (from)) (mapEntry ""Step20b"" (from)) (mapEntry ""Step20c"" (from)) (mapEntry ""Step20d"" (from)) (mapEntry ""Step20e"" (from)) (mapEntry ""Step20f"" (from)) (mapEntry ""Step20g"" (from)) (mapEntry (from))})}) (intersection {(sites ""Rings"") (sites Occupied by:Next) (sites {(mapEntry ""SameColor"" (arrayValue (intersection (array (sites Empty)) (array {(mapEntry ""Step4a"" (from))})) index:0)) (mapEntry ""SameColor"" (arrayValue (intersection (array (sites Empty)) (array {(mapEntry ""Step20b"" (from))})) index:0)) (mapEntry ""SameColor"" (arrayValue (intersection (array (sites Empty)) (array {(mapEntry ""Step20c"" (from))})) index:0)) (mapEntry ""SameColor"" (arrayValue (intersection (array (sites Empty)) (array {(mapEntry ""Step20d"" (from))})) index:0)) (mapEntry ""SameColor"" (arrayValue (intersection (array (sites Empty)) (array {(mapEntry ""Step20e"" (from))})) index:0)) (mapEntry ""SameColor"" (arrayValue (intersection (array (sites Empty)) (array {(mapEntry ""Step20f"" (from))})) index:0)) (mapEntry ""SameColor"" (arrayValue (intersection (array (sites Empty)) (array {(mapEntry ""Step20g"" (from))})) index:0)) (mapEntry ""SameColor"" (arrayValue (intersection (array (sites Empty)) (array {(mapEntry (from))})) index:0)) (mapEntry ""SameColor"" (from))})})})) stack:True (then (and {(set Var ""StartS"" 3) (set Var ""CntrAttack"" 0) (if (= 15 (last To)) (and {(add (piece (id ""Starter"" Mover)) (to (sites Mover ""Base"")) count:(count Stack at:(last To) if:(= (id ""Cone"" Mover) (what at:(to) level:(level)))) stack:True) (add (piece (id ""Prisoner"" Mover)) (to (sites Mover ""Prison"")) count:(count Stack at:(last To) if:(= (id ""Cone"" Next) (what at:(to) level:(level)))) stack:True) (remove 15 count:(count Stack at:(last To)))}) (if (and (is Friend (who at:(mapEntry ""SameColor"" (last To)))) (not (no Pieces in:(sites Mover ""Reserve"")))) (and (remove (sites Mover ""Reserve"")) (add (piece (id ""Starter"" Mover)) (to (sites Mover ""Base"")) stack:True)))) (set Value at:(last To) (count Stack at:(last To))) (addScore Mover (- (if (= (id Mover) 1) (mapEntry ""PipsP1"" (last To)) (mapEntry ""PipsP2"" (last To))) (if (= (id Mover) 1) (mapEntry ""PipsP1"" (last From)) (mapEntry ""PipsP2"" (last From))))) (if (> (size Stack at:(last To)) (value Piece at:(last To))) (addScore Next (- 0 (if (= (id Mover) 1) (mapEntry ""PipsP2"" (last To)) (mapEntry ""PipsP1"" (last To))))))}))))))))}) (rules (start {(place Stack ""Starter1"" 13 count:3) (place Stack ""Starter2"" 17 count:3) (place Stack ""Reserve1"" 1 count:6) (place Stack ""Reserve2"" 3 count:6)}) (play (do (if (no Pieces All in:(sites ""Rings"")) (and {(set Var ""StartS"" 0) (set Var ""CntrAttack"" 0)})) next:(if (is Prev Mover) (if (= 1 (var ""StartS"")) (move (from (sites Mover ""Base"")) (to (difference (sites Mover ""HomeRing"") (mapEntry ""SameColor"" (last To)))) (then (and {(promote (last To) (piece {""Cone""}) Mover) (set Var ""StartS"" (+ 1 (var ""StartS""))) (if (= 0 (var ""StartS"")) (set Var ""St1Pos"" (last To))) (if (and (= 1 (var ""StartS"")) (or (= (mapEntry ""Attacks1"" (last To)) (var ""St1Pos"")) (= (mapEntry ""Attacks2"" (last To)) (var ""St1Pos"")))) (set Var ""CntrAttack"" 1)) (if (> (var ""StartS"") 2) (set Var ""CntrAttack"" 0)) (if (and {(is Friend (who at:(mapEntry ""SameColor"" (last To)))) (!= 1 (var ""CntrAttack"")) (not (no Pieces in:(sites Mover ""Reserve"")))}) (and (add (piece (id ""Starter"" Mover)) (to (sites Mover ""Base"")) stack:True) (remove (sites Mover ""Reserve"")))) (set Value at:(last To) 1) (addScore Mover (if (= (id Mover) 1) (mapEntry ""PipsP1"" (last To)) (mapEntry ""PipsP2"" (last To))))}))) (if (and (= 2 (var ""StartS"")) (= 1 (var ""CntrAttack""))) (move (from (sites Mover ""Base"")) (to (intersection (sites ""Rings"") (sites Empty))) (then (and {(promote (last To) (piece {""Cone""}) Mover) (set Var ""StartS"" (+ 1 (var ""StartS""))) (if (= 0 (var ""StartS"")) (set Var ""St1Pos"" (last To))) (if (and (= 1 (var ""StartS"")) (or (= (mapEntry ""Attacks1"" (last To)) (var ""St1Pos"")) (= (mapEntry ""Attacks2"" (last To)) (var ""St1Pos"")))) (set Var ""CntrAttack"" 1)) (if (> (var ""StartS"") 2) (set Var ""CntrAttack"" 0)) (if (and {(is Friend (who at:(mapEntry ""SameColor"" (last To)))) (!= 1 (var ""CntrAttack"")) (not (no Pieces in:(sites Mover ""Reserve"")))}) (and (add (piece (id ""Starter"" Mover)) (to (sites Mover ""Base"")) stack:True) (remove (sites Mover ""Reserve"")))) (set Value at:(last To) 1) (addScore Mover (if (= (id Mover) 1) (mapEntry ""PipsP1"" (last To)) (mapEntry ""PipsP2"" (last To))))}))) (move (from (sites Mover ""Base"")) (to (intersection (sites Mover ""HomeRing"") (sites Empty))) (then (and {(promote (last To) (piece {""Cone""}) Mover) (set Var ""StartS"" (+ 1 (var ""StartS""))) (if (= 0 (var ""StartS"")) (set Var ""St1Pos"" (last To))) (if (and (= 1 (var ""StartS"")) (or (= (mapEntry ""Attacks1"" (last To)) (var ""St1Pos"")) (= (mapEntry ""Attacks2"" (last To)) (var ""St1Pos"")))) (set Var ""CntrAttack"" 1)) (if (> (var ""StartS"") 2) (set Var ""CntrAttack"" 0)) (if (and {(is Friend (who at:(mapEntry ""SameColor"" (last To)))) (!= 1 (var ""CntrAttack"")) (not (no Pieces in:(sites Mover ""Reserve"")))}) (and (add (piece (id ""Starter"" Mover)) (to (sites Mover ""Base"")) stack:True) (remove (sites Mover ""Reserve"")))) (set Value at:(last To) 1) (addScore Mover (if (= (id Mover) 1) (mapEntry ""PipsP1"" (last To)) (mapEntry ""PipsP2"" (last To))))}))))) (forEach Piece top:True)))) (end {(if (and {(no Moves Next) (= 0 (count Sites in:(intersection (sites Occupied by:Next) (sites ""RingsplusBase"")))) (< (count Sites in:(sites Occupied by:Next)) 2)}) (result Mover Win)) (if (>= (count Pieces Mover in:(sites ""Prison"")) 3) (result Mover Win))})))","###Description -Pieces start from the centers of the rings to the colored positions and later move orthogonal forward, left or right. The total STEP-length is equal to the sum of the pips of a players color on all the positions occupied by their pieces. If you can move you have to do so, even if it is a bad move. If you stalemate yourself, the other player can move until you can move again. STARTER-generation: If you reach the same color of one of your own pieces in the opposite ring, you get a new starter to your base (center of the rings) from your reserve. This also works from the base with a start-move (base to own ring). To CAPTURE an enemy, you need to be able to reach the same color of the enemy-piece in the opposite ring, then the possibility to directly capture the enemy on its board-position will be available. Capturing is not mandatory, you can also just go to the opposite-color position (move 'into the shadow'). Capturing with a start-move from the base is not possible. RingCapture: with steplenght 8 you could theoretically move in a circle to your own position, but as normal move this is not allowed. But if there is an enemy-piece on the opposite same color, the (ring-)capture-move ist allowed! For steplengths of 12 or 14 etc this is also possible from some other positions. The captured pieces remain under the attacker in a stack and have to be brought to the Transmitter (field in the middle of the board) with the according steplength. If you reach the transmitter, your pieces in the stack go back to base as starters, and the enemies land in your prison. First player to make 3 prisoners wins. Only pieces with a captured enemy can land on the Transmitter for prisonertransport. (Exception: #LastMan) Single pieces just step over it. With high steplength you can move in circles or to the other side and back, but not turn 180 degrees. Special Rules to balance the Start: From the Start-situation (or later, when there are temporarily no picese on colored positions) you cannot copy the move of the enemy, ie move to the same color with your first piece. #CounterAttack: If your first starter is attacked immediately (by the first enemy move), you are allowed to start also to the colors in the enemy-ring with your second starter. In this case, there is no Starter generation, if you move to the opposite color of your first piece (to protect it from capturing). Special Rules for Endgame: #LastMan: If you are left with just a single piece on the colored board positions (and no starter on your base), you may enter the Transmitter to move the piece to your base and get a second starter (if you still have one in your reserve)! #PrisonerExchange: Move a prisoner to your (empty) homebase, and you get an additional Starter taken from your reserve & the prisoner goes back to his reserve. You have to move this new starter immediately: the PrisonerExchange itself counts not as a full move. History : 'Mensa Spiel' invented by Andreas Pichler (Mensa Austria). Ludii file implemented by Franz Pichler. (June 2022) Strategy : Early starter-generation is important to have more options. Indirect or dynamic defense is sometimes best: if you are captured, to be able to capture back or dominate the opponent with controlling many positions is vital. In general, a move that attacks an enemy-piece and would make possible a Starter-Generation in the next move simultaneously, is good. But be aware: almost all moves change the steplength and attack & defence-patterns, ie. the whole situation. This makes it complicated to calculate, but entertaining to play. White player starts the game. Transfer 3 enemy-pieces to your prison-cell. - -###Ludii -(game ""MensaSpiel"" (players 2) (equipment {(board (remove (rectangle 5 7) cells:{2 4 7 8 9 11 12 13 17 31})) (regions ""Base"" P1 {13}) (regions ""Base"" P2 {17}) (regions ""Prison"" P1 {0}) (regions ""Prison"" P2 {4}) (regions ""Reserve"" P1 {1}) (regions ""Reserve"" P2 {3}) (regions ""HomeRing"" P1 {6 7 8 12 14 19 20 21}) (regions ""HomeRing"" P2 {9 10 11 16 18 22 23 24}) (regions ""SitesLastMan"" P1 {6 9 16 21 22}) (regions ""SitesLastMan"" P2 {7 9 14 21 22}) (regions ""Rings"" {6 7 8 9 10 11 12 14 16 18 19 20 21 22 23 24}) (regions ""RingsplusT"" {6 7 8 9 10 11 12 14 15 16 18 19 20 21 22 23 24}) (regions ""RingsplusBase"" {6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24}) (map ""PipsP1"" {6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24} {4 1 3 2 2 1 2 0 3 0 1 0 1 3 2 2 2 0 3}) (map ""PipsP2"" {6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24} {0 3 1 2 2 3 2 0 1 0 3 0 3 1 2 2 2 4 1}) (map ""Attacks1"" {6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24} {10 23 9 12 8 6 9 0 16 0 7 0 12 11 11 16 7 21 6}) (map ""Attacks2"" {6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24} {10 18 22 14 19 19 24 0 23 0 14 0 20 24 22 18 20 21 8}) (map ""SameColor"" {6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24} {23 24 18 20 21 14 22 0 11 0 19 0 8 16 9 10 12 6 7}) (map ""Step1c"" {14 16} {15 15}) (map ""Step2a"" {6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24} {19 14 6 22 18 24 20 0 20 0 23 0 23 21 14 19 24 18 11}) (map ""Step2b"" {6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24} {8 12 21 11 16 9 7 0 7 0 10 0 10 6 12 8 9 16 22}) (map ""Step2c"" {8 14 21 16 9 22} {15 16 15 14 15 15}) (map ""Step3a"" {6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24} {20 19 12 23 22 23 21 0 19 0 24 0 9 14 8 12 10 9 10}) (map ""Step3b"" {6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24} {14 21 20 18 24 16 8 0 6 0 11 0 22 7 6 7 18 11 16}) (map ""Step3c"" {7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23} {15 16 14 15 0 0 0 22 0 8 0 0 0 15 16 14 15}) (map ""Step3d"" {14 16} {9 21}) (map ""Step4a"" {6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24} {21 20 19 24 23 22 14 0 12 0 18 0 16 8 7 6 11 10 9}) (map ""Step4b"" {6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24} {15 16 9 8 14 15 0 0 10 0 7 0 0 15 16 9 8 14 15}) (map ""Step4c"" {8 14 21 9 16 22} {22 23 22 21 20 21}) (map ""Step5c"" {6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24} {16 9 10 7 8 14 15 0 11 0 6 0 15 16 9 10 7 8 14}) (map ""Step5d"" {7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23} {22 23 20 21 0 0 0 24 0 19 0 0 0 22 23 20 21}) (map ""Step6c"" {6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24} {9 10 11 6 7 8 16 0 18 0 12 0 14 9 10 11 6 7 8}) (map ""Step6d"" {6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24} {22 23 24 19 20 21 0 0 0 0 0 0 0 22 23 24 19 20 21}) (map ""Step6e"" {6 19 11 24} {15 15 15 15}) (map ""Step7a"" {6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24} {7 8 14 10 11 18 6 0 8 0 9 0 11 12 19 14 16 22 18}) (map ""Step7b"" {6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24} {12 6 7 16 9 10 19 0 21 0 22 0 24 20 21 20 23 24 23}) (map ""Step7c"" {6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24} {10 11 18 12 6 7 9 0 11 0 6 0 8 10 11 18 12 6 7}) (map ""Step7d"" {6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24} {23 24 0 0 19 20 22 0 24 0 19 0 21 23 24 0 0 19 20}) (map ""Step7e"" {6 19 7 20 10 23 11 24} {16 16 15 15 15 15 14 14}) (map ""Step8a"" {6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24} {11 18 11 6 12 6 10 0 10 0 7 0 7 11 18 11 6 12 6}) (map ""Step8b"" {6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24} {24 16 24 19 14 19 23 0 23 0 20 0 20 24 16 24 19 14 19}) (map ""Step8c"" {6 19 8 21 9 22 11 24} {9 9 15 15 15 15 8 8}) (map ""Step8d"" {6 19 11 24} {22 22 21 21}) (map ""Step9c"" {6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24} {18 11 10 7 6 12 11 0 9 0 8 0 6 18 11 10 7 6 12}) (map ""Step9d"" {6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24} {10 24 23 20 19 7 24 0 22 0 21 0 19 23 24 23 20 19 7}) (map ""Step9e"" {6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24} {23 9 16 14 8 20 0 0 15 0 15 0 0 10 9 16 14 8 20}) (map ""Step9f"" {20 7 10 23} {22 22 21 21}) (map ""Step10c"" {6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24} {11 10 9 8 7 6 18 0 16 0 14 0 12 11 10 9 8 7 6}) (map ""Step10d"" {6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24} {24 23 22 21 20 19 0 0 0 0 0 0 0 24 23 22 21 20 19}) (map ""Step10e"" {21 8 9 22} {15 15 15 15}) (map ""Step11c"" {6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24} {10 11 10 7 6 7 11 0 9 0 8 0 6 10 11 10 7 6 7}) (map ""Step11d"" {6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24} {23 24 23 20 19 20 24 0 22 0 21 0 19 23 24 23 20 19 20}) (map ""Step11e"" {6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24} {18 9 16 14 8 12 0 0 15 0 15 0 0 18 9 16 14 8 12}) (map ""Step11f"" {7 10 20 23} {22 21 22 21}) (map ""Step11g"" {7 10 20 23} {15 15 15 15}) (map ""Step12b"" {6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24} {11 18 11 6 12 6 10 0 10 0 7 0 7 11 18 11 6 12 6}) (map ""Step12c"" {6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24} {24 16 24 19 14 19 23 0 23 0 20 0 20 24 16 24 19 14 19}) (map ""Step12d"" {6 19 8 21 9 22 11 24} {9 9 9 9 8 8 8 8}) (map ""Step12e"" {6 19 8 21 9 22 11 24} {22 22 22 22 21 21 21 21}) (map ""Step12f"" {6 19 8 21 9 22 11 24} {15 15 15 15 15 15 15 15}) (map ""Step12g"" {14 16} {11 19}) (map ""Step13c"" {6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24} {10 11 10 7 6 7 9 0 11 0 6 0 8 10 11 10 7 6 7}) (map ""Step13d"" {6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24} {23 24 23 20 19 20 22 0 24 0 19 0 21 23 24 23 20 19 20}) (map ""Step13e"" {6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24} {16 9 14 16 8 14 15 0 8 0 9 0 15 16 9 14 16 8 14}) (map ""Step13f"" {7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23} {22 18 12 21 0 0 0 21 0 22 0 0 0 22 18 12 21}) (map ""Step14c"" {6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24} {9 10 11 6 7 8 16 0 18 0 12 0 14 9 10 11 6 7 8}) (map ""Step14d"" {6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24} {22 23 24 19 20 21 0 0 0 0 0 0 0 22 23 24 19 20 21}) (map ""Step14e"" {6 19 11 24} {15 15 15 15}) (map ""Step14f"" {8 9 21 22} {18 20 10 12}) (map ""Step15c"" {6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24} {10 11 18 12 6 7 9 0 11 0 11 0 8 10 11 18 12 6 7}) (map ""Step15d"" {6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24} {23 24 20 23 19 20 22 0 24 0 24 0 21 23 24 7 10 19 20}) (map ""Step15e"" {6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24} {16 21 10 7 22 16 15 0 6 0 6 0 15 16 8 10 7 9 16}) (map ""Step15f"" {6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24} {14 9 23 20 8 14 0 0 19 0 19 0 0 14 9 23 20 8 14}) (map ""Step16c"" {6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24} {9 20 15 15 23 8 14 0 12 0 18 0 16 9 7 15 15 10 8}) (map ""Step16d"" {6 19 8 21 9 22 11 24} {22 22 6 6 11 11 21 21}) (map ""Step16e"" {6 19 8 21 9 22 11 24} {8 8 9 9 8 8 9 9}) (map ""Step16f"" {6 19 8 21 9 22 11 24} {21 21 19 19 21 21 22 22}) (map ""Step16g"" {6 19 8 21 9 22 11 24} {15 15 22 22 24 24 15 15}) (map ""Step17c"" {6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24} {10 11 10 7 6 7 8 0 6 0 11 0 6 10 6 10 7 6 7}) (map ""Step17d"" {6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24} {23 9 12 14 8 12 11 0 9 0 8 0 9 23 9 12 14 8 10}) (map ""Step17e"" {6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24} {18 15 16 18 15 16 21 0 15 0 15 0 19 18 11 16 18 11 16}) (map ""Step17f"" {6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24} {14 19 23 20 19 20 24 0 19 0 21 0 22 14 15 23 20 15 12}) (map ""Step17g"" {6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24} {20 22 0 0 21 23 0 0 22 0 24 0 0 7 22 0 0 19 20}) (map ""Step17h"" {7 10 20 23} {24 24 24 21}) (map ""Step18c"" {6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24} {11 10 9 8 7 6 18 0 16 0 14 0 12 8 10 6 8 7 6}) (map ""Step18d"" {6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24} {21 23 15 15 20 19 0 0 0 0 0 0 0 11 23 9 11 20 9}) (map ""Step18e"" {6 19 8 21 22 9 11 24} {24 24 19 15 15 21 22 19}) (map ""Step18f"" {8 21 22 9} {22 22 21 24}) (map ""Step18g"" {6 19 11 24} {23 16 14 7}) (map ""Step19c"" {6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24} {7 6 7 7 6 7 6 0 8 0 8 0 6 10 9 10 7 6 7}) (map ""Step19d"" {6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24} {10 8 10 10 8 10 11 0 9 0 9 0 11 12 11 14 14 8 12}) (map ""Step19e"" {6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24} {12 9 14 14 9 12 19 0 15 0 15 0 19 18 15 16 16 15 18}) (map ""Step19f"" {6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24} {18 11 16 16 11 18 24 0 21 0 21 0 24 20 19 20 20 19 20}) (map ""Step19g"" {6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24} {23 15 23 20 15 20 0 0 22 0 22 0 0 23 21 23 23 21 23}) (map ""Step19h"" {7 10 20 23} {22 19 22 22}) (map ""Step19i"" {7 10 20 23} {24 21 24 24}) (map ""Step20b"" {6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24} {9 16 9 6 12 6 10 0 10 0 7 0 7 6 16 8 6 12 6}) (map ""Step20c"" {6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24} {11 18 11 8 14 8 23 0 23 0 20 0 20 9 18 9 8 14 8}) (map ""Step20d"" {6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24} {15 0 15 15 0 15 0 0 0 0 0 0 0 11 0 11 9 0 11}) (map ""Step20e"" {6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24} {19 0 21 19 0 19 0 0 0 0 0 0 0 15 0 15 15 0 15}) (map ""Step20f"" {6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24} {22 0 22 21 0 21 0 0 0 0 0 0 0 22 0 22 19 0 19}) (map ""Step20g"" {6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24} {24 0 24 22 0 24 0 0 0 0 0 0 0 24 0 24 21 0 21}) (piece ""Prisoner"" Each (if (and (no Pieces in:(sites Mover ""Base"")) (not (no Pieces in:(sites Mover ""Reserve"")))) (move (from) (to (sites Mover ""Base""))) (then (and {(promote (last To) (piece ""Starter"") Mover) (remove (sites Mover ""Reserve"")) (add (piece (id ""Reserve"" Next)) (to (sites Next ""Reserve"")) stack:True) (moveAgain)})))) (piece ""Starter"" Each (if (= 1 (var ""StartS"")) (move (from (sites Mover ""Base"")) (to (difference (sites Mover ""HomeRing"") (mapEntry ""SameColor"" (last To)))) (then (and {(promote (last To) (piece {""Cone""}) Mover) (set Var ""StartS"" (+ 1 (var ""StartS""))) (if (= 0 (var ""StartS"")) (set Var ""St1Pos"" (last To))) (if (and (= 1 (var ""StartS"")) (or (= (mapEntry ""Attacks1"" (last To)) (var ""St1Pos"")) (= (mapEntry ""Attacks2"" (last To)) (var ""St1Pos"")))) (set Var ""CntrAttack"" 1)) (if (> (var ""StartS"") 2) (set Var ""CntrAttack"" 0)) (if (and {(is Friend (who at:(mapEntry ""SameColor"" (last To)))) (!= 1 (var ""CntrAttack"")) (not (no Pieces in:(sites Mover ""Reserve"")))}) (and (add (piece (id ""Starter"" Mover)) (to (sites Mover ""Base"")) stack:True) (remove (sites Mover ""Reserve"")))) (set Value at:(last To) 1) (addScore Mover (if (= (id Mover) 1) (mapEntry ""PipsP1"" (last To)) (mapEntry ""PipsP2"" (last To))))}))) (if (and (= 2 (var ""StartS"")) (= 1 (var ""CntrAttack""))) (move (from (sites Mover ""Base"")) (to (intersection (sites ""Rings"") (sites Empty))) (then (and {(promote (last To) (piece {""Cone""}) Mover) (set Var ""StartS"" (+ 1 (var ""StartS""))) (if (= 0 (var ""StartS"")) (set Var ""St1Pos"" (last To))) (if (and (= 1 (var ""StartS"")) (or (= (mapEntry ""Attacks1"" (last To)) (var ""St1Pos"")) (= (mapEntry ""Attacks2"" (last To)) (var ""St1Pos"")))) (set Var ""CntrAttack"" 1)) (if (> (var ""StartS"") 2) (set Var ""CntrAttack"" 0)) (if (and {(is Friend (who at:(mapEntry ""SameColor"" (last To)))) (!= 1 (var ""CntrAttack"")) (not (no Pieces in:(sites Mover ""Reserve"")))}) (and (add (piece (id ""Starter"" Mover)) (to (sites Mover ""Base"")) stack:True) (remove (sites Mover ""Reserve"")))) (set Value at:(last To) 1) (addScore Mover (if (= (id Mover) 1) (mapEntry ""PipsP1"" (last To)) (mapEntry ""PipsP2"" (last To))))}))) (move (from (sites Mover ""Base"")) (to (intersection (sites Mover ""HomeRing"") (sites Empty))) (then (and {(promote (last To) (piece {""Cone""}) Mover) (set Var ""StartS"" (+ 1 (var ""StartS""))) (if (= 0 (var ""StartS"")) (set Var ""St1Pos"" (last To))) (if (and (= 1 (var ""StartS"")) (or (= (mapEntry ""Attacks1"" (last To)) (var ""St1Pos"")) (= (mapEntry ""Attacks2"" (last To)) (var ""St1Pos"")))) (set Var ""CntrAttack"" 1)) (if (> (var ""StartS"") 2) (set Var ""CntrAttack"" 0)) (if (and {(is Friend (who at:(mapEntry ""SameColor"" (last To)))) (!= 1 (var ""CntrAttack"")) (not (no Pieces in:(sites Mover ""Reserve"")))}) (and (add (piece (id ""Starter"" Mover)) (to (sites Mover ""Base"")) stack:True) (remove (sites Mover ""Reserve"")))) (set Value at:(last To) 1) (addScore Mover (if (= (id Mover) 1) (mapEntry ""PipsP1"" (last To)) (mapEntry ""PipsP2"" (last To))))})))))) (piece ""Reserve"" Each) (piece ""Cone"" Each (if (and {(no Pieces in:(sites Mover ""Base"")) (= 1 (count Pieces in:(intersection (sites ""Rings"") (sites Occupied by:Mover)))) (= 1 (size Stack at:(regionSite (intersection (sites Occupied by:Mover) (sites Mover ""SitesLastMan"")) index:0))) (not (no Pieces in:(sites Mover ""Reserve"")))}) (or (move (from) (to 15) (then (and {(set Var ""CntrAttack"" 0) (set Score Mover 0) (remove 15) (remove (sites Mover ""Reserve"")) (add (piece (id ""Starter"" Mover)) (to (sites Mover ""Base"")) count:2 stack:True)}))) (if (< (score Mover) 16) (if (< (score Mover) 8) (if (< (score Mover) 4) (if (< (score Mover) 2) (if (= (score Mover) 1) (move (from) (to (union {(intersection {(difference (if (= 1 (size Stack at:(from))) (sites ""Rings"") (sites ""RingsplusT"")) (from)) (sites Empty) (sites {(mapEntry ""Step7a"" (from)) (mapEntry ""Step7b"" (from)) (mapEntry ""Step1c"" (from)) (mapEntry (from)) (mapEntry (from)) (mapEntry (from)) (mapEntry (from)) (mapEntry (from))})}) (intersection {(sites ""Rings"") (sites Occupied by:Next) (sites {(mapEntry ""SameColor"" (arrayValue (intersection (array (sites Empty)) (array {(mapEntry ""Step7a"" (from))})) index:0)) (mapEntry ""SameColor"" (arrayValue (intersection (array (sites Empty)) (array {(mapEntry ""Step7b"" (from))})) index:0)) (mapEntry ""SameColor"" (arrayValue (intersection (array (sites Empty)) (array {(mapEntry ""Step1c"" (from))})) index:0)) (mapEntry ""SameColor"" (arrayValue (intersection (array (sites Empty)) (array {(mapEntry (from))})) index:0)) (mapEntry ""SameColor"" (arrayValue (intersection (array (sites Empty)) (array {(mapEntry (from))})) index:0)) (mapEntry ""SameColor"" (arrayValue (intersection (array (sites Empty)) (array {(mapEntry (from))})) index:0)) (mapEntry ""SameColor"" (arrayValue (intersection (array (sites Empty)) (array {(mapEntry (from))})) index:0)) (mapEntry ""SameColor"" (arrayValue (intersection (array (sites Empty)) (array {(mapEntry (from))})) index:0)) (mapEntry (from))})})})) stack:True (then (and {(set Var ""StartS"" 3) (set Var ""CntrAttack"" 0) (if (= 15 (last To)) (and {(add (piece (id ""Starter"" Mover)) (to (sites Mover ""Base"")) count:(count Stack at:(last To) if:(= (id ""Cone"" Mover) (what at:(to) level:(level)))) stack:True) (add (piece (id ""Prisoner"" Mover)) (to (sites Mover ""Prison"")) count:(count Stack at:(last To) if:(= (id ""Cone"" Next) (what at:(to) level:(level)))) stack:True) (remove 15 count:(count Stack at:(last To)))}) (if (and (is Friend (who at:(mapEntry ""SameColor"" (last To)))) (not (no Pieces in:(sites Mover ""Reserve"")))) (and (remove (sites Mover ""Reserve"")) (add (piece (id ""Starter"" Mover)) (to (sites Mover ""Base"")) stack:True)))) (set Value at:(last To) (count Stack at:(last To))) (addScore Mover (- (if (= (id Mover) 1) (mapEntry ""PipsP1"" (last To)) (mapEntry ""PipsP2"" (last To))) (if (= (id Mover) 1) (mapEntry ""PipsP1"" (last From)) (mapEntry ""PipsP2"" (last From))))) (if (> (size Stack at:(last To)) (value Piece at:(last To))) (addScore Next (- 0 (if (= (id Mover) 1) (mapEntry ""PipsP2"" (last To)) (mapEntry ""PipsP1"" (last To))))))})))) (if (= (score Mover) 2) (move (from) (to (union {(intersection {(difference (if (= 1 (size Stack at:(from))) (sites ""Rings"") (sites ""RingsplusT"")) (from)) (sites Empty) (sites {(mapEntry ""Step2a"" (from)) (mapEntry ""Step2b"" (from)) (mapEntry ""Step2c"" (from)) (mapEntry (from)) (mapEntry (from)) (mapEntry (from)) (mapEntry (from)) (mapEntry (from))})}) (intersection {(sites ""Rings"") (sites Occupied by:Next) (sites {(mapEntry ""SameColor"" (arrayValue (intersection (array (sites Empty)) (array {(mapEntry ""Step2a"" (from))})) index:0)) (mapEntry ""SameColor"" (arrayValue (intersection (array (sites Empty)) (array {(mapEntry ""Step2b"" (from))})) index:0)) (mapEntry ""SameColor"" (arrayValue (intersection (array (sites Empty)) (array {(mapEntry ""Step2c"" (from))})) index:0)) (mapEntry ""SameColor"" (arrayValue (intersection (array (sites Empty)) (array {(mapEntry (from))})) index:0)) (mapEntry ""SameColor"" (arrayValue (intersection (array (sites Empty)) (array {(mapEntry (from))})) index:0)) (mapEntry ""SameColor"" (arrayValue (intersection (array (sites Empty)) (array {(mapEntry (from))})) index:0)) (mapEntry ""SameColor"" (arrayValue (intersection (array (sites Empty)) (array {(mapEntry (from))})) index:0)) (mapEntry ""SameColor"" (arrayValue (intersection (array (sites Empty)) (array {(mapEntry (from))})) index:0)) (mapEntry (from))})})})) stack:True (then (and {(set Var ""StartS"" 3) (set Var ""CntrAttack"" 0) (if (= 15 (last To)) (and {(add (piece (id ""Starter"" Mover)) (to (sites Mover ""Base"")) count:(count Stack at:(last To) if:(= (id ""Cone"" Mover) (what at:(to) level:(level)))) stack:True) (add (piece (id ""Prisoner"" Mover)) (to (sites Mover ""Prison"")) count:(count Stack at:(last To) if:(= (id ""Cone"" Next) (what at:(to) level:(level)))) stack:True) (remove 15 count:(count Stack at:(last To)))}) (if (and (is Friend (who at:(mapEntry ""SameColor"" (last To)))) (not (no Pieces in:(sites Mover ""Reserve"")))) (and (remove (sites Mover ""Reserve"")) (add (piece (id ""Starter"" Mover)) (to (sites Mover ""Base"")) stack:True)))) (set Value at:(last To) (count Stack at:(last To))) (addScore Mover (- (if (= (id Mover) 1) (mapEntry ""PipsP1"" (last To)) (mapEntry ""PipsP2"" (last To))) (if (= (id Mover) 1) (mapEntry ""PipsP1"" (last From)) (mapEntry ""PipsP2"" (last From))))) (if (> (size Stack at:(last To)) (value Piece at:(last To))) (addScore Next (- 0 (if (= (id Mover) 1) (mapEntry ""PipsP2"" (last To)) (mapEntry ""PipsP1"" (last To))))))}))) (move (from) (to (union {(intersection {(difference (if (= 1 (size Stack at:(from))) (sites ""Rings"") (sites ""RingsplusT"")) (from)) (sites Empty) (sites {(mapEntry ""Step3a"" (from)) (mapEntry ""Step3b"" (from)) (mapEntry ""Step3c"" (from)) (mapEntry ""Step3d"" (from)) (mapEntry (from)) (mapEntry (from)) (mapEntry (from)) (mapEntry (from))})}) (intersection {(sites ""Rings"") (sites Occupied by:Next) (sites {(mapEntry ""SameColor"" (arrayValue (intersection (array (sites Empty)) (array {(mapEntry ""Step3a"" (from))})) index:0)) (mapEntry ""SameColor"" (arrayValue (intersection (array (sites Empty)) (array {(mapEntry ""Step3b"" (from))})) index:0)) (mapEntry ""SameColor"" (arrayValue (intersection (array (sites Empty)) (array {(mapEntry ""Step3c"" (from))})) index:0)) (mapEntry ""SameColor"" (arrayValue (intersection (array (sites Empty)) (array {(mapEntry ""Step3d"" (from))})) index:0)) (mapEntry ""SameColor"" (arrayValue (intersection (array (sites Empty)) (array {(mapEntry (from))})) index:0)) (mapEntry ""SameColor"" (arrayValue (intersection (array (sites Empty)) (array {(mapEntry (from))})) index:0)) (mapEntry ""SameColor"" (arrayValue (intersection (array (sites Empty)) (array {(mapEntry (from))})) index:0)) (mapEntry ""SameColor"" (arrayValue (intersection (array (sites Empty)) (array {(mapEntry (from))})) index:0)) (mapEntry (from))})})})) stack:True (then (and {(set Var ""StartS"" 3) (set Var ""CntrAttack"" 0) (if (= 15 (last To)) (and {(add (piece (id ""Starter"" Mover)) (to (sites Mover ""Base"")) count:(count Stack at:(last To) if:(= (id ""Cone"" Mover) (what at:(to) level:(level)))) stack:True) (add (piece (id ""Prisoner"" Mover)) (to (sites Mover ""Prison"")) count:(count Stack at:(last To) if:(= (id ""Cone"" Next) (what at:(to) level:(level)))) stack:True) (remove 15 count:(count Stack at:(last To)))}) (if (and (is Friend (who at:(mapEntry ""SameColor"" (last To)))) (not (no Pieces in:(sites Mover ""Reserve"")))) (and (remove (sites Mover ""Reserve"")) (add (piece (id ""Starter"" Mover)) (to (sites Mover ""Base"")) stack:True)))) (set Value at:(last To) (count Stack at:(last To))) (addScore Mover (- (if (= (id Mover) 1) (mapEntry ""PipsP1"" (last To)) (mapEntry ""PipsP2"" (last To))) (if (= (id Mover) 1) (mapEntry ""PipsP1"" (last From)) (mapEntry ""PipsP2"" (last From))))) (if (> (size Stack at:(last To)) (value Piece at:(last To))) (addScore Next (- 0 (if (= (id Mover) 1) (mapEntry ""PipsP2"" (last To)) (mapEntry ""PipsP1"" (last To))))))}))))) (if (< (score Mover) 6) (if (= (score Mover) 4) (move (from) (to (union {(intersection {(difference (if (= 1 (size Stack at:(from))) (sites ""Rings"") (sites ""RingsplusT"")) (from)) (sites Empty) (sites {(mapEntry ""Step4a"" (from)) (mapEntry ""Step4b"" (from)) (mapEntry ""Step4c"" (from)) (mapEntry (from)) (mapEntry (from)) (mapEntry (from)) (mapEntry (from)) (mapEntry (from))})}) (intersection {(sites ""Rings"") (sites Occupied by:Next) (sites {(mapEntry ""SameColor"" (arrayValue (intersection (array (sites Empty)) (array {(mapEntry ""Step4a"" (from))})) index:0)) (mapEntry ""SameColor"" (arrayValue (intersection (array (sites Empty)) (array {(mapEntry ""Step4b"" (from))})) index:0)) (mapEntry ""SameColor"" (arrayValue (intersection (array (sites Empty)) (array {(mapEntry ""Step4c"" (from))})) index:0)) (mapEntry ""SameColor"" (arrayValue (intersection (array (sites Empty)) (array {(mapEntry (from))})) index:0)) (mapEntry ""SameColor"" (arrayValue (intersection (array (sites Empty)) (array {(mapEntry (from))})) index:0)) (mapEntry ""SameColor"" (arrayValue (intersection (array (sites Empty)) (array {(mapEntry (from))})) index:0)) (mapEntry ""SameColor"" (arrayValue (intersection (array (sites Empty)) (array {(mapEntry (from))})) index:0)) (mapEntry ""SameColor"" (arrayValue (intersection (array (sites Empty)) (array {(mapEntry (from))})) index:0)) (mapEntry (from))})})})) stack:True (then (and {(set Var ""StartS"" 3) (set Var ""CntrAttack"" 0) (if (= 15 (last To)) (and {(add (piece (id ""Starter"" Mover)) (to (sites Mover ""Base"")) count:(count Stack at:(last To) if:(= (id ""Cone"" Mover) (what at:(to) level:(level)))) stack:True) (add (piece (id ""Prisoner"" Mover)) (to (sites Mover ""Prison"")) count:(count Stack at:(last To) if:(= (id ""Cone"" Next) (what at:(to) level:(level)))) stack:True) (remove 15 count:(count Stack at:(last To)))}) (if (and (is Friend (who at:(mapEntry ""SameColor"" (last To)))) (not (no Pieces in:(sites Mover ""Reserve"")))) (and (remove (sites Mover ""Reserve"")) (add (piece (id ""Starter"" Mover)) (to (sites Mover ""Base"")) stack:True)))) (set Value at:(last To) (count Stack at:(last To))) (addScore Mover (- (if (= (id Mover) 1) (mapEntry ""PipsP1"" (last To)) (mapEntry ""PipsP2"" (last To))) (if (= (id Mover) 1) (mapEntry ""PipsP1"" (last From)) (mapEntry ""PipsP2"" (last From))))) (if (> (size Stack at:(last To)) (value Piece at:(last To))) (addScore Next (- 0 (if (= (id Mover) 1) (mapEntry ""PipsP2"" (last To)) (mapEntry ""PipsP1"" (last To))))))}))) (move (from) (to (union {(intersection {(difference (if (= 1 (size Stack at:(from))) (sites ""Rings"") (sites ""RingsplusT"")) (from)) (sites Empty) (sites {(mapEntry ""Step3a"" (from)) (mapEntry ""Step3b"" (from)) (mapEntry ""Step5c"" (from)) (mapEntry ""Step5d"" (from)) (mapEntry (from)) (mapEntry (from)) (mapEntry (from)) (mapEntry (from))})}) (intersection {(sites ""Rings"") (sites Occupied by:Next) (sites {(mapEntry ""SameColor"" (arrayValue (intersection (array (sites Empty)) (array {(mapEntry ""Step3a"" (from))})) index:0)) (mapEntry ""SameColor"" (arrayValue (intersection (array (sites Empty)) (array {(mapEntry ""Step3b"" (from))})) index:0)) (mapEntry ""SameColor"" (arrayValue (intersection (array (sites Empty)) (array {(mapEntry ""Step5c"" (from))})) index:0)) (mapEntry ""SameColor"" (arrayValue (intersection (array (sites Empty)) (array {(mapEntry ""Step5d"" (from))})) index:0)) (mapEntry ""SameColor"" (arrayValue (intersection (array (sites Empty)) (array {(mapEntry (from))})) index:0)) (mapEntry ""SameColor"" (arrayValue (intersection (array (sites Empty)) (array {(mapEntry (from))})) index:0)) (mapEntry ""SameColor"" (arrayValue (intersection (array (sites Empty)) (array {(mapEntry (from))})) index:0)) (mapEntry ""SameColor"" (arrayValue (intersection (array (sites Empty)) (array {(mapEntry (from))})) index:0)) (mapEntry (from))})})})) stack:True (then (and {(set Var ""StartS"" 3) (set Var ""CntrAttack"" 0) (if (= 15 (last To)) (and {(add (piece (id ""Starter"" Mover)) (to (sites Mover ""Base"")) count:(count Stack at:(last To) if:(= (id ""Cone"" Mover) (what at:(to) level:(level)))) stack:True) (add (piece (id ""Prisoner"" Mover)) (to (sites Mover ""Prison"")) count:(count Stack at:(last To) if:(= (id ""Cone"" Next) (what at:(to) level:(level)))) stack:True) (remove 15 count:(count Stack at:(last To)))}) (if (and (is Friend (who at:(mapEntry ""SameColor"" (last To)))) (not (no Pieces in:(sites Mover ""Reserve"")))) (and (remove (sites Mover ""Reserve"")) (add (piece (id ""Starter"" Mover)) (to (sites Mover ""Base"")) stack:True)))) (set Value at:(last To) (count Stack at:(last To))) (addScore Mover (- (if (= (id Mover) 1) (mapEntry ""PipsP1"" (last To)) (mapEntry ""PipsP2"" (last To))) (if (= (id Mover) 1) (mapEntry ""PipsP1"" (last From)) (mapEntry ""PipsP2"" (last From))))) (if (> (size Stack at:(last To)) (value Piece at:(last To))) (addScore Next (- 0 (if (= (id Mover) 1) (mapEntry ""PipsP2"" (last To)) (mapEntry ""PipsP1"" (last To))))))})))) (if (= (score Mover) 6) (move (from) (to (union {(intersection {(difference (if (= 1 (size Stack at:(from))) (sites ""Rings"") (sites ""RingsplusT"")) (from)) (sites Empty) (sites {(mapEntry ""Step2a"" (from)) (mapEntry ""Step2b"" (from)) (mapEntry ""Step6c"" (from)) (mapEntry ""Step6d"" (from)) (mapEntry ""Step6e"" (from)) (mapEntry (from)) (mapEntry (from)) (mapEntry (from))})}) (intersection {(sites ""Rings"") (sites Occupied by:Next) (sites {(mapEntry ""SameColor"" (arrayValue (intersection (array (sites Empty)) (array {(mapEntry ""Step2a"" (from))})) index:0)) (mapEntry ""SameColor"" (arrayValue (intersection (array (sites Empty)) (array {(mapEntry ""Step2b"" (from))})) index:0)) (mapEntry ""SameColor"" (arrayValue (intersection (array (sites Empty)) (array {(mapEntry ""Step6c"" (from))})) index:0)) (mapEntry ""SameColor"" (arrayValue (intersection (array (sites Empty)) (array {(mapEntry ""Step6d"" (from))})) index:0)) (mapEntry ""SameColor"" (arrayValue (intersection (array (sites Empty)) (array {(mapEntry ""Step6e"" (from))})) index:0)) (mapEntry ""SameColor"" (arrayValue (intersection (array (sites Empty)) (array {(mapEntry (from))})) index:0)) (mapEntry ""SameColor"" (arrayValue (intersection (array (sites Empty)) (array {(mapEntry (from))})) index:0)) (mapEntry ""SameColor"" (arrayValue (intersection (array (sites Empty)) (array {(mapEntry (from))})) index:0)) (mapEntry (from))})})})) stack:True (then (and {(set Var ""StartS"" 3) (set Var ""CntrAttack"" 0) (if (= 15 (last To)) (and {(add (piece (id ""Starter"" Mover)) (to (sites Mover ""Base"")) count:(count Stack at:(last To) if:(= (id ""Cone"" Mover) (what at:(to) level:(level)))) stack:True) (add (piece (id ""Prisoner"" Mover)) (to (sites Mover ""Prison"")) count:(count Stack at:(last To) if:(= (id ""Cone"" Next) (what at:(to) level:(level)))) stack:True) (remove 15 count:(count Stack at:(last To)))}) (if (and (is Friend (who at:(mapEntry ""SameColor"" (last To)))) (not (no Pieces in:(sites Mover ""Reserve"")))) (and (remove (sites Mover ""Reserve"")) (add (piece (id ""Starter"" Mover)) (to (sites Mover ""Base"")) stack:True)))) (set Value at:(last To) (count Stack at:(last To))) (addScore Mover (- (if (= (id Mover) 1) (mapEntry ""PipsP1"" (last To)) (mapEntry ""PipsP2"" (last To))) (if (= (id Mover) 1) (mapEntry ""PipsP1"" (last From)) (mapEntry ""PipsP2"" (last From))))) (if (> (size Stack at:(last To)) (value Piece at:(last To))) (addScore Next (- 0 (if (= (id Mover) 1) (mapEntry ""PipsP2"" (last To)) (mapEntry ""PipsP1"" (last To))))))}))) (move (from) (to (union {(intersection {(difference (if (= 1 (size Stack at:(from))) (sites ""Rings"") (sites ""RingsplusT"")) (from)) (sites Empty) (sites {(mapEntry ""Step7a"" (from)) (mapEntry ""Step7b"" (from)) (mapEntry ""Step7c"" (from)) (mapEntry ""Step7d"" (from)) (mapEntry ""Step7e"" (from)) (mapEntry (from)) (mapEntry (from)) (mapEntry (from))})}) (intersection {(sites ""Rings"") (sites Occupied by:Next) (sites {(mapEntry ""SameColor"" (arrayValue (intersection (array (sites Empty)) (array {(mapEntry ""Step7a"" (from))})) index:0)) (mapEntry ""SameColor"" (arrayValue (intersection (array (sites Empty)) (array {(mapEntry ""Step7b"" (from))})) index:0)) (mapEntry ""SameColor"" (arrayValue (intersection (array (sites Empty)) (array {(mapEntry ""Step7c"" (from))})) index:0)) (mapEntry ""SameColor"" (arrayValue (intersection (array (sites Empty)) (array {(mapEntry ""Step7d"" (from))})) index:0)) (mapEntry ""SameColor"" (arrayValue (intersection (array (sites Empty)) (array {(mapEntry ""Step7e"" (from))})) index:0)) (mapEntry ""SameColor"" (arrayValue (intersection (array (sites Empty)) (array {(mapEntry (from))})) index:0)) (mapEntry ""SameColor"" (arrayValue (intersection (array (sites Empty)) (array {(mapEntry (from))})) index:0)) (mapEntry ""SameColor"" (arrayValue (intersection (array (sites Empty)) (array {(mapEntry (from))})) index:0)) (mapEntry (from))})})})) stack:True (then (and {(set Var ""StartS"" 3) (set Var ""CntrAttack"" 0) (if (= 15 (last To)) (and {(add (piece (id ""Starter"" Mover)) (to (sites Mover ""Base"")) count:(count Stack at:(last To) if:(= (id ""Cone"" Mover) (what at:(to) level:(level)))) stack:True) (add (piece (id ""Prisoner"" Mover)) (to (sites Mover ""Prison"")) count:(count Stack at:(last To) if:(= (id ""Cone"" Next) (what at:(to) level:(level)))) stack:True) (remove 15 count:(count Stack at:(last To)))}) (if (and (is Friend (who at:(mapEntry ""SameColor"" (last To)))) (not (no Pieces in:(sites Mover ""Reserve"")))) (and (remove (sites Mover ""Reserve"")) (add (piece (id ""Starter"" Mover)) (to (sites Mover ""Base"")) stack:True)))) (set Value at:(last To) (count Stack at:(last To))) (addScore Mover (- (if (= (id Mover) 1) (mapEntry ""PipsP1"" (last To)) (mapEntry ""PipsP2"" (last To))) (if (= (id Mover) 1) (mapEntry ""PipsP1"" (last From)) (mapEntry ""PipsP2"" (last From))))) (if (> (size Stack at:(last To)) (value Piece at:(last To))) (addScore Next (- 0 (if (= (id Mover) 1) (mapEntry ""PipsP2"" (last To)) (mapEntry ""PipsP1"" (last To))))))})))))) (if (< (score Mover) 12) (if (< (score Mover) 10) (if (= (score Mover) 8) (move (from) (to (union {(intersection {(difference (if (= 1 (size Stack at:(from))) (sites ""Rings"") (sites ""RingsplusT"")) (from)) (sites Empty) (sites {(mapEntry ""Step8a"" (from)) (mapEntry ""Step8b"" (from)) (mapEntry ""Step8c"" (from)) (mapEntry ""Step8d"" (from)) (mapEntry (from)) (mapEntry (from)) (mapEntry (from)) (mapEntry (from))})}) (intersection {(sites ""Rings"") (sites Occupied by:Next) (sites {(mapEntry ""SameColor"" (arrayValue (intersection (array (sites Empty)) (array {(mapEntry ""Step8a"" (from))})) index:0)) (mapEntry ""SameColor"" (arrayValue (intersection (array (sites Empty)) (array {(mapEntry ""Step8b"" (from))})) index:0)) (mapEntry ""SameColor"" (arrayValue (intersection (array (sites Empty)) (array {(mapEntry ""Step8c"" (from))})) index:0)) (mapEntry ""SameColor"" (arrayValue (intersection (array (sites Empty)) (array {(mapEntry ""Step8d"" (from))})) index:0)) (mapEntry ""SameColor"" (arrayValue (intersection (array (sites Empty)) (array {(mapEntry (from))})) index:0)) (mapEntry ""SameColor"" (arrayValue (intersection (array (sites Empty)) (array {(mapEntry (from))})) index:0)) (mapEntry ""SameColor"" (arrayValue (intersection (array (sites Empty)) (array {(mapEntry (from))})) index:0)) (mapEntry ""SameColor"" (arrayValue (intersection (array (sites Empty)) (array {(mapEntry (from))})) index:0)) (mapEntry ""SameColor"" (from))})})})) stack:True (then (and {(set Var ""StartS"" 3) (set Var ""CntrAttack"" 0) (if (= 15 (last To)) (and {(add (piece (id ""Starter"" Mover)) (to (sites Mover ""Base"")) count:(count Stack at:(last To) if:(= (id ""Cone"" Mover) (what at:(to) level:(level)))) stack:True) (add (piece (id ""Prisoner"" Mover)) (to (sites Mover ""Prison"")) count:(count Stack at:(last To) if:(= (id ""Cone"" Next) (what at:(to) level:(level)))) stack:True) (remove 15 count:(count Stack at:(last To)))}) (if (and (is Friend (who at:(mapEntry ""SameColor"" (last To)))) (not (no Pieces in:(sites Mover ""Reserve"")))) (and (remove (sites Mover ""Reserve"")) (add (piece (id ""Starter"" Mover)) (to (sites Mover ""Base"")) stack:True)))) (set Value at:(last To) (count Stack at:(last To))) (addScore Mover (- (if (= (id Mover) 1) (mapEntry ""PipsP1"" (last To)) (mapEntry ""PipsP2"" (last To))) (if (= (id Mover) 1) (mapEntry ""PipsP1"" (last From)) (mapEntry ""PipsP2"" (last From))))) (if (> (size Stack at:(last To)) (value Piece at:(last To))) (addScore Next (- 0 (if (= (id Mover) 1) (mapEntry ""PipsP2"" (last To)) (mapEntry ""PipsP1"" (last To))))))}))) (move (from) (to (union {(intersection {(difference (if (= 1 (size Stack at:(from))) (sites ""Rings"") (sites ""RingsplusT"")) (from)) (sites Empty) (sites {(mapEntry ""Step7a"" (from)) (mapEntry ""Step7b"" (from)) (mapEntry ""Step9c"" (from)) (mapEntry ""Step9d"" (from)) (mapEntry ""Step9e"" (from)) (mapEntry ""Step9f"" (from)) (mapEntry (from)) (mapEntry (from))})}) (intersection {(sites ""Rings"") (sites Occupied by:Next) (sites {(mapEntry ""SameColor"" (arrayValue (intersection (array (sites Empty)) (array {(mapEntry ""Step7a"" (from))})) index:0)) (mapEntry ""SameColor"" (arrayValue (intersection (array (sites Empty)) (array {(mapEntry ""Step7b"" (from))})) index:0)) (mapEntry ""SameColor"" (arrayValue (intersection (array (sites Empty)) (array {(mapEntry ""Step9c"" (from))})) index:0)) (mapEntry ""SameColor"" (arrayValue (intersection (array (sites Empty)) (array {(mapEntry ""Step9d"" (from))})) index:0)) (mapEntry ""SameColor"" (arrayValue (intersection (array (sites Empty)) (array {(mapEntry ""Step9e"" (from))})) index:0)) (mapEntry ""SameColor"" (arrayValue (intersection (array (sites Empty)) (array {(mapEntry ""Step9f"" (from))})) index:0)) (mapEntry ""SameColor"" (arrayValue (intersection (array (sites Empty)) (array {(mapEntry (from))})) index:0)) (mapEntry ""SameColor"" (arrayValue (intersection (array (sites Empty)) (array {(mapEntry (from))})) index:0)) (mapEntry (from))})})})) stack:True (then (and {(set Var ""StartS"" 3) (set Var ""CntrAttack"" 0) (if (= 15 (last To)) (and {(add (piece (id ""Starter"" Mover)) (to (sites Mover ""Base"")) count:(count Stack at:(last To) if:(= (id ""Cone"" Mover) (what at:(to) level:(level)))) stack:True) (add (piece (id ""Prisoner"" Mover)) (to (sites Mover ""Prison"")) count:(count Stack at:(last To) if:(= (id ""Cone"" Next) (what at:(to) level:(level)))) stack:True) (remove 15 count:(count Stack at:(last To)))}) (if (and (is Friend (who at:(mapEntry ""SameColor"" (last To)))) (not (no Pieces in:(sites Mover ""Reserve"")))) (and (remove (sites Mover ""Reserve"")) (add (piece (id ""Starter"" Mover)) (to (sites Mover ""Base"")) stack:True)))) (set Value at:(last To) (count Stack at:(last To))) (addScore Mover (- (if (= (id Mover) 1) (mapEntry ""PipsP1"" (last To)) (mapEntry ""PipsP2"" (last To))) (if (= (id Mover) 1) (mapEntry ""PipsP1"" (last From)) (mapEntry ""PipsP2"" (last From))))) (if (> (size Stack at:(last To)) (value Piece at:(last To))) (addScore Next (- 0 (if (= (id Mover) 1) (mapEntry ""PipsP2"" (last To)) (mapEntry ""PipsP1"" (last To))))))})))) (if (= (score Mover) 10) (move (from) (to (union {(intersection {(difference (if (= 1 (size Stack at:(from))) (sites ""Rings"") (sites ""RingsplusT"")) (from)) (sites Empty) (sites {(mapEntry ""Step2a"" (from)) (mapEntry ""Step2b"" (from)) (mapEntry ""Step10c"" (from)) (mapEntry ""Step10d"" (from)) (mapEntry ""Step10e"" (from)) (mapEntry (from)) (mapEntry (from)) (mapEntry (from))})}) (intersection {(sites ""Rings"") (sites Occupied by:Next) (sites {(mapEntry ""SameColor"" (arrayValue (intersection (array (sites Empty)) (array {(mapEntry ""Step2a"" (from))})) index:0)) (mapEntry ""SameColor"" (arrayValue (intersection (array (sites Empty)) (array {(mapEntry ""Step2b"" (from))})) index:0)) (mapEntry ""SameColor"" (arrayValue (intersection (array (sites Empty)) (array {(mapEntry ""Step10c"" (from))})) index:0)) (mapEntry ""SameColor"" (arrayValue (intersection (array (sites Empty)) (array {(mapEntry ""Step10d"" (from))})) index:0)) (mapEntry ""SameColor"" (arrayValue (intersection (array (sites Empty)) (array {(mapEntry ""Step10e"" (from))})) index:0)) (mapEntry ""SameColor"" (arrayValue (intersection (array (sites Empty)) (array {(mapEntry (from))})) index:0)) (mapEntry ""SameColor"" (arrayValue (intersection (array (sites Empty)) (array {(mapEntry (from))})) index:0)) (mapEntry ""SameColor"" (arrayValue (intersection (array (sites Empty)) (array {(mapEntry (from))})) index:0)) (mapEntry (from))})})})) stack:True (then (and {(set Var ""StartS"" 3) (set Var ""CntrAttack"" 0) (if (= 15 (last To)) (and {(add (piece (id ""Starter"" Mover)) (to (sites Mover ""Base"")) count:(count Stack at:(last To) if:(= (id ""Cone"" Mover) (what at:(to) level:(level)))) stack:True) (add (piece (id ""Prisoner"" Mover)) (to (sites Mover ""Prison"")) count:(count Stack at:(last To) if:(= (id ""Cone"" Next) (what at:(to) level:(level)))) stack:True) (remove 15 count:(count Stack at:(last To)))}) (if (and (is Friend (who at:(mapEntry ""SameColor"" (last To)))) (not (no Pieces in:(sites Mover ""Reserve"")))) (and (remove (sites Mover ""Reserve"")) (add (piece (id ""Starter"" Mover)) (to (sites Mover ""Base"")) stack:True)))) (set Value at:(last To) (count Stack at:(last To))) (addScore Mover (- (if (= (id Mover) 1) (mapEntry ""PipsP1"" (last To)) (mapEntry ""PipsP2"" (last To))) (if (= (id Mover) 1) (mapEntry ""PipsP1"" (last From)) (mapEntry ""PipsP2"" (last From))))) (if (> (size Stack at:(last To)) (value Piece at:(last To))) (addScore Next (- 0 (if (= (id Mover) 1) (mapEntry ""PipsP2"" (last To)) (mapEntry ""PipsP1"" (last To))))))}))) (move (from) (to (union {(intersection {(difference (if (= 1 (size Stack at:(from))) (sites ""Rings"") (sites ""RingsplusT"")) (from)) (sites Empty) (sites {(mapEntry ""Step3a"" (from)) (mapEntry ""Step3b"" (from)) (mapEntry ""Step11c"" (from)) (mapEntry ""Step11d"" (from)) (mapEntry ""Step11e"" (from)) (mapEntry ""Step11f"" (from)) (mapEntry ""Step11g"" (from)) (mapEntry (from))})}) (intersection {(sites ""Rings"") (sites Occupied by:Next) (sites {(mapEntry ""SameColor"" (arrayValue (intersection (array (sites Empty)) (array {(mapEntry ""Step3a"" (from))})) index:0)) (mapEntry ""SameColor"" (arrayValue (intersection (array (sites Empty)) (array {(mapEntry ""Step3b"" (from))})) index:0)) (mapEntry ""SameColor"" (arrayValue (intersection (array (sites Empty)) (array {(mapEntry ""Step11c"" (from))})) index:0)) (mapEntry ""SameColor"" (arrayValue (intersection (array (sites Empty)) (array {(mapEntry ""Step11d"" (from))})) index:0)) (mapEntry ""SameColor"" (arrayValue (intersection (array (sites Empty)) (array {(mapEntry ""Step11e"" (from))})) index:0)) (mapEntry ""SameColor"" (arrayValue (intersection (array (sites Empty)) (array {(mapEntry ""Step11f"" (from))})) index:0)) (mapEntry ""SameColor"" (arrayValue (intersection (array (sites Empty)) (array {(mapEntry ""Step11g"" (from))})) index:0)) (mapEntry ""SameColor"" (arrayValue (intersection (array (sites Empty)) (array {(mapEntry (from))})) index:0)) (mapEntry (from))})})})) stack:True (then (and {(set Var ""StartS"" 3) (set Var ""CntrAttack"" 0) (if (= 15 (last To)) (and {(add (piece (id ""Starter"" Mover)) (to (sites Mover ""Base"")) count:(count Stack at:(last To) if:(= (id ""Cone"" Mover) (what at:(to) level:(level)))) stack:True) (add (piece (id ""Prisoner"" Mover)) (to (sites Mover ""Prison"")) count:(count Stack at:(last To) if:(= (id ""Cone"" Next) (what at:(to) level:(level)))) stack:True) (remove 15 count:(count Stack at:(last To)))}) (if (and (is Friend (who at:(mapEntry ""SameColor"" (last To)))) (not (no Pieces in:(sites Mover ""Reserve"")))) (and (remove (sites Mover ""Reserve"")) (add (piece (id ""Starter"" Mover)) (to (sites Mover ""Base"")) stack:True)))) (set Value at:(last To) (count Stack at:(last To))) (addScore Mover (- (if (= (id Mover) 1) (mapEntry ""PipsP1"" (last To)) (mapEntry ""PipsP2"" (last To))) (if (= (id Mover) 1) (mapEntry ""PipsP1"" (last From)) (mapEntry ""PipsP2"" (last From))))) (if (> (size Stack at:(last To)) (value Piece at:(last To))) (addScore Next (- 0 (if (= (id Mover) 1) (mapEntry ""PipsP2"" (last To)) (mapEntry ""PipsP1"" (last To))))))}))))) (if (< (score Mover) 14) (if (= (score Mover) 12) (move (from) (to (union {(intersection {(difference (if (= 1 (size Stack at:(from))) (sites ""Rings"") (sites ""RingsplusT"")) (from)) (sites Empty) (sites {(mapEntry ""Step4a"" (from)) (mapEntry ""Step12b"" (from)) (mapEntry ""Step12c"" (from)) (mapEntry ""Step12d"" (from)) (mapEntry ""Step12e"" (from)) (mapEntry ""Step12f"" (from)) (mapEntry (from)) (mapEntry (from))})}) (intersection {(sites ""Rings"") (sites Occupied by:Next) (sites {(mapEntry ""SameColor"" (arrayValue (intersection (array (sites Empty)) (array {(mapEntry ""Step4a"" (from))})) index:0)) (mapEntry ""SameColor"" (arrayValue (intersection (array (sites Empty)) (array {(mapEntry ""Step12b"" (from))})) index:0)) (mapEntry ""SameColor"" (arrayValue (intersection (array (sites Empty)) (array {(mapEntry ""Step12c"" (from))})) index:0)) (mapEntry ""SameColor"" (arrayValue (intersection (array (sites Empty)) (array {(mapEntry ""Step12d"" (from))})) index:0)) (mapEntry ""SameColor"" (arrayValue (intersection (array (sites Empty)) (array {(mapEntry ""Step12e"" (from))})) index:0)) (mapEntry ""SameColor"" (arrayValue (intersection (array (sites Empty)) (array {(mapEntry ""Step12f"" (from))})) index:0)) (mapEntry ""SameColor"" (arrayValue (intersection (array (sites Empty)) (array {(mapEntry (from))})) index:0)) (mapEntry ""SameColor"" (arrayValue (intersection (array (sites Empty)) (array {(mapEntry (from))})) index:0)) (mapEntry ""Step12g"" (from))})})})) stack:True (then (and {(set Var ""StartS"" 3) (set Var ""CntrAttack"" 0) (if (= 15 (last To)) (and {(add (piece (id ""Starter"" Mover)) (to (sites Mover ""Base"")) count:(count Stack at:(last To) if:(= (id ""Cone"" Mover) (what at:(to) level:(level)))) stack:True) (add (piece (id ""Prisoner"" Mover)) (to (sites Mover ""Prison"")) count:(count Stack at:(last To) if:(= (id ""Cone"" Next) (what at:(to) level:(level)))) stack:True) (remove 15 count:(count Stack at:(last To)))}) (if (and (is Friend (who at:(mapEntry ""SameColor"" (last To)))) (not (no Pieces in:(sites Mover ""Reserve"")))) (and (remove (sites Mover ""Reserve"")) (add (piece (id ""Starter"" Mover)) (to (sites Mover ""Base"")) stack:True)))) (set Value at:(last To) (count Stack at:(last To))) (addScore Mover (- (if (= (id Mover) 1) (mapEntry ""PipsP1"" (last To)) (mapEntry ""PipsP2"" (last To))) (if (= (id Mover) 1) (mapEntry ""PipsP1"" (last From)) (mapEntry ""PipsP2"" (last From))))) (if (> (size Stack at:(last To)) (value Piece at:(last To))) (addScore Next (- 0 (if (= (id Mover) 1) (mapEntry ""PipsP2"" (last To)) (mapEntry ""PipsP1"" (last To))))))}))) (move (from) (to (union {(intersection {(difference (if (= 1 (size Stack at:(from))) (sites ""Rings"") (sites ""RingsplusT"")) (from)) (sites Empty) (sites {(mapEntry ""Step3a"" (from)) (mapEntry ""Step3b"" (from)) (mapEntry ""Step13c"" (from)) (mapEntry ""Step13d"" (from)) (mapEntry ""Step13e"" (from)) (mapEntry ""Step13f"" (from)) (mapEntry ""Step11g"" (from)) (mapEntry (from))})}) (intersection {(sites ""Rings"") (sites Occupied by:Next) (sites {(mapEntry ""SameColor"" (arrayValue (intersection (array (sites Empty)) (array {(mapEntry ""Step3a"" (from))})) index:0)) (mapEntry ""SameColor"" (arrayValue (intersection (array (sites Empty)) (array {(mapEntry ""Step3b"" (from))})) index:0)) (mapEntry ""SameColor"" (arrayValue (intersection (array (sites Empty)) (array {(mapEntry ""Step13c"" (from))})) index:0)) (mapEntry ""SameColor"" (arrayValue (intersection (array (sites Empty)) (array {(mapEntry ""Step13d"" (from))})) index:0)) (mapEntry ""SameColor"" (arrayValue (intersection (array (sites Empty)) (array {(mapEntry ""Step13e"" (from))})) index:0)) (mapEntry ""SameColor"" (arrayValue (intersection (array (sites Empty)) (array {(mapEntry ""Step13f"" (from))})) index:0)) (mapEntry ""SameColor"" (arrayValue (intersection (array (sites Empty)) (array {(mapEntry ""Step11g"" (from))})) index:0)) (mapEntry ""SameColor"" (arrayValue (intersection (array (sites Empty)) (array {(mapEntry (from))})) index:0)) (mapEntry (from))})})})) stack:True (then (and {(set Var ""StartS"" 3) (set Var ""CntrAttack"" 0) (if (= 15 (last To)) (and {(add (piece (id ""Starter"" Mover)) (to (sites Mover ""Base"")) count:(count Stack at:(last To) if:(= (id ""Cone"" Mover) (what at:(to) level:(level)))) stack:True) (add (piece (id ""Prisoner"" Mover)) (to (sites Mover ""Prison"")) count:(count Stack at:(last To) if:(= (id ""Cone"" Next) (what at:(to) level:(level)))) stack:True) (remove 15 count:(count Stack at:(last To)))}) (if (and (is Friend (who at:(mapEntry ""SameColor"" (last To)))) (not (no Pieces in:(sites Mover ""Reserve"")))) (and (remove (sites Mover ""Reserve"")) (add (piece (id ""Starter"" Mover)) (to (sites Mover ""Base"")) stack:True)))) (set Value at:(last To) (count Stack at:(last To))) (addScore Mover (- (if (= (id Mover) 1) (mapEntry ""PipsP1"" (last To)) (mapEntry ""PipsP2"" (last To))) (if (= (id Mover) 1) (mapEntry ""PipsP1"" (last From)) (mapEntry ""PipsP2"" (last From))))) (if (> (size Stack at:(last To)) (value Piece at:(last To))) (addScore Next (- 0 (if (= (id Mover) 1) (mapEntry ""PipsP2"" (last To)) (mapEntry ""PipsP1"" (last To))))))})))) (if (= (score Mover) 14) (move (from) (to (union {(intersection {(difference (if (= 1 (size Stack at:(from))) (sites ""Rings"") (sites ""RingsplusT"")) (from)) (sites Empty) (sites {(mapEntry ""Step2a"" (from)) (mapEntry ""Step2b"" (from)) (mapEntry ""Step14c"" (from)) (mapEntry ""Step14d"" (from)) (mapEntry ""Step14e"" (from)) (mapEntry (from)) (mapEntry (from)) (mapEntry (from))})}) (intersection {(sites ""Rings"") (sites Occupied by:Next) (sites {(mapEntry ""SameColor"" (arrayValue (intersection (array (sites Empty)) (array {(mapEntry ""Step2a"" (from))})) index:0)) (mapEntry ""SameColor"" (arrayValue (intersection (array (sites Empty)) (array {(mapEntry ""Step2b"" (from))})) index:0)) (mapEntry ""SameColor"" (arrayValue (intersection (array (sites Empty)) (array {(mapEntry ""Step14c"" (from))})) index:0)) (mapEntry ""SameColor"" (arrayValue (intersection (array (sites Empty)) (array {(mapEntry ""Step14d"" (from))})) index:0)) (mapEntry ""SameColor"" (arrayValue (intersection (array (sites Empty)) (array {(mapEntry ""Step14e"" (from))})) index:0)) (mapEntry ""SameColor"" (arrayValue (intersection (array (sites Empty)) (array {(mapEntry (from))})) index:0)) (mapEntry ""SameColor"" (arrayValue (intersection (array (sites Empty)) (array {(mapEntry (from))})) index:0)) (mapEntry ""SameColor"" (arrayValue (intersection (array (sites Empty)) (array {(mapEntry (from))})) index:0)) (mapEntry ""Step14f"" (from))})})})) stack:True (then (and {(set Var ""StartS"" 3) (set Var ""CntrAttack"" 0) (if (= 15 (last To)) (and {(add (piece (id ""Starter"" Mover)) (to (sites Mover ""Base"")) count:(count Stack at:(last To) if:(= (id ""Cone"" Mover) (what at:(to) level:(level)))) stack:True) (add (piece (id ""Prisoner"" Mover)) (to (sites Mover ""Prison"")) count:(count Stack at:(last To) if:(= (id ""Cone"" Next) (what at:(to) level:(level)))) stack:True) (remove 15 count:(count Stack at:(last To)))}) (if (and (is Friend (who at:(mapEntry ""SameColor"" (last To)))) (not (no Pieces in:(sites Mover ""Reserve"")))) (and (remove (sites Mover ""Reserve"")) (add (piece (id ""Starter"" Mover)) (to (sites Mover ""Base"")) stack:True)))) (set Value at:(last To) (count Stack at:(last To))) (addScore Mover (- (if (= (id Mover) 1) (mapEntry ""PipsP1"" (last To)) (mapEntry ""PipsP2"" (last To))) (if (= (id Mover) 1) (mapEntry ""PipsP1"" (last From)) (mapEntry ""PipsP2"" (last From))))) (if (> (size Stack at:(last To)) (value Piece at:(last To))) (addScore Next (- 0 (if (= (id Mover) 1) (mapEntry ""PipsP2"" (last To)) (mapEntry ""PipsP1"" (last To))))))}))) (move (from) (to (union {(intersection {(difference (if (= 1 (size Stack at:(from))) (sites ""Rings"") (sites ""RingsplusT"")) (from)) (sites Empty) (sites {(mapEntry ""Step7a"" (from)) (mapEntry ""Step7b"" (from)) (mapEntry ""Step15c"" (from)) (mapEntry ""Step15d"" (from)) (mapEntry ""Step15e"" (from)) (mapEntry ""Step15f"" (from)) (mapEntry ""Step11f"" (from)) (mapEntry ""Step11g"" (from))})}) (intersection {(sites ""Rings"") (sites Occupied by:Next) (sites {(mapEntry ""SameColor"" (arrayValue (intersection (array (sites Empty)) (array {(mapEntry ""Step7a"" (from))})) index:0)) (mapEntry ""SameColor"" (arrayValue (intersection (array (sites Empty)) (array {(mapEntry ""Step7b"" (from))})) index:0)) (mapEntry ""SameColor"" (arrayValue (intersection (array (sites Empty)) (array {(mapEntry ""Step15c"" (from))})) index:0)) (mapEntry ""SameColor"" (arrayValue (intersection (array (sites Empty)) (array {(mapEntry ""Step15d"" (from))})) index:0)) (mapEntry ""SameColor"" (arrayValue (intersection (array (sites Empty)) (array {(mapEntry ""Step15e"" (from))})) index:0)) (mapEntry ""SameColor"" (arrayValue (intersection (array (sites Empty)) (array {(mapEntry ""Step15f"" (from))})) index:0)) (mapEntry ""SameColor"" (arrayValue (intersection (array (sites Empty)) (array {(mapEntry ""Step11f"" (from))})) index:0)) (mapEntry ""SameColor"" (arrayValue (intersection (array (sites Empty)) (array {(mapEntry ""Step11g"" (from))})) index:0)) (mapEntry (from))})})})) stack:True (then (and {(set Var ""StartS"" 3) (set Var ""CntrAttack"" 0) (if (= 15 (last To)) (and {(add (piece (id ""Starter"" Mover)) (to (sites Mover ""Base"")) count:(count Stack at:(last To) if:(= (id ""Cone"" Mover) (what at:(to) level:(level)))) stack:True) (add (piece (id ""Prisoner"" Mover)) (to (sites Mover ""Prison"")) count:(count Stack at:(last To) if:(= (id ""Cone"" Next) (what at:(to) level:(level)))) stack:True) (remove 15 count:(count Stack at:(last To)))}) (if (and (is Friend (who at:(mapEntry ""SameColor"" (last To)))) (not (no Pieces in:(sites Mover ""Reserve"")))) (and (remove (sites Mover ""Reserve"")) (add (piece (id ""Starter"" Mover)) (to (sites Mover ""Base"")) stack:True)))) (set Value at:(last To) (count Stack at:(last To))) (addScore Mover (- (if (= (id Mover) 1) (mapEntry ""PipsP1"" (last To)) (mapEntry ""PipsP2"" (last To))) (if (= (id Mover) 1) (mapEntry ""PipsP1"" (last From)) (mapEntry ""PipsP2"" (last From))))) (if (> (size Stack at:(last To)) (value Piece at:(last To))) (addScore Next (- 0 (if (= (id Mover) 1) (mapEntry ""PipsP2"" (last To)) (mapEntry ""PipsP1"" (last To))))))}))))))) (if (< (score Mover) 20) (if (< (score Mover) 18) (if (= (score Mover) 16) (move (from) (to (union {(intersection {(difference (if (= 1 (size Stack at:(from))) (sites ""Rings"") (sites ""RingsplusT"")) (from)) (sites Empty) (sites {(mapEntry ""Step8a"" (from)) (mapEntry ""Step8b"" (from)) (mapEntry ""Step16c"" (from)) (mapEntry ""Step16d"" (from)) (mapEntry ""Step16e"" (from)) (mapEntry ""Step16f"" (from)) (mapEntry ""Step16g"" (from)) (mapEntry (from))})}) (intersection {(sites ""Rings"") (sites Occupied by:Next) (sites {(mapEntry ""SameColor"" (arrayValue (intersection (array (sites Empty)) (array {(mapEntry ""Step8a"" (from))})) index:0)) (mapEntry ""SameColor"" (arrayValue (intersection (array (sites Empty)) (array {(mapEntry ""Step8b"" (from))})) index:0)) (mapEntry ""SameColor"" (arrayValue (intersection (array (sites Empty)) (array {(mapEntry ""Step16c"" (from))})) index:0)) (mapEntry ""SameColor"" (arrayValue (intersection (array (sites Empty)) (array {(mapEntry ""Step16d"" (from))})) index:0)) (mapEntry ""SameColor"" (arrayValue (intersection (array (sites Empty)) (array {(mapEntry ""Step16e"" (from))})) index:0)) (mapEntry ""SameColor"" (arrayValue (intersection (array (sites Empty)) (array {(mapEntry ""Step16f"" (from))})) index:0)) (mapEntry ""SameColor"" (arrayValue (intersection (array (sites Empty)) (array {(mapEntry ""Step16g"" (from))})) index:0)) (mapEntry ""SameColor"" (arrayValue (intersection (array (sites Empty)) (array {(mapEntry (from))})) index:0)) (mapEntry ""SameColor"" (from))})})})) stack:True (then (and {(set Var ""StartS"" 3) (set Var ""CntrAttack"" 0) (if (= 15 (last To)) (and {(add (piece (id ""Starter"" Mover)) (to (sites Mover ""Base"")) count:(count Stack at:(last To) if:(= (id ""Cone"" Mover) (what at:(to) level:(level)))) stack:True) (add (piece (id ""Prisoner"" Mover)) (to (sites Mover ""Prison"")) count:(count Stack at:(last To) if:(= (id ""Cone"" Next) (what at:(to) level:(level)))) stack:True) (remove 15 count:(count Stack at:(last To)))}) (if (and (is Friend (who at:(mapEntry ""SameColor"" (last To)))) (not (no Pieces in:(sites Mover ""Reserve"")))) (and (remove (sites Mover ""Reserve"")) (add (piece (id ""Starter"" Mover)) (to (sites Mover ""Base"")) stack:True)))) (set Value at:(last To) (count Stack at:(last To))) (addScore Mover (- (if (= (id Mover) 1) (mapEntry ""PipsP1"" (last To)) (mapEntry ""PipsP2"" (last To))) (if (= (id Mover) 1) (mapEntry ""PipsP1"" (last From)) (mapEntry ""PipsP2"" (last From))))) (if (> (size Stack at:(last To)) (value Piece at:(last To))) (addScore Next (- 0 (if (= (id Mover) 1) (mapEntry ""PipsP2"" (last To)) (mapEntry ""PipsP1"" (last To))))))}))) (move (from) (to (union {(intersection {(difference (if (= 1 (size Stack at:(from))) (sites ""Rings"") (sites ""RingsplusT"")) (from)) (sites Empty) (sites {(mapEntry ""Step7a"" (from)) (mapEntry ""Step7b"" (from)) (mapEntry ""Step17c"" (from)) (mapEntry ""Step17d"" (from)) (mapEntry ""Step17e"" (from)) (mapEntry ""Step17f"" (from)) (mapEntry ""Step17g"" (from)) (mapEntry ""Step17h"" (from))})}) (intersection {(sites ""Rings"") (sites Occupied by:Next) (sites {(mapEntry ""SameColor"" (arrayValue (intersection (array (sites Empty)) (array {(mapEntry ""Step7a"" (from))})) index:0)) (mapEntry ""SameColor"" (arrayValue (intersection (array (sites Empty)) (array {(mapEntry ""Step7b"" (from))})) index:0)) (mapEntry ""SameColor"" (arrayValue (intersection (array (sites Empty)) (array {(mapEntry ""Step17c"" (from))})) index:0)) (mapEntry ""SameColor"" (arrayValue (intersection (array (sites Empty)) (array {(mapEntry ""Step17d"" (from))})) index:0)) (mapEntry ""SameColor"" (arrayValue (intersection (array (sites Empty)) (array {(mapEntry ""Step17e"" (from))})) index:0)) (mapEntry ""SameColor"" (arrayValue (intersection (array (sites Empty)) (array {(mapEntry ""Step17f"" (from))})) index:0)) (mapEntry ""SameColor"" (arrayValue (intersection (array (sites Empty)) (array {(mapEntry ""Step17g"" (from))})) index:0)) (mapEntry ""SameColor"" (arrayValue (intersection (array (sites Empty)) (array {(mapEntry ""Step17h"" (from))})) index:0)) (mapEntry (from))})})})) stack:True (then (and {(set Var ""StartS"" 3) (set Var ""CntrAttack"" 0) (if (= 15 (last To)) (and {(add (piece (id ""Starter"" Mover)) (to (sites Mover ""Base"")) count:(count Stack at:(last To) if:(= (id ""Cone"" Mover) (what at:(to) level:(level)))) stack:True) (add (piece (id ""Prisoner"" Mover)) (to (sites Mover ""Prison"")) count:(count Stack at:(last To) if:(= (id ""Cone"" Next) (what at:(to) level:(level)))) stack:True) (remove 15 count:(count Stack at:(last To)))}) (if (and (is Friend (who at:(mapEntry ""SameColor"" (last To)))) (not (no Pieces in:(sites Mover ""Reserve"")))) (and (remove (sites Mover ""Reserve"")) (add (piece (id ""Starter"" Mover)) (to (sites Mover ""Base"")) stack:True)))) (set Value at:(last To) (count Stack at:(last To))) (addScore Mover (- (if (= (id Mover) 1) (mapEntry ""PipsP1"" (last To)) (mapEntry ""PipsP2"" (last To))) (if (= (id Mover) 1) (mapEntry ""PipsP1"" (last From)) (mapEntry ""PipsP2"" (last From))))) (if (> (size Stack at:(last To)) (value Piece at:(last To))) (addScore Next (- 0 (if (= (id Mover) 1) (mapEntry ""PipsP2"" (last To)) (mapEntry ""PipsP1"" (last To))))))})))) (if (= (score Mover) 18) (move (from) (to (union {(intersection {(difference (if (= 1 (size Stack at:(from))) (sites ""Rings"") (sites ""RingsplusT"")) (from)) (sites Empty) (sites {(mapEntry ""Step2a"" (from)) (mapEntry ""Step2b"" (from)) (mapEntry ""Step18c"" (from)) (mapEntry ""Step18d"" (from)) (mapEntry ""Step18e"" (from)) (mapEntry ""Step18f"" (from)) (mapEntry (from)) (mapEntry (from))})}) (intersection {(sites ""Rings"") (sites Occupied by:Next) (sites {(mapEntry ""SameColor"" (arrayValue (intersection (array (sites Empty)) (array {(mapEntry ""Step2a"" (from))})) index:0)) (mapEntry ""SameColor"" (arrayValue (intersection (array (sites Empty)) (array {(mapEntry ""Step2b"" (from))})) index:0)) (mapEntry ""SameColor"" (arrayValue (intersection (array (sites Empty)) (array {(mapEntry ""Step18c"" (from))})) index:0)) (mapEntry ""SameColor"" (arrayValue (intersection (array (sites Empty)) (array {(mapEntry ""Step18d"" (from))})) index:0)) (mapEntry ""SameColor"" (arrayValue (intersection (array (sites Empty)) (array {(mapEntry ""Step18e"" (from))})) index:0)) (mapEntry ""SameColor"" (arrayValue (intersection (array (sites Empty)) (array {(mapEntry ""Step18f"" (from))})) index:0)) (mapEntry ""SameColor"" (arrayValue (intersection (array (sites Empty)) (array {(mapEntry (from))})) index:0)) (mapEntry ""SameColor"" (arrayValue (intersection (array (sites Empty)) (array {(mapEntry (from))})) index:0)) (mapEntry ""Step18g"" (from))})})})) stack:True (then (and {(set Var ""StartS"" 3) (set Var ""CntrAttack"" 0) (if (= 15 (last To)) (and {(add (piece (id ""Starter"" Mover)) (to (sites Mover ""Base"")) count:(count Stack at:(last To) if:(= (id ""Cone"" Mover) (what at:(to) level:(level)))) stack:True) (add (piece (id ""Prisoner"" Mover)) (to (sites Mover ""Prison"")) count:(count Stack at:(last To) if:(= (id ""Cone"" Next) (what at:(to) level:(level)))) stack:True) (remove 15 count:(count Stack at:(last To)))}) (if (and (is Friend (who at:(mapEntry ""SameColor"" (last To)))) (not (no Pieces in:(sites Mover ""Reserve"")))) (and (remove (sites Mover ""Reserve"")) (add (piece (id ""Starter"" Mover)) (to (sites Mover ""Base"")) stack:True)))) (set Value at:(last To) (count Stack at:(last To))) (addScore Mover (- (if (= (id Mover) 1) (mapEntry ""PipsP1"" (last To)) (mapEntry ""PipsP2"" (last To))) (if (= (id Mover) 1) (mapEntry ""PipsP1"" (last From)) (mapEntry ""PipsP2"" (last From))))) (if (> (size Stack at:(last To)) (value Piece at:(last To))) (addScore Next (- 0 (if (= (id Mover) 1) (mapEntry ""PipsP2"" (last To)) (mapEntry ""PipsP1"" (last To))))))}))) (and (move (from) (to (union {(intersection {(difference (if (= 1 (size Stack at:(from))) (sites ""Rings"") (sites ""RingsplusT"")) (from)) (sites Empty) (sites {(mapEntry ""Step3a"" (from)) (mapEntry ""Step3b"" (from)) (mapEntry ""Step19c"" (from)) (mapEntry ""Step19d"" (from)) (mapEntry ""Step19e"" (from)) (mapEntry ""Step19f"" (from)) (mapEntry ""Step19g"" (from)) (mapEntry ""Step19h"" (from))})}) (intersection {(sites ""Rings"") (sites Occupied by:Next) (sites {(mapEntry ""SameColor"" (arrayValue (intersection (array (sites Empty)) (array {(mapEntry ""Step3a"" (from))})) index:0)) (mapEntry ""SameColor"" (arrayValue (intersection (array (sites Empty)) (array {(mapEntry ""Step3b"" (from))})) index:0)) (mapEntry ""SameColor"" (arrayValue (intersection (array (sites Empty)) (array {(mapEntry ""Step19c"" (from))})) index:0)) (mapEntry ""SameColor"" (arrayValue (intersection (array (sites Empty)) (array {(mapEntry ""Step19d"" (from))})) index:0)) (mapEntry ""SameColor"" (arrayValue (intersection (array (sites Empty)) (array {(mapEntry ""Step19e"" (from))})) index:0)) (mapEntry ""SameColor"" (arrayValue (intersection (array (sites Empty)) (array {(mapEntry ""Step19f"" (from))})) index:0)) (mapEntry ""SameColor"" (arrayValue (intersection (array (sites Empty)) (array {(mapEntry ""Step19g"" (from))})) index:0)) (mapEntry ""SameColor"" (arrayValue (intersection (array (sites Empty)) (array {(mapEntry ""Step19h"" (from))})) index:0)) (mapEntry (from))})})})) stack:True (then (and {(set Var ""StartS"" 3) (set Var ""CntrAttack"" 0) (if (= 15 (last To)) (and {(add (piece (id ""Starter"" Mover)) (to (sites Mover ""Base"")) count:(count Stack at:(last To) if:(= (id ""Cone"" Mover) (what at:(to) level:(level)))) stack:True) (add (piece (id ""Prisoner"" Mover)) (to (sites Mover ""Prison"")) count:(count Stack at:(last To) if:(= (id ""Cone"" Next) (what at:(to) level:(level)))) stack:True) (remove 15 count:(count Stack at:(last To)))}) (if (and (is Friend (who at:(mapEntry ""SameColor"" (last To)))) (not (no Pieces in:(sites Mover ""Reserve"")))) (and (remove (sites Mover ""Reserve"")) (add (piece (id ""Starter"" Mover)) (to (sites Mover ""Base"")) stack:True)))) (set Value at:(last To) (count Stack at:(last To))) (addScore Mover (- (if (= (id Mover) 1) (mapEntry ""PipsP1"" (last To)) (mapEntry ""PipsP2"" (last To))) (if (= (id Mover) 1) (mapEntry ""PipsP1"" (last From)) (mapEntry ""PipsP2"" (last From))))) (if (> (size Stack at:(last To)) (value Piece at:(last To))) (addScore Next (- 0 (if (= (id Mover) 1) (mapEntry ""PipsP2"" (last To)) (mapEntry ""PipsP1"" (last To))))))}))) (move (from) (to (union {(intersection {(difference (if (= 1 (size Stack at:(from))) (sites ""Rings"") (sites ""RingsplusT"")) (from)) (sites Empty) (sites {(mapEntry ""Step19i"" (from)) (mapEntry (from)) (mapEntry (from)) (mapEntry (from)) (mapEntry (from)) (mapEntry (from)) (mapEntry (from)) (mapEntry (from))})}) (intersection {(sites ""Rings"") (sites Occupied by:Next) (sites {(mapEntry ""SameColor"" (arrayValue (intersection (array (sites Empty)) (array {(mapEntry ""Step19i"" (from))})) index:0)) (mapEntry ""SameColor"" (arrayValue (intersection (array (sites Empty)) (array {(mapEntry (from))})) index:0)) (mapEntry ""SameColor"" (arrayValue (intersection (array (sites Empty)) (array {(mapEntry (from))})) index:0)) (mapEntry ""SameColor"" (arrayValue (intersection (array (sites Empty)) (array {(mapEntry (from))})) index:0)) (mapEntry ""SameColor"" (arrayValue (intersection (array (sites Empty)) (array {(mapEntry (from))})) index:0)) (mapEntry ""SameColor"" (arrayValue (intersection (array (sites Empty)) (array {(mapEntry (from))})) index:0)) (mapEntry ""SameColor"" (arrayValue (intersection (array (sites Empty)) (array {(mapEntry (from))})) index:0)) (mapEntry ""SameColor"" (arrayValue (intersection (array (sites Empty)) (array {(mapEntry (from))})) index:0)) (mapEntry (from))})})})) stack:True (then (and {(set Var ""StartS"" 3) (set Var ""CntrAttack"" 0) (if (= 15 (last To)) (and {(add (piece (id ""Starter"" Mover)) (to (sites Mover ""Base"")) count:(count Stack at:(last To) if:(= (id ""Cone"" Mover) (what at:(to) level:(level)))) stack:True) (add (piece (id ""Prisoner"" Mover)) (to (sites Mover ""Prison"")) count:(count Stack at:(last To) if:(= (id ""Cone"" Next) (what at:(to) level:(level)))) stack:True) (remove 15 count:(count Stack at:(last To)))}) (if (and (is Friend (who at:(mapEntry ""SameColor"" (last To)))) (not (no Pieces in:(sites Mover ""Reserve"")))) (and (remove (sites Mover ""Reserve"")) (add (piece (id ""Starter"" Mover)) (to (sites Mover ""Base"")) stack:True)))) (set Value at:(last To) (count Stack at:(last To))) (addScore Mover (- (if (= (id Mover) 1) (mapEntry ""PipsP1"" (last To)) (mapEntry ""PipsP2"" (last To))) (if (= (id Mover) 1) (mapEntry ""PipsP1"" (last From)) (mapEntry ""PipsP2"" (last From))))) (if (> (size Stack at:(last To)) (value Piece at:(last To))) (addScore Next (- 0 (if (= (id Mover) 1) (mapEntry ""PipsP2"" (last To)) (mapEntry ""PipsP1"" (last To))))))})))))) (if (= 20 (score Mover)) (move (from) (to (union {(intersection {(difference (if (= 1 (size Stack at:(from))) (sites ""Rings"") (sites ""RingsplusT"")) (from)) (sites Empty) (sites {(mapEntry ""Step4a"" (from)) (mapEntry ""Step20b"" (from)) (mapEntry ""Step20c"" (from)) (mapEntry ""Step20d"" (from)) (mapEntry ""Step20e"" (from)) (mapEntry ""Step20f"" (from)) (mapEntry ""Step20g"" (from)) (mapEntry (from))})}) (intersection {(sites ""Rings"") (sites Occupied by:Next) (sites {(mapEntry ""SameColor"" (arrayValue (intersection (array (sites Empty)) (array {(mapEntry ""Step4a"" (from))})) index:0)) (mapEntry ""SameColor"" (arrayValue (intersection (array (sites Empty)) (array {(mapEntry ""Step20b"" (from))})) index:0)) (mapEntry ""SameColor"" (arrayValue (intersection (array (sites Empty)) (array {(mapEntry ""Step20c"" (from))})) index:0)) (mapEntry ""SameColor"" (arrayValue (intersection (array (sites Empty)) (array {(mapEntry ""Step20d"" (from))})) index:0)) (mapEntry ""SameColor"" (arrayValue (intersection (array (sites Empty)) (array {(mapEntry ""Step20e"" (from))})) index:0)) (mapEntry ""SameColor"" (arrayValue (intersection (array (sites Empty)) (array {(mapEntry ""Step20f"" (from))})) index:0)) (mapEntry ""SameColor"" (arrayValue (intersection (array (sites Empty)) (array {(mapEntry ""Step20g"" (from))})) index:0)) (mapEntry ""SameColor"" (arrayValue (intersection (array (sites Empty)) (array {(mapEntry (from))})) index:0)) (mapEntry ""SameColor"" (from))})})})) stack:True (then (and {(set Var ""StartS"" 3) (set Var ""CntrAttack"" 0) (if (= 15 (last To)) (and {(add (piece (id ""Starter"" Mover)) (to (sites Mover ""Base"")) count:(count Stack at:(last To) if:(= (id ""Cone"" Mover) (what at:(to) level:(level)))) stack:True) (add (piece (id ""Prisoner"" Mover)) (to (sites Mover ""Prison"")) count:(count Stack at:(last To) if:(= (id ""Cone"" Next) (what at:(to) level:(level)))) stack:True) (remove 15 count:(count Stack at:(last To)))}) (if (and (is Friend (who at:(mapEntry ""SameColor"" (last To)))) (not (no Pieces in:(sites Mover ""Reserve"")))) (and (remove (sites Mover ""Reserve"")) (add (piece (id ""Starter"" Mover)) (to (sites Mover ""Base"")) stack:True)))) (set Value at:(last To) (count Stack at:(last To))) (addScore Mover (- (if (= (id Mover) 1) (mapEntry ""PipsP1"" (last To)) (mapEntry ""PipsP2"" (last To))) (if (= (id Mover) 1) (mapEntry ""PipsP1"" (last From)) (mapEntry ""PipsP2"" (last From))))) (if (> (size Stack at:(last To)) (value Piece at:(last To))) (addScore Next (- 0 (if (= (id Mover) 1) (mapEntry ""PipsP2"" (last To)) (mapEntry ""PipsP1"" (last To))))))}))))))) (if (< (score Mover) 16) (if (< (score Mover) 8) (if (< (score Mover) 4) (if (< (score Mover) 2) (if (= (score Mover) 1) (move (from) (to (union {(intersection {(difference (if (= 1 (size Stack at:(from))) (sites ""Rings"") (sites ""RingsplusT"")) (from)) (sites Empty) (sites {(mapEntry ""Step7a"" (from)) (mapEntry ""Step7b"" (from)) (mapEntry ""Step1c"" (from)) (mapEntry (from)) (mapEntry (from)) (mapEntry (from)) (mapEntry (from)) (mapEntry (from))})}) (intersection {(sites ""Rings"") (sites Occupied by:Next) (sites {(mapEntry ""SameColor"" (arrayValue (intersection (array (sites Empty)) (array {(mapEntry ""Step7a"" (from))})) index:0)) (mapEntry ""SameColor"" (arrayValue (intersection (array (sites Empty)) (array {(mapEntry ""Step7b"" (from))})) index:0)) (mapEntry ""SameColor"" (arrayValue (intersection (array (sites Empty)) (array {(mapEntry ""Step1c"" (from))})) index:0)) (mapEntry ""SameColor"" (arrayValue (intersection (array (sites Empty)) (array {(mapEntry (from))})) index:0)) (mapEntry ""SameColor"" (arrayValue (intersection (array (sites Empty)) (array {(mapEntry (from))})) index:0)) (mapEntry ""SameColor"" (arrayValue (intersection (array (sites Empty)) (array {(mapEntry (from))})) index:0)) (mapEntry ""SameColor"" (arrayValue (intersection (array (sites Empty)) (array {(mapEntry (from))})) index:0)) (mapEntry ""SameColor"" (arrayValue (intersection (array (sites Empty)) (array {(mapEntry (from))})) index:0)) (mapEntry (from))})})})) stack:True (then (and {(set Var ""StartS"" 3) (set Var ""CntrAttack"" 0) (if (= 15 (last To)) (and {(add (piece (id ""Starter"" Mover)) (to (sites Mover ""Base"")) count:(count Stack at:(last To) if:(= (id ""Cone"" Mover) (what at:(to) level:(level)))) stack:True) (add (piece (id ""Prisoner"" Mover)) (to (sites Mover ""Prison"")) count:(count Stack at:(last To) if:(= (id ""Cone"" Next) (what at:(to) level:(level)))) stack:True) (remove 15 count:(count Stack at:(last To)))}) (if (and (is Friend (who at:(mapEntry ""SameColor"" (last To)))) (not (no Pieces in:(sites Mover ""Reserve"")))) (and (remove (sites Mover ""Reserve"")) (add (piece (id ""Starter"" Mover)) (to (sites Mover ""Base"")) stack:True)))) (set Value at:(last To) (count Stack at:(last To))) (addScore Mover (- (if (= (id Mover) 1) (mapEntry ""PipsP1"" (last To)) (mapEntry ""PipsP2"" (last To))) (if (= (id Mover) 1) (mapEntry ""PipsP1"" (last From)) (mapEntry ""PipsP2"" (last From))))) (if (> (size Stack at:(last To)) (value Piece at:(last To))) (addScore Next (- 0 (if (= (id Mover) 1) (mapEntry ""PipsP2"" (last To)) (mapEntry ""PipsP1"" (last To))))))})))) (if (= (score Mover) 2) (move (from) (to (union {(intersection {(difference (if (= 1 (size Stack at:(from))) (sites ""Rings"") (sites ""RingsplusT"")) (from)) (sites Empty) (sites {(mapEntry ""Step2a"" (from)) (mapEntry ""Step2b"" (from)) (mapEntry ""Step2c"" (from)) (mapEntry (from)) (mapEntry (from)) (mapEntry (from)) (mapEntry (from)) (mapEntry (from))})}) (intersection {(sites ""Rings"") (sites Occupied by:Next) (sites {(mapEntry ""SameColor"" (arrayValue (intersection (array (sites Empty)) (array {(mapEntry ""Step2a"" (from))})) index:0)) (mapEntry ""SameColor"" (arrayValue (intersection (array (sites Empty)) (array {(mapEntry ""Step2b"" (from))})) index:0)) (mapEntry ""SameColor"" (arrayValue (intersection (array (sites Empty)) (array {(mapEntry ""Step2c"" (from))})) index:0)) (mapEntry ""SameColor"" (arrayValue (intersection (array (sites Empty)) (array {(mapEntry (from))})) index:0)) (mapEntry ""SameColor"" (arrayValue (intersection (array (sites Empty)) (array {(mapEntry (from))})) index:0)) (mapEntry ""SameColor"" (arrayValue (intersection (array (sites Empty)) (array {(mapEntry (from))})) index:0)) (mapEntry ""SameColor"" (arrayValue (intersection (array (sites Empty)) (array {(mapEntry (from))})) index:0)) (mapEntry ""SameColor"" (arrayValue (intersection (array (sites Empty)) (array {(mapEntry (from))})) index:0)) (mapEntry (from))})})})) stack:True (then (and {(set Var ""StartS"" 3) (set Var ""CntrAttack"" 0) (if (= 15 (last To)) (and {(add (piece (id ""Starter"" Mover)) (to (sites Mover ""Base"")) count:(count Stack at:(last To) if:(= (id ""Cone"" Mover) (what at:(to) level:(level)))) stack:True) (add (piece (id ""Prisoner"" Mover)) (to (sites Mover ""Prison"")) count:(count Stack at:(last To) if:(= (id ""Cone"" Next) (what at:(to) level:(level)))) stack:True) (remove 15 count:(count Stack at:(last To)))}) (if (and (is Friend (who at:(mapEntry ""SameColor"" (last To)))) (not (no Pieces in:(sites Mover ""Reserve"")))) (and (remove (sites Mover ""Reserve"")) (add (piece (id ""Starter"" Mover)) (to (sites Mover ""Base"")) stack:True)))) (set Value at:(last To) (count Stack at:(last To))) (addScore Mover (- (if (= (id Mover) 1) (mapEntry ""PipsP1"" (last To)) (mapEntry ""PipsP2"" (last To))) (if (= (id Mover) 1) (mapEntry ""PipsP1"" (last From)) (mapEntry ""PipsP2"" (last From))))) (if (> (size Stack at:(last To)) (value Piece at:(last To))) (addScore Next (- 0 (if (= (id Mover) 1) (mapEntry ""PipsP2"" (last To)) (mapEntry ""PipsP1"" (last To))))))}))) (move (from) (to (union {(intersection {(difference (if (= 1 (size Stack at:(from))) (sites ""Rings"") (sites ""RingsplusT"")) (from)) (sites Empty) (sites {(mapEntry ""Step3a"" (from)) (mapEntry ""Step3b"" (from)) (mapEntry ""Step3c"" (from)) (mapEntry ""Step3d"" (from)) (mapEntry (from)) (mapEntry (from)) (mapEntry (from)) (mapEntry (from))})}) (intersection {(sites ""Rings"") (sites Occupied by:Next) (sites {(mapEntry ""SameColor"" (arrayValue (intersection (array (sites Empty)) (array {(mapEntry ""Step3a"" (from))})) index:0)) (mapEntry ""SameColor"" (arrayValue (intersection (array (sites Empty)) (array {(mapEntry ""Step3b"" (from))})) index:0)) (mapEntry ""SameColor"" (arrayValue (intersection (array (sites Empty)) (array {(mapEntry ""Step3c"" (from))})) index:0)) (mapEntry ""SameColor"" (arrayValue (intersection (array (sites Empty)) (array {(mapEntry ""Step3d"" (from))})) index:0)) (mapEntry ""SameColor"" (arrayValue (intersection (array (sites Empty)) (array {(mapEntry (from))})) index:0)) (mapEntry ""SameColor"" (arrayValue (intersection (array (sites Empty)) (array {(mapEntry (from))})) index:0)) (mapEntry ""SameColor"" (arrayValue (intersection (array (sites Empty)) (array {(mapEntry (from))})) index:0)) (mapEntry ""SameColor"" (arrayValue (intersection (array (sites Empty)) (array {(mapEntry (from))})) index:0)) (mapEntry (from))})})})) stack:True (then (and {(set Var ""StartS"" 3) (set Var ""CntrAttack"" 0) (if (= 15 (last To)) (and {(add (piece (id ""Starter"" Mover)) (to (sites Mover ""Base"")) count:(count Stack at:(last To) if:(= (id ""Cone"" Mover) (what at:(to) level:(level)))) stack:True) (add (piece (id ""Prisoner"" Mover)) (to (sites Mover ""Prison"")) count:(count Stack at:(last To) if:(= (id ""Cone"" Next) (what at:(to) level:(level)))) stack:True) (remove 15 count:(count Stack at:(last To)))}) (if (and (is Friend (who at:(mapEntry ""SameColor"" (last To)))) (not (no Pieces in:(sites Mover ""Reserve"")))) (and (remove (sites Mover ""Reserve"")) (add (piece (id ""Starter"" Mover)) (to (sites Mover ""Base"")) stack:True)))) (set Value at:(last To) (count Stack at:(last To))) (addScore Mover (- (if (= (id Mover) 1) (mapEntry ""PipsP1"" (last To)) (mapEntry ""PipsP2"" (last To))) (if (= (id Mover) 1) (mapEntry ""PipsP1"" (last From)) (mapEntry ""PipsP2"" (last From))))) (if (> (size Stack at:(last To)) (value Piece at:(last To))) (addScore Next (- 0 (if (= (id Mover) 1) (mapEntry ""PipsP2"" (last To)) (mapEntry ""PipsP1"" (last To))))))}))))) (if (< (score Mover) 6) (if (= (score Mover) 4) (move (from) (to (union {(intersection {(difference (if (= 1 (size Stack at:(from))) (sites ""Rings"") (sites ""RingsplusT"")) (from)) (sites Empty) (sites {(mapEntry ""Step4a"" (from)) (mapEntry ""Step4b"" (from)) (mapEntry ""Step4c"" (from)) (mapEntry (from)) (mapEntry (from)) (mapEntry (from)) (mapEntry (from)) (mapEntry (from))})}) (intersection {(sites ""Rings"") (sites Occupied by:Next) (sites {(mapEntry ""SameColor"" (arrayValue (intersection (array (sites Empty)) (array {(mapEntry ""Step4a"" (from))})) index:0)) (mapEntry ""SameColor"" (arrayValue (intersection (array (sites Empty)) (array {(mapEntry ""Step4b"" (from))})) index:0)) (mapEntry ""SameColor"" (arrayValue (intersection (array (sites Empty)) (array {(mapEntry ""Step4c"" (from))})) index:0)) (mapEntry ""SameColor"" (arrayValue (intersection (array (sites Empty)) (array {(mapEntry (from))})) index:0)) (mapEntry ""SameColor"" (arrayValue (intersection (array (sites Empty)) (array {(mapEntry (from))})) index:0)) (mapEntry ""SameColor"" (arrayValue (intersection (array (sites Empty)) (array {(mapEntry (from))})) index:0)) (mapEntry ""SameColor"" (arrayValue (intersection (array (sites Empty)) (array {(mapEntry (from))})) index:0)) (mapEntry ""SameColor"" (arrayValue (intersection (array (sites Empty)) (array {(mapEntry (from))})) index:0)) (mapEntry (from))})})})) stack:True (then (and {(set Var ""StartS"" 3) (set Var ""CntrAttack"" 0) (if (= 15 (last To)) (and {(add (piece (id ""Starter"" Mover)) (to (sites Mover ""Base"")) count:(count Stack at:(last To) if:(= (id ""Cone"" Mover) (what at:(to) level:(level)))) stack:True) (add (piece (id ""Prisoner"" Mover)) (to (sites Mover ""Prison"")) count:(count Stack at:(last To) if:(= (id ""Cone"" Next) (what at:(to) level:(level)))) stack:True) (remove 15 count:(count Stack at:(last To)))}) (if (and (is Friend (who at:(mapEntry ""SameColor"" (last To)))) (not (no Pieces in:(sites Mover ""Reserve"")))) (and (remove (sites Mover ""Reserve"")) (add (piece (id ""Starter"" Mover)) (to (sites Mover ""Base"")) stack:True)))) (set Value at:(last To) (count Stack at:(last To))) (addScore Mover (- (if (= (id Mover) 1) (mapEntry ""PipsP1"" (last To)) (mapEntry ""PipsP2"" (last To))) (if (= (id Mover) 1) (mapEntry ""PipsP1"" (last From)) (mapEntry ""PipsP2"" (last From))))) (if (> (size Stack at:(last To)) (value Piece at:(last To))) (addScore Next (- 0 (if (= (id Mover) 1) (mapEntry ""PipsP2"" (last To)) (mapEntry ""PipsP1"" (last To))))))}))) (move (from) (to (union {(intersection {(difference (if (= 1 (size Stack at:(from))) (sites ""Rings"") (sites ""RingsplusT"")) (from)) (sites Empty) (sites {(mapEntry ""Step3a"" (from)) (mapEntry ""Step3b"" (from)) (mapEntry ""Step5c"" (from)) (mapEntry ""Step5d"" (from)) (mapEntry (from)) (mapEntry (from)) (mapEntry (from)) (mapEntry (from))})}) (intersection {(sites ""Rings"") (sites Occupied by:Next) (sites {(mapEntry ""SameColor"" (arrayValue (intersection (array (sites Empty)) (array {(mapEntry ""Step3a"" (from))})) index:0)) (mapEntry ""SameColor"" (arrayValue (intersection (array (sites Empty)) (array {(mapEntry ""Step3b"" (from))})) index:0)) (mapEntry ""SameColor"" (arrayValue (intersection (array (sites Empty)) (array {(mapEntry ""Step5c"" (from))})) index:0)) (mapEntry ""SameColor"" (arrayValue (intersection (array (sites Empty)) (array {(mapEntry ""Step5d"" (from))})) index:0)) (mapEntry ""SameColor"" (arrayValue (intersection (array (sites Empty)) (array {(mapEntry (from))})) index:0)) (mapEntry ""SameColor"" (arrayValue (intersection (array (sites Empty)) (array {(mapEntry (from))})) index:0)) (mapEntry ""SameColor"" (arrayValue (intersection (array (sites Empty)) (array {(mapEntry (from))})) index:0)) (mapEntry ""SameColor"" (arrayValue (intersection (array (sites Empty)) (array {(mapEntry (from))})) index:0)) (mapEntry (from))})})})) stack:True (then (and {(set Var ""StartS"" 3) (set Var ""CntrAttack"" 0) (if (= 15 (last To)) (and {(add (piece (id ""Starter"" Mover)) (to (sites Mover ""Base"")) count:(count Stack at:(last To) if:(= (id ""Cone"" Mover) (what at:(to) level:(level)))) stack:True) (add (piece (id ""Prisoner"" Mover)) (to (sites Mover ""Prison"")) count:(count Stack at:(last To) if:(= (id ""Cone"" Next) (what at:(to) level:(level)))) stack:True) (remove 15 count:(count Stack at:(last To)))}) (if (and (is Friend (who at:(mapEntry ""SameColor"" (last To)))) (not (no Pieces in:(sites Mover ""Reserve"")))) (and (remove (sites Mover ""Reserve"")) (add (piece (id ""Starter"" Mover)) (to (sites Mover ""Base"")) stack:True)))) (set Value at:(last To) (count Stack at:(last To))) (addScore Mover (- (if (= (id Mover) 1) (mapEntry ""PipsP1"" (last To)) (mapEntry ""PipsP2"" (last To))) (if (= (id Mover) 1) (mapEntry ""PipsP1"" (last From)) (mapEntry ""PipsP2"" (last From))))) (if (> (size Stack at:(last To)) (value Piece at:(last To))) (addScore Next (- 0 (if (= (id Mover) 1) (mapEntry ""PipsP2"" (last To)) (mapEntry ""PipsP1"" (last To))))))})))) (if (= (score Mover) 6) (move (from) (to (union {(intersection {(difference (if (= 1 (size Stack at:(from))) (sites ""Rings"") (sites ""RingsplusT"")) (from)) (sites Empty) (sites {(mapEntry ""Step2a"" (from)) (mapEntry ""Step2b"" (from)) (mapEntry ""Step6c"" (from)) (mapEntry ""Step6d"" (from)) (mapEntry ""Step6e"" (from)) (mapEntry (from)) (mapEntry (from)) (mapEntry (from))})}) (intersection {(sites ""Rings"") (sites Occupied by:Next) (sites {(mapEntry ""SameColor"" (arrayValue (intersection (array (sites Empty)) (array {(mapEntry ""Step2a"" (from))})) index:0)) (mapEntry ""SameColor"" (arrayValue (intersection (array (sites Empty)) (array {(mapEntry ""Step2b"" (from))})) index:0)) (mapEntry ""SameColor"" (arrayValue (intersection (array (sites Empty)) (array {(mapEntry ""Step6c"" (from))})) index:0)) (mapEntry ""SameColor"" (arrayValue (intersection (array (sites Empty)) (array {(mapEntry ""Step6d"" (from))})) index:0)) (mapEntry ""SameColor"" (arrayValue (intersection (array (sites Empty)) (array {(mapEntry ""Step6e"" (from))})) index:0)) (mapEntry ""SameColor"" (arrayValue (intersection (array (sites Empty)) (array {(mapEntry (from))})) index:0)) (mapEntry ""SameColor"" (arrayValue (intersection (array (sites Empty)) (array {(mapEntry (from))})) index:0)) (mapEntry ""SameColor"" (arrayValue (intersection (array (sites Empty)) (array {(mapEntry (from))})) index:0)) (mapEntry (from))})})})) stack:True (then (and {(set Var ""StartS"" 3) (set Var ""CntrAttack"" 0) (if (= 15 (last To)) (and {(add (piece (id ""Starter"" Mover)) (to (sites Mover ""Base"")) count:(count Stack at:(last To) if:(= (id ""Cone"" Mover) (what at:(to) level:(level)))) stack:True) (add (piece (id ""Prisoner"" Mover)) (to (sites Mover ""Prison"")) count:(count Stack at:(last To) if:(= (id ""Cone"" Next) (what at:(to) level:(level)))) stack:True) (remove 15 count:(count Stack at:(last To)))}) (if (and (is Friend (who at:(mapEntry ""SameColor"" (last To)))) (not (no Pieces in:(sites Mover ""Reserve"")))) (and (remove (sites Mover ""Reserve"")) (add (piece (id ""Starter"" Mover)) (to (sites Mover ""Base"")) stack:True)))) (set Value at:(last To) (count Stack at:(last To))) (addScore Mover (- (if (= (id Mover) 1) (mapEntry ""PipsP1"" (last To)) (mapEntry ""PipsP2"" (last To))) (if (= (id Mover) 1) (mapEntry ""PipsP1"" (last From)) (mapEntry ""PipsP2"" (last From))))) (if (> (size Stack at:(last To)) (value Piece at:(last To))) (addScore Next (- 0 (if (= (id Mover) 1) (mapEntry ""PipsP2"" (last To)) (mapEntry ""PipsP1"" (last To))))))}))) (move (from) (to (union {(intersection {(difference (if (= 1 (size Stack at:(from))) (sites ""Rings"") (sites ""RingsplusT"")) (from)) (sites Empty) (sites {(mapEntry ""Step7a"" (from)) (mapEntry ""Step7b"" (from)) (mapEntry ""Step7c"" (from)) (mapEntry ""Step7d"" (from)) (mapEntry ""Step7e"" (from)) (mapEntry (from)) (mapEntry (from)) (mapEntry (from))})}) (intersection {(sites ""Rings"") (sites Occupied by:Next) (sites {(mapEntry ""SameColor"" (arrayValue (intersection (array (sites Empty)) (array {(mapEntry ""Step7a"" (from))})) index:0)) (mapEntry ""SameColor"" (arrayValue (intersection (array (sites Empty)) (array {(mapEntry ""Step7b"" (from))})) index:0)) (mapEntry ""SameColor"" (arrayValue (intersection (array (sites Empty)) (array {(mapEntry ""Step7c"" (from))})) index:0)) (mapEntry ""SameColor"" (arrayValue (intersection (array (sites Empty)) (array {(mapEntry ""Step7d"" (from))})) index:0)) (mapEntry ""SameColor"" (arrayValue (intersection (array (sites Empty)) (array {(mapEntry ""Step7e"" (from))})) index:0)) (mapEntry ""SameColor"" (arrayValue (intersection (array (sites Empty)) (array {(mapEntry (from))})) index:0)) (mapEntry ""SameColor"" (arrayValue (intersection (array (sites Empty)) (array {(mapEntry (from))})) index:0)) (mapEntry ""SameColor"" (arrayValue (intersection (array (sites Empty)) (array {(mapEntry (from))})) index:0)) (mapEntry (from))})})})) stack:True (then (and {(set Var ""StartS"" 3) (set Var ""CntrAttack"" 0) (if (= 15 (last To)) (and {(add (piece (id ""Starter"" Mover)) (to (sites Mover ""Base"")) count:(count Stack at:(last To) if:(= (id ""Cone"" Mover) (what at:(to) level:(level)))) stack:True) (add (piece (id ""Prisoner"" Mover)) (to (sites Mover ""Prison"")) count:(count Stack at:(last To) if:(= (id ""Cone"" Next) (what at:(to) level:(level)))) stack:True) (remove 15 count:(count Stack at:(last To)))}) (if (and (is Friend (who at:(mapEntry ""SameColor"" (last To)))) (not (no Pieces in:(sites Mover ""Reserve"")))) (and (remove (sites Mover ""Reserve"")) (add (piece (id ""Starter"" Mover)) (to (sites Mover ""Base"")) stack:True)))) (set Value at:(last To) (count Stack at:(last To))) (addScore Mover (- (if (= (id Mover) 1) (mapEntry ""PipsP1"" (last To)) (mapEntry ""PipsP2"" (last To))) (if (= (id Mover) 1) (mapEntry ""PipsP1"" (last From)) (mapEntry ""PipsP2"" (last From))))) (if (> (size Stack at:(last To)) (value Piece at:(last To))) (addScore Next (- 0 (if (= (id Mover) 1) (mapEntry ""PipsP2"" (last To)) (mapEntry ""PipsP1"" (last To))))))})))))) (if (< (score Mover) 12) (if (< (score Mover) 10) (if (= (score Mover) 8) (move (from) (to (union {(intersection {(difference (if (= 1 (size Stack at:(from))) (sites ""Rings"") (sites ""RingsplusT"")) (from)) (sites Empty) (sites {(mapEntry ""Step8a"" (from)) (mapEntry ""Step8b"" (from)) (mapEntry ""Step8c"" (from)) (mapEntry ""Step8d"" (from)) (mapEntry (from)) (mapEntry (from)) (mapEntry (from)) (mapEntry (from))})}) (intersection {(sites ""Rings"") (sites Occupied by:Next) (sites {(mapEntry ""SameColor"" (arrayValue (intersection (array (sites Empty)) (array {(mapEntry ""Step8a"" (from))})) index:0)) (mapEntry ""SameColor"" (arrayValue (intersection (array (sites Empty)) (array {(mapEntry ""Step8b"" (from))})) index:0)) (mapEntry ""SameColor"" (arrayValue (intersection (array (sites Empty)) (array {(mapEntry ""Step8c"" (from))})) index:0)) (mapEntry ""SameColor"" (arrayValue (intersection (array (sites Empty)) (array {(mapEntry ""Step8d"" (from))})) index:0)) (mapEntry ""SameColor"" (arrayValue (intersection (array (sites Empty)) (array {(mapEntry (from))})) index:0)) (mapEntry ""SameColor"" (arrayValue (intersection (array (sites Empty)) (array {(mapEntry (from))})) index:0)) (mapEntry ""SameColor"" (arrayValue (intersection (array (sites Empty)) (array {(mapEntry (from))})) index:0)) (mapEntry ""SameColor"" (arrayValue (intersection (array (sites Empty)) (array {(mapEntry (from))})) index:0)) (mapEntry ""SameColor"" (from))})})})) stack:True (then (and {(set Var ""StartS"" 3) (set Var ""CntrAttack"" 0) (if (= 15 (last To)) (and {(add (piece (id ""Starter"" Mover)) (to (sites Mover ""Base"")) count:(count Stack at:(last To) if:(= (id ""Cone"" Mover) (what at:(to) level:(level)))) stack:True) (add (piece (id ""Prisoner"" Mover)) (to (sites Mover ""Prison"")) count:(count Stack at:(last To) if:(= (id ""Cone"" Next) (what at:(to) level:(level)))) stack:True) (remove 15 count:(count Stack at:(last To)))}) (if (and (is Friend (who at:(mapEntry ""SameColor"" (last To)))) (not (no Pieces in:(sites Mover ""Reserve"")))) (and (remove (sites Mover ""Reserve"")) (add (piece (id ""Starter"" Mover)) (to (sites Mover ""Base"")) stack:True)))) (set Value at:(last To) (count Stack at:(last To))) (addScore Mover (- (if (= (id Mover) 1) (mapEntry ""PipsP1"" (last To)) (mapEntry ""PipsP2"" (last To))) (if (= (id Mover) 1) (mapEntry ""PipsP1"" (last From)) (mapEntry ""PipsP2"" (last From))))) (if (> (size Stack at:(last To)) (value Piece at:(last To))) (addScore Next (- 0 (if (= (id Mover) 1) (mapEntry ""PipsP2"" (last To)) (mapEntry ""PipsP1"" (last To))))))}))) (move (from) (to (union {(intersection {(difference (if (= 1 (size Stack at:(from))) (sites ""Rings"") (sites ""RingsplusT"")) (from)) (sites Empty) (sites {(mapEntry ""Step7a"" (from)) (mapEntry ""Step7b"" (from)) (mapEntry ""Step9c"" (from)) (mapEntry ""Step9d"" (from)) (mapEntry ""Step9e"" (from)) (mapEntry ""Step9f"" (from)) (mapEntry (from)) (mapEntry (from))})}) (intersection {(sites ""Rings"") (sites Occupied by:Next) (sites {(mapEntry ""SameColor"" (arrayValue (intersection (array (sites Empty)) (array {(mapEntry ""Step7a"" (from))})) index:0)) (mapEntry ""SameColor"" (arrayValue (intersection (array (sites Empty)) (array {(mapEntry ""Step7b"" (from))})) index:0)) (mapEntry ""SameColor"" (arrayValue (intersection (array (sites Empty)) (array {(mapEntry ""Step9c"" (from))})) index:0)) (mapEntry ""SameColor"" (arrayValue (intersection (array (sites Empty)) (array {(mapEntry ""Step9d"" (from))})) index:0)) (mapEntry ""SameColor"" (arrayValue (intersection (array (sites Empty)) (array {(mapEntry ""Step9e"" (from))})) index:0)) (mapEntry ""SameColor"" (arrayValue (intersection (array (sites Empty)) (array {(mapEntry ""Step9f"" (from))})) index:0)) (mapEntry ""SameColor"" (arrayValue (intersection (array (sites Empty)) (array {(mapEntry (from))})) index:0)) (mapEntry ""SameColor"" (arrayValue (intersection (array (sites Empty)) (array {(mapEntry (from))})) index:0)) (mapEntry (from))})})})) stack:True (then (and {(set Var ""StartS"" 3) (set Var ""CntrAttack"" 0) (if (= 15 (last To)) (and {(add (piece (id ""Starter"" Mover)) (to (sites Mover ""Base"")) count:(count Stack at:(last To) if:(= (id ""Cone"" Mover) (what at:(to) level:(level)))) stack:True) (add (piece (id ""Prisoner"" Mover)) (to (sites Mover ""Prison"")) count:(count Stack at:(last To) if:(= (id ""Cone"" Next) (what at:(to) level:(level)))) stack:True) (remove 15 count:(count Stack at:(last To)))}) (if (and (is Friend (who at:(mapEntry ""SameColor"" (last To)))) (not (no Pieces in:(sites Mover ""Reserve"")))) (and (remove (sites Mover ""Reserve"")) (add (piece (id ""Starter"" Mover)) (to (sites Mover ""Base"")) stack:True)))) (set Value at:(last To) (count Stack at:(last To))) (addScore Mover (- (if (= (id Mover) 1) (mapEntry ""PipsP1"" (last To)) (mapEntry ""PipsP2"" (last To))) (if (= (id Mover) 1) (mapEntry ""PipsP1"" (last From)) (mapEntry ""PipsP2"" (last From))))) (if (> (size Stack at:(last To)) (value Piece at:(last To))) (addScore Next (- 0 (if (= (id Mover) 1) (mapEntry ""PipsP2"" (last To)) (mapEntry ""PipsP1"" (last To))))))})))) (if (= (score Mover) 10) (move (from) (to (union {(intersection {(difference (if (= 1 (size Stack at:(from))) (sites ""Rings"") (sites ""RingsplusT"")) (from)) (sites Empty) (sites {(mapEntry ""Step2a"" (from)) (mapEntry ""Step2b"" (from)) (mapEntry ""Step10c"" (from)) (mapEntry ""Step10d"" (from)) (mapEntry ""Step10e"" (from)) (mapEntry (from)) (mapEntry (from)) (mapEntry (from))})}) (intersection {(sites ""Rings"") (sites Occupied by:Next) (sites {(mapEntry ""SameColor"" (arrayValue (intersection (array (sites Empty)) (array {(mapEntry ""Step2a"" (from))})) index:0)) (mapEntry ""SameColor"" (arrayValue (intersection (array (sites Empty)) (array {(mapEntry ""Step2b"" (from))})) index:0)) (mapEntry ""SameColor"" (arrayValue (intersection (array (sites Empty)) (array {(mapEntry ""Step10c"" (from))})) index:0)) (mapEntry ""SameColor"" (arrayValue (intersection (array (sites Empty)) (array {(mapEntry ""Step10d"" (from))})) index:0)) (mapEntry ""SameColor"" (arrayValue (intersection (array (sites Empty)) (array {(mapEntry ""Step10e"" (from))})) index:0)) (mapEntry ""SameColor"" (arrayValue (intersection (array (sites Empty)) (array {(mapEntry (from))})) index:0)) (mapEntry ""SameColor"" (arrayValue (intersection (array (sites Empty)) (array {(mapEntry (from))})) index:0)) (mapEntry ""SameColor"" (arrayValue (intersection (array (sites Empty)) (array {(mapEntry (from))})) index:0)) (mapEntry (from))})})})) stack:True (then (and {(set Var ""StartS"" 3) (set Var ""CntrAttack"" 0) (if (= 15 (last To)) (and {(add (piece (id ""Starter"" Mover)) (to (sites Mover ""Base"")) count:(count Stack at:(last To) if:(= (id ""Cone"" Mover) (what at:(to) level:(level)))) stack:True) (add (piece (id ""Prisoner"" Mover)) (to (sites Mover ""Prison"")) count:(count Stack at:(last To) if:(= (id ""Cone"" Next) (what at:(to) level:(level)))) stack:True) (remove 15 count:(count Stack at:(last To)))}) (if (and (is Friend (who at:(mapEntry ""SameColor"" (last To)))) (not (no Pieces in:(sites Mover ""Reserve"")))) (and (remove (sites Mover ""Reserve"")) (add (piece (id ""Starter"" Mover)) (to (sites Mover ""Base"")) stack:True)))) (set Value at:(last To) (count Stack at:(last To))) (addScore Mover (- (if (= (id Mover) 1) (mapEntry ""PipsP1"" (last To)) (mapEntry ""PipsP2"" (last To))) (if (= (id Mover) 1) (mapEntry ""PipsP1"" (last From)) (mapEntry ""PipsP2"" (last From))))) (if (> (size Stack at:(last To)) (value Piece at:(last To))) (addScore Next (- 0 (if (= (id Mover) 1) (mapEntry ""PipsP2"" (last To)) (mapEntry ""PipsP1"" (last To))))))}))) (move (from) (to (union {(intersection {(difference (if (= 1 (size Stack at:(from))) (sites ""Rings"") (sites ""RingsplusT"")) (from)) (sites Empty) (sites {(mapEntry ""Step3a"" (from)) (mapEntry ""Step3b"" (from)) (mapEntry ""Step11c"" (from)) (mapEntry ""Step11d"" (from)) (mapEntry ""Step11e"" (from)) (mapEntry ""Step11f"" (from)) (mapEntry ""Step11g"" (from)) (mapEntry (from))})}) (intersection {(sites ""Rings"") (sites Occupied by:Next) (sites {(mapEntry ""SameColor"" (arrayValue (intersection (array (sites Empty)) (array {(mapEntry ""Step3a"" (from))})) index:0)) (mapEntry ""SameColor"" (arrayValue (intersection (array (sites Empty)) (array {(mapEntry ""Step3b"" (from))})) index:0)) (mapEntry ""SameColor"" (arrayValue (intersection (array (sites Empty)) (array {(mapEntry ""Step11c"" (from))})) index:0)) (mapEntry ""SameColor"" (arrayValue (intersection (array (sites Empty)) (array {(mapEntry ""Step11d"" (from))})) index:0)) (mapEntry ""SameColor"" (arrayValue (intersection (array (sites Empty)) (array {(mapEntry ""Step11e"" (from))})) index:0)) (mapEntry ""SameColor"" (arrayValue (intersection (array (sites Empty)) (array {(mapEntry ""Step11f"" (from))})) index:0)) (mapEntry ""SameColor"" (arrayValue (intersection (array (sites Empty)) (array {(mapEntry ""Step11g"" (from))})) index:0)) (mapEntry ""SameColor"" (arrayValue (intersection (array (sites Empty)) (array {(mapEntry (from))})) index:0)) (mapEntry (from))})})})) stack:True (then (and {(set Var ""StartS"" 3) (set Var ""CntrAttack"" 0) (if (= 15 (last To)) (and {(add (piece (id ""Starter"" Mover)) (to (sites Mover ""Base"")) count:(count Stack at:(last To) if:(= (id ""Cone"" Mover) (what at:(to) level:(level)))) stack:True) (add (piece (id ""Prisoner"" Mover)) (to (sites Mover ""Prison"")) count:(count Stack at:(last To) if:(= (id ""Cone"" Next) (what at:(to) level:(level)))) stack:True) (remove 15 count:(count Stack at:(last To)))}) (if (and (is Friend (who at:(mapEntry ""SameColor"" (last To)))) (not (no Pieces in:(sites Mover ""Reserve"")))) (and (remove (sites Mover ""Reserve"")) (add (piece (id ""Starter"" Mover)) (to (sites Mover ""Base"")) stack:True)))) (set Value at:(last To) (count Stack at:(last To))) (addScore Mover (- (if (= (id Mover) 1) (mapEntry ""PipsP1"" (last To)) (mapEntry ""PipsP2"" (last To))) (if (= (id Mover) 1) (mapEntry ""PipsP1"" (last From)) (mapEntry ""PipsP2"" (last From))))) (if (> (size Stack at:(last To)) (value Piece at:(last To))) (addScore Next (- 0 (if (= (id Mover) 1) (mapEntry ""PipsP2"" (last To)) (mapEntry ""PipsP1"" (last To))))))}))))) (if (< (score Mover) 14) (if (= (score Mover) 12) (move (from) (to (union {(intersection {(difference (if (= 1 (size Stack at:(from))) (sites ""Rings"") (sites ""RingsplusT"")) (from)) (sites Empty) (sites {(mapEntry ""Step4a"" (from)) (mapEntry ""Step12b"" (from)) (mapEntry ""Step12c"" (from)) (mapEntry ""Step12d"" (from)) (mapEntry ""Step12e"" (from)) (mapEntry ""Step12f"" (from)) (mapEntry (from)) (mapEntry (from))})}) (intersection {(sites ""Rings"") (sites Occupied by:Next) (sites {(mapEntry ""SameColor"" (arrayValue (intersection (array (sites Empty)) (array {(mapEntry ""Step4a"" (from))})) index:0)) (mapEntry ""SameColor"" (arrayValue (intersection (array (sites Empty)) (array {(mapEntry ""Step12b"" (from))})) index:0)) (mapEntry ""SameColor"" (arrayValue (intersection (array (sites Empty)) (array {(mapEntry ""Step12c"" (from))})) index:0)) (mapEntry ""SameColor"" (arrayValue (intersection (array (sites Empty)) (array {(mapEntry ""Step12d"" (from))})) index:0)) (mapEntry ""SameColor"" (arrayValue (intersection (array (sites Empty)) (array {(mapEntry ""Step12e"" (from))})) index:0)) (mapEntry ""SameColor"" (arrayValue (intersection (array (sites Empty)) (array {(mapEntry ""Step12f"" (from))})) index:0)) (mapEntry ""SameColor"" (arrayValue (intersection (array (sites Empty)) (array {(mapEntry (from))})) index:0)) (mapEntry ""SameColor"" (arrayValue (intersection (array (sites Empty)) (array {(mapEntry (from))})) index:0)) (mapEntry ""Step12g"" (from))})})})) stack:True (then (and {(set Var ""StartS"" 3) (set Var ""CntrAttack"" 0) (if (= 15 (last To)) (and {(add (piece (id ""Starter"" Mover)) (to (sites Mover ""Base"")) count:(count Stack at:(last To) if:(= (id ""Cone"" Mover) (what at:(to) level:(level)))) stack:True) (add (piece (id ""Prisoner"" Mover)) (to (sites Mover ""Prison"")) count:(count Stack at:(last To) if:(= (id ""Cone"" Next) (what at:(to) level:(level)))) stack:True) (remove 15 count:(count Stack at:(last To)))}) (if (and (is Friend (who at:(mapEntry ""SameColor"" (last To)))) (not (no Pieces in:(sites Mover ""Reserve"")))) (and (remove (sites Mover ""Reserve"")) (add (piece (id ""Starter"" Mover)) (to (sites Mover ""Base"")) stack:True)))) (set Value at:(last To) (count Stack at:(last To))) (addScore Mover (- (if (= (id Mover) 1) (mapEntry ""PipsP1"" (last To)) (mapEntry ""PipsP2"" (last To))) (if (= (id Mover) 1) (mapEntry ""PipsP1"" (last From)) (mapEntry ""PipsP2"" (last From))))) (if (> (size Stack at:(last To)) (value Piece at:(last To))) (addScore Next (- 0 (if (= (id Mover) 1) (mapEntry ""PipsP2"" (last To)) (mapEntry ""PipsP1"" (last To))))))}))) (move (from) (to (union {(intersection {(difference (if (= 1 (size Stack at:(from))) (sites ""Rings"") (sites ""RingsplusT"")) (from)) (sites Empty) (sites {(mapEntry ""Step3a"" (from)) (mapEntry ""Step3b"" (from)) (mapEntry ""Step13c"" (from)) (mapEntry ""Step13d"" (from)) (mapEntry ""Step13e"" (from)) (mapEntry ""Step13f"" (from)) (mapEntry ""Step11g"" (from)) (mapEntry (from))})}) (intersection {(sites ""Rings"") (sites Occupied by:Next) (sites {(mapEntry ""SameColor"" (arrayValue (intersection (array (sites Empty)) (array {(mapEntry ""Step3a"" (from))})) index:0)) (mapEntry ""SameColor"" (arrayValue (intersection (array (sites Empty)) (array {(mapEntry ""Step3b"" (from))})) index:0)) (mapEntry ""SameColor"" (arrayValue (intersection (array (sites Empty)) (array {(mapEntry ""Step13c"" (from))})) index:0)) (mapEntry ""SameColor"" (arrayValue (intersection (array (sites Empty)) (array {(mapEntry ""Step13d"" (from))})) index:0)) (mapEntry ""SameColor"" (arrayValue (intersection (array (sites Empty)) (array {(mapEntry ""Step13e"" (from))})) index:0)) (mapEntry ""SameColor"" (arrayValue (intersection (array (sites Empty)) (array {(mapEntry ""Step13f"" (from))})) index:0)) (mapEntry ""SameColor"" (arrayValue (intersection (array (sites Empty)) (array {(mapEntry ""Step11g"" (from))})) index:0)) (mapEntry ""SameColor"" (arrayValue (intersection (array (sites Empty)) (array {(mapEntry (from))})) index:0)) (mapEntry (from))})})})) stack:True (then (and {(set Var ""StartS"" 3) (set Var ""CntrAttack"" 0) (if (= 15 (last To)) (and {(add (piece (id ""Starter"" Mover)) (to (sites Mover ""Base"")) count:(count Stack at:(last To) if:(= (id ""Cone"" Mover) (what at:(to) level:(level)))) stack:True) (add (piece (id ""Prisoner"" Mover)) (to (sites Mover ""Prison"")) count:(count Stack at:(last To) if:(= (id ""Cone"" Next) (what at:(to) level:(level)))) stack:True) (remove 15 count:(count Stack at:(last To)))}) (if (and (is Friend (who at:(mapEntry ""SameColor"" (last To)))) (not (no Pieces in:(sites Mover ""Reserve"")))) (and (remove (sites Mover ""Reserve"")) (add (piece (id ""Starter"" Mover)) (to (sites Mover ""Base"")) stack:True)))) (set Value at:(last To) (count Stack at:(last To))) (addScore Mover (- (if (= (id Mover) 1) (mapEntry ""PipsP1"" (last To)) (mapEntry ""PipsP2"" (last To))) (if (= (id Mover) 1) (mapEntry ""PipsP1"" (last From)) (mapEntry ""PipsP2"" (last From))))) (if (> (size Stack at:(last To)) (value Piece at:(last To))) (addScore Next (- 0 (if (= (id Mover) 1) (mapEntry ""PipsP2"" (last To)) (mapEntry ""PipsP1"" (last To))))))})))) (if (= (score Mover) 14) (move (from) (to (union {(intersection {(difference (if (= 1 (size Stack at:(from))) (sites ""Rings"") (sites ""RingsplusT"")) (from)) (sites Empty) (sites {(mapEntry ""Step2a"" (from)) (mapEntry ""Step2b"" (from)) (mapEntry ""Step14c"" (from)) (mapEntry ""Step14d"" (from)) (mapEntry ""Step14e"" (from)) (mapEntry (from)) (mapEntry (from)) (mapEntry (from))})}) (intersection {(sites ""Rings"") (sites Occupied by:Next) (sites {(mapEntry ""SameColor"" (arrayValue (intersection (array (sites Empty)) (array {(mapEntry ""Step2a"" (from))})) index:0)) (mapEntry ""SameColor"" (arrayValue (intersection (array (sites Empty)) (array {(mapEntry ""Step2b"" (from))})) index:0)) (mapEntry ""SameColor"" (arrayValue (intersection (array (sites Empty)) (array {(mapEntry ""Step14c"" (from))})) index:0)) (mapEntry ""SameColor"" (arrayValue (intersection (array (sites Empty)) (array {(mapEntry ""Step14d"" (from))})) index:0)) (mapEntry ""SameColor"" (arrayValue (intersection (array (sites Empty)) (array {(mapEntry ""Step14e"" (from))})) index:0)) (mapEntry ""SameColor"" (arrayValue (intersection (array (sites Empty)) (array {(mapEntry (from))})) index:0)) (mapEntry ""SameColor"" (arrayValue (intersection (array (sites Empty)) (array {(mapEntry (from))})) index:0)) (mapEntry ""SameColor"" (arrayValue (intersection (array (sites Empty)) (array {(mapEntry (from))})) index:0)) (mapEntry ""Step14f"" (from))})})})) stack:True (then (and {(set Var ""StartS"" 3) (set Var ""CntrAttack"" 0) (if (= 15 (last To)) (and {(add (piece (id ""Starter"" Mover)) (to (sites Mover ""Base"")) count:(count Stack at:(last To) if:(= (id ""Cone"" Mover) (what at:(to) level:(level)))) stack:True) (add (piece (id ""Prisoner"" Mover)) (to (sites Mover ""Prison"")) count:(count Stack at:(last To) if:(= (id ""Cone"" Next) (what at:(to) level:(level)))) stack:True) (remove 15 count:(count Stack at:(last To)))}) (if (and (is Friend (who at:(mapEntry ""SameColor"" (last To)))) (not (no Pieces in:(sites Mover ""Reserve"")))) (and (remove (sites Mover ""Reserve"")) (add (piece (id ""Starter"" Mover)) (to (sites Mover ""Base"")) stack:True)))) (set Value at:(last To) (count Stack at:(last To))) (addScore Mover (- (if (= (id Mover) 1) (mapEntry ""PipsP1"" (last To)) (mapEntry ""PipsP2"" (last To))) (if (= (id Mover) 1) (mapEntry ""PipsP1"" (last From)) (mapEntry ""PipsP2"" (last From))))) (if (> (size Stack at:(last To)) (value Piece at:(last To))) (addScore Next (- 0 (if (= (id Mover) 1) (mapEntry ""PipsP2"" (last To)) (mapEntry ""PipsP1"" (last To))))))}))) (move (from) (to (union {(intersection {(difference (if (= 1 (size Stack at:(from))) (sites ""Rings"") (sites ""RingsplusT"")) (from)) (sites Empty) (sites {(mapEntry ""Step7a"" (from)) (mapEntry ""Step7b"" (from)) (mapEntry ""Step15c"" (from)) (mapEntry ""Step15d"" (from)) (mapEntry ""Step15e"" (from)) (mapEntry ""Step15f"" (from)) (mapEntry ""Step11f"" (from)) (mapEntry ""Step11g"" (from))})}) (intersection {(sites ""Rings"") (sites Occupied by:Next) (sites {(mapEntry ""SameColor"" (arrayValue (intersection (array (sites Empty)) (array {(mapEntry ""Step7a"" (from))})) index:0)) (mapEntry ""SameColor"" (arrayValue (intersection (array (sites Empty)) (array {(mapEntry ""Step7b"" (from))})) index:0)) (mapEntry ""SameColor"" (arrayValue (intersection (array (sites Empty)) (array {(mapEntry ""Step15c"" (from))})) index:0)) (mapEntry ""SameColor"" (arrayValue (intersection (array (sites Empty)) (array {(mapEntry ""Step15d"" (from))})) index:0)) (mapEntry ""SameColor"" (arrayValue (intersection (array (sites Empty)) (array {(mapEntry ""Step15e"" (from))})) index:0)) (mapEntry ""SameColor"" (arrayValue (intersection (array (sites Empty)) (array {(mapEntry ""Step15f"" (from))})) index:0)) (mapEntry ""SameColor"" (arrayValue (intersection (array (sites Empty)) (array {(mapEntry ""Step11f"" (from))})) index:0)) (mapEntry ""SameColor"" (arrayValue (intersection (array (sites Empty)) (array {(mapEntry ""Step11g"" (from))})) index:0)) (mapEntry (from))})})})) stack:True (then (and {(set Var ""StartS"" 3) (set Var ""CntrAttack"" 0) (if (= 15 (last To)) (and {(add (piece (id ""Starter"" Mover)) (to (sites Mover ""Base"")) count:(count Stack at:(last To) if:(= (id ""Cone"" Mover) (what at:(to) level:(level)))) stack:True) (add (piece (id ""Prisoner"" Mover)) (to (sites Mover ""Prison"")) count:(count Stack at:(last To) if:(= (id ""Cone"" Next) (what at:(to) level:(level)))) stack:True) (remove 15 count:(count Stack at:(last To)))}) (if (and (is Friend (who at:(mapEntry ""SameColor"" (last To)))) (not (no Pieces in:(sites Mover ""Reserve"")))) (and (remove (sites Mover ""Reserve"")) (add (piece (id ""Starter"" Mover)) (to (sites Mover ""Base"")) stack:True)))) (set Value at:(last To) (count Stack at:(last To))) (addScore Mover (- (if (= (id Mover) 1) (mapEntry ""PipsP1"" (last To)) (mapEntry ""PipsP2"" (last To))) (if (= (id Mover) 1) (mapEntry ""PipsP1"" (last From)) (mapEntry ""PipsP2"" (last From))))) (if (> (size Stack at:(last To)) (value Piece at:(last To))) (addScore Next (- 0 (if (= (id Mover) 1) (mapEntry ""PipsP2"" (last To)) (mapEntry ""PipsP1"" (last To))))))}))))))) (if (< (score Mover) 20) (if (< (score Mover) 18) (if (= (score Mover) 16) (move (from) (to (union {(intersection {(difference (if (= 1 (size Stack at:(from))) (sites ""Rings"") (sites ""RingsplusT"")) (from)) (sites Empty) (sites {(mapEntry ""Step8a"" (from)) (mapEntry ""Step8b"" (from)) (mapEntry ""Step16c"" (from)) (mapEntry ""Step16d"" (from)) (mapEntry ""Step16e"" (from)) (mapEntry ""Step16f"" (from)) (mapEntry ""Step16g"" (from)) (mapEntry (from))})}) (intersection {(sites ""Rings"") (sites Occupied by:Next) (sites {(mapEntry ""SameColor"" (arrayValue (intersection (array (sites Empty)) (array {(mapEntry ""Step8a"" (from))})) index:0)) (mapEntry ""SameColor"" (arrayValue (intersection (array (sites Empty)) (array {(mapEntry ""Step8b"" (from))})) index:0)) (mapEntry ""SameColor"" (arrayValue (intersection (array (sites Empty)) (array {(mapEntry ""Step16c"" (from))})) index:0)) (mapEntry ""SameColor"" (arrayValue (intersection (array (sites Empty)) (array {(mapEntry ""Step16d"" (from))})) index:0)) (mapEntry ""SameColor"" (arrayValue (intersection (array (sites Empty)) (array {(mapEntry ""Step16e"" (from))})) index:0)) (mapEntry ""SameColor"" (arrayValue (intersection (array (sites Empty)) (array {(mapEntry ""Step16f"" (from))})) index:0)) (mapEntry ""SameColor"" (arrayValue (intersection (array (sites Empty)) (array {(mapEntry ""Step16g"" (from))})) index:0)) (mapEntry ""SameColor"" (arrayValue (intersection (array (sites Empty)) (array {(mapEntry (from))})) index:0)) (mapEntry ""SameColor"" (from))})})})) stack:True (then (and {(set Var ""StartS"" 3) (set Var ""CntrAttack"" 0) (if (= 15 (last To)) (and {(add (piece (id ""Starter"" Mover)) (to (sites Mover ""Base"")) count:(count Stack at:(last To) if:(= (id ""Cone"" Mover) (what at:(to) level:(level)))) stack:True) (add (piece (id ""Prisoner"" Mover)) (to (sites Mover ""Prison"")) count:(count Stack at:(last To) if:(= (id ""Cone"" Next) (what at:(to) level:(level)))) stack:True) (remove 15 count:(count Stack at:(last To)))}) (if (and (is Friend (who at:(mapEntry ""SameColor"" (last To)))) (not (no Pieces in:(sites Mover ""Reserve"")))) (and (remove (sites Mover ""Reserve"")) (add (piece (id ""Starter"" Mover)) (to (sites Mover ""Base"")) stack:True)))) (set Value at:(last To) (count Stack at:(last To))) (addScore Mover (- (if (= (id Mover) 1) (mapEntry ""PipsP1"" (last To)) (mapEntry ""PipsP2"" (last To))) (if (= (id Mover) 1) (mapEntry ""PipsP1"" (last From)) (mapEntry ""PipsP2"" (last From))))) (if (> (size Stack at:(last To)) (value Piece at:(last To))) (addScore Next (- 0 (if (= (id Mover) 1) (mapEntry ""PipsP2"" (last To)) (mapEntry ""PipsP1"" (last To))))))}))) (move (from) (to (union {(intersection {(difference (if (= 1 (size Stack at:(from))) (sites ""Rings"") (sites ""RingsplusT"")) (from)) (sites Empty) (sites {(mapEntry ""Step7a"" (from)) (mapEntry ""Step7b"" (from)) (mapEntry ""Step17c"" (from)) (mapEntry ""Step17d"" (from)) (mapEntry ""Step17e"" (from)) (mapEntry ""Step17f"" (from)) (mapEntry ""Step17g"" (from)) (mapEntry ""Step17h"" (from))})}) (intersection {(sites ""Rings"") (sites Occupied by:Next) (sites {(mapEntry ""SameColor"" (arrayValue (intersection (array (sites Empty)) (array {(mapEntry ""Step7a"" (from))})) index:0)) (mapEntry ""SameColor"" (arrayValue (intersection (array (sites Empty)) (array {(mapEntry ""Step7b"" (from))})) index:0)) (mapEntry ""SameColor"" (arrayValue (intersection (array (sites Empty)) (array {(mapEntry ""Step17c"" (from))})) index:0)) (mapEntry ""SameColor"" (arrayValue (intersection (array (sites Empty)) (array {(mapEntry ""Step17d"" (from))})) index:0)) (mapEntry ""SameColor"" (arrayValue (intersection (array (sites Empty)) (array {(mapEntry ""Step17e"" (from))})) index:0)) (mapEntry ""SameColor"" (arrayValue (intersection (array (sites Empty)) (array {(mapEntry ""Step17f"" (from))})) index:0)) (mapEntry ""SameColor"" (arrayValue (intersection (array (sites Empty)) (array {(mapEntry ""Step17g"" (from))})) index:0)) (mapEntry ""SameColor"" (arrayValue (intersection (array (sites Empty)) (array {(mapEntry ""Step17h"" (from))})) index:0)) (mapEntry (from))})})})) stack:True (then (and {(set Var ""StartS"" 3) (set Var ""CntrAttack"" 0) (if (= 15 (last To)) (and {(add (piece (id ""Starter"" Mover)) (to (sites Mover ""Base"")) count:(count Stack at:(last To) if:(= (id ""Cone"" Mover) (what at:(to) level:(level)))) stack:True) (add (piece (id ""Prisoner"" Mover)) (to (sites Mover ""Prison"")) count:(count Stack at:(last To) if:(= (id ""Cone"" Next) (what at:(to) level:(level)))) stack:True) (remove 15 count:(count Stack at:(last To)))}) (if (and (is Friend (who at:(mapEntry ""SameColor"" (last To)))) (not (no Pieces in:(sites Mover ""Reserve"")))) (and (remove (sites Mover ""Reserve"")) (add (piece (id ""Starter"" Mover)) (to (sites Mover ""Base"")) stack:True)))) (set Value at:(last To) (count Stack at:(last To))) (addScore Mover (- (if (= (id Mover) 1) (mapEntry ""PipsP1"" (last To)) (mapEntry ""PipsP2"" (last To))) (if (= (id Mover) 1) (mapEntry ""PipsP1"" (last From)) (mapEntry ""PipsP2"" (last From))))) (if (> (size Stack at:(last To)) (value Piece at:(last To))) (addScore Next (- 0 (if (= (id Mover) 1) (mapEntry ""PipsP2"" (last To)) (mapEntry ""PipsP1"" (last To))))))})))) (if (= (score Mover) 18) (move (from) (to (union {(intersection {(difference (if (= 1 (size Stack at:(from))) (sites ""Rings"") (sites ""RingsplusT"")) (from)) (sites Empty) (sites {(mapEntry ""Step2a"" (from)) (mapEntry ""Step2b"" (from)) (mapEntry ""Step18c"" (from)) (mapEntry ""Step18d"" (from)) (mapEntry ""Step18e"" (from)) (mapEntry ""Step18f"" (from)) (mapEntry (from)) (mapEntry (from))})}) (intersection {(sites ""Rings"") (sites Occupied by:Next) (sites {(mapEntry ""SameColor"" (arrayValue (intersection (array (sites Empty)) (array {(mapEntry ""Step2a"" (from))})) index:0)) (mapEntry ""SameColor"" (arrayValue (intersection (array (sites Empty)) (array {(mapEntry ""Step2b"" (from))})) index:0)) (mapEntry ""SameColor"" (arrayValue (intersection (array (sites Empty)) (array {(mapEntry ""Step18c"" (from))})) index:0)) (mapEntry ""SameColor"" (arrayValue (intersection (array (sites Empty)) (array {(mapEntry ""Step18d"" (from))})) index:0)) (mapEntry ""SameColor"" (arrayValue (intersection (array (sites Empty)) (array {(mapEntry ""Step18e"" (from))})) index:0)) (mapEntry ""SameColor"" (arrayValue (intersection (array (sites Empty)) (array {(mapEntry ""Step18f"" (from))})) index:0)) (mapEntry ""SameColor"" (arrayValue (intersection (array (sites Empty)) (array {(mapEntry (from))})) index:0)) (mapEntry ""SameColor"" (arrayValue (intersection (array (sites Empty)) (array {(mapEntry (from))})) index:0)) (mapEntry ""Step18g"" (from))})})})) stack:True (then (and {(set Var ""StartS"" 3) (set Var ""CntrAttack"" 0) (if (= 15 (last To)) (and {(add (piece (id ""Starter"" Mover)) (to (sites Mover ""Base"")) count:(count Stack at:(last To) if:(= (id ""Cone"" Mover) (what at:(to) level:(level)))) stack:True) (add (piece (id ""Prisoner"" Mover)) (to (sites Mover ""Prison"")) count:(count Stack at:(last To) if:(= (id ""Cone"" Next) (what at:(to) level:(level)))) stack:True) (remove 15 count:(count Stack at:(last To)))}) (if (and (is Friend (who at:(mapEntry ""SameColor"" (last To)))) (not (no Pieces in:(sites Mover ""Reserve"")))) (and (remove (sites Mover ""Reserve"")) (add (piece (id ""Starter"" Mover)) (to (sites Mover ""Base"")) stack:True)))) (set Value at:(last To) (count Stack at:(last To))) (addScore Mover (- (if (= (id Mover) 1) (mapEntry ""PipsP1"" (last To)) (mapEntry ""PipsP2"" (last To))) (if (= (id Mover) 1) (mapEntry ""PipsP1"" (last From)) (mapEntry ""PipsP2"" (last From))))) (if (> (size Stack at:(last To)) (value Piece at:(last To))) (addScore Next (- 0 (if (= (id Mover) 1) (mapEntry ""PipsP2"" (last To)) (mapEntry ""PipsP1"" (last To))))))}))) (and (move (from) (to (union {(intersection {(difference (if (= 1 (size Stack at:(from))) (sites ""Rings"") (sites ""RingsplusT"")) (from)) (sites Empty) (sites {(mapEntry ""Step3a"" (from)) (mapEntry ""Step3b"" (from)) (mapEntry ""Step19c"" (from)) (mapEntry ""Step19d"" (from)) (mapEntry ""Step19e"" (from)) (mapEntry ""Step19f"" (from)) (mapEntry ""Step19g"" (from)) (mapEntry ""Step19h"" (from))})}) (intersection {(sites ""Rings"") (sites Occupied by:Next) (sites {(mapEntry ""SameColor"" (arrayValue (intersection (array (sites Empty)) (array {(mapEntry ""Step3a"" (from))})) index:0)) (mapEntry ""SameColor"" (arrayValue (intersection (array (sites Empty)) (array {(mapEntry ""Step3b"" (from))})) index:0)) (mapEntry ""SameColor"" (arrayValue (intersection (array (sites Empty)) (array {(mapEntry ""Step19c"" (from))})) index:0)) (mapEntry ""SameColor"" (arrayValue (intersection (array (sites Empty)) (array {(mapEntry ""Step19d"" (from))})) index:0)) (mapEntry ""SameColor"" (arrayValue (intersection (array (sites Empty)) (array {(mapEntry ""Step19e"" (from))})) index:0)) (mapEntry ""SameColor"" (arrayValue (intersection (array (sites Empty)) (array {(mapEntry ""Step19f"" (from))})) index:0)) (mapEntry ""SameColor"" (arrayValue (intersection (array (sites Empty)) (array {(mapEntry ""Step19g"" (from))})) index:0)) (mapEntry ""SameColor"" (arrayValue (intersection (array (sites Empty)) (array {(mapEntry ""Step19h"" (from))})) index:0)) (mapEntry (from))})})})) stack:True (then (and {(set Var ""StartS"" 3) (set Var ""CntrAttack"" 0) (if (= 15 (last To)) (and {(add (piece (id ""Starter"" Mover)) (to (sites Mover ""Base"")) count:(count Stack at:(last To) if:(= (id ""Cone"" Mover) (what at:(to) level:(level)))) stack:True) (add (piece (id ""Prisoner"" Mover)) (to (sites Mover ""Prison"")) count:(count Stack at:(last To) if:(= (id ""Cone"" Next) (what at:(to) level:(level)))) stack:True) (remove 15 count:(count Stack at:(last To)))}) (if (and (is Friend (who at:(mapEntry ""SameColor"" (last To)))) (not (no Pieces in:(sites Mover ""Reserve"")))) (and (remove (sites Mover ""Reserve"")) (add (piece (id ""Starter"" Mover)) (to (sites Mover ""Base"")) stack:True)))) (set Value at:(last To) (count Stack at:(last To))) (addScore Mover (- (if (= (id Mover) 1) (mapEntry ""PipsP1"" (last To)) (mapEntry ""PipsP2"" (last To))) (if (= (id Mover) 1) (mapEntry ""PipsP1"" (last From)) (mapEntry ""PipsP2"" (last From))))) (if (> (size Stack at:(last To)) (value Piece at:(last To))) (addScore Next (- 0 (if (= (id Mover) 1) (mapEntry ""PipsP2"" (last To)) (mapEntry ""PipsP1"" (last To))))))}))) (move (from) (to (union {(intersection {(difference (if (= 1 (size Stack at:(from))) (sites ""Rings"") (sites ""RingsplusT"")) (from)) (sites Empty) (sites {(mapEntry ""Step19i"" (from)) (mapEntry (from)) (mapEntry (from)) (mapEntry (from)) (mapEntry (from)) (mapEntry (from)) (mapEntry (from)) (mapEntry (from))})}) (intersection {(sites ""Rings"") (sites Occupied by:Next) (sites {(mapEntry ""SameColor"" (arrayValue (intersection (array (sites Empty)) (array {(mapEntry ""Step19i"" (from))})) index:0)) (mapEntry ""SameColor"" (arrayValue (intersection (array (sites Empty)) (array {(mapEntry (from))})) index:0)) (mapEntry ""SameColor"" (arrayValue (intersection (array (sites Empty)) (array {(mapEntry (from))})) index:0)) (mapEntry ""SameColor"" (arrayValue (intersection (array (sites Empty)) (array {(mapEntry (from))})) index:0)) (mapEntry ""SameColor"" (arrayValue (intersection (array (sites Empty)) (array {(mapEntry (from))})) index:0)) (mapEntry ""SameColor"" (arrayValue (intersection (array (sites Empty)) (array {(mapEntry (from))})) index:0)) (mapEntry ""SameColor"" (arrayValue (intersection (array (sites Empty)) (array {(mapEntry (from))})) index:0)) (mapEntry ""SameColor"" (arrayValue (intersection (array (sites Empty)) (array {(mapEntry (from))})) index:0)) (mapEntry (from))})})})) stack:True (then (and {(set Var ""StartS"" 3) (set Var ""CntrAttack"" 0) (if (= 15 (last To)) (and {(add (piece (id ""Starter"" Mover)) (to (sites Mover ""Base"")) count:(count Stack at:(last To) if:(= (id ""Cone"" Mover) (what at:(to) level:(level)))) stack:True) (add (piece (id ""Prisoner"" Mover)) (to (sites Mover ""Prison"")) count:(count Stack at:(last To) if:(= (id ""Cone"" Next) (what at:(to) level:(level)))) stack:True) (remove 15 count:(count Stack at:(last To)))}) (if (and (is Friend (who at:(mapEntry ""SameColor"" (last To)))) (not (no Pieces in:(sites Mover ""Reserve"")))) (and (remove (sites Mover ""Reserve"")) (add (piece (id ""Starter"" Mover)) (to (sites Mover ""Base"")) stack:True)))) (set Value at:(last To) (count Stack at:(last To))) (addScore Mover (- (if (= (id Mover) 1) (mapEntry ""PipsP1"" (last To)) (mapEntry ""PipsP2"" (last To))) (if (= (id Mover) 1) (mapEntry ""PipsP1"" (last From)) (mapEntry ""PipsP2"" (last From))))) (if (> (size Stack at:(last To)) (value Piece at:(last To))) (addScore Next (- 0 (if (= (id Mover) 1) (mapEntry ""PipsP2"" (last To)) (mapEntry ""PipsP1"" (last To))))))})))))) (if (= 20 (score Mover)) (move (from) (to (union {(intersection {(difference (if (= 1 (size Stack at:(from))) (sites ""Rings"") (sites ""RingsplusT"")) (from)) (sites Empty) (sites {(mapEntry ""Step4a"" (from)) (mapEntry ""Step20b"" (from)) (mapEntry ""Step20c"" (from)) (mapEntry ""Step20d"" (from)) (mapEntry ""Step20e"" (from)) (mapEntry ""Step20f"" (from)) (mapEntry ""Step20g"" (from)) (mapEntry (from))})}) (intersection {(sites ""Rings"") (sites Occupied by:Next) (sites {(mapEntry ""SameColor"" (arrayValue (intersection (array (sites Empty)) (array {(mapEntry ""Step4a"" (from))})) index:0)) (mapEntry ""SameColor"" (arrayValue (intersection (array (sites Empty)) (array {(mapEntry ""Step20b"" (from))})) index:0)) (mapEntry ""SameColor"" (arrayValue (intersection (array (sites Empty)) (array {(mapEntry ""Step20c"" (from))})) index:0)) (mapEntry ""SameColor"" (arrayValue (intersection (array (sites Empty)) (array {(mapEntry ""Step20d"" (from))})) index:0)) (mapEntry ""SameColor"" (arrayValue (intersection (array (sites Empty)) (array {(mapEntry ""Step20e"" (from))})) index:0)) (mapEntry ""SameColor"" (arrayValue (intersection (array (sites Empty)) (array {(mapEntry ""Step20f"" (from))})) index:0)) (mapEntry ""SameColor"" (arrayValue (intersection (array (sites Empty)) (array {(mapEntry ""Step20g"" (from))})) index:0)) (mapEntry ""SameColor"" (arrayValue (intersection (array (sites Empty)) (array {(mapEntry (from))})) index:0)) (mapEntry ""SameColor"" (from))})})})) stack:True (then (and {(set Var ""StartS"" 3) (set Var ""CntrAttack"" 0) (if (= 15 (last To)) (and {(add (piece (id ""Starter"" Mover)) (to (sites Mover ""Base"")) count:(count Stack at:(last To) if:(= (id ""Cone"" Mover) (what at:(to) level:(level)))) stack:True) (add (piece (id ""Prisoner"" Mover)) (to (sites Mover ""Prison"")) count:(count Stack at:(last To) if:(= (id ""Cone"" Next) (what at:(to) level:(level)))) stack:True) (remove 15 count:(count Stack at:(last To)))}) (if (and (is Friend (who at:(mapEntry ""SameColor"" (last To)))) (not (no Pieces in:(sites Mover ""Reserve"")))) (and (remove (sites Mover ""Reserve"")) (add (piece (id ""Starter"" Mover)) (to (sites Mover ""Base"")) stack:True)))) (set Value at:(last To) (count Stack at:(last To))) (addScore Mover (- (if (= (id Mover) 1) (mapEntry ""PipsP1"" (last To)) (mapEntry ""PipsP2"" (last To))) (if (= (id Mover) 1) (mapEntry ""PipsP1"" (last From)) (mapEntry ""PipsP2"" (last From))))) (if (> (size Stack at:(last To)) (value Piece at:(last To))) (addScore Next (- 0 (if (= (id Mover) 1) (mapEntry ""PipsP2"" (last To)) (mapEntry ""PipsP1"" (last To))))))}))))))))}) (rules (start {(place Stack ""Starter1"" 13 count:3) (place Stack ""Starter2"" 17 count:3) (place Stack ""Reserve1"" 1 count:6) (place Stack ""Reserve2"" 3 count:6)}) (play (do (if (no Pieces All in:(sites ""Rings"")) (and {(set Var ""StartS"" 0) (set Var ""CntrAttack"" 0)})) next:(if (is Prev Mover) (if (= 1 (var ""StartS"")) (move (from (sites Mover ""Base"")) (to (difference (sites Mover ""HomeRing"") (mapEntry ""SameColor"" (last To)))) (then (and {(promote (last To) (piece {""Cone""}) Mover) (set Var ""StartS"" (+ 1 (var ""StartS""))) (if (= 0 (var ""StartS"")) (set Var ""St1Pos"" (last To))) (if (and (= 1 (var ""StartS"")) (or (= (mapEntry ""Attacks1"" (last To)) (var ""St1Pos"")) (= (mapEntry ""Attacks2"" (last To)) (var ""St1Pos"")))) (set Var ""CntrAttack"" 1)) (if (> (var ""StartS"") 2) (set Var ""CntrAttack"" 0)) (if (and {(is Friend (who at:(mapEntry ""SameColor"" (last To)))) (!= 1 (var ""CntrAttack"")) (not (no Pieces in:(sites Mover ""Reserve"")))}) (and (add (piece (id ""Starter"" Mover)) (to (sites Mover ""Base"")) stack:True) (remove (sites Mover ""Reserve"")))) (set Value at:(last To) 1) (addScore Mover (if (= (id Mover) 1) (mapEntry ""PipsP1"" (last To)) (mapEntry ""PipsP2"" (last To))))}))) (if (and (= 2 (var ""StartS"")) (= 1 (var ""CntrAttack""))) (move (from (sites Mover ""Base"")) (to (intersection (sites ""Rings"") (sites Empty))) (then (and {(promote (last To) (piece {""Cone""}) Mover) (set Var ""StartS"" (+ 1 (var ""StartS""))) (if (= 0 (var ""StartS"")) (set Var ""St1Pos"" (last To))) (if (and (= 1 (var ""StartS"")) (or (= (mapEntry ""Attacks1"" (last To)) (var ""St1Pos"")) (= (mapEntry ""Attacks2"" (last To)) (var ""St1Pos"")))) (set Var ""CntrAttack"" 1)) (if (> (var ""StartS"") 2) (set Var ""CntrAttack"" 0)) (if (and {(is Friend (who at:(mapEntry ""SameColor"" (last To)))) (!= 1 (var ""CntrAttack"")) (not (no Pieces in:(sites Mover ""Reserve"")))}) (and (add (piece (id ""Starter"" Mover)) (to (sites Mover ""Base"")) stack:True) (remove (sites Mover ""Reserve"")))) (set Value at:(last To) 1) (addScore Mover (if (= (id Mover) 1) (mapEntry ""PipsP1"" (last To)) (mapEntry ""PipsP2"" (last To))))}))) (move (from (sites Mover ""Base"")) (to (intersection (sites Mover ""HomeRing"") (sites Empty))) (then (and {(promote (last To) (piece {""Cone""}) Mover) (set Var ""StartS"" (+ 1 (var ""StartS""))) (if (= 0 (var ""StartS"")) (set Var ""St1Pos"" (last To))) (if (and (= 1 (var ""StartS"")) (or (= (mapEntry ""Attacks1"" (last To)) (var ""St1Pos"")) (= (mapEntry ""Attacks2"" (last To)) (var ""St1Pos"")))) (set Var ""CntrAttack"" 1)) (if (> (var ""StartS"") 2) (set Var ""CntrAttack"" 0)) (if (and {(is Friend (who at:(mapEntry ""SameColor"" (last To)))) (!= 1 (var ""CntrAttack"")) (not (no Pieces in:(sites Mover ""Reserve"")))}) (and (add (piece (id ""Starter"" Mover)) (to (sites Mover ""Base"")) stack:True) (remove (sites Mover ""Reserve"")))) (set Value at:(last To) 1) (addScore Mover (if (= (id Mover) 1) (mapEntry ""PipsP1"" (last To)) (mapEntry ""PipsP2"" (last To))))}))))) (forEach Piece top:True)))) (end {(if (and {(no Moves Next) (= 0 (count Sites in:(intersection (sites Occupied by:Next) (sites ""RingsplusBase"")))) (< (count Sites in:(sites Occupied by:Next)) 2)}) (result Mover Win)) (if (>= (count Pieces Mover in:(sites ""Prison"")) 3) (result Mover Win))})))" "Oust is a game for two players, played on a hexagonally patterned board which is initially empty. The two players, Black and White, take turns placing stones of their color onto unoccupied cells on the board. A group is a set of interconnected, like-colored stones. A group can be a singleton, a single stone which is not connected to any other stones of its color. A group includes all the stones of its own color connected to it. There are two types of moves - non-capturing placements and capturing placements. Non-capturing placements either forms no connections (adjacencies) with any stones, or forms one or more connections with only enemy stones. A non-capturing placement does not form any connection with stones of its own color. Making a non-capturing placement concludes your turn. When you place a stone which forms one or more connections with your own groups, you will create a new, larger group of your own stones. You can only make such a placement if said new group will have one or more connections with enemy groups upon its creation and if all said enemy groups are smaller than said new group. Upon making such a placement, all said enemy groups are removed from the board. After capturing one or more enemy groups and while it is still your turn, you must continue to add stones until you make a non-capturing placement, at which time your turn is concluded. If you have a placement available on your turn you must make one. If you don't have any placements available, you must pass your turn. There will always be a placement available for at least one player. You win by making a placement which captures all of the enemy stones on the board. The game is played on a size 7 board","(game ""Oust"" (players 2) (equipment {(board (hex 7)) (piece ""Disc"" Each)}) (rules (play (or (move Add (to (sites Empty) if:(= 0 (count Sites in:(sites Around (to) Own))))) (do (move Add (to (sites Empty) if:(< 0 (count Sites in:(sites Around (to) Own))))) ifAfterwards:(and (all Sites (sites Around (sites Group at:(last To)) Enemy) if:(> (size Group at:(last To)) (size Group at:(site)))) (< 0 (count Sites in:(sites Around (sites Group at:(last To)) Enemy)))) (then (and (forEach Site (sites Around (sites Group at:(last To)) Enemy) (remove (sites Group at:(site)))) (moveAgain)))))) (end (if (and (< 2 (count Moves)) (= 0 (count Sites in:(sites Occupied by:Enemy)))) (result Mover Win)))))","###Description Oust is a game for two players, played on a hexagonally patterned board which is initially empty. The two players, Black and White, take turns placing stones of their color onto unoccupied cells on the board. A group is a set of interconnected, like-colored stones. A group can be a singleton, a single stone which is not connected to any other stones of its color. A group includes all the stones of its own color connected to it. There are two types of moves - non-capturing placements and capturing placements. Non-capturing placements either forms no connections (adjacencies) with any stones, or forms one or more connections with only enemy stones. A non-capturing placement does not form any connection with stones of its own color. Making a non-capturing placement concludes your turn. When you place a stone which forms one or more connections with your own groups, you will create a new, larger group of your own stones. You can only make such a placement if said new group will have one or more connections with enemy groups upon its creation and if all said enemy groups are smaller than said new group. Upon making such a placement, all said enemy groups are removed from the board. After capturing one or more enemy groups and while it is still your turn, you must continue to add stones until you make a non-capturing placement, at which time your turn is concluded. If you have a placement available on your turn you must make one. If you don't have any placements available, you must pass your turn. There will always be a placement available for at least one player. You win by making a placement which captures all of the enemy stones on the board. The game is played on a size 7 board @@ -5049,11 +4889,6 @@ Each player controls a tank with three health and an initial shooting range of t ###Ludii (game ""Tank Tactics"" (players 2) (equipment {(board (rectangle 5 10)) (hand Each) (piece ""Tank"" Each (or {(move Step (to if:(is Empty (to))) (then (if (> (score Mover) 1) (and (addScore Mover -1) (moveAgain))))) (move Select (from) (to (intersection (sites Occupied by:Enemy container:""Board"") (sites Distance from:(from) (range 1 (state at:(from)))))) (then (and (if (= (value Piece at:(last To)) 1) (remove (last To)) (set Value at:(last To) (- (value Piece at:(last To)) 1))) (if (> (score Mover) 1) (and (addScore Mover -1) (moveAgain)))))) (move Select (from) (to (intersection (sites Occupied by:Enemy container:""Board"") (sites Distance from:(from) (range 1 (state at:(from)))))) (then (and (addScore (player (who at:(last To))) 1) (if (> (score Mover) 1) (and (addScore Mover -1) (moveAgain)))))) (move Select (from) (to) (then (and (if (< (state at:(last To)) 100) (set State at:(last To) (+ 1 (state at:(last To))))) (if (> (score Mover) 1) (and (addScore Mover -1) (moveAgain))))))}) maxState:100)}) (rules (meta (passEnd NoEnd)) (start {(set Score Each 1) (place ""Tank1"" (handSite P1) state:2 value:3) (place ""Tank2"" (handSite P2) state:2 value:3)}) phases:{(phase ""Placement"" (play (move (from (handSite Mover)) (to (sites Empty)))) (nextPhase Mover (all Sites (sites Hand Mover) if:(= 0 (count Cell at:(site)))) ""Movement"")) (phase ""Movement"" (play (or (forEach Piece) (move Pass (then (addScore Mover 1))))))} (end (forEach NonMover if:(no Pieces Player) (result Player Loss)))))" -"8x8 board, 32 pieces per player. There's a diagonal in the centre of the chessboard, but it's not an edge. The game is played by white first and is divided into three main stage: Layout, Battle and Fly. Layout stage: When placing a piece, both player must first place a piece on the diagonal of the middle square of the board, and then two players alternately put a piece on any point of the board until the board is full of chess pieces. Battle Stage: At the end of the Layout stage, the first player removes the pieces on the Jiu-ti (diagonal line in the middle square of the board), and then the player who secondly place pieces in the Layout stage starts the first move and enters the Battle Stage; During the move, the opponent's pieces are taken by using the Square capture, Jumping capture. Flying Stage: Later in the game, if a player's number of pieces is less than 8, the player enters the Flying Pieces phase, where the player moves pieces without the one-step-per-frame limit, and pieces can land on any empty square. The opponent's pieces are taken by using the Square capture, Jumping capture, but the rules of the Jumping capture have changed a little. Jumping capture: Pieces capture opponent's pieces by jumping them in a forward direction if they are adjacent. Multiple captures are allowed. But in the Flying Stage, single captures are forbidden, you can only do multiple captures. Square capture: Use four adjacent friendly chess pieces to make a square. When a player makes a new square, they may remove another of the opponent's pieces from the board. Multiple captures are allowed. The goal: One player wins if the number of pieces of the opponent is less than 4.","(game ""Tibetan Jiuqi"" (players 2) (equipment {(board (add (square 8)) use:Vertex) (piece ""Marker"" Each (or (move Step (to if:(is Empty (to))) (then (if (> (count Sites in:(forEach (sites Around (last To)) if:(if (is In (last To) (sites {(ahead (site) S)})) (if (not (is In (site) (sites {""H2"" ""H3"" ""H4"" ""H5"" ""H6"" ""H7"" ""H8""}))) (and {(is Mover (who at:(ahead (site) E))) (is Mover (who at:(ahead (site) SE))) (is Mover (who at:(site)))})) (if (is In (last To) (sites {(ahead (site) W)})) (if (not (is In (site) (sites {""B1"" ""C1"" ""D1"" ""E1"" ""F1"" ""G1"" ""H1""}))) (and {(is Mover (who at:(ahead (site) S))) (is Mover (who at:(ahead (site) SW))) (is Mover (who at:(site)))})) (if (is In (last To) (sites {(ahead (site) N)})) (if (not (is In (site) (sites {""A1"" ""A2"" ""A3"" ""A4"" ""A5"" ""A6"" ""A7""}))) (and {(is Mover (who at:(ahead (site) W))) (is Mover (who at:(ahead (site) NW))) (is Mover (who at:(site)))})) (if (is In (last To) (sites {(ahead (site) E)})) (if (not (is In (site) (sites {""A8"" ""B8"" ""C8"" ""D8"" ""E8"" ""F8"" ""G8""}))) (and {(is Mover (who at:(ahead (site) N))) (is Mover (who at:(ahead (site) NE))) (is Mover (who at:(site)))})))))))) 0) (and (set Value Mover (count Sites in:(forEach (sites Around (last To)) if:(if (is In (last To) (sites {(ahead (site) S)})) (if (not (is In (site) (sites {""H2"" ""H3"" ""H4"" ""H5"" ""H6"" ""H7"" ""H8""}))) (and {(is Mover (who at:(ahead (site) E))) (is Mover (who at:(ahead (site) SE))) (is Mover (who at:(site)))})) (if (is In (last To) (sites {(ahead (site) W)})) (if (not (is In (site) (sites {""B1"" ""C1"" ""D1"" ""E1"" ""F1"" ""G1"" ""H1""}))) (and {(is Mover (who at:(ahead (site) S))) (is Mover (who at:(ahead (site) SW))) (is Mover (who at:(site)))})) (if (is In (last To) (sites {(ahead (site) N)})) (if (not (is In (site) (sites {""A1"" ""A2"" ""A3"" ""A4"" ""A5"" ""A6"" ""A7""}))) (and {(is Mover (who at:(ahead (site) W))) (is Mover (who at:(ahead (site) NW))) (is Mover (who at:(site)))})) (if (is In (last To) (sites {(ahead (site) E)})) (if (not (is In (site) (sites {""A8"" ""B8"" ""C8"" ""D8"" ""E8"" ""F8"" ""G8""}))) (and {(is Mover (who at:(ahead (site) N))) (is Mover (who at:(ahead (site) NE))) (is Mover (who at:(site)))}))))))))) (moveAgain))))) (move Hop (between if:(and (not (is In (between) (sites ToClear))) (is Enemy (who at:(between)))) (apply (remove (between)))) (to if:(is Empty (to))) (then (if (can Move (hop (from (last To)) (between if:(and (not (is In (between) (sites ToClear))) (is Enemy (who at:(between))))) (to if:(is Empty (to))))) (and (set Value Mover (count Sites in:(forEach (sites Around (last To)) if:(if (is In (last To) (sites {(ahead (site) S)})) (if (not (is In (site) (sites {""H2"" ""H3"" ""H4"" ""H5"" ""H6"" ""H7"" ""H8""}))) (and {(is Mover (who at:(ahead (site) E))) (is Mover (who at:(ahead (site) SE))) (is Mover (who at:(site)))})) (if (is In (last To) (sites {(ahead (site) W)})) (if (not (is In (site) (sites {""B1"" ""C1"" ""D1"" ""E1"" ""F1"" ""G1"" ""H1""}))) (and {(is Mover (who at:(ahead (site) S))) (is Mover (who at:(ahead (site) SW))) (is Mover (who at:(site)))})) (if (is In (last To) (sites {(ahead (site) N)})) (if (not (is In (site) (sites {""A1"" ""A2"" ""A3"" ""A4"" ""A5"" ""A6"" ""A7""}))) (and {(is Mover (who at:(ahead (site) W))) (is Mover (who at:(ahead (site) NW))) (is Mover (who at:(site)))})) (if (is In (last To) (sites {(ahead (site) E)})) (if (not (is In (site) (sites {""A8"" ""B8"" ""C8"" ""D8"" ""E8"" ""F8"" ""G8""}))) (and {(is Mover (who at:(ahead (site) N))) (is Mover (who at:(ahead (site) NE))) (is Mover (who at:(site)))}))))))))) (moveAgain)) (if (> (count Sites in:(forEach (sites Around (last To)) if:(if (is In (last To) (sites {(ahead (site) S)})) (if (not (is In (site) (sites {""H2"" ""H3"" ""H4"" ""H5"" ""H6"" ""H7"" ""H8""}))) (and {(is Mover (who at:(ahead (site) E))) (is Mover (who at:(ahead (site) SE))) (is Mover (who at:(site)))})) (if (is In (last To) (sites {(ahead (site) W)})) (if (not (is In (site) (sites {""B1"" ""C1"" ""D1"" ""E1"" ""F1"" ""G1"" ""H1""}))) (and {(is Mover (who at:(ahead (site) S))) (is Mover (who at:(ahead (site) SW))) (is Mover (who at:(site)))})) (if (is In (last To) (sites {(ahead (site) N)})) (if (not (is In (site) (sites {""A1"" ""A2"" ""A3"" ""A4"" ""A5"" ""A6"" ""A7""}))) (and {(is Mover (who at:(ahead (site) W))) (is Mover (who at:(ahead (site) NW))) (is Mover (who at:(site)))})) (if (is In (last To) (sites {(ahead (site) E)})) (if (not (is In (site) (sites {""A8"" ""B8"" ""C8"" ""D8"" ""E8"" ""F8"" ""G8""}))) (and {(is Mover (who at:(ahead (site) N))) (is Mover (who at:(ahead (site) NE))) (is Mover (who at:(site)))})))))))) 0) (and (set Value Mover (count Sites in:(forEach (sites Around (last To)) if:(if (is In (last To) (sites {(ahead (site) S)})) (if (not (is In (site) (sites {""H2"" ""H3"" ""H4"" ""H5"" ""H6"" ""H7"" ""H8""}))) (and {(is Mover (who at:(ahead (site) E))) (is Mover (who at:(ahead (site) SE))) (is Mover (who at:(site)))})) (if (is In (last To) (sites {(ahead (site) W)})) (if (not (is In (site) (sites {""B1"" ""C1"" ""D1"" ""E1"" ""F1"" ""G1"" ""H1""}))) (and {(is Mover (who at:(ahead (site) S))) (is Mover (who at:(ahead (site) SW))) (is Mover (who at:(site)))})) (if (is In (last To) (sites {(ahead (site) N)})) (if (not (is In (site) (sites {""A1"" ""A2"" ""A3"" ""A4"" ""A5"" ""A6"" ""A7""}))) (and {(is Mover (who at:(ahead (site) W))) (is Mover (who at:(ahead (site) NW))) (is Mover (who at:(site)))})) (if (is In (last To) (sites {(ahead (site) E)})) (if (not (is In (site) (sites {""A8"" ""B8"" ""C8"" ""D8"" ""E8"" ""F8"" ""G8""}))) (and {(is Mover (who at:(ahead (site) N))) (is Mover (who at:(ahead (site) NE))) (is Mover (who at:(site)))}))))))))) (moveAgain)))))))) (hand Each)}) (rules (start (place ""Marker"" ""Hand"" count:32)) phases:{(phase ""FirstPlacement"" (play (or (move (from (handSite Mover)) (to (sites ""D4"") if:(is Empty (to)))) (move (from (handSite Mover)) (to (sites ""E5"") if:(is Empty (to)))))) (nextPhase Mover ""Layout"")) (phase ""Layout"" (play (move (from (handSite Mover)) (to (sites Empty)))) (nextPhase Mover (all Sites (sites Hand Mover) if:(= 0 (count Cell at:(site)))) ""RemoveCentre"")) (phase ""RemoveCentre"" (play (move Remove (sites {""D4"" ""E5""}) (then (if (not (and (is Empty 27) (is Empty 36))) (moveAgain))))) (nextPhase All (and (is Empty 27) (is Empty 36)) ""Battle"")) (phase ""Battle"" (play (if (is Prev Mover) (if (> (value Player Mover) 0) (or (move Remove (sites Occupied by:Next) (then (if (> (value Player Mover) 1) (and (moveAgain) (set Value Mover (- (value Player Mover) 1))) (set Value Mover 0)))) (if (is Mover (who at:(last To))) (move Hop (from (last To)) (between if:(and {(not (is In (between) (sites ToClear))) (is Enemy (who at:(between))) (!= (between) (var ""Between""))}) (apply (and (remove (between)) (remove (var ""Between""))))) (to if:(is Empty (to))) (then (if (can Move (hop (from (last To)) (between if:(and (not (is In (between) (sites ToClear))) (is Enemy (who at:(between))))) (to if:(is Empty (to))))) (and (set Value Mover (count Sites in:(forEach (sites Around (last To)) if:(if (is In (last To) (sites {(ahead (site) S)})) (if (not (is In (site) (sites {""H2"" ""H3"" ""H4"" ""H5"" ""H6"" ""H7"" ""H8""}))) (and {(is Mover (who at:(ahead (site) E))) (is Mover (who at:(ahead (site) SE))) (is Mover (who at:(site)))})) (if (is In (last To) (sites {(ahead (site) W)})) (if (not (is In (site) (sites {""B1"" ""C1"" ""D1"" ""E1"" ""F1"" ""G1"" ""H1""}))) (and {(is Mover (who at:(ahead (site) S))) (is Mover (who at:(ahead (site) SW))) (is Mover (who at:(site)))})) (if (is In (last To) (sites {(ahead (site) N)})) (if (not (is In (site) (sites {""A1"" ""A2"" ""A3"" ""A4"" ""A5"" ""A6"" ""A7""}))) (and {(is Mover (who at:(ahead (site) W))) (is Mover (who at:(ahead (site) NW))) (is Mover (who at:(site)))})) (if (is In (last To) (sites {(ahead (site) E)})) (if (not (is In (site) (sites {""A8"" ""B8"" ""C8"" ""D8"" ""E8"" ""F8"" ""G8""}))) (and {(is Mover (who at:(ahead (site) N))) (is Mover (who at:(ahead (site) NE))) (is Mover (who at:(site)))}))))))))) (moveAgain)) (if (> (count Sites in:(forEach (sites Around (last To)) if:(if (is In (last To) (sites {(ahead (site) S)})) (if (not (is In (site) (sites {""H2"" ""H3"" ""H4"" ""H5"" ""H6"" ""H7"" ""H8""}))) (and {(is Mover (who at:(ahead (site) E))) (is Mover (who at:(ahead (site) SE))) (is Mover (who at:(site)))})) (if (is In (last To) (sites {(ahead (site) W)})) (if (not (is In (site) (sites {""B1"" ""C1"" ""D1"" ""E1"" ""F1"" ""G1"" ""H1""}))) (and {(is Mover (who at:(ahead (site) S))) (is Mover (who at:(ahead (site) SW))) (is Mover (who at:(site)))})) (if (is In (last To) (sites {(ahead (site) N)})) (if (not (is In (site) (sites {""A1"" ""A2"" ""A3"" ""A4"" ""A5"" ""A6"" ""A7""}))) (and {(is Mover (who at:(ahead (site) W))) (is Mover (who at:(ahead (site) NW))) (is Mover (who at:(site)))})) (if (is In (last To) (sites {(ahead (site) E)})) (if (not (is In (site) (sites {""A8"" ""B8"" ""C8"" ""D8"" ""E8"" ""F8"" ""G8""}))) (and {(is Mover (who at:(ahead (site) N))) (is Mover (who at:(ahead (site) NE))) (is Mover (who at:(site)))})))))))) 0) (and (set Value Mover (count Sites in:(forEach (sites Around (last To)) if:(if (is In (last To) (sites {(ahead (site) S)})) (if (not (is In (site) (sites {""H2"" ""H3"" ""H4"" ""H5"" ""H6"" ""H7"" ""H8""}))) (and {(is Mover (who at:(ahead (site) E))) (is Mover (who at:(ahead (site) SE))) (is Mover (who at:(site)))})) (if (is In (last To) (sites {(ahead (site) W)})) (if (not (is In (site) (sites {""B1"" ""C1"" ""D1"" ""E1"" ""F1"" ""G1"" ""H1""}))) (and {(is Mover (who at:(ahead (site) S))) (is Mover (who at:(ahead (site) SW))) (is Mover (who at:(site)))})) (if (is In (last To) (sites {(ahead (site) N)})) (if (not (is In (site) (sites {""A1"" ""A2"" ""A3"" ""A4"" ""A5"" ""A6"" ""A7""}))) (and {(is Mover (who at:(ahead (site) W))) (is Mover (who at:(ahead (site) NW))) (is Mover (who at:(site)))})) (if (is In (last To) (sites {(ahead (site) E)})) (if (not (is In (site) (sites {""A8"" ""B8"" ""C8"" ""D8"" ""E8"" ""F8"" ""G8""}))) (and {(is Mover (who at:(ahead (site) N))) (is Mover (who at:(ahead (site) NE))) (is Mover (who at:(site)))}))))))))) (moveAgain)))))))) (or (if (is Mover (who at:(last To))) (move Hop (from (last To)) (between if:(and {(not (is In (between) (sites ToClear))) (is Enemy (who at:(between))) (!= (between) (var ""Between""))}) (apply (and (remove (between)) (remove (var ""Between""))))) (to if:(is Empty (to))) (then (if (can Move (hop (from (last To)) (between if:(and (not (is In (between) (sites ToClear))) (is Enemy (who at:(between))))) (to if:(is Empty (to))))) (and (set Value Mover (count Sites in:(forEach (sites Around (last To)) if:(if (is In (last To) (sites {(ahead (site) S)})) (if (not (is In (site) (sites {""H2"" ""H3"" ""H4"" ""H5"" ""H6"" ""H7"" ""H8""}))) (and {(is Mover (who at:(ahead (site) E))) (is Mover (who at:(ahead (site) SE))) (is Mover (who at:(site)))})) (if (is In (last To) (sites {(ahead (site) W)})) (if (not (is In (site) (sites {""B1"" ""C1"" ""D1"" ""E1"" ""F1"" ""G1"" ""H1""}))) (and {(is Mover (who at:(ahead (site) S))) (is Mover (who at:(ahead (site) SW))) (is Mover (who at:(site)))})) (if (is In (last To) (sites {(ahead (site) N)})) (if (not (is In (site) (sites {""A1"" ""A2"" ""A3"" ""A4"" ""A5"" ""A6"" ""A7""}))) (and {(is Mover (who at:(ahead (site) W))) (is Mover (who at:(ahead (site) NW))) (is Mover (who at:(site)))})) (if (is In (last To) (sites {(ahead (site) E)})) (if (not (is In (site) (sites {""A8"" ""B8"" ""C8"" ""D8"" ""E8"" ""F8"" ""G8""}))) (and {(is Mover (who at:(ahead (site) N))) (is Mover (who at:(ahead (site) NE))) (is Mover (who at:(site)))}))))))))) (moveAgain)) (if (> (count Sites in:(forEach (sites Around (last To)) if:(if (is In (last To) (sites {(ahead (site) S)})) (if (not (is In (site) (sites {""H2"" ""H3"" ""H4"" ""H5"" ""H6"" ""H7"" ""H8""}))) (and {(is Mover (who at:(ahead (site) E))) (is Mover (who at:(ahead (site) SE))) (is Mover (who at:(site)))})) (if (is In (last To) (sites {(ahead (site) W)})) (if (not (is In (site) (sites {""B1"" ""C1"" ""D1"" ""E1"" ""F1"" ""G1"" ""H1""}))) (and {(is Mover (who at:(ahead (site) S))) (is Mover (who at:(ahead (site) SW))) (is Mover (who at:(site)))})) (if (is In (last To) (sites {(ahead (site) N)})) (if (not (is In (site) (sites {""A1"" ""A2"" ""A3"" ""A4"" ""A5"" ""A6"" ""A7""}))) (and {(is Mover (who at:(ahead (site) W))) (is Mover (who at:(ahead (site) NW))) (is Mover (who at:(site)))})) (if (is In (last To) (sites {(ahead (site) E)})) (if (not (is In (site) (sites {""A8"" ""B8"" ""C8"" ""D8"" ""E8"" ""F8"" ""G8""}))) (and {(is Mover (who at:(ahead (site) N))) (is Mover (who at:(ahead (site) NE))) (is Mover (who at:(site)))})))))))) 0) (and (set Value Mover (count Sites in:(forEach (sites Around (last To)) if:(if (is In (last To) (sites {(ahead (site) S)})) (if (not (is In (site) (sites {""H2"" ""H3"" ""H4"" ""H5"" ""H6"" ""H7"" ""H8""}))) (and {(is Mover (who at:(ahead (site) E))) (is Mover (who at:(ahead (site) SE))) (is Mover (who at:(site)))})) (if (is In (last To) (sites {(ahead (site) W)})) (if (not (is In (site) (sites {""B1"" ""C1"" ""D1"" ""E1"" ""F1"" ""G1"" ""H1""}))) (and {(is Mover (who at:(ahead (site) S))) (is Mover (who at:(ahead (site) SW))) (is Mover (who at:(site)))})) (if (is In (last To) (sites {(ahead (site) N)})) (if (not (is In (site) (sites {""A1"" ""A2"" ""A3"" ""A4"" ""A5"" ""A6"" ""A7""}))) (and {(is Mover (who at:(ahead (site) W))) (is Mover (who at:(ahead (site) NW))) (is Mover (who at:(site)))})) (if (is In (last To) (sites {(ahead (site) E)})) (if (not (is In (site) (sites {""A8"" ""B8"" ""C8"" ""D8"" ""E8"" ""F8"" ""G8""}))) (and {(is Mover (who at:(ahead (site) N))) (is Mover (who at:(ahead (site) NE))) (is Mover (who at:(site)))}))))))))) (moveAgain))))))) (move Pass))) (forEach Piece))) (nextPhase All (or (< (count Pieces Mover) 9) (< (count Pieces Next) 9)) ""Fly"")) (phase ""Fly"" (play (if (is Prev Mover) (if (> (value Player Mover) 0) (or (move Remove (sites Occupied by:Next) (then (if (> (value Player Mover) 1) (and (moveAgain) (set Value Mover (- (value Player Mover) 1))) (set Value Mover 0)))) (if (is Mover (who at:(last To))) (move Hop (from (last To)) (between if:(and {(not (is In (between) (sites ToClear))) (is Enemy (who at:(between))) (!= (between) (var ""Between""))}) (apply (and (remove (between)) (remove (var ""Between""))))) (to if:(is Empty (to))) (then (if (can Move (hop (from (last To)) (between if:(and (not (is In (between) (sites ToClear))) (is Enemy (who at:(between))))) (to if:(is Empty (to))))) (and (set Value Mover (count Sites in:(forEach (sites Around (last To)) if:(if (is In (last To) (sites {(ahead (site) S)})) (if (not (is In (site) (sites {""H2"" ""H3"" ""H4"" ""H5"" ""H6"" ""H7"" ""H8""}))) (and {(is Mover (who at:(ahead (site) E))) (is Mover (who at:(ahead (site) SE))) (is Mover (who at:(site)))})) (if (is In (last To) (sites {(ahead (site) W)})) (if (not (is In (site) (sites {""B1"" ""C1"" ""D1"" ""E1"" ""F1"" ""G1"" ""H1""}))) (and {(is Mover (who at:(ahead (site) S))) (is Mover (who at:(ahead (site) SW))) (is Mover (who at:(site)))})) (if (is In (last To) (sites {(ahead (site) N)})) (if (not (is In (site) (sites {""A1"" ""A2"" ""A3"" ""A4"" ""A5"" ""A6"" ""A7""}))) (and {(is Mover (who at:(ahead (site) W))) (is Mover (who at:(ahead (site) NW))) (is Mover (who at:(site)))})) (if (is In (last To) (sites {(ahead (site) E)})) (if (not (is In (site) (sites {""A8"" ""B8"" ""C8"" ""D8"" ""E8"" ""F8"" ""G8""}))) (and {(is Mover (who at:(ahead (site) N))) (is Mover (who at:(ahead (site) NE))) (is Mover (who at:(site)))}))))))))) (moveAgain)) (if (> (count Sites in:(forEach (sites Around (last To)) if:(if (is In (last To) (sites {(ahead (site) S)})) (if (not (is In (site) (sites {""H2"" ""H3"" ""H4"" ""H5"" ""H6"" ""H7"" ""H8""}))) (and {(is Mover (who at:(ahead (site) E))) (is Mover (who at:(ahead (site) SE))) (is Mover (who at:(site)))})) (if (is In (last To) (sites {(ahead (site) W)})) (if (not (is In (site) (sites {""B1"" ""C1"" ""D1"" ""E1"" ""F1"" ""G1"" ""H1""}))) (and {(is Mover (who at:(ahead (site) S))) (is Mover (who at:(ahead (site) SW))) (is Mover (who at:(site)))})) (if (is In (last To) (sites {(ahead (site) N)})) (if (not (is In (site) (sites {""A1"" ""A2"" ""A3"" ""A4"" ""A5"" ""A6"" ""A7""}))) (and {(is Mover (who at:(ahead (site) W))) (is Mover (who at:(ahead (site) NW))) (is Mover (who at:(site)))})) (if (is In (last To) (sites {(ahead (site) E)})) (if (not (is In (site) (sites {""A8"" ""B8"" ""C8"" ""D8"" ""E8"" ""F8"" ""G8""}))) (and {(is Mover (who at:(ahead (site) N))) (is Mover (who at:(ahead (site) NE))) (is Mover (who at:(site)))})))))))) 0) (and (set Value Mover (count Sites in:(forEach (sites Around (last To)) if:(if (is In (last To) (sites {(ahead (site) S)})) (if (not (is In (site) (sites {""H2"" ""H3"" ""H4"" ""H5"" ""H6"" ""H7"" ""H8""}))) (and {(is Mover (who at:(ahead (site) E))) (is Mover (who at:(ahead (site) SE))) (is Mover (who at:(site)))})) (if (is In (last To) (sites {(ahead (site) W)})) (if (not (is In (site) (sites {""B1"" ""C1"" ""D1"" ""E1"" ""F1"" ""G1"" ""H1""}))) (and {(is Mover (who at:(ahead (site) S))) (is Mover (who at:(ahead (site) SW))) (is Mover (who at:(site)))})) (if (is In (last To) (sites {(ahead (site) N)})) (if (not (is In (site) (sites {""A1"" ""A2"" ""A3"" ""A4"" ""A5"" ""A6"" ""A7""}))) (and {(is Mover (who at:(ahead (site) W))) (is Mover (who at:(ahead (site) NW))) (is Mover (who at:(site)))})) (if (is In (last To) (sites {(ahead (site) E)})) (if (not (is In (site) (sites {""A8"" ""B8"" ""C8"" ""D8"" ""E8"" ""F8"" ""G8""}))) (and {(is Mover (who at:(ahead (site) N))) (is Mover (who at:(ahead (site) NE))) (is Mover (who at:(site)))}))))))))) (moveAgain)))))))) (or (if (is Mover (who at:(last To))) (move Hop (from (last To)) (between if:(and {(not (is In (between) (sites ToClear))) (is Enemy (who at:(between))) (!= (between) (var ""Between""))}) (apply (and (remove (between)) (remove (var ""Between""))))) (to if:(is Empty (to))) (then (if (can Move (hop (from (last To)) (between if:(and (not (is In (between) (sites ToClear))) (is Enemy (who at:(between))))) (to if:(is Empty (to))))) (and (set Value Mover (count Sites in:(forEach (sites Around (last To)) if:(if (is In (last To) (sites {(ahead (site) S)})) (if (not (is In (site) (sites {""H2"" ""H3"" ""H4"" ""H5"" ""H6"" ""H7"" ""H8""}))) (and {(is Mover (who at:(ahead (site) E))) (is Mover (who at:(ahead (site) SE))) (is Mover (who at:(site)))})) (if (is In (last To) (sites {(ahead (site) W)})) (if (not (is In (site) (sites {""B1"" ""C1"" ""D1"" ""E1"" ""F1"" ""G1"" ""H1""}))) (and {(is Mover (who at:(ahead (site) S))) (is Mover (who at:(ahead (site) SW))) (is Mover (who at:(site)))})) (if (is In (last To) (sites {(ahead (site) N)})) (if (not (is In (site) (sites {""A1"" ""A2"" ""A3"" ""A4"" ""A5"" ""A6"" ""A7""}))) (and {(is Mover (who at:(ahead (site) W))) (is Mover (who at:(ahead (site) NW))) (is Mover (who at:(site)))})) (if (is In (last To) (sites {(ahead (site) E)})) (if (not (is In (site) (sites {""A8"" ""B8"" ""C8"" ""D8"" ""E8"" ""F8"" ""G8""}))) (and {(is Mover (who at:(ahead (site) N))) (is Mover (who at:(ahead (site) NE))) (is Mover (who at:(site)))}))))))))) (moveAgain)) (if (> (count Sites in:(forEach (sites Around (last To)) if:(if (is In (last To) (sites {(ahead (site) S)})) (if (not (is In (site) (sites {""H2"" ""H3"" ""H4"" ""H5"" ""H6"" ""H7"" ""H8""}))) (and {(is Mover (who at:(ahead (site) E))) (is Mover (who at:(ahead (site) SE))) (is Mover (who at:(site)))})) (if (is In (last To) (sites {(ahead (site) W)})) (if (not (is In (site) (sites {""B1"" ""C1"" ""D1"" ""E1"" ""F1"" ""G1"" ""H1""}))) (and {(is Mover (who at:(ahead (site) S))) (is Mover (who at:(ahead (site) SW))) (is Mover (who at:(site)))})) (if (is In (last To) (sites {(ahead (site) N)})) (if (not (is In (site) (sites {""A1"" ""A2"" ""A3"" ""A4"" ""A5"" ""A6"" ""A7""}))) (and {(is Mover (who at:(ahead (site) W))) (is Mover (who at:(ahead (site) NW))) (is Mover (who at:(site)))})) (if (is In (last To) (sites {(ahead (site) E)})) (if (not (is In (site) (sites {""A8"" ""B8"" ""C8"" ""D8"" ""E8"" ""F8"" ""G8""}))) (and {(is Mover (who at:(ahead (site) N))) (is Mover (who at:(ahead (site) NE))) (is Mover (who at:(site)))})))))))) 0) (and (set Value Mover (count Sites in:(forEach (sites Around (last To)) if:(if (is In (last To) (sites {(ahead (site) S)})) (if (not (is In (site) (sites {""H2"" ""H3"" ""H4"" ""H5"" ""H6"" ""H7"" ""H8""}))) (and {(is Mover (who at:(ahead (site) E))) (is Mover (who at:(ahead (site) SE))) (is Mover (who at:(site)))})) (if (is In (last To) (sites {(ahead (site) W)})) (if (not (is In (site) (sites {""B1"" ""C1"" ""D1"" ""E1"" ""F1"" ""G1"" ""H1""}))) (and {(is Mover (who at:(ahead (site) S))) (is Mover (who at:(ahead (site) SW))) (is Mover (who at:(site)))})) (if (is In (last To) (sites {(ahead (site) N)})) (if (not (is In (site) (sites {""A1"" ""A2"" ""A3"" ""A4"" ""A5"" ""A6"" ""A7""}))) (and {(is Mover (who at:(ahead (site) W))) (is Mover (who at:(ahead (site) NW))) (is Mover (who at:(site)))})) (if (is In (last To) (sites {(ahead (site) E)})) (if (not (is In (site) (sites {""A8"" ""B8"" ""C8"" ""D8"" ""E8"" ""F8"" ""G8""}))) (and {(is Mover (who at:(ahead (site) N))) (is Mover (who at:(ahead (site) NE))) (is Mover (who at:(site)))}))))))))) (moveAgain))))))) (move Pass))) (if (< (count Pieces Mover) 9) (forEach Piece (or (move Hop (from (sites Occupied by:Mover)) (between if:(and (not (is In (between) (sites ToClear))) (is Enemy (who at:(between)))) (apply (set Var ""Between"" (between)))) (to if:(is Empty (to))) (then (if (can Move (hop (from (last To)) (between if:(and {(not (is In (between) (sites ToClear))) (is Enemy (who at:(between))) (!= (between) (var ""Between""))})) (to if:(is Empty (to))))) (and (set Value Mover (count Sites in:(forEach (sites Around (last To)) if:(if (is In (last To) (sites {(ahead (site) S)})) (if (not (is In (site) (sites {""H2"" ""H3"" ""H4"" ""H5"" ""H6"" ""H7"" ""H8""}))) (and {(is Mover (who at:(ahead (site) E))) (is Mover (who at:(ahead (site) SE))) (is Mover (who at:(site)))})) (if (is In (last To) (sites {(ahead (site) W)})) (if (not (is In (site) (sites {""B1"" ""C1"" ""D1"" ""E1"" ""F1"" ""G1"" ""H1""}))) (and {(is Mover (who at:(ahead (site) S))) (is Mover (who at:(ahead (site) SW))) (is Mover (who at:(site)))})) (if (is In (last To) (sites {(ahead (site) N)})) (if (not (is In (site) (sites {""A1"" ""A2"" ""A3"" ""A4"" ""A5"" ""A6"" ""A7""}))) (and {(is Mover (who at:(ahead (site) W))) (is Mover (who at:(ahead (site) NW))) (is Mover (who at:(site)))})) (if (is In (last To) (sites {(ahead (site) E)})) (if (not (is In (site) (sites {""A8"" ""B8"" ""C8"" ""D8"" ""E8"" ""F8"" ""G8""}))) (and {(is Mover (who at:(ahead (site) N))) (is Mover (who at:(ahead (site) NE))) (is Mover (who at:(site)))}))))))))) (moveAgain)) (if (> (count Sites in:(forEach (sites Around (last To)) if:(if (is In (last To) (sites {(ahead (site) S)})) (if (not (is In (site) (sites {""H2"" ""H3"" ""H4"" ""H5"" ""H6"" ""H7"" ""H8""}))) (and {(is Mover (who at:(ahead (site) E))) (is Mover (who at:(ahead (site) SE))) (is Mover (who at:(site)))})) (if (is In (last To) (sites {(ahead (site) W)})) (if (not (is In (site) (sites {""B1"" ""C1"" ""D1"" ""E1"" ""F1"" ""G1"" ""H1""}))) (and {(is Mover (who at:(ahead (site) S))) (is Mover (who at:(ahead (site) SW))) (is Mover (who at:(site)))})) (if (is In (last To) (sites {(ahead (site) N)})) (if (not (is In (site) (sites {""A1"" ""A2"" ""A3"" ""A4"" ""A5"" ""A6"" ""A7""}))) (and {(is Mover (who at:(ahead (site) W))) (is Mover (who at:(ahead (site) NW))) (is Mover (who at:(site)))})) (if (is In (last To) (sites {(ahead (site) E)})) (if (not (is In (site) (sites {""A8"" ""B8"" ""C8"" ""D8"" ""E8"" ""F8"" ""G8""}))) (and {(is Mover (who at:(ahead (site) N))) (is Mover (who at:(ahead (site) NE))) (is Mover (who at:(site)))})))))))) 0) (and (set Value Mover (count Sites in:(forEach (sites Around (last To)) if:(if (is In (last To) (sites {(ahead (site) S)})) (if (not (is In (site) (sites {""H2"" ""H3"" ""H4"" ""H5"" ""H6"" ""H7"" ""H8""}))) (and {(is Mover (who at:(ahead (site) E))) (is Mover (who at:(ahead (site) SE))) (is Mover (who at:(site)))})) (if (is In (last To) (sites {(ahead (site) W)})) (if (not (is In (site) (sites {""B1"" ""C1"" ""D1"" ""E1"" ""F1"" ""G1"" ""H1""}))) (and {(is Mover (who at:(ahead (site) S))) (is Mover (who at:(ahead (site) SW))) (is Mover (who at:(site)))})) (if (is In (last To) (sites {(ahead (site) N)})) (if (not (is In (site) (sites {""A1"" ""A2"" ""A3"" ""A4"" ""A5"" ""A6"" ""A7""}))) (and {(is Mover (who at:(ahead (site) W))) (is Mover (who at:(ahead (site) NW))) (is Mover (who at:(site)))})) (if (is In (last To) (sites {(ahead (site) E)})) (if (not (is In (site) (sites {""A8"" ""B8"" ""C8"" ""D8"" ""E8"" ""F8"" ""G8""}))) (and {(is Mover (who at:(ahead (site) N))) (is Mover (who at:(ahead (site) NE))) (is Mover (who at:(site)))}))))))))) (moveAgain)))))) (move (from (sites Occupied by:Mover)) (to (sites Empty)) (then (if (> (count Sites in:(forEach (sites Around (last To)) if:(if (is In (last To) (sites {(ahead (site) S)})) (if (not (is In (site) (sites {""H2"" ""H3"" ""H4"" ""H5"" ""H6"" ""H7"" ""H8""}))) (and {(is Mover (who at:(ahead (site) E))) (is Mover (who at:(ahead (site) SE))) (is Mover (who at:(site)))})) (if (is In (last To) (sites {(ahead (site) W)})) (if (not (is In (site) (sites {""B1"" ""C1"" ""D1"" ""E1"" ""F1"" ""G1"" ""H1""}))) (and {(is Mover (who at:(ahead (site) S))) (is Mover (who at:(ahead (site) SW))) (is Mover (who at:(site)))})) (if (is In (last To) (sites {(ahead (site) N)})) (if (not (is In (site) (sites {""A1"" ""A2"" ""A3"" ""A4"" ""A5"" ""A6"" ""A7""}))) (and {(is Mover (who at:(ahead (site) W))) (is Mover (who at:(ahead (site) NW))) (is Mover (who at:(site)))})) (if (is In (last To) (sites {(ahead (site) E)})) (if (not (is In (site) (sites {""A8"" ""B8"" ""C8"" ""D8"" ""E8"" ""F8"" ""G8""}))) (and {(is Mover (who at:(ahead (site) N))) (is Mover (who at:(ahead (site) NE))) (is Mover (who at:(site)))})))))))) 0) (and (set Value Mover (count Sites in:(forEach (sites Around (last To)) if:(if (is In (last To) (sites {(ahead (site) S)})) (if (not (is In (site) (sites {""H2"" ""H3"" ""H4"" ""H5"" ""H6"" ""H7"" ""H8""}))) (and {(is Mover (who at:(ahead (site) E))) (is Mover (who at:(ahead (site) SE))) (is Mover (who at:(site)))})) (if (is In (last To) (sites {(ahead (site) W)})) (if (not (is In (site) (sites {""B1"" ""C1"" ""D1"" ""E1"" ""F1"" ""G1"" ""H1""}))) (and {(is Mover (who at:(ahead (site) S))) (is Mover (who at:(ahead (site) SW))) (is Mover (who at:(site)))})) (if (is In (last To) (sites {(ahead (site) N)})) (if (not (is In (site) (sites {""A1"" ""A2"" ""A3"" ""A4"" ""A5"" ""A6"" ""A7""}))) (and {(is Mover (who at:(ahead (site) W))) (is Mover (who at:(ahead (site) NW))) (is Mover (who at:(site)))})) (if (is In (last To) (sites {(ahead (site) E)})) (if (not (is In (site) (sites {""A8"" ""B8"" ""C8"" ""D8"" ""E8"" ""F8"" ""G8""}))) (and {(is Mover (who at:(ahead (site) N))) (is Mover (who at:(ahead (site) NE))) (is Mover (who at:(site)))}))))))))) (moveAgain))))))) (forEach Piece (or (move Step (to if:(is Empty (to))) (then (if (> (count Sites in:(forEach (sites Around (last To)) if:(if (is In (last To) (sites {(ahead (site) S)})) (if (not (is In (site) (sites {""H2"" ""H3"" ""H4"" ""H5"" ""H6"" ""H7"" ""H8""}))) (and {(is Mover (who at:(ahead (site) E))) (is Mover (who at:(ahead (site) SE))) (is Mover (who at:(site)))})) (if (is In (last To) (sites {(ahead (site) W)})) (if (not (is In (site) (sites {""B1"" ""C1"" ""D1"" ""E1"" ""F1"" ""G1"" ""H1""}))) (and {(is Mover (who at:(ahead (site) S))) (is Mover (who at:(ahead (site) SW))) (is Mover (who at:(site)))})) (if (is In (last To) (sites {(ahead (site) N)})) (if (not (is In (site) (sites {""A1"" ""A2"" ""A3"" ""A4"" ""A5"" ""A6"" ""A7""}))) (and {(is Mover (who at:(ahead (site) W))) (is Mover (who at:(ahead (site) NW))) (is Mover (who at:(site)))})) (if (is In (last To) (sites {(ahead (site) E)})) (if (not (is In (site) (sites {""A8"" ""B8"" ""C8"" ""D8"" ""E8"" ""F8"" ""G8""}))) (and {(is Mover (who at:(ahead (site) N))) (is Mover (who at:(ahead (site) NE))) (is Mover (who at:(site)))})))))))) 0) (and (set Value Mover (count Sites in:(forEach (sites Around (last To)) if:(if (is In (last To) (sites {(ahead (site) S)})) (if (not (is In (site) (sites {""H2"" ""H3"" ""H4"" ""H5"" ""H6"" ""H7"" ""H8""}))) (and {(is Mover (who at:(ahead (site) E))) (is Mover (who at:(ahead (site) SE))) (is Mover (who at:(site)))})) (if (is In (last To) (sites {(ahead (site) W)})) (if (not (is In (site) (sites {""B1"" ""C1"" ""D1"" ""E1"" ""F1"" ""G1"" ""H1""}))) (and {(is Mover (who at:(ahead (site) S))) (is Mover (who at:(ahead (site) SW))) (is Mover (who at:(site)))})) (if (is In (last To) (sites {(ahead (site) N)})) (if (not (is In (site) (sites {""A1"" ""A2"" ""A3"" ""A4"" ""A5"" ""A6"" ""A7""}))) (and {(is Mover (who at:(ahead (site) W))) (is Mover (who at:(ahead (site) NW))) (is Mover (who at:(site)))})) (if (is In (last To) (sites {(ahead (site) E)})) (if (not (is In (site) (sites {""A8"" ""B8"" ""C8"" ""D8"" ""E8"" ""F8"" ""G8""}))) (and {(is Mover (who at:(ahead (site) N))) (is Mover (who at:(ahead (site) NE))) (is Mover (who at:(site)))}))))))))) (moveAgain))))) (move Hop (from (sites Occupied by:Mover)) (between if:(and (not (is In (between) (sites ToClear))) (is Enemy (who at:(between)))) (apply (set Var ""Between"" (between)))) (to if:(and (is Empty (to)) (can Move (hop (from (to)) (between if:(and {(not (is In (between) (sites ToClear))) (is Enemy (who at:(between))) (!= (between) (var ""Between""))})) (to if:(is Empty (to))))))) (then (if (can Move (hop (from (last To)) (between if:(and {(not (is In (between) (sites ToClear))) (is Enemy (who at:(between))) (!= (between) (var ""Between""))})) (to if:(is Empty (to))))) (and (set Value Mover (count Sites in:(forEach (sites Around (last To)) if:(if (is In (last To) (sites {(ahead (site) S)})) (if (not (is In (site) (sites {""H2"" ""H3"" ""H4"" ""H5"" ""H6"" ""H7"" ""H8""}))) (and {(is Mover (who at:(ahead (site) E))) (is Mover (who at:(ahead (site) SE))) (is Mover (who at:(site)))})) (if (is In (last To) (sites {(ahead (site) W)})) (if (not (is In (site) (sites {""B1"" ""C1"" ""D1"" ""E1"" ""F1"" ""G1"" ""H1""}))) (and {(is Mover (who at:(ahead (site) S))) (is Mover (who at:(ahead (site) SW))) (is Mover (who at:(site)))})) (if (is In (last To) (sites {(ahead (site) N)})) (if (not (is In (site) (sites {""A1"" ""A2"" ""A3"" ""A4"" ""A5"" ""A6"" ""A7""}))) (and {(is Mover (who at:(ahead (site) W))) (is Mover (who at:(ahead (site) NW))) (is Mover (who at:(site)))})) (if (is In (last To) (sites {(ahead (site) E)})) (if (not (is In (site) (sites {""A8"" ""B8"" ""C8"" ""D8"" ""E8"" ""F8"" ""G8""}))) (and {(is Mover (who at:(ahead (site) N))) (is Mover (who at:(ahead (site) NE))) (is Mover (who at:(site)))}))))))))) (moveAgain)) (if (> (count Sites in:(forEach (sites Around (last To)) if:(if (is In (last To) (sites {(ahead (site) S)})) (if (not (is In (site) (sites {""H2"" ""H3"" ""H4"" ""H5"" ""H6"" ""H7"" ""H8""}))) (and {(is Mover (who at:(ahead (site) E))) (is Mover (who at:(ahead (site) SE))) (is Mover (who at:(site)))})) (if (is In (last To) (sites {(ahead (site) W)})) (if (not (is In (site) (sites {""B1"" ""C1"" ""D1"" ""E1"" ""F1"" ""G1"" ""H1""}))) (and {(is Mover (who at:(ahead (site) S))) (is Mover (who at:(ahead (site) SW))) (is Mover (who at:(site)))})) (if (is In (last To) (sites {(ahead (site) N)})) (if (not (is In (site) (sites {""A1"" ""A2"" ""A3"" ""A4"" ""A5"" ""A6"" ""A7""}))) (and {(is Mover (who at:(ahead (site) W))) (is Mover (who at:(ahead (site) NW))) (is Mover (who at:(site)))})) (if (is In (last To) (sites {(ahead (site) E)})) (if (not (is In (site) (sites {""A8"" ""B8"" ""C8"" ""D8"" ""E8"" ""F8"" ""G8""}))) (and {(is Mover (who at:(ahead (site) N))) (is Mover (who at:(ahead (site) NE))) (is Mover (who at:(site)))})))))))) 0) (and (set Value Mover (count Sites in:(forEach (sites Around (last To)) if:(if (is In (last To) (sites {(ahead (site) S)})) (if (not (is In (site) (sites {""H2"" ""H3"" ""H4"" ""H5"" ""H6"" ""H7"" ""H8""}))) (and {(is Mover (who at:(ahead (site) E))) (is Mover (who at:(ahead (site) SE))) (is Mover (who at:(site)))})) (if (is In (last To) (sites {(ahead (site) W)})) (if (not (is In (site) (sites {""B1"" ""C1"" ""D1"" ""E1"" ""F1"" ""G1"" ""H1""}))) (and {(is Mover (who at:(ahead (site) S))) (is Mover (who at:(ahead (site) SW))) (is Mover (who at:(site)))})) (if (is In (last To) (sites {(ahead (site) N)})) (if (not (is In (site) (sites {""A1"" ""A2"" ""A3"" ""A4"" ""A5"" ""A6"" ""A7""}))) (and {(is Mover (who at:(ahead (site) W))) (is Mover (who at:(ahead (site) NW))) (is Mover (who at:(site)))})) (if (is In (last To) (sites {(ahead (site) E)})) (if (not (is In (site) (sites {""A8"" ""B8"" ""C8"" ""D8"" ""E8"" ""F8"" ""G8""}))) (and {(is Mover (who at:(ahead (site) N))) (is Mover (who at:(ahead (site) NE))) (is Mover (who at:(site)))}))))))))) (moveAgain))))))))))))} (end (if (<= (count Pieces Next) 3) (result Next Loss)))))","###Description -8x8 board, 32 pieces per player. There's a diagonal in the centre of the chessboard, but it's not an edge. The game is played by white first and is divided into three main stage: Layout, Battle and Fly. Layout stage: When placing a piece, both player must first place a piece on the diagonal of the middle square of the board, and then two players alternately put a piece on any point of the board until the board is full of chess pieces. Battle Stage: At the end of the Layout stage, the first player removes the pieces on the Jiu-ti (diagonal line in the middle square of the board), and then the player who secondly place pieces in the Layout stage starts the first move and enters the Battle Stage; During the move, the opponent's pieces are taken by using the Square capture, Jumping capture. Flying Stage: Later in the game, if a player's number of pieces is less than 8, the player enters the Flying Pieces phase, where the player moves pieces without the one-step-per-frame limit, and pieces can land on any empty square. The opponent's pieces are taken by using the Square capture, Jumping capture, but the rules of the Jumping capture have changed a little. Jumping capture: Pieces capture opponent's pieces by jumping them in a forward direction if they are adjacent. Multiple captures are allowed. But in the Flying Stage, single captures are forbidden, you can only do multiple captures. Square capture: Use four adjacent friendly chess pieces to make a square. When a player makes a new square, they may remove another of the opponent's pieces from the board. Multiple captures are allowed. The goal: One player wins if the number of pieces of the opponent is less than 4. - -###Ludii -(game ""Tibetan Jiuqi"" (players 2) (equipment {(board (add (square 8)) use:Vertex) (piece ""Marker"" Each (or (move Step (to if:(is Empty (to))) (then (if (> (count Sites in:(forEach (sites Around (last To)) if:(if (is In (last To) (sites {(ahead (site) S)})) (if (not (is In (site) (sites {""H2"" ""H3"" ""H4"" ""H5"" ""H6"" ""H7"" ""H8""}))) (and {(is Mover (who at:(ahead (site) E))) (is Mover (who at:(ahead (site) SE))) (is Mover (who at:(site)))})) (if (is In (last To) (sites {(ahead (site) W)})) (if (not (is In (site) (sites {""B1"" ""C1"" ""D1"" ""E1"" ""F1"" ""G1"" ""H1""}))) (and {(is Mover (who at:(ahead (site) S))) (is Mover (who at:(ahead (site) SW))) (is Mover (who at:(site)))})) (if (is In (last To) (sites {(ahead (site) N)})) (if (not (is In (site) (sites {""A1"" ""A2"" ""A3"" ""A4"" ""A5"" ""A6"" ""A7""}))) (and {(is Mover (who at:(ahead (site) W))) (is Mover (who at:(ahead (site) NW))) (is Mover (who at:(site)))})) (if (is In (last To) (sites {(ahead (site) E)})) (if (not (is In (site) (sites {""A8"" ""B8"" ""C8"" ""D8"" ""E8"" ""F8"" ""G8""}))) (and {(is Mover (who at:(ahead (site) N))) (is Mover (who at:(ahead (site) NE))) (is Mover (who at:(site)))})))))))) 0) (and (set Value Mover (count Sites in:(forEach (sites Around (last To)) if:(if (is In (last To) (sites {(ahead (site) S)})) (if (not (is In (site) (sites {""H2"" ""H3"" ""H4"" ""H5"" ""H6"" ""H7"" ""H8""}))) (and {(is Mover (who at:(ahead (site) E))) (is Mover (who at:(ahead (site) SE))) (is Mover (who at:(site)))})) (if (is In (last To) (sites {(ahead (site) W)})) (if (not (is In (site) (sites {""B1"" ""C1"" ""D1"" ""E1"" ""F1"" ""G1"" ""H1""}))) (and {(is Mover (who at:(ahead (site) S))) (is Mover (who at:(ahead (site) SW))) (is Mover (who at:(site)))})) (if (is In (last To) (sites {(ahead (site) N)})) (if (not (is In (site) (sites {""A1"" ""A2"" ""A3"" ""A4"" ""A5"" ""A6"" ""A7""}))) (and {(is Mover (who at:(ahead (site) W))) (is Mover (who at:(ahead (site) NW))) (is Mover (who at:(site)))})) (if (is In (last To) (sites {(ahead (site) E)})) (if (not (is In (site) (sites {""A8"" ""B8"" ""C8"" ""D8"" ""E8"" ""F8"" ""G8""}))) (and {(is Mover (who at:(ahead (site) N))) (is Mover (who at:(ahead (site) NE))) (is Mover (who at:(site)))}))))))))) (moveAgain))))) (move Hop (between if:(and (not (is In (between) (sites ToClear))) (is Enemy (who at:(between)))) (apply (remove (between)))) (to if:(is Empty (to))) (then (if (can Move (hop (from (last To)) (between if:(and (not (is In (between) (sites ToClear))) (is Enemy (who at:(between))))) (to if:(is Empty (to))))) (and (set Value Mover (count Sites in:(forEach (sites Around (last To)) if:(if (is In (last To) (sites {(ahead (site) S)})) (if (not (is In (site) (sites {""H2"" ""H3"" ""H4"" ""H5"" ""H6"" ""H7"" ""H8""}))) (and {(is Mover (who at:(ahead (site) E))) (is Mover (who at:(ahead (site) SE))) (is Mover (who at:(site)))})) (if (is In (last To) (sites {(ahead (site) W)})) (if (not (is In (site) (sites {""B1"" ""C1"" ""D1"" ""E1"" ""F1"" ""G1"" ""H1""}))) (and {(is Mover (who at:(ahead (site) S))) (is Mover (who at:(ahead (site) SW))) (is Mover (who at:(site)))})) (if (is In (last To) (sites {(ahead (site) N)})) (if (not (is In (site) (sites {""A1"" ""A2"" ""A3"" ""A4"" ""A5"" ""A6"" ""A7""}))) (and {(is Mover (who at:(ahead (site) W))) (is Mover (who at:(ahead (site) NW))) (is Mover (who at:(site)))})) (if (is In (last To) (sites {(ahead (site) E)})) (if (not (is In (site) (sites {""A8"" ""B8"" ""C8"" ""D8"" ""E8"" ""F8"" ""G8""}))) (and {(is Mover (who at:(ahead (site) N))) (is Mover (who at:(ahead (site) NE))) (is Mover (who at:(site)))}))))))))) (moveAgain)) (if (> (count Sites in:(forEach (sites Around (last To)) if:(if (is In (last To) (sites {(ahead (site) S)})) (if (not (is In (site) (sites {""H2"" ""H3"" ""H4"" ""H5"" ""H6"" ""H7"" ""H8""}))) (and {(is Mover (who at:(ahead (site) E))) (is Mover (who at:(ahead (site) SE))) (is Mover (who at:(site)))})) (if (is In (last To) (sites {(ahead (site) W)})) (if (not (is In (site) (sites {""B1"" ""C1"" ""D1"" ""E1"" ""F1"" ""G1"" ""H1""}))) (and {(is Mover (who at:(ahead (site) S))) (is Mover (who at:(ahead (site) SW))) (is Mover (who at:(site)))})) (if (is In (last To) (sites {(ahead (site) N)})) (if (not (is In (site) (sites {""A1"" ""A2"" ""A3"" ""A4"" ""A5"" ""A6"" ""A7""}))) (and {(is Mover (who at:(ahead (site) W))) (is Mover (who at:(ahead (site) NW))) (is Mover (who at:(site)))})) (if (is In (last To) (sites {(ahead (site) E)})) (if (not (is In (site) (sites {""A8"" ""B8"" ""C8"" ""D8"" ""E8"" ""F8"" ""G8""}))) (and {(is Mover (who at:(ahead (site) N))) (is Mover (who at:(ahead (site) NE))) (is Mover (who at:(site)))})))))))) 0) (and (set Value Mover (count Sites in:(forEach (sites Around (last To)) if:(if (is In (last To) (sites {(ahead (site) S)})) (if (not (is In (site) (sites {""H2"" ""H3"" ""H4"" ""H5"" ""H6"" ""H7"" ""H8""}))) (and {(is Mover (who at:(ahead (site) E))) (is Mover (who at:(ahead (site) SE))) (is Mover (who at:(site)))})) (if (is In (last To) (sites {(ahead (site) W)})) (if (not (is In (site) (sites {""B1"" ""C1"" ""D1"" ""E1"" ""F1"" ""G1"" ""H1""}))) (and {(is Mover (who at:(ahead (site) S))) (is Mover (who at:(ahead (site) SW))) (is Mover (who at:(site)))})) (if (is In (last To) (sites {(ahead (site) N)})) (if (not (is In (site) (sites {""A1"" ""A2"" ""A3"" ""A4"" ""A5"" ""A6"" ""A7""}))) (and {(is Mover (who at:(ahead (site) W))) (is Mover (who at:(ahead (site) NW))) (is Mover (who at:(site)))})) (if (is In (last To) (sites {(ahead (site) E)})) (if (not (is In (site) (sites {""A8"" ""B8"" ""C8"" ""D8"" ""E8"" ""F8"" ""G8""}))) (and {(is Mover (who at:(ahead (site) N))) (is Mover (who at:(ahead (site) NE))) (is Mover (who at:(site)))}))))))))) (moveAgain)))))))) (hand Each)}) (rules (start (place ""Marker"" ""Hand"" count:32)) phases:{(phase ""FirstPlacement"" (play (or (move (from (handSite Mover)) (to (sites ""D4"") if:(is Empty (to)))) (move (from (handSite Mover)) (to (sites ""E5"") if:(is Empty (to)))))) (nextPhase Mover ""Layout"")) (phase ""Layout"" (play (move (from (handSite Mover)) (to (sites Empty)))) (nextPhase Mover (all Sites (sites Hand Mover) if:(= 0 (count Cell at:(site)))) ""RemoveCentre"")) (phase ""RemoveCentre"" (play (move Remove (sites {""D4"" ""E5""}) (then (if (not (and (is Empty 27) (is Empty 36))) (moveAgain))))) (nextPhase All (and (is Empty 27) (is Empty 36)) ""Battle"")) (phase ""Battle"" (play (if (is Prev Mover) (if (> (value Player Mover) 0) (or (move Remove (sites Occupied by:Next) (then (if (> (value Player Mover) 1) (and (moveAgain) (set Value Mover (- (value Player Mover) 1))) (set Value Mover 0)))) (if (is Mover (who at:(last To))) (move Hop (from (last To)) (between if:(and {(not (is In (between) (sites ToClear))) (is Enemy (who at:(between))) (!= (between) (var ""Between""))}) (apply (and (remove (between)) (remove (var ""Between""))))) (to if:(is Empty (to))) (then (if (can Move (hop (from (last To)) (between if:(and (not (is In (between) (sites ToClear))) (is Enemy (who at:(between))))) (to if:(is Empty (to))))) (and (set Value Mover (count Sites in:(forEach (sites Around (last To)) if:(if (is In (last To) (sites {(ahead (site) S)})) (if (not (is In (site) (sites {""H2"" ""H3"" ""H4"" ""H5"" ""H6"" ""H7"" ""H8""}))) (and {(is Mover (who at:(ahead (site) E))) (is Mover (who at:(ahead (site) SE))) (is Mover (who at:(site)))})) (if (is In (last To) (sites {(ahead (site) W)})) (if (not (is In (site) (sites {""B1"" ""C1"" ""D1"" ""E1"" ""F1"" ""G1"" ""H1""}))) (and {(is Mover (who at:(ahead (site) S))) (is Mover (who at:(ahead (site) SW))) (is Mover (who at:(site)))})) (if (is In (last To) (sites {(ahead (site) N)})) (if (not (is In (site) (sites {""A1"" ""A2"" ""A3"" ""A4"" ""A5"" ""A6"" ""A7""}))) (and {(is Mover (who at:(ahead (site) W))) (is Mover (who at:(ahead (site) NW))) (is Mover (who at:(site)))})) (if (is In (last To) (sites {(ahead (site) E)})) (if (not (is In (site) (sites {""A8"" ""B8"" ""C8"" ""D8"" ""E8"" ""F8"" ""G8""}))) (and {(is Mover (who at:(ahead (site) N))) (is Mover (who at:(ahead (site) NE))) (is Mover (who at:(site)))}))))))))) (moveAgain)) (if (> (count Sites in:(forEach (sites Around (last To)) if:(if (is In (last To) (sites {(ahead (site) S)})) (if (not (is In (site) (sites {""H2"" ""H3"" ""H4"" ""H5"" ""H6"" ""H7"" ""H8""}))) (and {(is Mover (who at:(ahead (site) E))) (is Mover (who at:(ahead (site) SE))) (is Mover (who at:(site)))})) (if (is In (last To) (sites {(ahead (site) W)})) (if (not (is In (site) (sites {""B1"" ""C1"" ""D1"" ""E1"" ""F1"" ""G1"" ""H1""}))) (and {(is Mover (who at:(ahead (site) S))) (is Mover (who at:(ahead (site) SW))) (is Mover (who at:(site)))})) (if (is In (last To) (sites {(ahead (site) N)})) (if (not (is In (site) (sites {""A1"" ""A2"" ""A3"" ""A4"" ""A5"" ""A6"" ""A7""}))) (and {(is Mover (who at:(ahead (site) W))) (is Mover (who at:(ahead (site) NW))) (is Mover (who at:(site)))})) (if (is In (last To) (sites {(ahead (site) E)})) (if (not (is In (site) (sites {""A8"" ""B8"" ""C8"" ""D8"" ""E8"" ""F8"" ""G8""}))) (and {(is Mover (who at:(ahead (site) N))) (is Mover (who at:(ahead (site) NE))) (is Mover (who at:(site)))})))))))) 0) (and (set Value Mover (count Sites in:(forEach (sites Around (last To)) if:(if (is In (last To) (sites {(ahead (site) S)})) (if (not (is In (site) (sites {""H2"" ""H3"" ""H4"" ""H5"" ""H6"" ""H7"" ""H8""}))) (and {(is Mover (who at:(ahead (site) E))) (is Mover (who at:(ahead (site) SE))) (is Mover (who at:(site)))})) (if (is In (last To) (sites {(ahead (site) W)})) (if (not (is In (site) (sites {""B1"" ""C1"" ""D1"" ""E1"" ""F1"" ""G1"" ""H1""}))) (and {(is Mover (who at:(ahead (site) S))) (is Mover (who at:(ahead (site) SW))) (is Mover (who at:(site)))})) (if (is In (last To) (sites {(ahead (site) N)})) (if (not (is In (site) (sites {""A1"" ""A2"" ""A3"" ""A4"" ""A5"" ""A6"" ""A7""}))) (and {(is Mover (who at:(ahead (site) W))) (is Mover (who at:(ahead (site) NW))) (is Mover (who at:(site)))})) (if (is In (last To) (sites {(ahead (site) E)})) (if (not (is In (site) (sites {""A8"" ""B8"" ""C8"" ""D8"" ""E8"" ""F8"" ""G8""}))) (and {(is Mover (who at:(ahead (site) N))) (is Mover (who at:(ahead (site) NE))) (is Mover (who at:(site)))}))))))))) (moveAgain)))))))) (or (if (is Mover (who at:(last To))) (move Hop (from (last To)) (between if:(and {(not (is In (between) (sites ToClear))) (is Enemy (who at:(between))) (!= (between) (var ""Between""))}) (apply (and (remove (between)) (remove (var ""Between""))))) (to if:(is Empty (to))) (then (if (can Move (hop (from (last To)) (between if:(and (not (is In (between) (sites ToClear))) (is Enemy (who at:(between))))) (to if:(is Empty (to))))) (and (set Value Mover (count Sites in:(forEach (sites Around (last To)) if:(if (is In (last To) (sites {(ahead (site) S)})) (if (not (is In (site) (sites {""H2"" ""H3"" ""H4"" ""H5"" ""H6"" ""H7"" ""H8""}))) (and {(is Mover (who at:(ahead (site) E))) (is Mover (who at:(ahead (site) SE))) (is Mover (who at:(site)))})) (if (is In (last To) (sites {(ahead (site) W)})) (if (not (is In (site) (sites {""B1"" ""C1"" ""D1"" ""E1"" ""F1"" ""G1"" ""H1""}))) (and {(is Mover (who at:(ahead (site) S))) (is Mover (who at:(ahead (site) SW))) (is Mover (who at:(site)))})) (if (is In (last To) (sites {(ahead (site) N)})) (if (not (is In (site) (sites {""A1"" ""A2"" ""A3"" ""A4"" ""A5"" ""A6"" ""A7""}))) (and {(is Mover (who at:(ahead (site) W))) (is Mover (who at:(ahead (site) NW))) (is Mover (who at:(site)))})) (if (is In (last To) (sites {(ahead (site) E)})) (if (not (is In (site) (sites {""A8"" ""B8"" ""C8"" ""D8"" ""E8"" ""F8"" ""G8""}))) (and {(is Mover (who at:(ahead (site) N))) (is Mover (who at:(ahead (site) NE))) (is Mover (who at:(site)))}))))))))) (moveAgain)) (if (> (count Sites in:(forEach (sites Around (last To)) if:(if (is In (last To) (sites {(ahead (site) S)})) (if (not (is In (site) (sites {""H2"" ""H3"" ""H4"" ""H5"" ""H6"" ""H7"" ""H8""}))) (and {(is Mover (who at:(ahead (site) E))) (is Mover (who at:(ahead (site) SE))) (is Mover (who at:(site)))})) (if (is In (last To) (sites {(ahead (site) W)})) (if (not (is In (site) (sites {""B1"" ""C1"" ""D1"" ""E1"" ""F1"" ""G1"" ""H1""}))) (and {(is Mover (who at:(ahead (site) S))) (is Mover (who at:(ahead (site) SW))) (is Mover (who at:(site)))})) (if (is In (last To) (sites {(ahead (site) N)})) (if (not (is In (site) (sites {""A1"" ""A2"" ""A3"" ""A4"" ""A5"" ""A6"" ""A7""}))) (and {(is Mover (who at:(ahead (site) W))) (is Mover (who at:(ahead (site) NW))) (is Mover (who at:(site)))})) (if (is In (last To) (sites {(ahead (site) E)})) (if (not (is In (site) (sites {""A8"" ""B8"" ""C8"" ""D8"" ""E8"" ""F8"" ""G8""}))) (and {(is Mover (who at:(ahead (site) N))) (is Mover (who at:(ahead (site) NE))) (is Mover (who at:(site)))})))))))) 0) (and (set Value Mover (count Sites in:(forEach (sites Around (last To)) if:(if (is In (last To) (sites {(ahead (site) S)})) (if (not (is In (site) (sites {""H2"" ""H3"" ""H4"" ""H5"" ""H6"" ""H7"" ""H8""}))) (and {(is Mover (who at:(ahead (site) E))) (is Mover (who at:(ahead (site) SE))) (is Mover (who at:(site)))})) (if (is In (last To) (sites {(ahead (site) W)})) (if (not (is In (site) (sites {""B1"" ""C1"" ""D1"" ""E1"" ""F1"" ""G1"" ""H1""}))) (and {(is Mover (who at:(ahead (site) S))) (is Mover (who at:(ahead (site) SW))) (is Mover (who at:(site)))})) (if (is In (last To) (sites {(ahead (site) N)})) (if (not (is In (site) (sites {""A1"" ""A2"" ""A3"" ""A4"" ""A5"" ""A6"" ""A7""}))) (and {(is Mover (who at:(ahead (site) W))) (is Mover (who at:(ahead (site) NW))) (is Mover (who at:(site)))})) (if (is In (last To) (sites {(ahead (site) E)})) (if (not (is In (site) (sites {""A8"" ""B8"" ""C8"" ""D8"" ""E8"" ""F8"" ""G8""}))) (and {(is Mover (who at:(ahead (site) N))) (is Mover (who at:(ahead (site) NE))) (is Mover (who at:(site)))}))))))))) (moveAgain))))))) (move Pass))) (forEach Piece))) (nextPhase All (or (< (count Pieces Mover) 9) (< (count Pieces Next) 9)) ""Fly"")) (phase ""Fly"" (play (if (is Prev Mover) (if (> (value Player Mover) 0) (or (move Remove (sites Occupied by:Next) (then (if (> (value Player Mover) 1) (and (moveAgain) (set Value Mover (- (value Player Mover) 1))) (set Value Mover 0)))) (if (is Mover (who at:(last To))) (move Hop (from (last To)) (between if:(and {(not (is In (between) (sites ToClear))) (is Enemy (who at:(between))) (!= (between) (var ""Between""))}) (apply (and (remove (between)) (remove (var ""Between""))))) (to if:(is Empty (to))) (then (if (can Move (hop (from (last To)) (between if:(and (not (is In (between) (sites ToClear))) (is Enemy (who at:(between))))) (to if:(is Empty (to))))) (and (set Value Mover (count Sites in:(forEach (sites Around (last To)) if:(if (is In (last To) (sites {(ahead (site) S)})) (if (not (is In (site) (sites {""H2"" ""H3"" ""H4"" ""H5"" ""H6"" ""H7"" ""H8""}))) (and {(is Mover (who at:(ahead (site) E))) (is Mover (who at:(ahead (site) SE))) (is Mover (who at:(site)))})) (if (is In (last To) (sites {(ahead (site) W)})) (if (not (is In (site) (sites {""B1"" ""C1"" ""D1"" ""E1"" ""F1"" ""G1"" ""H1""}))) (and {(is Mover (who at:(ahead (site) S))) (is Mover (who at:(ahead (site) SW))) (is Mover (who at:(site)))})) (if (is In (last To) (sites {(ahead (site) N)})) (if (not (is In (site) (sites {""A1"" ""A2"" ""A3"" ""A4"" ""A5"" ""A6"" ""A7""}))) (and {(is Mover (who at:(ahead (site) W))) (is Mover (who at:(ahead (site) NW))) (is Mover (who at:(site)))})) (if (is In (last To) (sites {(ahead (site) E)})) (if (not (is In (site) (sites {""A8"" ""B8"" ""C8"" ""D8"" ""E8"" ""F8"" ""G8""}))) (and {(is Mover (who at:(ahead (site) N))) (is Mover (who at:(ahead (site) NE))) (is Mover (who at:(site)))}))))))))) (moveAgain)) (if (> (count Sites in:(forEach (sites Around (last To)) if:(if (is In (last To) (sites {(ahead (site) S)})) (if (not (is In (site) (sites {""H2"" ""H3"" ""H4"" ""H5"" ""H6"" ""H7"" ""H8""}))) (and {(is Mover (who at:(ahead (site) E))) (is Mover (who at:(ahead (site) SE))) (is Mover (who at:(site)))})) (if (is In (last To) (sites {(ahead (site) W)})) (if (not (is In (site) (sites {""B1"" ""C1"" ""D1"" ""E1"" ""F1"" ""G1"" ""H1""}))) (and {(is Mover (who at:(ahead (site) S))) (is Mover (who at:(ahead (site) SW))) (is Mover (who at:(site)))})) (if (is In (last To) (sites {(ahead (site) N)})) (if (not (is In (site) (sites {""A1"" ""A2"" ""A3"" ""A4"" ""A5"" ""A6"" ""A7""}))) (and {(is Mover (who at:(ahead (site) W))) (is Mover (who at:(ahead (site) NW))) (is Mover (who at:(site)))})) (if (is In (last To) (sites {(ahead (site) E)})) (if (not (is In (site) (sites {""A8"" ""B8"" ""C8"" ""D8"" ""E8"" ""F8"" ""G8""}))) (and {(is Mover (who at:(ahead (site) N))) (is Mover (who at:(ahead (site) NE))) (is Mover (who at:(site)))})))))))) 0) (and (set Value Mover (count Sites in:(forEach (sites Around (last To)) if:(if (is In (last To) (sites {(ahead (site) S)})) (if (not (is In (site) (sites {""H2"" ""H3"" ""H4"" ""H5"" ""H6"" ""H7"" ""H8""}))) (and {(is Mover (who at:(ahead (site) E))) (is Mover (who at:(ahead (site) SE))) (is Mover (who at:(site)))})) (if (is In (last To) (sites {(ahead (site) W)})) (if (not (is In (site) (sites {""B1"" ""C1"" ""D1"" ""E1"" ""F1"" ""G1"" ""H1""}))) (and {(is Mover (who at:(ahead (site) S))) (is Mover (who at:(ahead (site) SW))) (is Mover (who at:(site)))})) (if (is In (last To) (sites {(ahead (site) N)})) (if (not (is In (site) (sites {""A1"" ""A2"" ""A3"" ""A4"" ""A5"" ""A6"" ""A7""}))) (and {(is Mover (who at:(ahead (site) W))) (is Mover (who at:(ahead (site) NW))) (is Mover (who at:(site)))})) (if (is In (last To) (sites {(ahead (site) E)})) (if (not (is In (site) (sites {""A8"" ""B8"" ""C8"" ""D8"" ""E8"" ""F8"" ""G8""}))) (and {(is Mover (who at:(ahead (site) N))) (is Mover (who at:(ahead (site) NE))) (is Mover (who at:(site)))}))))))))) (moveAgain)))))))) (or (if (is Mover (who at:(last To))) (move Hop (from (last To)) (between if:(and {(not (is In (between) (sites ToClear))) (is Enemy (who at:(between))) (!= (between) (var ""Between""))}) (apply (and (remove (between)) (remove (var ""Between""))))) (to if:(is Empty (to))) (then (if (can Move (hop (from (last To)) (between if:(and (not (is In (between) (sites ToClear))) (is Enemy (who at:(between))))) (to if:(is Empty (to))))) (and (set Value Mover (count Sites in:(forEach (sites Around (last To)) if:(if (is In (last To) (sites {(ahead (site) S)})) (if (not (is In (site) (sites {""H2"" ""H3"" ""H4"" ""H5"" ""H6"" ""H7"" ""H8""}))) (and {(is Mover (who at:(ahead (site) E))) (is Mover (who at:(ahead (site) SE))) (is Mover (who at:(site)))})) (if (is In (last To) (sites {(ahead (site) W)})) (if (not (is In (site) (sites {""B1"" ""C1"" ""D1"" ""E1"" ""F1"" ""G1"" ""H1""}))) (and {(is Mover (who at:(ahead (site) S))) (is Mover (who at:(ahead (site) SW))) (is Mover (who at:(site)))})) (if (is In (last To) (sites {(ahead (site) N)})) (if (not (is In (site) (sites {""A1"" ""A2"" ""A3"" ""A4"" ""A5"" ""A6"" ""A7""}))) (and {(is Mover (who at:(ahead (site) W))) (is Mover (who at:(ahead (site) NW))) (is Mover (who at:(site)))})) (if (is In (last To) (sites {(ahead (site) E)})) (if (not (is In (site) (sites {""A8"" ""B8"" ""C8"" ""D8"" ""E8"" ""F8"" ""G8""}))) (and {(is Mover (who at:(ahead (site) N))) (is Mover (who at:(ahead (site) NE))) (is Mover (who at:(site)))}))))))))) (moveAgain)) (if (> (count Sites in:(forEach (sites Around (last To)) if:(if (is In (last To) (sites {(ahead (site) S)})) (if (not (is In (site) (sites {""H2"" ""H3"" ""H4"" ""H5"" ""H6"" ""H7"" ""H8""}))) (and {(is Mover (who at:(ahead (site) E))) (is Mover (who at:(ahead (site) SE))) (is Mover (who at:(site)))})) (if (is In (last To) (sites {(ahead (site) W)})) (if (not (is In (site) (sites {""B1"" ""C1"" ""D1"" ""E1"" ""F1"" ""G1"" ""H1""}))) (and {(is Mover (who at:(ahead (site) S))) (is Mover (who at:(ahead (site) SW))) (is Mover (who at:(site)))})) (if (is In (last To) (sites {(ahead (site) N)})) (if (not (is In (site) (sites {""A1"" ""A2"" ""A3"" ""A4"" ""A5"" ""A6"" ""A7""}))) (and {(is Mover (who at:(ahead (site) W))) (is Mover (who at:(ahead (site) NW))) (is Mover (who at:(site)))})) (if (is In (last To) (sites {(ahead (site) E)})) (if (not (is In (site) (sites {""A8"" ""B8"" ""C8"" ""D8"" ""E8"" ""F8"" ""G8""}))) (and {(is Mover (who at:(ahead (site) N))) (is Mover (who at:(ahead (site) NE))) (is Mover (who at:(site)))})))))))) 0) (and (set Value Mover (count Sites in:(forEach (sites Around (last To)) if:(if (is In (last To) (sites {(ahead (site) S)})) (if (not (is In (site) (sites {""H2"" ""H3"" ""H4"" ""H5"" ""H6"" ""H7"" ""H8""}))) (and {(is Mover (who at:(ahead (site) E))) (is Mover (who at:(ahead (site) SE))) (is Mover (who at:(site)))})) (if (is In (last To) (sites {(ahead (site) W)})) (if (not (is In (site) (sites {""B1"" ""C1"" ""D1"" ""E1"" ""F1"" ""G1"" ""H1""}))) (and {(is Mover (who at:(ahead (site) S))) (is Mover (who at:(ahead (site) SW))) (is Mover (who at:(site)))})) (if (is In (last To) (sites {(ahead (site) N)})) (if (not (is In (site) (sites {""A1"" ""A2"" ""A3"" ""A4"" ""A5"" ""A6"" ""A7""}))) (and {(is Mover (who at:(ahead (site) W))) (is Mover (who at:(ahead (site) NW))) (is Mover (who at:(site)))})) (if (is In (last To) (sites {(ahead (site) E)})) (if (not (is In (site) (sites {""A8"" ""B8"" ""C8"" ""D8"" ""E8"" ""F8"" ""G8""}))) (and {(is Mover (who at:(ahead (site) N))) (is Mover (who at:(ahead (site) NE))) (is Mover (who at:(site)))}))))))))) (moveAgain))))))) (move Pass))) (if (< (count Pieces Mover) 9) (forEach Piece (or (move Hop (from (sites Occupied by:Mover)) (between if:(and (not (is In (between) (sites ToClear))) (is Enemy (who at:(between)))) (apply (set Var ""Between"" (between)))) (to if:(is Empty (to))) (then (if (can Move (hop (from (last To)) (between if:(and {(not (is In (between) (sites ToClear))) (is Enemy (who at:(between))) (!= (between) (var ""Between""))})) (to if:(is Empty (to))))) (and (set Value Mover (count Sites in:(forEach (sites Around (last To)) if:(if (is In (last To) (sites {(ahead (site) S)})) (if (not (is In (site) (sites {""H2"" ""H3"" ""H4"" ""H5"" ""H6"" ""H7"" ""H8""}))) (and {(is Mover (who at:(ahead (site) E))) (is Mover (who at:(ahead (site) SE))) (is Mover (who at:(site)))})) (if (is In (last To) (sites {(ahead (site) W)})) (if (not (is In (site) (sites {""B1"" ""C1"" ""D1"" ""E1"" ""F1"" ""G1"" ""H1""}))) (and {(is Mover (who at:(ahead (site) S))) (is Mover (who at:(ahead (site) SW))) (is Mover (who at:(site)))})) (if (is In (last To) (sites {(ahead (site) N)})) (if (not (is In (site) (sites {""A1"" ""A2"" ""A3"" ""A4"" ""A5"" ""A6"" ""A7""}))) (and {(is Mover (who at:(ahead (site) W))) (is Mover (who at:(ahead (site) NW))) (is Mover (who at:(site)))})) (if (is In (last To) (sites {(ahead (site) E)})) (if (not (is In (site) (sites {""A8"" ""B8"" ""C8"" ""D8"" ""E8"" ""F8"" ""G8""}))) (and {(is Mover (who at:(ahead (site) N))) (is Mover (who at:(ahead (site) NE))) (is Mover (who at:(site)))}))))))))) (moveAgain)) (if (> (count Sites in:(forEach (sites Around (last To)) if:(if (is In (last To) (sites {(ahead (site) S)})) (if (not (is In (site) (sites {""H2"" ""H3"" ""H4"" ""H5"" ""H6"" ""H7"" ""H8""}))) (and {(is Mover (who at:(ahead (site) E))) (is Mover (who at:(ahead (site) SE))) (is Mover (who at:(site)))})) (if (is In (last To) (sites {(ahead (site) W)})) (if (not (is In (site) (sites {""B1"" ""C1"" ""D1"" ""E1"" ""F1"" ""G1"" ""H1""}))) (and {(is Mover (who at:(ahead (site) S))) (is Mover (who at:(ahead (site) SW))) (is Mover (who at:(site)))})) (if (is In (last To) (sites {(ahead (site) N)})) (if (not (is In (site) (sites {""A1"" ""A2"" ""A3"" ""A4"" ""A5"" ""A6"" ""A7""}))) (and {(is Mover (who at:(ahead (site) W))) (is Mover (who at:(ahead (site) NW))) (is Mover (who at:(site)))})) (if (is In (last To) (sites {(ahead (site) E)})) (if (not (is In (site) (sites {""A8"" ""B8"" ""C8"" ""D8"" ""E8"" ""F8"" ""G8""}))) (and {(is Mover (who at:(ahead (site) N))) (is Mover (who at:(ahead (site) NE))) (is Mover (who at:(site)))})))))))) 0) (and (set Value Mover (count Sites in:(forEach (sites Around (last To)) if:(if (is In (last To) (sites {(ahead (site) S)})) (if (not (is In (site) (sites {""H2"" ""H3"" ""H4"" ""H5"" ""H6"" ""H7"" ""H8""}))) (and {(is Mover (who at:(ahead (site) E))) (is Mover (who at:(ahead (site) SE))) (is Mover (who at:(site)))})) (if (is In (last To) (sites {(ahead (site) W)})) (if (not (is In (site) (sites {""B1"" ""C1"" ""D1"" ""E1"" ""F1"" ""G1"" ""H1""}))) (and {(is Mover (who at:(ahead (site) S))) (is Mover (who at:(ahead (site) SW))) (is Mover (who at:(site)))})) (if (is In (last To) (sites {(ahead (site) N)})) (if (not (is In (site) (sites {""A1"" ""A2"" ""A3"" ""A4"" ""A5"" ""A6"" ""A7""}))) (and {(is Mover (who at:(ahead (site) W))) (is Mover (who at:(ahead (site) NW))) (is Mover (who at:(site)))})) (if (is In (last To) (sites {(ahead (site) E)})) (if (not (is In (site) (sites {""A8"" ""B8"" ""C8"" ""D8"" ""E8"" ""F8"" ""G8""}))) (and {(is Mover (who at:(ahead (site) N))) (is Mover (who at:(ahead (site) NE))) (is Mover (who at:(site)))}))))))))) (moveAgain)))))) (move (from (sites Occupied by:Mover)) (to (sites Empty)) (then (if (> (count Sites in:(forEach (sites Around (last To)) if:(if (is In (last To) (sites {(ahead (site) S)})) (if (not (is In (site) (sites {""H2"" ""H3"" ""H4"" ""H5"" ""H6"" ""H7"" ""H8""}))) (and {(is Mover (who at:(ahead (site) E))) (is Mover (who at:(ahead (site) SE))) (is Mover (who at:(site)))})) (if (is In (last To) (sites {(ahead (site) W)})) (if (not (is In (site) (sites {""B1"" ""C1"" ""D1"" ""E1"" ""F1"" ""G1"" ""H1""}))) (and {(is Mover (who at:(ahead (site) S))) (is Mover (who at:(ahead (site) SW))) (is Mover (who at:(site)))})) (if (is In (last To) (sites {(ahead (site) N)})) (if (not (is In (site) (sites {""A1"" ""A2"" ""A3"" ""A4"" ""A5"" ""A6"" ""A7""}))) (and {(is Mover (who at:(ahead (site) W))) (is Mover (who at:(ahead (site) NW))) (is Mover (who at:(site)))})) (if (is In (last To) (sites {(ahead (site) E)})) (if (not (is In (site) (sites {""A8"" ""B8"" ""C8"" ""D8"" ""E8"" ""F8"" ""G8""}))) (and {(is Mover (who at:(ahead (site) N))) (is Mover (who at:(ahead (site) NE))) (is Mover (who at:(site)))})))))))) 0) (and (set Value Mover (count Sites in:(forEach (sites Around (last To)) if:(if (is In (last To) (sites {(ahead (site) S)})) (if (not (is In (site) (sites {""H2"" ""H3"" ""H4"" ""H5"" ""H6"" ""H7"" ""H8""}))) (and {(is Mover (who at:(ahead (site) E))) (is Mover (who at:(ahead (site) SE))) (is Mover (who at:(site)))})) (if (is In (last To) (sites {(ahead (site) W)})) (if (not (is In (site) (sites {""B1"" ""C1"" ""D1"" ""E1"" ""F1"" ""G1"" ""H1""}))) (and {(is Mover (who at:(ahead (site) S))) (is Mover (who at:(ahead (site) SW))) (is Mover (who at:(site)))})) (if (is In (last To) (sites {(ahead (site) N)})) (if (not (is In (site) (sites {""A1"" ""A2"" ""A3"" ""A4"" ""A5"" ""A6"" ""A7""}))) (and {(is Mover (who at:(ahead (site) W))) (is Mover (who at:(ahead (site) NW))) (is Mover (who at:(site)))})) (if (is In (last To) (sites {(ahead (site) E)})) (if (not (is In (site) (sites {""A8"" ""B8"" ""C8"" ""D8"" ""E8"" ""F8"" ""G8""}))) (and {(is Mover (who at:(ahead (site) N))) (is Mover (who at:(ahead (site) NE))) (is Mover (who at:(site)))}))))))))) (moveAgain))))))) (forEach Piece (or (move Step (to if:(is Empty (to))) (then (if (> (count Sites in:(forEach (sites Around (last To)) if:(if (is In (last To) (sites {(ahead (site) S)})) (if (not (is In (site) (sites {""H2"" ""H3"" ""H4"" ""H5"" ""H6"" ""H7"" ""H8""}))) (and {(is Mover (who at:(ahead (site) E))) (is Mover (who at:(ahead (site) SE))) (is Mover (who at:(site)))})) (if (is In (last To) (sites {(ahead (site) W)})) (if (not (is In (site) (sites {""B1"" ""C1"" ""D1"" ""E1"" ""F1"" ""G1"" ""H1""}))) (and {(is Mover (who at:(ahead (site) S))) (is Mover (who at:(ahead (site) SW))) (is Mover (who at:(site)))})) (if (is In (last To) (sites {(ahead (site) N)})) (if (not (is In (site) (sites {""A1"" ""A2"" ""A3"" ""A4"" ""A5"" ""A6"" ""A7""}))) (and {(is Mover (who at:(ahead (site) W))) (is Mover (who at:(ahead (site) NW))) (is Mover (who at:(site)))})) (if (is In (last To) (sites {(ahead (site) E)})) (if (not (is In (site) (sites {""A8"" ""B8"" ""C8"" ""D8"" ""E8"" ""F8"" ""G8""}))) (and {(is Mover (who at:(ahead (site) N))) (is Mover (who at:(ahead (site) NE))) (is Mover (who at:(site)))})))))))) 0) (and (set Value Mover (count Sites in:(forEach (sites Around (last To)) if:(if (is In (last To) (sites {(ahead (site) S)})) (if (not (is In (site) (sites {""H2"" ""H3"" ""H4"" ""H5"" ""H6"" ""H7"" ""H8""}))) (and {(is Mover (who at:(ahead (site) E))) (is Mover (who at:(ahead (site) SE))) (is Mover (who at:(site)))})) (if (is In (last To) (sites {(ahead (site) W)})) (if (not (is In (site) (sites {""B1"" ""C1"" ""D1"" ""E1"" ""F1"" ""G1"" ""H1""}))) (and {(is Mover (who at:(ahead (site) S))) (is Mover (who at:(ahead (site) SW))) (is Mover (who at:(site)))})) (if (is In (last To) (sites {(ahead (site) N)})) (if (not (is In (site) (sites {""A1"" ""A2"" ""A3"" ""A4"" ""A5"" ""A6"" ""A7""}))) (and {(is Mover (who at:(ahead (site) W))) (is Mover (who at:(ahead (site) NW))) (is Mover (who at:(site)))})) (if (is In (last To) (sites {(ahead (site) E)})) (if (not (is In (site) (sites {""A8"" ""B8"" ""C8"" ""D8"" ""E8"" ""F8"" ""G8""}))) (and {(is Mover (who at:(ahead (site) N))) (is Mover (who at:(ahead (site) NE))) (is Mover (who at:(site)))}))))))))) (moveAgain))))) (move Hop (from (sites Occupied by:Mover)) (between if:(and (not (is In (between) (sites ToClear))) (is Enemy (who at:(between)))) (apply (set Var ""Between"" (between)))) (to if:(and (is Empty (to)) (can Move (hop (from (to)) (between if:(and {(not (is In (between) (sites ToClear))) (is Enemy (who at:(between))) (!= (between) (var ""Between""))})) (to if:(is Empty (to))))))) (then (if (can Move (hop (from (last To)) (between if:(and {(not (is In (between) (sites ToClear))) (is Enemy (who at:(between))) (!= (between) (var ""Between""))})) (to if:(is Empty (to))))) (and (set Value Mover (count Sites in:(forEach (sites Around (last To)) if:(if (is In (last To) (sites {(ahead (site) S)})) (if (not (is In (site) (sites {""H2"" ""H3"" ""H4"" ""H5"" ""H6"" ""H7"" ""H8""}))) (and {(is Mover (who at:(ahead (site) E))) (is Mover (who at:(ahead (site) SE))) (is Mover (who at:(site)))})) (if (is In (last To) (sites {(ahead (site) W)})) (if (not (is In (site) (sites {""B1"" ""C1"" ""D1"" ""E1"" ""F1"" ""G1"" ""H1""}))) (and {(is Mover (who at:(ahead (site) S))) (is Mover (who at:(ahead (site) SW))) (is Mover (who at:(site)))})) (if (is In (last To) (sites {(ahead (site) N)})) (if (not (is In (site) (sites {""A1"" ""A2"" ""A3"" ""A4"" ""A5"" ""A6"" ""A7""}))) (and {(is Mover (who at:(ahead (site) W))) (is Mover (who at:(ahead (site) NW))) (is Mover (who at:(site)))})) (if (is In (last To) (sites {(ahead (site) E)})) (if (not (is In (site) (sites {""A8"" ""B8"" ""C8"" ""D8"" ""E8"" ""F8"" ""G8""}))) (and {(is Mover (who at:(ahead (site) N))) (is Mover (who at:(ahead (site) NE))) (is Mover (who at:(site)))}))))))))) (moveAgain)) (if (> (count Sites in:(forEach (sites Around (last To)) if:(if (is In (last To) (sites {(ahead (site) S)})) (if (not (is In (site) (sites {""H2"" ""H3"" ""H4"" ""H5"" ""H6"" ""H7"" ""H8""}))) (and {(is Mover (who at:(ahead (site) E))) (is Mover (who at:(ahead (site) SE))) (is Mover (who at:(site)))})) (if (is In (last To) (sites {(ahead (site) W)})) (if (not (is In (site) (sites {""B1"" ""C1"" ""D1"" ""E1"" ""F1"" ""G1"" ""H1""}))) (and {(is Mover (who at:(ahead (site) S))) (is Mover (who at:(ahead (site) SW))) (is Mover (who at:(site)))})) (if (is In (last To) (sites {(ahead (site) N)})) (if (not (is In (site) (sites {""A1"" ""A2"" ""A3"" ""A4"" ""A5"" ""A6"" ""A7""}))) (and {(is Mover (who at:(ahead (site) W))) (is Mover (who at:(ahead (site) NW))) (is Mover (who at:(site)))})) (if (is In (last To) (sites {(ahead (site) E)})) (if (not (is In (site) (sites {""A8"" ""B8"" ""C8"" ""D8"" ""E8"" ""F8"" ""G8""}))) (and {(is Mover (who at:(ahead (site) N))) (is Mover (who at:(ahead (site) NE))) (is Mover (who at:(site)))})))))))) 0) (and (set Value Mover (count Sites in:(forEach (sites Around (last To)) if:(if (is In (last To) (sites {(ahead (site) S)})) (if (not (is In (site) (sites {""H2"" ""H3"" ""H4"" ""H5"" ""H6"" ""H7"" ""H8""}))) (and {(is Mover (who at:(ahead (site) E))) (is Mover (who at:(ahead (site) SE))) (is Mover (who at:(site)))})) (if (is In (last To) (sites {(ahead (site) W)})) (if (not (is In (site) (sites {""B1"" ""C1"" ""D1"" ""E1"" ""F1"" ""G1"" ""H1""}))) (and {(is Mover (who at:(ahead (site) S))) (is Mover (who at:(ahead (site) SW))) (is Mover (who at:(site)))})) (if (is In (last To) (sites {(ahead (site) N)})) (if (not (is In (site) (sites {""A1"" ""A2"" ""A3"" ""A4"" ""A5"" ""A6"" ""A7""}))) (and {(is Mover (who at:(ahead (site) W))) (is Mover (who at:(ahead (site) NW))) (is Mover (who at:(site)))})) (if (is In (last To) (sites {(ahead (site) E)})) (if (not (is In (site) (sites {""A8"" ""B8"" ""C8"" ""D8"" ""E8"" ""F8"" ""G8""}))) (and {(is Mover (who at:(ahead (site) N))) (is Mover (who at:(ahead (site) NE))) (is Mover (who at:(site)))}))))))))) (moveAgain))))))))))))} (end (if (<= (count Pieces Next) 3) (result Next Loss)))))" "Two concentric circles, with two perpendicular diameters intersecting both circles, and four other lines, positioned diagonally, connecting the circumferences of the two circles. Six pieces per player. which begin on opposite sides of the circle from the other player, three on each circle. Players alternate turns moving their pieces. Pieces move three spaces along the lines on the board, regardless of whether they are occupied, capturing any piece on the third. Pieces may change direction in a turn, as long as the lines are followed and there is no backtracking. The player who captures all of the opponent's pieces wins.","(game ""Toono"" (players 2) (equipment {(board (add (concentric {1 0 8 8}) edges:{{0 2} {0 4} {0 6} {0 8}}) use:Vertex) (piece ""Marker"" Each (move (from) (to (sites Distance from:(from) (exact 3)) if:(not (is Friend (who at:(to)))) (apply (if (is Enemy (who at:(to))) (remove (to)))))))}) (rules (start {(place ""Marker1"" (difference (expand (sites Bottom) steps:2) (expand (sites Top) steps:2))) (place ""Marker2"" (difference (expand (sites Top) steps:2) (expand (sites Bottom) steps:2)))}) (play (forEach Piece)) (end (if (no Pieces Next) (result Next Loss)))))","###Description Two concentric circles, with two perpendicular diameters intersecting both circles, and four other lines, positioned diagonally, connecting the circumferences of the two circles. Six pieces per player. which begin on opposite sides of the circle from the other player, three on each circle. Players alternate turns moving their pieces. Pieces move three spaces along the lines on the board, regardless of whether they are occupied, capturing any piece on the third. Pieces may change direction in a turn, as long as the lines are followed and there is no backtracking. The player who captures all of the opponent's pieces wins. @@ -5094,11 +4929,6 @@ GOAL Get your king into the enemy home square, or kill the enemy king. MOVES Pla ###Ludii (game ""King And Courtesan"" (players {(player N) (player S)}) (equipment {(board (rotate 45 (square 6))) (piece ""Disc"" Each (or {(move Step Forwards (to if:(is Empty (to))) stack:True) (move Step (to if:(is Enemy (who at:(to))) (apply (and (if (= 2 (size Stack at:(to))) (set Var ""NextLoss"" 1)) (remove (to) count:(size Stack at:(to)))))) stack:True) (move Step (from if:(= 2 (size Stack at:(from)))) Forwards (to if:(is Mover (who at:(to)))))}))}) (rules (start {(place ""Disc1"" (expand (sites Bottom) steps:(- 6 2) Orthogonal)) (place ""Disc2"" (expand (sites Top) steps:(- 6 2) Orthogonal)) (place Stack ""Disc1"" (sites Bottom)) (place Stack ""Disc2"" (sites Top))}) (play (forEach Piece top:True)) (end {(if (= 1 (var ""NextLoss"")) (result Next Loss)) (if (or (and (= (id P1) (who at:(- (* 6 6) 1))) (= 2 (size Stack at:(- (* 6 6) 1)))) (and (= (id P2) (who at:0)) (= 2 (size Stack at:0)))) (result Mover Win))})))" -"Modern translation of the original rules (German)","(game ""Kriegsspiel"" (players 2) (equipment {(board (rectangle 33 49)) (hand Each size:6) (piece ""Mountain"" Neutral) (piece ""Town"" Neutral) (piece ""Forest"" Neutral) (piece ""Triangle"" Neutral) (piece ""Square"" Neutral) (regions ""HomeP1"" P1 (expand (sites Left) steps:15)) (regions ""HomeP2"" P2 (expand (sites Right) steps:15)) (piece ""CannonOutline"" Each (or {(move Slide (from (from) if:(and {(= (state at:(from)) 3) (is In (from) (sites Around (var ""FromArtillerySite"") Orthogonal))})) Orthogonal (between (range 1 6) if:(is In (between) (difference (sites Empty) (difference (sites ""WaterRegion"") (sites (values Remembered ""Bridges"")))))) (to if:False (apply if:(is In (to) (sites Around (var ""ToArtillerySite"") Orthogonal)))) (then (and (set Var ""FromArtillerySite"" -1) (set Var ""ToArtillerySite"" -1)))) (move Select (from (from) if:(and {(= (state at:(from)) 1) (< 0 (count Sites in:(intersection (sites Around (from) Orthogonal) (sites Occupied by:Mover container:""Board"" components:{""TinSoldier"" ""Bishop""}))))})) (to (intersection (union (sites Occupied by:Enemy container:""Board"" components:{""TinSoldier"" ""RiderOutline"" ""Bishop"" ""CannonOutline"" ""RegimentalOutline"" ""WagonOutline""}) (sites Occupied by:All container:""Board"" components:{""Triangle""})) (union (expand origin:(ahead (from)) Orthogonal) (expand origin:(ahead (from) steps:2) Orthogonal))) if:(or (not (= 1 (count Sites in:(intersection (sites Direction from:(to) (directions Cell from:(ahead (from)) to:(from)) distance:1) (forEach (sites Occupied by:All container:""Board"" components:{""Triangle""}) if:(and (= (% (+ (rotation at:(site)) 4) 8) (rotation at:(from))) (= (value Piece at:(site)) (who at:(to))))))))) (is In (to) (sites Occupied by:Mover container:""Board"" components:{""RiderOutline""})))) (then (remove (last To)))) (move Select (from (from) if:(and {(= (state at:(from)) 1) (< 0 (count Sites in:(intersection (sites Around (from) Orthogonal) (sites Occupied by:Mover container:""Board"" components:{""TinSoldier"" ""Bishop""}))))})) (to (intersection (sites (values Remembered ""Bridges"")) (union (expand origin:(ahead (from)) Orthogonal) (expand origin:(ahead (from) steps:2) Orthogonal))) if:(not (= 1 (count Sites in:(intersection (sites Direction from:(to) (directions Cell from:(ahead (from)) to:(from)) distance:1) (forEach (sites Occupied by:All container:""Board"" components:{""Triangle""}) if:(and (= (% (+ (rotation at:(site)) 4) 8) (rotation at:(from))) (= (value Piece at:(site)) (who at:(to)))))))))) (then (forget Value ""Bridges"" (last To)))) (if (and (= (state at:(from)) 1) (< 0 (count Sites in:(intersection (sites Around (from) Orthogonal) (sites Occupied by:Mover container:""Board"" components:{""TinSoldier"" ""Bishop""}))))) (move Set Rotation {0 2 4 6} previous:False next:False))}) maxState:100 maxValue:10000) (piece ""RegimentalOutline"" Each (or {(move Slide (from (from) if:(and {(= (state at:(from)) 3) (is In (from) (sites Around (var ""FromArtillerySite"") Orthogonal))})) Orthogonal (between (range 1 8) if:(is In (between) (difference (sites Empty) (difference (sites ""WaterRegion"") (sites (values Remembered ""Bridges"")))))) (to if:False (apply if:(is In (to) (sites Around (var ""ToArtillerySite"") Orthogonal)))) (then (and (set Var ""FromArtillerySite"" -1) (set Var ""ToArtillerySite"" -1)))) (move Select (from (from) if:(and {(= (state at:(from)) 1) (< 0 (count Sites in:(intersection (sites Around (from) Orthogonal) (sites Occupied by:Mover container:""Board"" components:{""TinSoldier"" ""Bishop""}))))})) (to (intersection (union (sites Occupied by:Enemy container:""Board"" components:{""TinSoldier"" ""RiderOutline"" ""Bishop"" ""RegimentalOutline"" ""WagonOutline""}) (sites Occupied by:All container:""Board"" components:{""Triangle""})) (expand origin:(ahead (from)) Orthogonal)) if:(or (not (= 1 (count Sites in:(intersection (sites Direction from:(to) (directions Cell from:(ahead (from)) to:(from)) distance:1) (forEach (sites Occupied by:All container:""Board"" components:{""Triangle""}) if:(and (= (% (+ (rotation at:(site)) 4) 8) (rotation at:(from))) (= (value Piece at:(site)) (who at:(to))))))))) (is In (to) (sites Occupied by:Mover container:""Board"" components:{""RiderOutline""})))) (then (remove (last To)))) (move Select (from (from) if:(and {(= (state at:(from)) 1) (< 0 (count Sites in:(intersection (sites Around (from) Orthogonal) (sites Occupied by:Mover container:""Board"" components:{""TinSoldier"" ""Bishop""}))))})) (to (intersection (union (sites Occupied by:Enemy container:""Board"" components:{""TinSoldier"" ""RiderOutline"" ""Bishop"" ""CannonOutline"" ""RegimentalOutline"" ""WagonOutline""}) (sites Occupied by:All container:""Board"" components:{""Triangle""})) (expand origin:(ahead (from)) Orthogonal)) if:(and (or (not (= 1 (count Sites in:(intersection (sites Direction from:(to) (directions Cell from:(ahead (from)) to:(from)) distance:1) (forEach (sites Occupied by:All container:""Board"" components:{""Triangle""}) if:(and (= (% (+ (rotation at:(site)) 4) 8) (rotation at:(from))) (= (value Piece at:(site)) (who at:(to))))))))) (is In (to) (sites Occupied by:Mover container:""Board"" components:{""RiderOutline""}))) (= 1 (count Sites in:(intersection (sites Direction from:(from) (directions Cell from:(ahead (to)) to:(to)) distance:1) (forEach (sites Occupied by:All container:""Board"" components:{""Triangle""}) if:(and (= (% (+ (rotation at:(site)) 4) 8) (rotation at:(to))) (= (value Piece at:(site)) (who at:(from)))))))))) (then (remove (last To)))) (move Select (from (from) if:(and {(= (state at:(from)) 1) (< 0 (count Sites in:(intersection (sites Around (from) Orthogonal) (sites Occupied by:Mover container:""Board"" components:{""TinSoldier"" ""Bishop""}))))})) (to (intersection (sites (values Remembered ""Bridges"")) (expand origin:(ahead (from)) Orthogonal)) if:(not (= 1 (count Sites in:(intersection (sites Direction from:(to) (directions Cell from:(ahead (from)) to:(from)) distance:1) (forEach (sites Occupied by:All container:""Board"" components:{""Triangle""}) if:(and (= (% (+ (rotation at:(site)) 4) 8) (rotation at:(from))) (= (value Piece at:(site)) (who at:(to)))))))))) (then (forget Value ""Bridges"" (last To)))) (if (and (= (state at:(from)) 1) (< 0 (count Sites in:(intersection (sites Around (from) Orthogonal) (sites Occupied by:Mover container:""Board"" components:{""TinSoldier"" ""Bishop""}))))) (move Set Rotation {0 2 4 6} previous:False next:False))})) (piece ""TinSoldier"" Each (or {(move Slide (from (from) if:(= (state at:(from)) 3)) (between (range 1 8) if:(or {(is In (between) (difference (sites Empty) (difference (sites ""WaterRegion"") (sites (values Remembered ""Bridges""))))) (is In (between) (sites ""TownRegion""))})) (to if:False (apply if:(if (is Occupied (to)) (not (is In (to) (sites ""TownRegion""))) True))) (then (and (set Var ""FromArtillerySite"" (last From)) (set Var ""ToArtillerySite"" (last To))))) (move Step (from (from) if:(= (state at:(from)) 1)) (directions {Forward FR FL}) (to if:(is Enemy (who at:(to))) (apply (remove (to))))) (move Select (from (from) if:(= (state at:(from)) 1)) (to (intersection (forEach (sites Occupied by:Enemy container:""Board"" components:{""TinSoldier"" ""RiderOutline"" ""Bishop""}) if:(not (= (% (+ (rotation at:(site)) 4) 8) (rotation at:(from))))) (expand origin:(ahead (from)) Orthogonal)) if:(or (not (= 1 (count Sites in:(intersection (sites Direction from:(to) (directions Cell from:(ahead (from)) to:(from)) distance:1) (forEach (sites Occupied by:All container:""Board"" components:{""Triangle""}) if:(and (= (% (+ (rotation at:(site)) 4) 8) (rotation at:(from))) (= (value Piece at:(site)) (who at:(to))))))))) (is In (to) (sites Occupied by:Mover container:""Board"" components:{""RiderOutline""})))) (then (remove (last To)))) (move Select (from (from) if:(= (state at:(from)) 1)) (to (intersection (sites Occupied by:Enemy container:""Board"" components:{""TinSoldier"" ""RiderOutline"" ""Bishop""}) (expand origin:(ahead (from)) Orthogonal)) if:(= 1 (count Sites in:(intersection (sites Direction from:(from) (directions Cell from:(ahead (to)) to:(to)) distance:1) (forEach (sites Occupied by:All container:""Board"" components:{""Triangle""}) if:(and (= (% (+ (rotation at:(site)) 4) 8) (rotation at:(to))) (= (value Piece at:(site)) (who at:(from))))))))) (then (remove (last To)))) (move Select (from (from) if:(and (= (state at:(from)) 1) (is In (ahead (from)) (sites Occupied by:Mover container:""Board"" components:{""TinSoldier"" ""Bishop""})))) (to (intersection (expand origin:(ahead (from)) Orthogonal) (sites Occupied by:Enemy container:""Board"" components:{""TinSoldier"" ""RiderOutline"" ""Bishop""})) if:(or (not (= 1 (count Sites in:(intersection (sites Direction from:(to) (directions Cell from:(ahead (from)) to:(from)) distance:1) (forEach (sites Occupied by:All container:""Board"" components:{""Triangle""}) if:(and (= (% (+ (rotation at:(site)) 4) 8) (rotation at:(from))) (= (value Piece at:(site)) (who at:(to))))))))) (is In (to) (sites Occupied by:Mover container:""Board"" components:{""RiderOutline""})))) (then (remove (last To)))) (move Select (from (from) if:(= (state at:(from)) 1)) (to (difference (intersection (sites Around (from)) (difference (sites Empty) (difference (sites ""WaterRegion"") (sites (values Remembered ""Bridges""))))) (union {(sites Around (sites Occupied by:Enemy container:""Board"") includeSelf:True) (sites Around (sites Direction from:(sites Occupied by:Enemy container:""Board"" components:{""TinSoldier"" ""Bishop""}) Forward distance:1) Orthogonal includeSelf:True) (sites Around (sites Direction from:(sites Occupied by:Enemy container:""Board"" components:{""RegimentalOutline""}) Forward distance:1) Orthogonal includeSelf:True) (sites Around (sites Direction from:(sites Occupied by:Enemy container:""Board"" components:{""CannonOutline""}) Forward distance:1) Orthogonal includeSelf:True) (sites Around (sites Direction from:(sites Occupied by:Enemy container:""Board"" components:{""CannonOutline""}) Forward distance:2) Orthogonal includeSelf:True)}))) (then (and {(add (piece ""Triangle0"") (to (last To))) (set Rotation (to (last To)) {0} previous:False next:False) (set Value at:(last To) (id Mover))}))) (move Select (from (from) if:(= (state at:(from)) 1)) (to (difference (intersection (sites Around (from)) (difference (sites Empty) (difference (sites ""WaterRegion"") (sites (values Remembered ""Bridges""))))) (union {(sites Around (sites Occupied by:Enemy container:""Board"") includeSelf:True) (sites Around (sites Direction from:(sites Occupied by:Enemy container:""Board"" components:{""TinSoldier"" ""Bishop""}) Forward distance:1) Orthogonal includeSelf:True) (sites Around (sites Direction from:(sites Occupied by:Enemy container:""Board"" components:{""RegimentalOutline""}) Forward distance:1) Orthogonal includeSelf:True) (sites Around (sites Direction from:(sites Occupied by:Enemy container:""Board"" components:{""CannonOutline""}) Forward distance:1) Orthogonal includeSelf:True) (sites Around (sites Direction from:(sites Occupied by:Enemy container:""Board"" components:{""CannonOutline""}) Forward distance:2) Orthogonal includeSelf:True)}))) (then (and {(add (piece ""Triangle0"") (to (last To))) (set Rotation (to (last To)) {2} previous:False next:False) (set Value at:(last To) (id Mover))}))) (move Select (from (from) if:(= (state at:(from)) 1)) (to (difference (intersection (sites Around (from)) (difference (sites Empty) (difference (sites ""WaterRegion"") (sites (values Remembered ""Bridges""))))) (union {(sites Around (sites Occupied by:Enemy container:""Board"") includeSelf:True) (sites Around (sites Direction from:(sites Occupied by:Enemy container:""Board"" components:{""TinSoldier"" ""Bishop""}) Forward distance:1) Orthogonal includeSelf:True) (sites Around (sites Direction from:(sites Occupied by:Enemy container:""Board"" components:{""RegimentalOutline""}) Forward distance:1) Orthogonal includeSelf:True) (sites Around (sites Direction from:(sites Occupied by:Enemy container:""Board"" components:{""CannonOutline""}) Forward distance:1) Orthogonal includeSelf:True) (sites Around (sites Direction from:(sites Occupied by:Enemy container:""Board"" components:{""CannonOutline""}) Forward distance:2) Orthogonal includeSelf:True)}))) (then (and {(add (piece ""Triangle0"") (to (last To))) (set Rotation (to (last To)) {4} previous:False next:False) (set Value at:(last To) (id Mover))}))) (move Select (from (from) if:(= (state at:(from)) 1)) (to (difference (intersection (sites Around (from)) (difference (sites Empty) (difference (sites ""WaterRegion"") (sites (values Remembered ""Bridges""))))) (union {(sites Around (sites Occupied by:Enemy container:""Board"") includeSelf:True) (sites Around (sites Direction from:(sites Occupied by:Enemy container:""Board"" components:{""TinSoldier"" ""Bishop""}) Forward distance:1) Orthogonal includeSelf:True) (sites Around (sites Direction from:(sites Occupied by:Enemy container:""Board"" components:{""RegimentalOutline""}) Forward distance:1) Orthogonal includeSelf:True) (sites Around (sites Direction from:(sites Occupied by:Enemy container:""Board"" components:{""CannonOutline""}) Forward distance:1) Orthogonal includeSelf:True) (sites Around (sites Direction from:(sites Occupied by:Enemy container:""Board"" components:{""CannonOutline""}) Forward distance:2) Orthogonal includeSelf:True)}))) (then (and {(add (piece ""Triangle0"") (to (last To))) (set Rotation (to (last To)) {6} previous:False next:False) (set Value at:(last To) (id Mover))}))) (if (= (state at:(from)) 1) (move Set Rotation {0 2 4 6} previous:False next:False)) (move Select (from (from) if:(= (state at:(from)) 1)) (to (intersection (sites Occupied by:All container:""Board"" components:{""Triangle""}) (sites Around (from))) if:(and (= (value Piece at:(to)) (id Mover)) (not (is In (to) (union {(sites Around (sites Occupied by:Enemy container:""Board"") includeSelf:True) (sites Around (sites Direction from:(sites Occupied by:Enemy container:""Board"" components:{""TinSoldier"" ""Bishop""}) Forward distance:1) Orthogonal includeSelf:True) (sites Around (sites Direction from:(sites Occupied by:Enemy container:""Board"" components:{""RegimentalOutline""}) Forward distance:1) Orthogonal includeSelf:True) (sites Around (sites Direction from:(sites Occupied by:Enemy container:""Board"" components:{""CannonOutline""}) Forward distance:1) Orthogonal includeSelf:True) (sites Around (sites Direction from:(sites Occupied by:Enemy container:""Board"" components:{""CannonOutline""}) Forward distance:2) Orthogonal includeSelf:True)}))))) (then (remove (last To)))) (move Select (from (from) if:(= (state at:(from)) 1)) (to (intersection (sites Occupied by:All container:""Board"" components:{""CannonOutline"" ""RegimentalOutline""}) (sites Around (from) Orthogonal)) if:(> (state at:(to)) 0)) (then (remove (last To)))) (move Select (from (from) if:(= (state at:(from)) 1)) (to (intersection {(sites Occupied by:All container:""Board"" components:{""WagonOutline""}) (sites Around (from)) (union {(forEach (sites Occupied by:All container:""Board"" components:{""Triangle""}) if:(= (value Piece at:(site)) 0)) (forEach (sites Occupied by:P1 container:""Board"" components:{""CannonOutline"" ""RegimentalOutline"" ""WagonOutline""}) if:(= 0 (count Sites in:(intersection (sites Around (site) Orthogonal) (sites Occupied by:P1 container:""Board"" components:{""TinSoldier"" ""Bishop""}))))) (forEach (sites Occupied by:P2 container:""Board"" components:{""CannonOutline"" ""RegimentalOutline"" ""WagonOutline""}) if:(= 0 (count Sites in:(intersection (sites Around (site) Orthogonal) (sites Occupied by:P2 container:""Board"" components:{""TinSoldier"" ""Bishop""})))))})})) (then (remove (last To)))) (move Select (from (from) if:(= (state at:(from)) 1)) (to (intersection (sites (values Remembered ""Bridges"")) (sites Around (from))) if:(not (is In (to) (union {(sites Around (sites Occupied by:Enemy container:""Board"") includeSelf:True) (sites Around (sites Direction from:(sites Occupied by:Enemy container:""Board"" components:{""TinSoldier"" ""Bishop""}) Forward distance:1) Orthogonal includeSelf:True) (sites Around (sites Direction from:(sites Occupied by:Enemy container:""Board"" components:{""RegimentalOutline""}) Forward distance:1) Orthogonal includeSelf:True) (sites Around (sites Direction from:(sites Occupied by:Enemy container:""Board"" components:{""CannonOutline""}) Forward distance:1) Orthogonal includeSelf:True) (sites Around (sites Direction from:(sites Occupied by:Enemy container:""Board"" components:{""CannonOutline""}) Forward distance:2) Orthogonal includeSelf:True)})))) (then (forget Value ""Bridges"" (last To)))) (move Select (from (from) if:(= (state at:(from)) 1)) (to (intersection (sites (values Remembered ""Bridges"")) (sites Around (from)))) (then (if (= (id Mover) 1) (remember Value ""Fires1"" (last To)) (remember Value ""Fires2"" (last To)))))})) (piece ""Bishop"" Each (or {(move Slide (from (from) if:(= (state at:(from)) 3)) (between (range 1 8) if:(or {(is In (between) (difference (sites Empty) (difference (sites ""WaterRegion"") (sites (values Remembered ""Bridges""))))) (is In (between) (sites ""TownRegion""))})) (to if:False (apply if:(if (is Occupied (to)) (not (is In (to) (sites ""TownRegion""))) True))) (then (and (set Var ""FromArtillerySite"" (last From)) (set Var ""ToArtillerySite"" (last To))))) (move Step (from (from) if:(= (state at:(from)) 1)) (directions {Forward FR FL}) (to if:(is Enemy (who at:(to))) (apply (remove (to))))) (move Select (from (from) if:(= (state at:(from)) 1)) (to (intersection (forEach (sites Occupied by:Enemy container:""Board"" components:{""TinSoldier"" ""RiderOutline"" ""Bishop""}) if:(not (= (% (+ (rotation at:(site)) 4) 8) (rotation at:(from))))) (expand origin:(ahead (from)) Orthogonal)) if:(or (not (= 1 (count Sites in:(intersection (sites Direction from:(to) (directions Cell from:(ahead (from)) to:(from)) distance:1) (forEach (sites Occupied by:All container:""Board"" components:{""Triangle""}) if:(and (= (% (+ (rotation at:(site)) 4) 8) (rotation at:(from))) (= (value Piece at:(site)) (who at:(to))))))))) (is In (to) (sites Occupied by:Mover container:""Board"" components:{""RiderOutline""})))) (then (remove (last To)))) (move Select (from (from) if:(= (state at:(from)) 1)) (to (intersection (sites Occupied by:Enemy container:""Board"" components:{""TinSoldier"" ""RiderOutline"" ""Bishop""}) (expand origin:(ahead (from)) Orthogonal)) if:(= 1 (count Sites in:(intersection (sites Direction from:(from) (directions Cell from:(ahead (to)) to:(to)) distance:1) (forEach (sites Occupied by:All container:""Board"" components:{""Triangle""}) if:(and (= (% (+ (rotation at:(site)) 4) 8) (rotation at:(to))) (= (value Piece at:(site)) (who at:(from))))))))) (then (remove (last To)))) (move Select (from (from) if:(and (= (state at:(from)) 1) (is In (ahead (from)) (sites Occupied by:Mover container:""Board"" components:{""TinSoldier"" ""Bishop""})))) (to (intersection (expand origin:(ahead (from)) Orthogonal) (sites Occupied by:Enemy container:""Board"" components:{""TinSoldier"" ""RiderOutline"" ""Bishop""})) if:(or (not (= 1 (count Sites in:(intersection (sites Direction from:(to) (directions Cell from:(ahead (from)) to:(from)) distance:1) (forEach (sites Occupied by:All container:""Board"" components:{""Triangle""}) if:(and (= (% (+ (rotation at:(site)) 4) 8) (rotation at:(from))) (= (value Piece at:(site)) (who at:(to))))))))) (is In (to) (sites Occupied by:Mover container:""Board"" components:{""RiderOutline""})))) (then (remove (last To)))) (move Select (from (from) if:(= (state at:(from)) 1)) (to (difference (intersection (sites Around (from)) (difference (sites Empty) (difference (sites ""WaterRegion"") (sites (values Remembered ""Bridges""))))) (union {(sites Around (sites Occupied by:Enemy container:""Board"") includeSelf:True) (sites Around (sites Direction from:(sites Occupied by:Enemy container:""Board"" components:{""TinSoldier"" ""Bishop""}) Forward distance:1) Orthogonal includeSelf:True) (sites Around (sites Direction from:(sites Occupied by:Enemy container:""Board"" components:{""RegimentalOutline""}) Forward distance:1) Orthogonal includeSelf:True) (sites Around (sites Direction from:(sites Occupied by:Enemy container:""Board"" components:{""CannonOutline""}) Forward distance:1) Orthogonal includeSelf:True) (sites Around (sites Direction from:(sites Occupied by:Enemy container:""Board"" components:{""CannonOutline""}) Forward distance:2) Orthogonal includeSelf:True)}))) (then (and {(add (piece ""Triangle0"") (to (last To))) (set Rotation (to (last To)) {0} previous:False next:False) (set Value at:(last To) (id Mover))}))) (move Select (from (from) if:(= (state at:(from)) 1)) (to (difference (intersection (sites Around (from)) (difference (sites Empty) (difference (sites ""WaterRegion"") (sites (values Remembered ""Bridges""))))) (union {(sites Around (sites Occupied by:Enemy container:""Board"") includeSelf:True) (sites Around (sites Direction from:(sites Occupied by:Enemy container:""Board"" components:{""TinSoldier"" ""Bishop""}) Forward distance:1) Orthogonal includeSelf:True) (sites Around (sites Direction from:(sites Occupied by:Enemy container:""Board"" components:{""RegimentalOutline""}) Forward distance:1) Orthogonal includeSelf:True) (sites Around (sites Direction from:(sites Occupied by:Enemy container:""Board"" components:{""CannonOutline""}) Forward distance:1) Orthogonal includeSelf:True) (sites Around (sites Direction from:(sites Occupied by:Enemy container:""Board"" components:{""CannonOutline""}) Forward distance:2) Orthogonal includeSelf:True)}))) (then (and {(add (piece ""Triangle0"") (to (last To))) (set Rotation (to (last To)) {2} previous:False next:False) (set Value at:(last To) (id Mover))}))) (move Select (from (from) if:(= (state at:(from)) 1)) (to (difference (intersection (sites Around (from)) (difference (sites Empty) (difference (sites ""WaterRegion"") (sites (values Remembered ""Bridges""))))) (union {(sites Around (sites Occupied by:Enemy container:""Board"") includeSelf:True) (sites Around (sites Direction from:(sites Occupied by:Enemy container:""Board"" components:{""TinSoldier"" ""Bishop""}) Forward distance:1) Orthogonal includeSelf:True) (sites Around (sites Direction from:(sites Occupied by:Enemy container:""Board"" components:{""RegimentalOutline""}) Forward distance:1) Orthogonal includeSelf:True) (sites Around (sites Direction from:(sites Occupied by:Enemy container:""Board"" components:{""CannonOutline""}) Forward distance:1) Orthogonal includeSelf:True) (sites Around (sites Direction from:(sites Occupied by:Enemy container:""Board"" components:{""CannonOutline""}) Forward distance:2) Orthogonal includeSelf:True)}))) (then (and {(add (piece ""Triangle0"") (to (last To))) (set Rotation (to (last To)) {4} previous:False next:False) (set Value at:(last To) (id Mover))}))) (move Select (from (from) if:(= (state at:(from)) 1)) (to (difference (intersection (sites Around (from)) (difference (sites Empty) (difference (sites ""WaterRegion"") (sites (values Remembered ""Bridges""))))) (union {(sites Around (sites Occupied by:Enemy container:""Board"") includeSelf:True) (sites Around (sites Direction from:(sites Occupied by:Enemy container:""Board"" components:{""TinSoldier"" ""Bishop""}) Forward distance:1) Orthogonal includeSelf:True) (sites Around (sites Direction from:(sites Occupied by:Enemy container:""Board"" components:{""RegimentalOutline""}) Forward distance:1) Orthogonal includeSelf:True) (sites Around (sites Direction from:(sites Occupied by:Enemy container:""Board"" components:{""CannonOutline""}) Forward distance:1) Orthogonal includeSelf:True) (sites Around (sites Direction from:(sites Occupied by:Enemy container:""Board"" components:{""CannonOutline""}) Forward distance:2) Orthogonal includeSelf:True)}))) (then (and {(add (piece ""Triangle0"") (to (last To))) (set Rotation (to (last To)) {6} previous:False next:False) (set Value at:(last To) (id Mover))}))) (if (= (state at:(from)) 1) (move Set Rotation {0 2 4 6} previous:False next:False)) (move Select (from (from) if:(= (state at:(from)) 1)) (to (intersection (sites Occupied by:All container:""Board"" components:{""Triangle""}) (sites Around (from))) if:(and (= (value Piece at:(to)) (id Mover)) (not (is In (to) (union {(sites Around (sites Occupied by:Enemy container:""Board"") includeSelf:True) (sites Around (sites Direction from:(sites Occupied by:Enemy container:""Board"" components:{""TinSoldier"" ""Bishop""}) Forward distance:1) Orthogonal includeSelf:True) (sites Around (sites Direction from:(sites Occupied by:Enemy container:""Board"" components:{""RegimentalOutline""}) Forward distance:1) Orthogonal includeSelf:True) (sites Around (sites Direction from:(sites Occupied by:Enemy container:""Board"" components:{""CannonOutline""}) Forward distance:1) Orthogonal includeSelf:True) (sites Around (sites Direction from:(sites Occupied by:Enemy container:""Board"" components:{""CannonOutline""}) Forward distance:2) Orthogonal includeSelf:True)}))))) (then (remove (last To)))) (move Select (from (from) if:(= (state at:(from)) 1)) (to (intersection (sites Occupied by:All container:""Board"" components:{""CannonOutline"" ""RegimentalOutline""}) (sites Around (from) Orthogonal)) if:(> (state at:(to)) 0)) (then (remove (last To)))) (move Select (from (from) if:(= (state at:(from)) 1)) (to (intersection {(sites Occupied by:All container:""Board"" components:{""WagonOutline""}) (sites Around (from)) (union {(forEach (sites Occupied by:All container:""Board"" components:{""Triangle""}) if:(= (value Piece at:(site)) 0)) (forEach (sites Occupied by:P1 container:""Board"" components:{""CannonOutline"" ""RegimentalOutline"" ""WagonOutline""}) if:(= 0 (count Sites in:(intersection (sites Around (site) Orthogonal) (sites Occupied by:P1 container:""Board"" components:{""TinSoldier"" ""Bishop""}))))) (forEach (sites Occupied by:P2 container:""Board"" components:{""CannonOutline"" ""RegimentalOutline"" ""WagonOutline""}) if:(= 0 (count Sites in:(intersection (sites Around (site) Orthogonal) (sites Occupied by:P2 container:""Board"" components:{""TinSoldier"" ""Bishop""})))))})})) (then (remove (last To)))) (move Select (from (from) if:(= (state at:(from)) 1)) (to (intersection (sites (values Remembered ""Bridges"")) (sites Around (from))) if:(not (is In (to) (union {(sites Around (sites Occupied by:Enemy container:""Board"") includeSelf:True) (sites Around (sites Direction from:(sites Occupied by:Enemy container:""Board"" components:{""TinSoldier"" ""Bishop""}) Forward distance:1) Orthogonal includeSelf:True) (sites Around (sites Direction from:(sites Occupied by:Enemy container:""Board"" components:{""RegimentalOutline""}) Forward distance:1) Orthogonal includeSelf:True) (sites Around (sites Direction from:(sites Occupied by:Enemy container:""Board"" components:{""CannonOutline""}) Forward distance:1) Orthogonal includeSelf:True) (sites Around (sites Direction from:(sites Occupied by:Enemy container:""Board"" components:{""CannonOutline""}) Forward distance:2) Orthogonal includeSelf:True)})))) (then (forget Value ""Bridges"" (last To)))) (move Select (from (from) if:(= (state at:(from)) 1)) (to (intersection (sites (values Remembered ""Bridges"")) (sites Around (from)))) (then (if (= (id Mover) 1) (remember Value ""Fires1"" (last To)) (remember Value ""Fires2"" (last To))))) (if (= (state at:(from)) 1) (move Promote (from) (piece {""RiderOutline""}) Mover))}) maxState:100) (piece ""RiderOutline"" Each (or {(move Slide (from (from) if:(= (state at:(from)) 3)) (between (range 1 12) if:(or {(is In (between) (difference (sites Empty) (difference (sites ""WaterRegion"") (sites (values Remembered ""Bridges""))))) (is In (between) (sites ""TownRegion""))})) (to if:False (apply if:(if (is Occupied (to)) (not (is In (to) (sites ""TownRegion""))) True)))) (move Slide (from (from) if:(= (state at:(from)) 1)) (between (range 1 12) if:(or {(is In (between) (difference (sites Empty) (difference (sites ""WaterRegion"") (sites (values Remembered ""Bridges""))))) (is In (between) (sites ""TownRegion"")) (is In (between) (sites Occupied by:Enemy container:""Board"" components:{""TinSoldier"" ""Bishop""}))}) (apply (remove (between)))) (to if:(and (< 0 (count Sites in:(intersection (sites Around (to) Orthogonal) (sites Occupied by:Enemy container:""Board"")))) (is In (to) (sites Occupied by:Enemy container:""Board"" components:{""TinSoldier"" ""Bishop""}))) (apply if:(and (not (is In (to) (sites ""TownRegion""))) (is In (to) (sites Occupied by:Enemy container:""Board""))) (remove (to))))) (move Slide (from (from) if:(= (state at:(from)) 1)) (directions {Forward FR FL}) (between (range 1 12) if:(or {(is In (between) (difference (sites Empty) (difference (sites ""WaterRegion"") (sites (values Remembered ""Bridges""))))) (is In (between) (sites ""TownRegion"")) (is In (between) (sites Occupied by:Enemy container:""Board"" components:{""TinSoldier"" ""RiderOutline"" ""Bishop""}))}) (apply if:(is In (between) (sites Occupied by:Enemy container:""Board"" components:{""TinSoldier"" ""RiderOutline"" ""Bishop""})) (remove (between)))) (to if:(and (< 0 (count Sites in:(intersection (sites Around (to) Orthogonal) (sites Occupied by:Enemy container:""Board"")))) (is In (to) (sites Occupied by:Enemy container:""Board"" components:{""TinSoldier"" ""RiderOutline"" ""Bishop""}))) (apply if:(and (not (is In (to) (sites ""TownRegion""))) (is In (to) (sites Occupied by:Enemy container:""Board""))) (remove (to))))) (if (= (state at:(from)) 1) (move Set Rotation {0 2 4 6} previous:False next:False)) (move Select (from (from) if:(= (state at:(from)) 1)) (to (intersection (sites Occupied by:All container:""Board"" components:{""Triangle""}) (sites Around (from))) if:(and (= (value Piece at:(to)) (id Mover)) (not (is In (to) (union {(sites Around (sites Occupied by:Enemy container:""Board"") includeSelf:True) (sites Around (sites Direction from:(sites Occupied by:Enemy container:""Board"" components:{""TinSoldier"" ""Bishop""}) Forward distance:1) Orthogonal includeSelf:True) (sites Around (sites Direction from:(sites Occupied by:Enemy container:""Board"" components:{""RegimentalOutline""}) Forward distance:1) Orthogonal includeSelf:True) (sites Around (sites Direction from:(sites Occupied by:Enemy container:""Board"" components:{""CannonOutline""}) Forward distance:1) Orthogonal includeSelf:True) (sites Around (sites Direction from:(sites Occupied by:Enemy container:""Board"" components:{""CannonOutline""}) Forward distance:2) Orthogonal includeSelf:True)}))))) (then (remove (last To)))) (move Select (from (from) if:(= (state at:(from)) 1)) (to (intersection (sites Occupied by:All container:""Board"" components:{""CannonOutline"" ""RegimentalOutline""}) (sites Around (from) Orthogonal)) if:(> (state at:(to)) 0)) (then (remove (last To)))) (move Select (from (from) if:(= (state at:(from)) 1)) (to (intersection {(sites Occupied by:All container:""Board"" components:{""WagonOutline""}) (sites Around (from)) (union {(forEach (sites Occupied by:All container:""Board"" components:{""Triangle""}) if:(= (value Piece at:(site)) 0)) (forEach (sites Occupied by:P1 container:""Board"" components:{""CannonOutline"" ""RegimentalOutline"" ""WagonOutline""}) if:(= 0 (count Sites in:(intersection (sites Around (site) Orthogonal) (sites Occupied by:P1 container:""Board"" components:{""TinSoldier"" ""Bishop""}))))) (forEach (sites Occupied by:P2 container:""Board"" components:{""CannonOutline"" ""RegimentalOutline"" ""WagonOutline""}) if:(= 0 (count Sites in:(intersection (sites Around (site) Orthogonal) (sites Occupied by:P2 container:""Board"" components:{""TinSoldier"" ""Bishop""})))))})})) (then (remove (last To)))) (move Select (from (from) if:(= (state at:(from)) 1)) (to (intersection (sites (values Remembered ""Bridges"")) (sites Around (from))) if:(not (is In (to) (union {(sites Around (sites Occupied by:Enemy container:""Board"") includeSelf:True) (sites Around (sites Direction from:(sites Occupied by:Enemy container:""Board"" components:{""TinSoldier"" ""Bishop""}) Forward distance:1) Orthogonal includeSelf:True) (sites Around (sites Direction from:(sites Occupied by:Enemy container:""Board"" components:{""RegimentalOutline""}) Forward distance:1) Orthogonal includeSelf:True) (sites Around (sites Direction from:(sites Occupied by:Enemy container:""Board"" components:{""CannonOutline""}) Forward distance:1) Orthogonal includeSelf:True) (sites Around (sites Direction from:(sites Occupied by:Enemy container:""Board"" components:{""CannonOutline""}) Forward distance:2) Orthogonal includeSelf:True)})))) (then (forget Value ""Bridges"" (last To)))) (move Select (from (from) if:(= (state at:(from)) 1)) (to (intersection (sites (values Remembered ""Bridges"")) (sites Around (from)))) (then (if (= (id Mover) 1) (remember Value ""Fires1"" (last To)) (remember Value ""Fires2"" (last To))))) (if (= (state at:(from)) 1) (move Promote (from) (piece {""Bishop""}) Mover))})) (piece ""WagonOutline"" Each (or {(move Slide (from (from) if:(and {(= (state at:(from)) 3) (is In (from) (sites Around (var ""FromArtillerySite"") Orthogonal))})) Orthogonal (between (range 1 8) if:(is In (between) (difference (sites Empty) (difference (sites ""WaterRegion"") (sites (values Remembered ""Bridges"")))))) (to if:False (apply if:(is In (to) (sites Around (var ""ToArtillerySite"") Orthogonal)))) (then (and (set Var ""FromArtillerySite"" -1) (set Var ""ToArtillerySite"" -1)))) (move Select (from (from) if:(and {(= (state at:(from)) 1) (< 0 (value Piece at:(from))) (< 0 (count Sites in:(intersection (sites Around (from) Orthogonal) (sites Occupied by:Mover container:""Board"" components:{""TinSoldier"" ""Bishop""}))))})) (to (forEach (union (sites Around (from)) (sites Around (sites Group from:(forEach (sites Around (from)) if:(is In (site) (sites (values Remembered ""Bridges"")))) if:(is In (to) (sites (values Remembered ""Bridges"")))))) if:(and {(is In (site) (difference (sites ""WaterRegion"") (sites (values Remembered ""Bridges"")))) (not (is In (site) (union {(sites Around (sites Occupied by:Enemy container:""Board"") includeSelf:True) (sites Around (sites Direction from:(sites Occupied by:Enemy container:""Board"" components:{""TinSoldier"" ""Bishop""}) Forward distance:1) Orthogonal includeSelf:True) (sites Around (sites Direction from:(sites Occupied by:Enemy container:""Board"" components:{""RegimentalOutline""}) Forward distance:1) Orthogonal includeSelf:True) (sites Around (sites Direction from:(sites Occupied by:Enemy container:""Board"" components:{""CannonOutline""}) Forward distance:1) Orthogonal includeSelf:True) (sites Around (sites Direction from:(sites Occupied by:Enemy container:""Board"" components:{""CannonOutline""}) Forward distance:2) Orthogonal includeSelf:True)})))}))) (then (and {(remember Value ""Bridges"" (last To)) (set Value at:(last From) (- (value Piece at:(last From)) 1))}))) (move Select (from (from) if:(and {(= (state at:(from)) 1) (> 4 (value Piece at:(from))) (< 0 (count Sites in:(intersection (sites Around (from) Orthogonal) (sites Occupied by:Mover container:""Board"" components:{""TinSoldier"" ""Bishop""}))))})) (to (forEach (union (sites Around (from)) (sites Around (sites Group from:(forEach (sites Around (from)) if:(is In (site) (sites (values Remembered ""Bridges"")))) if:(is In (to) (sites (values Remembered ""Bridges"")))))) if:(and {(is In (site) (sites (values Remembered ""Bridges""))) (is In (site) (union (sites Empty) (union {(forEach (sites Occupied by:All container:""Board"" components:{""Triangle""}) if:(= (value Piece at:(site)) 0)) (forEach (sites Occupied by:P1 container:""Board"" components:{""CannonOutline"" ""RegimentalOutline"" ""WagonOutline""}) if:(= 0 (count Sites in:(intersection (sites Around (site) Orthogonal) (sites Occupied by:P1 container:""Board"" components:{""TinSoldier"" ""Bishop""}))))) (forEach (sites Occupied by:P2 container:""Board"" components:{""CannonOutline"" ""RegimentalOutline"" ""WagonOutline""}) if:(= 0 (count Sites in:(intersection (sites Around (site) Orthogonal) (sites Occupied by:P2 container:""Board"" components:{""TinSoldier"" ""Bishop""})))))})))}))) (then (and {(forget Value ""Bridges"" (last To)) (set Value at:(last From) (+ (value Piece at:(last From)) 1)) (remove (last To))}))) (move Select (from (from) if:(and {(= (state at:(from)) 1) (< 0 (value Piece at:(from))) (< 0 (count Sites in:(intersection (sites Around (from) Orthogonal) (sites Occupied by:Mover container:""Board"" components:{""TinSoldier"" ""Bishop""}))))})) (to (intersection (sites Around (from)) (difference (sites Empty) (sites ""WaterRegion"")))) (then (and {(add (piece ""Square0"") (to (last To))) (set Value at:(last From) (- (value Piece at:(last From)) 1))}))) (move Select (from (from) if:(and {(= (state at:(from)) 1) (> 4 (value Piece at:(from))) (< 0 (count Sites in:(intersection (sites Around (from) Orthogonal) (sites Occupied by:Mover container:""Board"" components:{""TinSoldier"" ""Bishop""}))))})) (to (intersection (sites Around (from)) (sites Occupied by:Neutral container:""Board"" components:{""Square""}))) (then (and {(set Value at:(last From) (+ (value Piece at:(last From)) 1)) (remove (last To))}))) (if (and (= (state at:(from)) 1) (< 0 (count Sites in:(intersection (sites Around (from) Orthogonal) (sites Occupied by:Mover container:""Board"" components:{""TinSoldier"" ""Bishop""}))))) (move Set Rotation {0 2 4 6} previous:False next:False))})) (regions ""WaterRegion"" (sites {343 344 345 346 347 348 349 350 301 302 303 254 205 156 107 58 9 10 59 255 256 399 448 497 498 547 596 645 694 695 744 793 842 841 840 839 838 837 836 835 834 833 882 883 884 933 934 885 886 935 887 891 940 989 1038 1037 1036 1035 1034 1033 1032 1031 1030 1029 1079 1128 1083 1132 1181 1230 1087 1136 1185 1088 1186 1234 1233 1232 1281 1282 1283 1332 1331 1330 1379 1380 1381 1430 1431 1479 1528 1529 1578 1577 1569 1570 1571 1572 1573 1574 1575 1576 1520 1471 1524 1475 1426 1377 1376 1375 1326 1277 1228 1229 1279 1328 1089 1090 1091 1140 1189 1190 1239 1240 1289 1338 1339 1388 1437 1486 1535 1584 1042 1043 1044 1045 1046 997 948 949 950 951 952 953 1002 1003 1004 955 1005 1006 1055 1007 1008 1340 1341 1342 1343 1344 1345 1346 1347 1348 1349 1350 1351 1300 1251 1202 1153 1104 1352 1401 1450 1499 1500 1501 1353 1354 1355 1306 1257 1208 1159 1110 1061 1012 963 1356 1357 1358 1359 1360 1361 1362 1411 1460 1509 1558 1557 1606 1607 1313 1314 1315 1266 1267 1268 1269 1270 1271 1272 1273 1217 1168 1119 1070 1118 1069 1020 971 922 921 872 823 774 775 776 777 778 779 780 781 782 783 734 733 732 731 730 729 725 681 682 683 676 627 578 579 580 581 582 583 584 585 586 587 537 488 529 480 431 382 333 284 235 186 137 88 39 87 38 185 40 41 42 43 44 45 46 47 96 145 92 141 190 239 288 337 386 435 484 533 236 237 286 335 384 383 334 285 240 241 290 339 388 387 430 528 527 526 525 476 427 574 573 572 571 570 619 668 667 666 665 664 663 614 613 612 661 710 759 808 857 906 611 610 561 609 608 607 512 426 377 376 327 278 277 276 275 274 273 272 271 270 269 268 267 266 265 264 263 262 261 260 259 258 257 463 414 365 316 604 653 555 506 457 408 359 310 215 166 117 116 228 179 130 81 32})) (regions ""MountainRegion"" (sites {395 444 493 542 591 784 701 702 703 752 751 750 565 516 913 864 865 914 915 866 1299 1250 1296 1247 1394 1443 1492 1397 1446 1495 1502 1551 1503})) (regions ""TownRegion"" (sites {449 450 451 452 400 351 352 562 513 563 564 515 1052 1101 1053 1054 1103 1264 1265 1216 1167 1166 1165 1164})) (regions ""ForestRegion"" (sites {499 500 501 790 791 1432 1433 1201 1200 1395 1396 415 416 220 221 184 183 825 826 1117 1116 1115})) (regions ""EntrenchmentRegion1"" (sites {939 988 1086 1135 1184 1180 1131 1082 1425 1474 1523 1527 1478 1429})) (regions ""EntrenchmentRegion2"" (sites {932 936 888 889 890 1081})) (regions ""EntrenchmentRegion3"" (sites {677 628 530 481 432 534 485 436 191 142 93 187 138 89})) (regions ""EntrenchmentRegion4"" (sites {726 727 728 680 684 535}))}) (rules (meta (passEnd NoEnd)) (start {(place ""Mountain0"" (sites ""MountainRegion"")) (place ""Town0"" (sites ""TownRegion"")) (place ""Forest0"" (sites ""ForestRegion"")) (place ""Triangle0"" (sites ""EntrenchmentRegion1"") rotation:2 value:0) (place ""Triangle0"" (sites ""EntrenchmentRegion2"") rotation:4 value:0) (place ""Triangle0"" (sites ""EntrenchmentRegion3"") rotation:6 value:0) (place ""Triangle0"" (sites ""EntrenchmentRegion4"") rotation:0 value:0) (place ""TinSoldier1"" 1617 count:76 state:3) (place ""TinSoldier2"" 1623 count:76 state:3) (place ""RiderOutline1"" 1618 count:20 state:3) (place ""RiderOutline2"" 1624 count:20 state:3) (place ""CannonOutline1"" 1619 count:10 state:3) (place ""CannonOutline2"" 1625 count:10 state:3) (place ""RegimentalOutline1"" 1620 count:5 state:3) (place ""RegimentalOutline2"" 1626 count:5 state:3) (place ""WagonOutline1"" 1621 count:10 state:3) (place ""WagonOutline2"" 1627 count:10 state:3) (place ""Square0"" 1622 count:20 state:3) (place ""Square0"" 1628 count:20 state:3) (set Hidden (sites Hand P1) to:P2) (set Hidden (sites Hand P2) to:P1) (set Hidden (sites P2 ""Home"") to:P1) (set Hidden (sites P1 ""Home"") to:P2)}) phases:{(phase ""Placement"" (play (or {(move (from (sites Occupied by:Mover container:(mover) components:{""TinSoldier"" ""RiderOutline"" ""CannonOutline"" ""RegimentalOutline"" ""WagonOutline""})) (to (intersection (sites Mover ""Home"") (difference (sites Empty) (sites ""WaterRegion"")))) (then (set Rotation (to (last To)) 0 previous:False next:False))) (move (from (sites Occupied by:Mover container:(mover) components:{""TinSoldier"" ""RiderOutline"" ""CannonOutline"" ""RegimentalOutline"" ""WagonOutline""})) (to (intersection (sites Mover ""Home"") (difference (sites Empty) (sites ""WaterRegion"")))) (then (set Rotation (to (last To)) 2 previous:False next:False))) (move (from (sites Occupied by:Mover container:(mover) components:{""TinSoldier"" ""RiderOutline"" ""CannonOutline"" ""RegimentalOutline"" ""WagonOutline""})) (to (intersection (sites Mover ""Home"") (difference (sites Empty) (sites ""WaterRegion"")))) (then (set Rotation (to (last To)) 4 previous:False next:False))) (move (from (sites Occupied by:Mover container:(mover) components:{""TinSoldier"" ""RiderOutline"" ""CannonOutline"" ""RegimentalOutline"" ""WagonOutline""})) (to (intersection (sites Mover ""Home"") (difference (sites Empty) (sites ""WaterRegion"")))) (then (set Rotation (to (last To)) 6 previous:False next:False)))})) (nextPhase (= 20 (count in:(sites Hand P2))) ""BridgePlacement"")) (phase ""BridgePlacement"" (play (or (move (from (sites Occupied by:Neutral container:(mover) components:{""Square""})) (to (intersection {(sites Mover ""Home"") (sites ""WaterRegion"") (sites Empty)})) (then (if (all Sites (sites Hand P2) if:(= 0 (count Cell at:(site)))) (and {(set Hidden (sites Board) False to:All) (set Var ""FromArtillerySite"" -1) (set Var ""ToArtillerySite"" -1) (forEach Site (sites Occupied by:All container:""Board"" components:{""Square""}) (and (remember Value ""Bridges"" (site)) (remove (site))))}) (pass)))) (move Select (from (sites Occupied by:Neutral container:(mover) components:{""Square""})) (to (intersection (sites Mover ""Home"") (sites Occupied by:Mover container:""Board"" components:{""WagonOutline""})) if:(< (value Piece at:(to)) 4)) (then (do (and (set Value at:(last To) (+ (value Piece at:(last To)) 1)) (set Count at:(last From) (- (count at:(last From)) 1))) next:(if (all Sites (sites Hand P2) if:(= 0 (count Cell at:(site)))) (and {(set Hidden (sites Board) False to:All) (set Var ""FromArtillerySite"" -1) (set Var ""ToArtillerySite"" -1) (forEach Site (sites Occupied by:All container:""Board"" components:{""Square""}) (and (remember Value ""Bridges"" (site)) (remove (site))))}) (pass))))))) (nextPhase (all Sites (sites Hand P2) if:(= 0 (count Cell at:(site)))) ""FireSpread"")) (phase ""FireSpread"" (play (if (= (id Mover) 1) (or (move Select (from (sites (values Remembered ""Fires1""))) (to (from)) (then (and {(forEach Site (intersection (sites Around (last From)) (sites (values Remembered ""Bridges""))) (remember Value ""FireTemp"" (site))) (moveAgain)}))) (move Pass (then (and {(forEach Site (sites (values Remembered ""Fires1"")) (and (forget Value ""Fires1"" (site)) (forget Value ""Bridges"" (site)))) (forEach Site (sites ""FireTemp"") (and (remember Value ""Fires1"" (site)) (forget Value ""FireTemp"" (site)))) (moveAgain)})))) (or (move Select (from (sites (values Remembered ""Fires2""))) (to (from)) (then (and {(forEach Site (intersection (sites Around (last From)) (sites (values Remembered ""Bridges""))) (remember Value ""FireTemp"" (site))) (moveAgain)}))) (move Pass (then (and {(forEach Site (sites (values Remembered ""Fires2"")) (and (forget Value ""Fires2"" (site)) (forget Value ""Bridges"" (site)))) (forEach Site (sites ""FireTemp"") (and (remember Value ""Fires2"" (site)) (forget Value ""FireTemp"" (site)))) (moveAgain)})))))) (nextPhase (was Pass) ""Movement"")) (phase ""Movement"" (play (or (forEach Piece (then (and {(set State at:(last To) 0) (moveAgain)}))) (move Pass (then (and {(forEach Site (sites Occupied by:Mover container:""Board"") (if (= (state at:(site)) 3) (set State at:(site) 1))) (and (forEach Site (sites Occupied by:All container:""Board"" components:{""Triangle""}) (if (and (not (is In (site) (union {(sites Around (sites Occupied by:Mover container:""Board"") includeSelf:True) (sites Around (sites Direction from:(sites Occupied by:Mover container:""Board"" components:{""TinSoldier"" ""Bishop""}) Forward distance:1) Orthogonal includeSelf:True) (sites Around (sites Direction from:(sites Occupied by:Mover container:""Board"" components:{""RegimentalOutline""}) Forward distance:1) Orthogonal includeSelf:True) (sites Around (sites Direction from:(sites Occupied by:Mover container:""Board"" components:{""CannonOutline""}) Forward distance:1) Orthogonal includeSelf:True) (sites Around (sites Direction from:(sites Occupied by:Mover container:""Board"" components:{""CannonOutline""}) Forward distance:2) Orthogonal includeSelf:True)}))) (= (value Piece at:(site)) (id Mover))) (set Value at:(site) 0))) (forEach Site (sites Occupied by:All container:""Board"" components:{""Triangle""}) (if (and (is In (site) (union {(sites Around (sites Occupied by:Mover container:""Board"") includeSelf:True) (sites Around (sites Direction from:(sites Occupied by:Mover container:""Board"" components:{""TinSoldier"" ""Bishop""}) Forward distance:1) Orthogonal includeSelf:True) (sites Around (sites Direction from:(sites Occupied by:Mover container:""Board"" components:{""RegimentalOutline""}) Forward distance:1) Orthogonal includeSelf:True) (sites Around (sites Direction from:(sites Occupied by:Mover container:""Board"" components:{""CannonOutline""}) Forward distance:1) Orthogonal includeSelf:True) (sites Around (sites Direction from:(sites Occupied by:Mover container:""Board"" components:{""CannonOutline""}) Forward distance:2) Orthogonal includeSelf:True)})) (= (value Piece at:(site)) 0)) (set Value at:(site) (id Mover))))) (moveAgain)}))))) (nextPhase (was Pass) ""Actions"")) (phase ""Actions"" (play (or (forEach Piece (then (and {(set State at:(last To) 0) (set State at:(last From) 0) (moveAgain)}))) (move Pass (then (and {(forEach Site (sites Occupied by:Mover container:""Board"") (set State at:(site) 3)) (and (forEach Site (sites Occupied by:All container:""Board"" components:{""Triangle""}) (if (and (not (is In (site) (union {(sites Around (sites Occupied by:Mover container:""Board"") includeSelf:True) (sites Around (sites Direction from:(sites Occupied by:Mover container:""Board"" components:{""TinSoldier"" ""Bishop""}) Forward distance:1) Orthogonal includeSelf:True) (sites Around (sites Direction from:(sites Occupied by:Mover container:""Board"" components:{""RegimentalOutline""}) Forward distance:1) Orthogonal includeSelf:True) (sites Around (sites Direction from:(sites Occupied by:Mover container:""Board"" components:{""CannonOutline""}) Forward distance:1) Orthogonal includeSelf:True) (sites Around (sites Direction from:(sites Occupied by:Mover container:""Board"" components:{""CannonOutline""}) Forward distance:2) Orthogonal includeSelf:True)}))) (= (value Piece at:(site)) (id Mover))) (set Value at:(site) 0))) (forEach Site (sites Occupied by:All container:""Board"" components:{""Triangle""}) (if (and (is In (site) (union {(sites Around (sites Occupied by:Mover container:""Board"") includeSelf:True) (sites Around (sites Direction from:(sites Occupied by:Mover container:""Board"" components:{""TinSoldier"" ""Bishop""}) Forward distance:1) Orthogonal includeSelf:True) (sites Around (sites Direction from:(sites Occupied by:Mover container:""Board"" components:{""RegimentalOutline""}) Forward distance:1) Orthogonal includeSelf:True) (sites Around (sites Direction from:(sites Occupied by:Mover container:""Board"" components:{""CannonOutline""}) Forward distance:1) Orthogonal includeSelf:True) (sites Around (sites Direction from:(sites Occupied by:Mover container:""Board"" components:{""CannonOutline""}) Forward distance:2) Orthogonal includeSelf:True)})) (= (value Piece at:(site)) 0)) (set Value at:(site) (id Mover))))) (if (= (id Mover) 1) (forEach Site (sites (values Remembered ""Fires1"")) (remove (site))) (forEach Site (sites (values Remembered ""Fires2"")) (remove (site))))}))))) (nextPhase (was Pass) ""FireSpread""))} (end {(if (is In 1323 (sites Occupied by:P2 container:""Board"")) (result P2 Win)) (if (is In 293 (sites Occupied by:P1 container:""Board"")) (result P1 Win))})))","###Description -Modern translation of the original rules (German) - -###Ludii -(game ""Kriegsspiel"" (players 2) (equipment {(board (rectangle 33 49)) (hand Each size:6) (piece ""Mountain"" Neutral) (piece ""Town"" Neutral) (piece ""Forest"" Neutral) (piece ""Triangle"" Neutral) (piece ""Square"" Neutral) (regions ""HomeP1"" P1 (expand (sites Left) steps:15)) (regions ""HomeP2"" P2 (expand (sites Right) steps:15)) (piece ""CannonOutline"" Each (or {(move Slide (from (from) if:(and {(= (state at:(from)) 3) (is In (from) (sites Around (var ""FromArtillerySite"") Orthogonal))})) Orthogonal (between (range 1 6) if:(is In (between) (difference (sites Empty) (difference (sites ""WaterRegion"") (sites (values Remembered ""Bridges"")))))) (to if:False (apply if:(is In (to) (sites Around (var ""ToArtillerySite"") Orthogonal)))) (then (and (set Var ""FromArtillerySite"" -1) (set Var ""ToArtillerySite"" -1)))) (move Select (from (from) if:(and {(= (state at:(from)) 1) (< 0 (count Sites in:(intersection (sites Around (from) Orthogonal) (sites Occupied by:Mover container:""Board"" components:{""TinSoldier"" ""Bishop""}))))})) (to (intersection (union (sites Occupied by:Enemy container:""Board"" components:{""TinSoldier"" ""RiderOutline"" ""Bishop"" ""CannonOutline"" ""RegimentalOutline"" ""WagonOutline""}) (sites Occupied by:All container:""Board"" components:{""Triangle""})) (union (expand origin:(ahead (from)) Orthogonal) (expand origin:(ahead (from) steps:2) Orthogonal))) if:(or (not (= 1 (count Sites in:(intersection (sites Direction from:(to) (directions Cell from:(ahead (from)) to:(from)) distance:1) (forEach (sites Occupied by:All container:""Board"" components:{""Triangle""}) if:(and (= (% (+ (rotation at:(site)) 4) 8) (rotation at:(from))) (= (value Piece at:(site)) (who at:(to))))))))) (is In (to) (sites Occupied by:Mover container:""Board"" components:{""RiderOutline""})))) (then (remove (last To)))) (move Select (from (from) if:(and {(= (state at:(from)) 1) (< 0 (count Sites in:(intersection (sites Around (from) Orthogonal) (sites Occupied by:Mover container:""Board"" components:{""TinSoldier"" ""Bishop""}))))})) (to (intersection (sites (values Remembered ""Bridges"")) (union (expand origin:(ahead (from)) Orthogonal) (expand origin:(ahead (from) steps:2) Orthogonal))) if:(not (= 1 (count Sites in:(intersection (sites Direction from:(to) (directions Cell from:(ahead (from)) to:(from)) distance:1) (forEach (sites Occupied by:All container:""Board"" components:{""Triangle""}) if:(and (= (% (+ (rotation at:(site)) 4) 8) (rotation at:(from))) (= (value Piece at:(site)) (who at:(to)))))))))) (then (forget Value ""Bridges"" (last To)))) (if (and (= (state at:(from)) 1) (< 0 (count Sites in:(intersection (sites Around (from) Orthogonal) (sites Occupied by:Mover container:""Board"" components:{""TinSoldier"" ""Bishop""}))))) (move Set Rotation {0 2 4 6} previous:False next:False))}) maxState:100 maxValue:10000) (piece ""RegimentalOutline"" Each (or {(move Slide (from (from) if:(and {(= (state at:(from)) 3) (is In (from) (sites Around (var ""FromArtillerySite"") Orthogonal))})) Orthogonal (between (range 1 8) if:(is In (between) (difference (sites Empty) (difference (sites ""WaterRegion"") (sites (values Remembered ""Bridges"")))))) (to if:False (apply if:(is In (to) (sites Around (var ""ToArtillerySite"") Orthogonal)))) (then (and (set Var ""FromArtillerySite"" -1) (set Var ""ToArtillerySite"" -1)))) (move Select (from (from) if:(and {(= (state at:(from)) 1) (< 0 (count Sites in:(intersection (sites Around (from) Orthogonal) (sites Occupied by:Mover container:""Board"" components:{""TinSoldier"" ""Bishop""}))))})) (to (intersection (union (sites Occupied by:Enemy container:""Board"" components:{""TinSoldier"" ""RiderOutline"" ""Bishop"" ""RegimentalOutline"" ""WagonOutline""}) (sites Occupied by:All container:""Board"" components:{""Triangle""})) (expand origin:(ahead (from)) Orthogonal)) if:(or (not (= 1 (count Sites in:(intersection (sites Direction from:(to) (directions Cell from:(ahead (from)) to:(from)) distance:1) (forEach (sites Occupied by:All container:""Board"" components:{""Triangle""}) if:(and (= (% (+ (rotation at:(site)) 4) 8) (rotation at:(from))) (= (value Piece at:(site)) (who at:(to))))))))) (is In (to) (sites Occupied by:Mover container:""Board"" components:{""RiderOutline""})))) (then (remove (last To)))) (move Select (from (from) if:(and {(= (state at:(from)) 1) (< 0 (count Sites in:(intersection (sites Around (from) Orthogonal) (sites Occupied by:Mover container:""Board"" components:{""TinSoldier"" ""Bishop""}))))})) (to (intersection (union (sites Occupied by:Enemy container:""Board"" components:{""TinSoldier"" ""RiderOutline"" ""Bishop"" ""CannonOutline"" ""RegimentalOutline"" ""WagonOutline""}) (sites Occupied by:All container:""Board"" components:{""Triangle""})) (expand origin:(ahead (from)) Orthogonal)) if:(and (or (not (= 1 (count Sites in:(intersection (sites Direction from:(to) (directions Cell from:(ahead (from)) to:(from)) distance:1) (forEach (sites Occupied by:All container:""Board"" components:{""Triangle""}) if:(and (= (% (+ (rotation at:(site)) 4) 8) (rotation at:(from))) (= (value Piece at:(site)) (who at:(to))))))))) (is In (to) (sites Occupied by:Mover container:""Board"" components:{""RiderOutline""}))) (= 1 (count Sites in:(intersection (sites Direction from:(from) (directions Cell from:(ahead (to)) to:(to)) distance:1) (forEach (sites Occupied by:All container:""Board"" components:{""Triangle""}) if:(and (= (% (+ (rotation at:(site)) 4) 8) (rotation at:(to))) (= (value Piece at:(site)) (who at:(from)))))))))) (then (remove (last To)))) (move Select (from (from) if:(and {(= (state at:(from)) 1) (< 0 (count Sites in:(intersection (sites Around (from) Orthogonal) (sites Occupied by:Mover container:""Board"" components:{""TinSoldier"" ""Bishop""}))))})) (to (intersection (sites (values Remembered ""Bridges"")) (expand origin:(ahead (from)) Orthogonal)) if:(not (= 1 (count Sites in:(intersection (sites Direction from:(to) (directions Cell from:(ahead (from)) to:(from)) distance:1) (forEach (sites Occupied by:All container:""Board"" components:{""Triangle""}) if:(and (= (% (+ (rotation at:(site)) 4) 8) (rotation at:(from))) (= (value Piece at:(site)) (who at:(to)))))))))) (then (forget Value ""Bridges"" (last To)))) (if (and (= (state at:(from)) 1) (< 0 (count Sites in:(intersection (sites Around (from) Orthogonal) (sites Occupied by:Mover container:""Board"" components:{""TinSoldier"" ""Bishop""}))))) (move Set Rotation {0 2 4 6} previous:False next:False))})) (piece ""TinSoldier"" Each (or {(move Slide (from (from) if:(= (state at:(from)) 3)) (between (range 1 8) if:(or {(is In (between) (difference (sites Empty) (difference (sites ""WaterRegion"") (sites (values Remembered ""Bridges""))))) (is In (between) (sites ""TownRegion""))})) (to if:False (apply if:(if (is Occupied (to)) (not (is In (to) (sites ""TownRegion""))) True))) (then (and (set Var ""FromArtillerySite"" (last From)) (set Var ""ToArtillerySite"" (last To))))) (move Step (from (from) if:(= (state at:(from)) 1)) (directions {Forward FR FL}) (to if:(is Enemy (who at:(to))) (apply (remove (to))))) (move Select (from (from) if:(= (state at:(from)) 1)) (to (intersection (forEach (sites Occupied by:Enemy container:""Board"" components:{""TinSoldier"" ""RiderOutline"" ""Bishop""}) if:(not (= (% (+ (rotation at:(site)) 4) 8) (rotation at:(from))))) (expand origin:(ahead (from)) Orthogonal)) if:(or (not (= 1 (count Sites in:(intersection (sites Direction from:(to) (directions Cell from:(ahead (from)) to:(from)) distance:1) (forEach (sites Occupied by:All container:""Board"" components:{""Triangle""}) if:(and (= (% (+ (rotation at:(site)) 4) 8) (rotation at:(from))) (= (value Piece at:(site)) (who at:(to))))))))) (is In (to) (sites Occupied by:Mover container:""Board"" components:{""RiderOutline""})))) (then (remove (last To)))) (move Select (from (from) if:(= (state at:(from)) 1)) (to (intersection (sites Occupied by:Enemy container:""Board"" components:{""TinSoldier"" ""RiderOutline"" ""Bishop""}) (expand origin:(ahead (from)) Orthogonal)) if:(= 1 (count Sites in:(intersection (sites Direction from:(from) (directions Cell from:(ahead (to)) to:(to)) distance:1) (forEach (sites Occupied by:All container:""Board"" components:{""Triangle""}) if:(and (= (% (+ (rotation at:(site)) 4) 8) (rotation at:(to))) (= (value Piece at:(site)) (who at:(from))))))))) (then (remove (last To)))) (move Select (from (from) if:(and (= (state at:(from)) 1) (is In (ahead (from)) (sites Occupied by:Mover container:""Board"" components:{""TinSoldier"" ""Bishop""})))) (to (intersection (expand origin:(ahead (from)) Orthogonal) (sites Occupied by:Enemy container:""Board"" components:{""TinSoldier"" ""RiderOutline"" ""Bishop""})) if:(or (not (= 1 (count Sites in:(intersection (sites Direction from:(to) (directions Cell from:(ahead (from)) to:(from)) distance:1) (forEach (sites Occupied by:All container:""Board"" components:{""Triangle""}) if:(and (= (% (+ (rotation at:(site)) 4) 8) (rotation at:(from))) (= (value Piece at:(site)) (who at:(to))))))))) (is In (to) (sites Occupied by:Mover container:""Board"" components:{""RiderOutline""})))) (then (remove (last To)))) (move Select (from (from) if:(= (state at:(from)) 1)) (to (difference (intersection (sites Around (from)) (difference (sites Empty) (difference (sites ""WaterRegion"") (sites (values Remembered ""Bridges""))))) (union {(sites Around (sites Occupied by:Enemy container:""Board"") includeSelf:True) (sites Around (sites Direction from:(sites Occupied by:Enemy container:""Board"" components:{""TinSoldier"" ""Bishop""}) Forward distance:1) Orthogonal includeSelf:True) (sites Around (sites Direction from:(sites Occupied by:Enemy container:""Board"" components:{""RegimentalOutline""}) Forward distance:1) Orthogonal includeSelf:True) (sites Around (sites Direction from:(sites Occupied by:Enemy container:""Board"" components:{""CannonOutline""}) Forward distance:1) Orthogonal includeSelf:True) (sites Around (sites Direction from:(sites Occupied by:Enemy container:""Board"" components:{""CannonOutline""}) Forward distance:2) Orthogonal includeSelf:True)}))) (then (and {(add (piece ""Triangle0"") (to (last To))) (set Rotation (to (last To)) {0} previous:False next:False) (set Value at:(last To) (id Mover))}))) (move Select (from (from) if:(= (state at:(from)) 1)) (to (difference (intersection (sites Around (from)) (difference (sites Empty) (difference (sites ""WaterRegion"") (sites (values Remembered ""Bridges""))))) (union {(sites Around (sites Occupied by:Enemy container:""Board"") includeSelf:True) (sites Around (sites Direction from:(sites Occupied by:Enemy container:""Board"" components:{""TinSoldier"" ""Bishop""}) Forward distance:1) Orthogonal includeSelf:True) (sites Around (sites Direction from:(sites Occupied by:Enemy container:""Board"" components:{""RegimentalOutline""}) Forward distance:1) Orthogonal includeSelf:True) (sites Around (sites Direction from:(sites Occupied by:Enemy container:""Board"" components:{""CannonOutline""}) Forward distance:1) Orthogonal includeSelf:True) (sites Around (sites Direction from:(sites Occupied by:Enemy container:""Board"" components:{""CannonOutline""}) Forward distance:2) Orthogonal includeSelf:True)}))) (then (and {(add (piece ""Triangle0"") (to (last To))) (set Rotation (to (last To)) {2} previous:False next:False) (set Value at:(last To) (id Mover))}))) (move Select (from (from) if:(= (state at:(from)) 1)) (to (difference (intersection (sites Around (from)) (difference (sites Empty) (difference (sites ""WaterRegion"") (sites (values Remembered ""Bridges""))))) (union {(sites Around (sites Occupied by:Enemy container:""Board"") includeSelf:True) (sites Around (sites Direction from:(sites Occupied by:Enemy container:""Board"" components:{""TinSoldier"" ""Bishop""}) Forward distance:1) Orthogonal includeSelf:True) (sites Around (sites Direction from:(sites Occupied by:Enemy container:""Board"" components:{""RegimentalOutline""}) Forward distance:1) Orthogonal includeSelf:True) (sites Around (sites Direction from:(sites Occupied by:Enemy container:""Board"" components:{""CannonOutline""}) Forward distance:1) Orthogonal includeSelf:True) (sites Around (sites Direction from:(sites Occupied by:Enemy container:""Board"" components:{""CannonOutline""}) Forward distance:2) Orthogonal includeSelf:True)}))) (then (and {(add (piece ""Triangle0"") (to (last To))) (set Rotation (to (last To)) {4} previous:False next:False) (set Value at:(last To) (id Mover))}))) (move Select (from (from) if:(= (state at:(from)) 1)) (to (difference (intersection (sites Around (from)) (difference (sites Empty) (difference (sites ""WaterRegion"") (sites (values Remembered ""Bridges""))))) (union {(sites Around (sites Occupied by:Enemy container:""Board"") includeSelf:True) (sites Around (sites Direction from:(sites Occupied by:Enemy container:""Board"" components:{""TinSoldier"" ""Bishop""}) Forward distance:1) Orthogonal includeSelf:True) (sites Around (sites Direction from:(sites Occupied by:Enemy container:""Board"" components:{""RegimentalOutline""}) Forward distance:1) Orthogonal includeSelf:True) (sites Around (sites Direction from:(sites Occupied by:Enemy container:""Board"" components:{""CannonOutline""}) Forward distance:1) Orthogonal includeSelf:True) (sites Around (sites Direction from:(sites Occupied by:Enemy container:""Board"" components:{""CannonOutline""}) Forward distance:2) Orthogonal includeSelf:True)}))) (then (and {(add (piece ""Triangle0"") (to (last To))) (set Rotation (to (last To)) {6} previous:False next:False) (set Value at:(last To) (id Mover))}))) (if (= (state at:(from)) 1) (move Set Rotation {0 2 4 6} previous:False next:False)) (move Select (from (from) if:(= (state at:(from)) 1)) (to (intersection (sites Occupied by:All container:""Board"" components:{""Triangle""}) (sites Around (from))) if:(and (= (value Piece at:(to)) (id Mover)) (not (is In (to) (union {(sites Around (sites Occupied by:Enemy container:""Board"") includeSelf:True) (sites Around (sites Direction from:(sites Occupied by:Enemy container:""Board"" components:{""TinSoldier"" ""Bishop""}) Forward distance:1) Orthogonal includeSelf:True) (sites Around (sites Direction from:(sites Occupied by:Enemy container:""Board"" components:{""RegimentalOutline""}) Forward distance:1) Orthogonal includeSelf:True) (sites Around (sites Direction from:(sites Occupied by:Enemy container:""Board"" components:{""CannonOutline""}) Forward distance:1) Orthogonal includeSelf:True) (sites Around (sites Direction from:(sites Occupied by:Enemy container:""Board"" components:{""CannonOutline""}) Forward distance:2) Orthogonal includeSelf:True)}))))) (then (remove (last To)))) (move Select (from (from) if:(= (state at:(from)) 1)) (to (intersection (sites Occupied by:All container:""Board"" components:{""CannonOutline"" ""RegimentalOutline""}) (sites Around (from) Orthogonal)) if:(> (state at:(to)) 0)) (then (remove (last To)))) (move Select (from (from) if:(= (state at:(from)) 1)) (to (intersection {(sites Occupied by:All container:""Board"" components:{""WagonOutline""}) (sites Around (from)) (union {(forEach (sites Occupied by:All container:""Board"" components:{""Triangle""}) if:(= (value Piece at:(site)) 0)) (forEach (sites Occupied by:P1 container:""Board"" components:{""CannonOutline"" ""RegimentalOutline"" ""WagonOutline""}) if:(= 0 (count Sites in:(intersection (sites Around (site) Orthogonal) (sites Occupied by:P1 container:""Board"" components:{""TinSoldier"" ""Bishop""}))))) (forEach (sites Occupied by:P2 container:""Board"" components:{""CannonOutline"" ""RegimentalOutline"" ""WagonOutline""}) if:(= 0 (count Sites in:(intersection (sites Around (site) Orthogonal) (sites Occupied by:P2 container:""Board"" components:{""TinSoldier"" ""Bishop""})))))})})) (then (remove (last To)))) (move Select (from (from) if:(= (state at:(from)) 1)) (to (intersection (sites (values Remembered ""Bridges"")) (sites Around (from))) if:(not (is In (to) (union {(sites Around (sites Occupied by:Enemy container:""Board"") includeSelf:True) (sites Around (sites Direction from:(sites Occupied by:Enemy container:""Board"" components:{""TinSoldier"" ""Bishop""}) Forward distance:1) Orthogonal includeSelf:True) (sites Around (sites Direction from:(sites Occupied by:Enemy container:""Board"" components:{""RegimentalOutline""}) Forward distance:1) Orthogonal includeSelf:True) (sites Around (sites Direction from:(sites Occupied by:Enemy container:""Board"" components:{""CannonOutline""}) Forward distance:1) Orthogonal includeSelf:True) (sites Around (sites Direction from:(sites Occupied by:Enemy container:""Board"" components:{""CannonOutline""}) Forward distance:2) Orthogonal includeSelf:True)})))) (then (forget Value ""Bridges"" (last To)))) (move Select (from (from) if:(= (state at:(from)) 1)) (to (intersection (sites (values Remembered ""Bridges"")) (sites Around (from)))) (then (if (= (id Mover) 1) (remember Value ""Fires1"" (last To)) (remember Value ""Fires2"" (last To)))))})) (piece ""Bishop"" Each (or {(move Slide (from (from) if:(= (state at:(from)) 3)) (between (range 1 8) if:(or {(is In (between) (difference (sites Empty) (difference (sites ""WaterRegion"") (sites (values Remembered ""Bridges""))))) (is In (between) (sites ""TownRegion""))})) (to if:False (apply if:(if (is Occupied (to)) (not (is In (to) (sites ""TownRegion""))) True))) (then (and (set Var ""FromArtillerySite"" (last From)) (set Var ""ToArtillerySite"" (last To))))) (move Step (from (from) if:(= (state at:(from)) 1)) (directions {Forward FR FL}) (to if:(is Enemy (who at:(to))) (apply (remove (to))))) (move Select (from (from) if:(= (state at:(from)) 1)) (to (intersection (forEach (sites Occupied by:Enemy container:""Board"" components:{""TinSoldier"" ""RiderOutline"" ""Bishop""}) if:(not (= (% (+ (rotation at:(site)) 4) 8) (rotation at:(from))))) (expand origin:(ahead (from)) Orthogonal)) if:(or (not (= 1 (count Sites in:(intersection (sites Direction from:(to) (directions Cell from:(ahead (from)) to:(from)) distance:1) (forEach (sites Occupied by:All container:""Board"" components:{""Triangle""}) if:(and (= (% (+ (rotation at:(site)) 4) 8) (rotation at:(from))) (= (value Piece at:(site)) (who at:(to))))))))) (is In (to) (sites Occupied by:Mover container:""Board"" components:{""RiderOutline""})))) (then (remove (last To)))) (move Select (from (from) if:(= (state at:(from)) 1)) (to (intersection (sites Occupied by:Enemy container:""Board"" components:{""TinSoldier"" ""RiderOutline"" ""Bishop""}) (expand origin:(ahead (from)) Orthogonal)) if:(= 1 (count Sites in:(intersection (sites Direction from:(from) (directions Cell from:(ahead (to)) to:(to)) distance:1) (forEach (sites Occupied by:All container:""Board"" components:{""Triangle""}) if:(and (= (% (+ (rotation at:(site)) 4) 8) (rotation at:(to))) (= (value Piece at:(site)) (who at:(from))))))))) (then (remove (last To)))) (move Select (from (from) if:(and (= (state at:(from)) 1) (is In (ahead (from)) (sites Occupied by:Mover container:""Board"" components:{""TinSoldier"" ""Bishop""})))) (to (intersection (expand origin:(ahead (from)) Orthogonal) (sites Occupied by:Enemy container:""Board"" components:{""TinSoldier"" ""RiderOutline"" ""Bishop""})) if:(or (not (= 1 (count Sites in:(intersection (sites Direction from:(to) (directions Cell from:(ahead (from)) to:(from)) distance:1) (forEach (sites Occupied by:All container:""Board"" components:{""Triangle""}) if:(and (= (% (+ (rotation at:(site)) 4) 8) (rotation at:(from))) (= (value Piece at:(site)) (who at:(to))))))))) (is In (to) (sites Occupied by:Mover container:""Board"" components:{""RiderOutline""})))) (then (remove (last To)))) (move Select (from (from) if:(= (state at:(from)) 1)) (to (difference (intersection (sites Around (from)) (difference (sites Empty) (difference (sites ""WaterRegion"") (sites (values Remembered ""Bridges""))))) (union {(sites Around (sites Occupied by:Enemy container:""Board"") includeSelf:True) (sites Around (sites Direction from:(sites Occupied by:Enemy container:""Board"" components:{""TinSoldier"" ""Bishop""}) Forward distance:1) Orthogonal includeSelf:True) (sites Around (sites Direction from:(sites Occupied by:Enemy container:""Board"" components:{""RegimentalOutline""}) Forward distance:1) Orthogonal includeSelf:True) (sites Around (sites Direction from:(sites Occupied by:Enemy container:""Board"" components:{""CannonOutline""}) Forward distance:1) Orthogonal includeSelf:True) (sites Around (sites Direction from:(sites Occupied by:Enemy container:""Board"" components:{""CannonOutline""}) Forward distance:2) Orthogonal includeSelf:True)}))) (then (and {(add (piece ""Triangle0"") (to (last To))) (set Rotation (to (last To)) {0} previous:False next:False) (set Value at:(last To) (id Mover))}))) (move Select (from (from) if:(= (state at:(from)) 1)) (to (difference (intersection (sites Around (from)) (difference (sites Empty) (difference (sites ""WaterRegion"") (sites (values Remembered ""Bridges""))))) (union {(sites Around (sites Occupied by:Enemy container:""Board"") includeSelf:True) (sites Around (sites Direction from:(sites Occupied by:Enemy container:""Board"" components:{""TinSoldier"" ""Bishop""}) Forward distance:1) Orthogonal includeSelf:True) (sites Around (sites Direction from:(sites Occupied by:Enemy container:""Board"" components:{""RegimentalOutline""}) Forward distance:1) Orthogonal includeSelf:True) (sites Around (sites Direction from:(sites Occupied by:Enemy container:""Board"" components:{""CannonOutline""}) Forward distance:1) Orthogonal includeSelf:True) (sites Around (sites Direction from:(sites Occupied by:Enemy container:""Board"" components:{""CannonOutline""}) Forward distance:2) Orthogonal includeSelf:True)}))) (then (and {(add (piece ""Triangle0"") (to (last To))) (set Rotation (to (last To)) {2} previous:False next:False) (set Value at:(last To) (id Mover))}))) (move Select (from (from) if:(= (state at:(from)) 1)) (to (difference (intersection (sites Around (from)) (difference (sites Empty) (difference (sites ""WaterRegion"") (sites (values Remembered ""Bridges""))))) (union {(sites Around (sites Occupied by:Enemy container:""Board"") includeSelf:True) (sites Around (sites Direction from:(sites Occupied by:Enemy container:""Board"" components:{""TinSoldier"" ""Bishop""}) Forward distance:1) Orthogonal includeSelf:True) (sites Around (sites Direction from:(sites Occupied by:Enemy container:""Board"" components:{""RegimentalOutline""}) Forward distance:1) Orthogonal includeSelf:True) (sites Around (sites Direction from:(sites Occupied by:Enemy container:""Board"" components:{""CannonOutline""}) Forward distance:1) Orthogonal includeSelf:True) (sites Around (sites Direction from:(sites Occupied by:Enemy container:""Board"" components:{""CannonOutline""}) Forward distance:2) Orthogonal includeSelf:True)}))) (then (and {(add (piece ""Triangle0"") (to (last To))) (set Rotation (to (last To)) {4} previous:False next:False) (set Value at:(last To) (id Mover))}))) (move Select (from (from) if:(= (state at:(from)) 1)) (to (difference (intersection (sites Around (from)) (difference (sites Empty) (difference (sites ""WaterRegion"") (sites (values Remembered ""Bridges""))))) (union {(sites Around (sites Occupied by:Enemy container:""Board"") includeSelf:True) (sites Around (sites Direction from:(sites Occupied by:Enemy container:""Board"" components:{""TinSoldier"" ""Bishop""}) Forward distance:1) Orthogonal includeSelf:True) (sites Around (sites Direction from:(sites Occupied by:Enemy container:""Board"" components:{""RegimentalOutline""}) Forward distance:1) Orthogonal includeSelf:True) (sites Around (sites Direction from:(sites Occupied by:Enemy container:""Board"" components:{""CannonOutline""}) Forward distance:1) Orthogonal includeSelf:True) (sites Around (sites Direction from:(sites Occupied by:Enemy container:""Board"" components:{""CannonOutline""}) Forward distance:2) Orthogonal includeSelf:True)}))) (then (and {(add (piece ""Triangle0"") (to (last To))) (set Rotation (to (last To)) {6} previous:False next:False) (set Value at:(last To) (id Mover))}))) (if (= (state at:(from)) 1) (move Set Rotation {0 2 4 6} previous:False next:False)) (move Select (from (from) if:(= (state at:(from)) 1)) (to (intersection (sites Occupied by:All container:""Board"" components:{""Triangle""}) (sites Around (from))) if:(and (= (value Piece at:(to)) (id Mover)) (not (is In (to) (union {(sites Around (sites Occupied by:Enemy container:""Board"") includeSelf:True) (sites Around (sites Direction from:(sites Occupied by:Enemy container:""Board"" components:{""TinSoldier"" ""Bishop""}) Forward distance:1) Orthogonal includeSelf:True) (sites Around (sites Direction from:(sites Occupied by:Enemy container:""Board"" components:{""RegimentalOutline""}) Forward distance:1) Orthogonal includeSelf:True) (sites Around (sites Direction from:(sites Occupied by:Enemy container:""Board"" components:{""CannonOutline""}) Forward distance:1) Orthogonal includeSelf:True) (sites Around (sites Direction from:(sites Occupied by:Enemy container:""Board"" components:{""CannonOutline""}) Forward distance:2) Orthogonal includeSelf:True)}))))) (then (remove (last To)))) (move Select (from (from) if:(= (state at:(from)) 1)) (to (intersection (sites Occupied by:All container:""Board"" components:{""CannonOutline"" ""RegimentalOutline""}) (sites Around (from) Orthogonal)) if:(> (state at:(to)) 0)) (then (remove (last To)))) (move Select (from (from) if:(= (state at:(from)) 1)) (to (intersection {(sites Occupied by:All container:""Board"" components:{""WagonOutline""}) (sites Around (from)) (union {(forEach (sites Occupied by:All container:""Board"" components:{""Triangle""}) if:(= (value Piece at:(site)) 0)) (forEach (sites Occupied by:P1 container:""Board"" components:{""CannonOutline"" ""RegimentalOutline"" ""WagonOutline""}) if:(= 0 (count Sites in:(intersection (sites Around (site) Orthogonal) (sites Occupied by:P1 container:""Board"" components:{""TinSoldier"" ""Bishop""}))))) (forEach (sites Occupied by:P2 container:""Board"" components:{""CannonOutline"" ""RegimentalOutline"" ""WagonOutline""}) if:(= 0 (count Sites in:(intersection (sites Around (site) Orthogonal) (sites Occupied by:P2 container:""Board"" components:{""TinSoldier"" ""Bishop""})))))})})) (then (remove (last To)))) (move Select (from (from) if:(= (state at:(from)) 1)) (to (intersection (sites (values Remembered ""Bridges"")) (sites Around (from))) if:(not (is In (to) (union {(sites Around (sites Occupied by:Enemy container:""Board"") includeSelf:True) (sites Around (sites Direction from:(sites Occupied by:Enemy container:""Board"" components:{""TinSoldier"" ""Bishop""}) Forward distance:1) Orthogonal includeSelf:True) (sites Around (sites Direction from:(sites Occupied by:Enemy container:""Board"" components:{""RegimentalOutline""}) Forward distance:1) Orthogonal includeSelf:True) (sites Around (sites Direction from:(sites Occupied by:Enemy container:""Board"" components:{""CannonOutline""}) Forward distance:1) Orthogonal includeSelf:True) (sites Around (sites Direction from:(sites Occupied by:Enemy container:""Board"" components:{""CannonOutline""}) Forward distance:2) Orthogonal includeSelf:True)})))) (then (forget Value ""Bridges"" (last To)))) (move Select (from (from) if:(= (state at:(from)) 1)) (to (intersection (sites (values Remembered ""Bridges"")) (sites Around (from)))) (then (if (= (id Mover) 1) (remember Value ""Fires1"" (last To)) (remember Value ""Fires2"" (last To))))) (if (= (state at:(from)) 1) (move Promote (from) (piece {""RiderOutline""}) Mover))}) maxState:100) (piece ""RiderOutline"" Each (or {(move Slide (from (from) if:(= (state at:(from)) 3)) (between (range 1 12) if:(or {(is In (between) (difference (sites Empty) (difference (sites ""WaterRegion"") (sites (values Remembered ""Bridges""))))) (is In (between) (sites ""TownRegion""))})) (to if:False (apply if:(if (is Occupied (to)) (not (is In (to) (sites ""TownRegion""))) True)))) (move Slide (from (from) if:(= (state at:(from)) 1)) (between (range 1 12) if:(or {(is In (between) (difference (sites Empty) (difference (sites ""WaterRegion"") (sites (values Remembered ""Bridges""))))) (is In (between) (sites ""TownRegion"")) (is In (between) (sites Occupied by:Enemy container:""Board"" components:{""TinSoldier"" ""Bishop""}))}) (apply (remove (between)))) (to if:(and (< 0 (count Sites in:(intersection (sites Around (to) Orthogonal) (sites Occupied by:Enemy container:""Board"")))) (is In (to) (sites Occupied by:Enemy container:""Board"" components:{""TinSoldier"" ""Bishop""}))) (apply if:(and (not (is In (to) (sites ""TownRegion""))) (is In (to) (sites Occupied by:Enemy container:""Board""))) (remove (to))))) (move Slide (from (from) if:(= (state at:(from)) 1)) (directions {Forward FR FL}) (between (range 1 12) if:(or {(is In (between) (difference (sites Empty) (difference (sites ""WaterRegion"") (sites (values Remembered ""Bridges""))))) (is In (between) (sites ""TownRegion"")) (is In (between) (sites Occupied by:Enemy container:""Board"" components:{""TinSoldier"" ""RiderOutline"" ""Bishop""}))}) (apply if:(is In (between) (sites Occupied by:Enemy container:""Board"" components:{""TinSoldier"" ""RiderOutline"" ""Bishop""})) (remove (between)))) (to if:(and (< 0 (count Sites in:(intersection (sites Around (to) Orthogonal) (sites Occupied by:Enemy container:""Board"")))) (is In (to) (sites Occupied by:Enemy container:""Board"" components:{""TinSoldier"" ""RiderOutline"" ""Bishop""}))) (apply if:(and (not (is In (to) (sites ""TownRegion""))) (is In (to) (sites Occupied by:Enemy container:""Board""))) (remove (to))))) (if (= (state at:(from)) 1) (move Set Rotation {0 2 4 6} previous:False next:False)) (move Select (from (from) if:(= (state at:(from)) 1)) (to (intersection (sites Occupied by:All container:""Board"" components:{""Triangle""}) (sites Around (from))) if:(and (= (value Piece at:(to)) (id Mover)) (not (is In (to) (union {(sites Around (sites Occupied by:Enemy container:""Board"") includeSelf:True) (sites Around (sites Direction from:(sites Occupied by:Enemy container:""Board"" components:{""TinSoldier"" ""Bishop""}) Forward distance:1) Orthogonal includeSelf:True) (sites Around (sites Direction from:(sites Occupied by:Enemy container:""Board"" components:{""RegimentalOutline""}) Forward distance:1) Orthogonal includeSelf:True) (sites Around (sites Direction from:(sites Occupied by:Enemy container:""Board"" components:{""CannonOutline""}) Forward distance:1) Orthogonal includeSelf:True) (sites Around (sites Direction from:(sites Occupied by:Enemy container:""Board"" components:{""CannonOutline""}) Forward distance:2) Orthogonal includeSelf:True)}))))) (then (remove (last To)))) (move Select (from (from) if:(= (state at:(from)) 1)) (to (intersection (sites Occupied by:All container:""Board"" components:{""CannonOutline"" ""RegimentalOutline""}) (sites Around (from) Orthogonal)) if:(> (state at:(to)) 0)) (then (remove (last To)))) (move Select (from (from) if:(= (state at:(from)) 1)) (to (intersection {(sites Occupied by:All container:""Board"" components:{""WagonOutline""}) (sites Around (from)) (union {(forEach (sites Occupied by:All container:""Board"" components:{""Triangle""}) if:(= (value Piece at:(site)) 0)) (forEach (sites Occupied by:P1 container:""Board"" components:{""CannonOutline"" ""RegimentalOutline"" ""WagonOutline""}) if:(= 0 (count Sites in:(intersection (sites Around (site) Orthogonal) (sites Occupied by:P1 container:""Board"" components:{""TinSoldier"" ""Bishop""}))))) (forEach (sites Occupied by:P2 container:""Board"" components:{""CannonOutline"" ""RegimentalOutline"" ""WagonOutline""}) if:(= 0 (count Sites in:(intersection (sites Around (site) Orthogonal) (sites Occupied by:P2 container:""Board"" components:{""TinSoldier"" ""Bishop""})))))})})) (then (remove (last To)))) (move Select (from (from) if:(= (state at:(from)) 1)) (to (intersection (sites (values Remembered ""Bridges"")) (sites Around (from))) if:(not (is In (to) (union {(sites Around (sites Occupied by:Enemy container:""Board"") includeSelf:True) (sites Around (sites Direction from:(sites Occupied by:Enemy container:""Board"" components:{""TinSoldier"" ""Bishop""}) Forward distance:1) Orthogonal includeSelf:True) (sites Around (sites Direction from:(sites Occupied by:Enemy container:""Board"" components:{""RegimentalOutline""}) Forward distance:1) Orthogonal includeSelf:True) (sites Around (sites Direction from:(sites Occupied by:Enemy container:""Board"" components:{""CannonOutline""}) Forward distance:1) Orthogonal includeSelf:True) (sites Around (sites Direction from:(sites Occupied by:Enemy container:""Board"" components:{""CannonOutline""}) Forward distance:2) Orthogonal includeSelf:True)})))) (then (forget Value ""Bridges"" (last To)))) (move Select (from (from) if:(= (state at:(from)) 1)) (to (intersection (sites (values Remembered ""Bridges"")) (sites Around (from)))) (then (if (= (id Mover) 1) (remember Value ""Fires1"" (last To)) (remember Value ""Fires2"" (last To))))) (if (= (state at:(from)) 1) (move Promote (from) (piece {""Bishop""}) Mover))})) (piece ""WagonOutline"" Each (or {(move Slide (from (from) if:(and {(= (state at:(from)) 3) (is In (from) (sites Around (var ""FromArtillerySite"") Orthogonal))})) Orthogonal (between (range 1 8) if:(is In (between) (difference (sites Empty) (difference (sites ""WaterRegion"") (sites (values Remembered ""Bridges"")))))) (to if:False (apply if:(is In (to) (sites Around (var ""ToArtillerySite"") Orthogonal)))) (then (and (set Var ""FromArtillerySite"" -1) (set Var ""ToArtillerySite"" -1)))) (move Select (from (from) if:(and {(= (state at:(from)) 1) (< 0 (value Piece at:(from))) (< 0 (count Sites in:(intersection (sites Around (from) Orthogonal) (sites Occupied by:Mover container:""Board"" components:{""TinSoldier"" ""Bishop""}))))})) (to (forEach (union (sites Around (from)) (sites Around (sites Group from:(forEach (sites Around (from)) if:(is In (site) (sites (values Remembered ""Bridges"")))) if:(is In (to) (sites (values Remembered ""Bridges"")))))) if:(and {(is In (site) (difference (sites ""WaterRegion"") (sites (values Remembered ""Bridges"")))) (not (is In (site) (union {(sites Around (sites Occupied by:Enemy container:""Board"") includeSelf:True) (sites Around (sites Direction from:(sites Occupied by:Enemy container:""Board"" components:{""TinSoldier"" ""Bishop""}) Forward distance:1) Orthogonal includeSelf:True) (sites Around (sites Direction from:(sites Occupied by:Enemy container:""Board"" components:{""RegimentalOutline""}) Forward distance:1) Orthogonal includeSelf:True) (sites Around (sites Direction from:(sites Occupied by:Enemy container:""Board"" components:{""CannonOutline""}) Forward distance:1) Orthogonal includeSelf:True) (sites Around (sites Direction from:(sites Occupied by:Enemy container:""Board"" components:{""CannonOutline""}) Forward distance:2) Orthogonal includeSelf:True)})))}))) (then (and {(remember Value ""Bridges"" (last To)) (set Value at:(last From) (- (value Piece at:(last From)) 1))}))) (move Select (from (from) if:(and {(= (state at:(from)) 1) (> 4 (value Piece at:(from))) (< 0 (count Sites in:(intersection (sites Around (from) Orthogonal) (sites Occupied by:Mover container:""Board"" components:{""TinSoldier"" ""Bishop""}))))})) (to (forEach (union (sites Around (from)) (sites Around (sites Group from:(forEach (sites Around (from)) if:(is In (site) (sites (values Remembered ""Bridges"")))) if:(is In (to) (sites (values Remembered ""Bridges"")))))) if:(and {(is In (site) (sites (values Remembered ""Bridges""))) (is In (site) (union (sites Empty) (union {(forEach (sites Occupied by:All container:""Board"" components:{""Triangle""}) if:(= (value Piece at:(site)) 0)) (forEach (sites Occupied by:P1 container:""Board"" components:{""CannonOutline"" ""RegimentalOutline"" ""WagonOutline""}) if:(= 0 (count Sites in:(intersection (sites Around (site) Orthogonal) (sites Occupied by:P1 container:""Board"" components:{""TinSoldier"" ""Bishop""}))))) (forEach (sites Occupied by:P2 container:""Board"" components:{""CannonOutline"" ""RegimentalOutline"" ""WagonOutline""}) if:(= 0 (count Sites in:(intersection (sites Around (site) Orthogonal) (sites Occupied by:P2 container:""Board"" components:{""TinSoldier"" ""Bishop""})))))})))}))) (then (and {(forget Value ""Bridges"" (last To)) (set Value at:(last From) (+ (value Piece at:(last From)) 1)) (remove (last To))}))) (move Select (from (from) if:(and {(= (state at:(from)) 1) (< 0 (value Piece at:(from))) (< 0 (count Sites in:(intersection (sites Around (from) Orthogonal) (sites Occupied by:Mover container:""Board"" components:{""TinSoldier"" ""Bishop""}))))})) (to (intersection (sites Around (from)) (difference (sites Empty) (sites ""WaterRegion"")))) (then (and {(add (piece ""Square0"") (to (last To))) (set Value at:(last From) (- (value Piece at:(last From)) 1))}))) (move Select (from (from) if:(and {(= (state at:(from)) 1) (> 4 (value Piece at:(from))) (< 0 (count Sites in:(intersection (sites Around (from) Orthogonal) (sites Occupied by:Mover container:""Board"" components:{""TinSoldier"" ""Bishop""}))))})) (to (intersection (sites Around (from)) (sites Occupied by:Neutral container:""Board"" components:{""Square""}))) (then (and {(set Value at:(last From) (+ (value Piece at:(last From)) 1)) (remove (last To))}))) (if (and (= (state at:(from)) 1) (< 0 (count Sites in:(intersection (sites Around (from) Orthogonal) (sites Occupied by:Mover container:""Board"" components:{""TinSoldier"" ""Bishop""}))))) (move Set Rotation {0 2 4 6} previous:False next:False))})) (regions ""WaterRegion"" (sites {343 344 345 346 347 348 349 350 301 302 303 254 205 156 107 58 9 10 59 255 256 399 448 497 498 547 596 645 694 695 744 793 842 841 840 839 838 837 836 835 834 833 882 883 884 933 934 885 886 935 887 891 940 989 1038 1037 1036 1035 1034 1033 1032 1031 1030 1029 1079 1128 1083 1132 1181 1230 1087 1136 1185 1088 1186 1234 1233 1232 1281 1282 1283 1332 1331 1330 1379 1380 1381 1430 1431 1479 1528 1529 1578 1577 1569 1570 1571 1572 1573 1574 1575 1576 1520 1471 1524 1475 1426 1377 1376 1375 1326 1277 1228 1229 1279 1328 1089 1090 1091 1140 1189 1190 1239 1240 1289 1338 1339 1388 1437 1486 1535 1584 1042 1043 1044 1045 1046 997 948 949 950 951 952 953 1002 1003 1004 955 1005 1006 1055 1007 1008 1340 1341 1342 1343 1344 1345 1346 1347 1348 1349 1350 1351 1300 1251 1202 1153 1104 1352 1401 1450 1499 1500 1501 1353 1354 1355 1306 1257 1208 1159 1110 1061 1012 963 1356 1357 1358 1359 1360 1361 1362 1411 1460 1509 1558 1557 1606 1607 1313 1314 1315 1266 1267 1268 1269 1270 1271 1272 1273 1217 1168 1119 1070 1118 1069 1020 971 922 921 872 823 774 775 776 777 778 779 780 781 782 783 734 733 732 731 730 729 725 681 682 683 676 627 578 579 580 581 582 583 584 585 586 587 537 488 529 480 431 382 333 284 235 186 137 88 39 87 38 185 40 41 42 43 44 45 46 47 96 145 92 141 190 239 288 337 386 435 484 533 236 237 286 335 384 383 334 285 240 241 290 339 388 387 430 528 527 526 525 476 427 574 573 572 571 570 619 668 667 666 665 664 663 614 613 612 661 710 759 808 857 906 611 610 561 609 608 607 512 426 377 376 327 278 277 276 275 274 273 272 271 270 269 268 267 266 265 264 263 262 261 260 259 258 257 463 414 365 316 604 653 555 506 457 408 359 310 215 166 117 116 228 179 130 81 32})) (regions ""MountainRegion"" (sites {395 444 493 542 591 784 701 702 703 752 751 750 565 516 913 864 865 914 915 866 1299 1250 1296 1247 1394 1443 1492 1397 1446 1495 1502 1551 1503})) (regions ""TownRegion"" (sites {449 450 451 452 400 351 352 562 513 563 564 515 1052 1101 1053 1054 1103 1264 1265 1216 1167 1166 1165 1164})) (regions ""ForestRegion"" (sites {499 500 501 790 791 1432 1433 1201 1200 1395 1396 415 416 220 221 184 183 825 826 1117 1116 1115})) (regions ""EntrenchmentRegion1"" (sites {939 988 1086 1135 1184 1180 1131 1082 1425 1474 1523 1527 1478 1429})) (regions ""EntrenchmentRegion2"" (sites {932 936 888 889 890 1081})) (regions ""EntrenchmentRegion3"" (sites {677 628 530 481 432 534 485 436 191 142 93 187 138 89})) (regions ""EntrenchmentRegion4"" (sites {726 727 728 680 684 535}))}) (rules (meta (passEnd NoEnd)) (start {(place ""Mountain0"" (sites ""MountainRegion"")) (place ""Town0"" (sites ""TownRegion"")) (place ""Forest0"" (sites ""ForestRegion"")) (place ""Triangle0"" (sites ""EntrenchmentRegion1"") rotation:2 value:0) (place ""Triangle0"" (sites ""EntrenchmentRegion2"") rotation:4 value:0) (place ""Triangle0"" (sites ""EntrenchmentRegion3"") rotation:6 value:0) (place ""Triangle0"" (sites ""EntrenchmentRegion4"") rotation:0 value:0) (place ""TinSoldier1"" 1617 count:76 state:3) (place ""TinSoldier2"" 1623 count:76 state:3) (place ""RiderOutline1"" 1618 count:20 state:3) (place ""RiderOutline2"" 1624 count:20 state:3) (place ""CannonOutline1"" 1619 count:10 state:3) (place ""CannonOutline2"" 1625 count:10 state:3) (place ""RegimentalOutline1"" 1620 count:5 state:3) (place ""RegimentalOutline2"" 1626 count:5 state:3) (place ""WagonOutline1"" 1621 count:10 state:3) (place ""WagonOutline2"" 1627 count:10 state:3) (place ""Square0"" 1622 count:20 state:3) (place ""Square0"" 1628 count:20 state:3) (set Hidden (sites Hand P1) to:P2) (set Hidden (sites Hand P2) to:P1) (set Hidden (sites P2 ""Home"") to:P1) (set Hidden (sites P1 ""Home"") to:P2)}) phases:{(phase ""Placement"" (play (or {(move (from (sites Occupied by:Mover container:(mover) components:{""TinSoldier"" ""RiderOutline"" ""CannonOutline"" ""RegimentalOutline"" ""WagonOutline""})) (to (intersection (sites Mover ""Home"") (difference (sites Empty) (sites ""WaterRegion"")))) (then (set Rotation (to (last To)) 0 previous:False next:False))) (move (from (sites Occupied by:Mover container:(mover) components:{""TinSoldier"" ""RiderOutline"" ""CannonOutline"" ""RegimentalOutline"" ""WagonOutline""})) (to (intersection (sites Mover ""Home"") (difference (sites Empty) (sites ""WaterRegion"")))) (then (set Rotation (to (last To)) 2 previous:False next:False))) (move (from (sites Occupied by:Mover container:(mover) components:{""TinSoldier"" ""RiderOutline"" ""CannonOutline"" ""RegimentalOutline"" ""WagonOutline""})) (to (intersection (sites Mover ""Home"") (difference (sites Empty) (sites ""WaterRegion"")))) (then (set Rotation (to (last To)) 4 previous:False next:False))) (move (from (sites Occupied by:Mover container:(mover) components:{""TinSoldier"" ""RiderOutline"" ""CannonOutline"" ""RegimentalOutline"" ""WagonOutline""})) (to (intersection (sites Mover ""Home"") (difference (sites Empty) (sites ""WaterRegion"")))) (then (set Rotation (to (last To)) 6 previous:False next:False)))})) (nextPhase (= 20 (count in:(sites Hand P2))) ""BridgePlacement"")) (phase ""BridgePlacement"" (play (or (move (from (sites Occupied by:Neutral container:(mover) components:{""Square""})) (to (intersection {(sites Mover ""Home"") (sites ""WaterRegion"") (sites Empty)})) (then (if (all Sites (sites Hand P2) if:(= 0 (count Cell at:(site)))) (and {(set Hidden (sites Board) False to:All) (set Var ""FromArtillerySite"" -1) (set Var ""ToArtillerySite"" -1) (forEach Site (sites Occupied by:All container:""Board"" components:{""Square""}) (and (remember Value ""Bridges"" (site)) (remove (site))))}) (pass)))) (move Select (from (sites Occupied by:Neutral container:(mover) components:{""Square""})) (to (intersection (sites Mover ""Home"") (sites Occupied by:Mover container:""Board"" components:{""WagonOutline""})) if:(< (value Piece at:(to)) 4)) (then (do (and (set Value at:(last To) (+ (value Piece at:(last To)) 1)) (set Count at:(last From) (- (count at:(last From)) 1))) next:(if (all Sites (sites Hand P2) if:(= 0 (count Cell at:(site)))) (and {(set Hidden (sites Board) False to:All) (set Var ""FromArtillerySite"" -1) (set Var ""ToArtillerySite"" -1) (forEach Site (sites Occupied by:All container:""Board"" components:{""Square""}) (and (remember Value ""Bridges"" (site)) (remove (site))))}) (pass))))))) (nextPhase (all Sites (sites Hand P2) if:(= 0 (count Cell at:(site)))) ""FireSpread"")) (phase ""FireSpread"" (play (if (= (id Mover) 1) (or (move Select (from (sites (values Remembered ""Fires1""))) (to (from)) (then (and {(forEach Site (intersection (sites Around (last From)) (sites (values Remembered ""Bridges""))) (remember Value ""FireTemp"" (site))) (moveAgain)}))) (move Pass (then (and {(forEach Site (sites (values Remembered ""Fires1"")) (and (forget Value ""Fires1"" (site)) (forget Value ""Bridges"" (site)))) (forEach Site (sites ""FireTemp"") (and (remember Value ""Fires1"" (site)) (forget Value ""FireTemp"" (site)))) (moveAgain)})))) (or (move Select (from (sites (values Remembered ""Fires2""))) (to (from)) (then (and {(forEach Site (intersection (sites Around (last From)) (sites (values Remembered ""Bridges""))) (remember Value ""FireTemp"" (site))) (moveAgain)}))) (move Pass (then (and {(forEach Site (sites (values Remembered ""Fires2"")) (and (forget Value ""Fires2"" (site)) (forget Value ""Bridges"" (site)))) (forEach Site (sites ""FireTemp"") (and (remember Value ""Fires2"" (site)) (forget Value ""FireTemp"" (site)))) (moveAgain)})))))) (nextPhase (was Pass) ""Movement"")) (phase ""Movement"" (play (or (forEach Piece (then (and {(set State at:(last To) 0) (moveAgain)}))) (move Pass (then (and {(forEach Site (sites Occupied by:Mover container:""Board"") (if (= (state at:(site)) 3) (set State at:(site) 1))) (and (forEach Site (sites Occupied by:All container:""Board"" components:{""Triangle""}) (if (and (not (is In (site) (union {(sites Around (sites Occupied by:Mover container:""Board"") includeSelf:True) (sites Around (sites Direction from:(sites Occupied by:Mover container:""Board"" components:{""TinSoldier"" ""Bishop""}) Forward distance:1) Orthogonal includeSelf:True) (sites Around (sites Direction from:(sites Occupied by:Mover container:""Board"" components:{""RegimentalOutline""}) Forward distance:1) Orthogonal includeSelf:True) (sites Around (sites Direction from:(sites Occupied by:Mover container:""Board"" components:{""CannonOutline""}) Forward distance:1) Orthogonal includeSelf:True) (sites Around (sites Direction from:(sites Occupied by:Mover container:""Board"" components:{""CannonOutline""}) Forward distance:2) Orthogonal includeSelf:True)}))) (= (value Piece at:(site)) (id Mover))) (set Value at:(site) 0))) (forEach Site (sites Occupied by:All container:""Board"" components:{""Triangle""}) (if (and (is In (site) (union {(sites Around (sites Occupied by:Mover container:""Board"") includeSelf:True) (sites Around (sites Direction from:(sites Occupied by:Mover container:""Board"" components:{""TinSoldier"" ""Bishop""}) Forward distance:1) Orthogonal includeSelf:True) (sites Around (sites Direction from:(sites Occupied by:Mover container:""Board"" components:{""RegimentalOutline""}) Forward distance:1) Orthogonal includeSelf:True) (sites Around (sites Direction from:(sites Occupied by:Mover container:""Board"" components:{""CannonOutline""}) Forward distance:1) Orthogonal includeSelf:True) (sites Around (sites Direction from:(sites Occupied by:Mover container:""Board"" components:{""CannonOutline""}) Forward distance:2) Orthogonal includeSelf:True)})) (= (value Piece at:(site)) 0)) (set Value at:(site) (id Mover))))) (moveAgain)}))))) (nextPhase (was Pass) ""Actions"")) (phase ""Actions"" (play (or (forEach Piece (then (and {(set State at:(last To) 0) (set State at:(last From) 0) (moveAgain)}))) (move Pass (then (and {(forEach Site (sites Occupied by:Mover container:""Board"") (set State at:(site) 3)) (and (forEach Site (sites Occupied by:All container:""Board"" components:{""Triangle""}) (if (and (not (is In (site) (union {(sites Around (sites Occupied by:Mover container:""Board"") includeSelf:True) (sites Around (sites Direction from:(sites Occupied by:Mover container:""Board"" components:{""TinSoldier"" ""Bishop""}) Forward distance:1) Orthogonal includeSelf:True) (sites Around (sites Direction from:(sites Occupied by:Mover container:""Board"" components:{""RegimentalOutline""}) Forward distance:1) Orthogonal includeSelf:True) (sites Around (sites Direction from:(sites Occupied by:Mover container:""Board"" components:{""CannonOutline""}) Forward distance:1) Orthogonal includeSelf:True) (sites Around (sites Direction from:(sites Occupied by:Mover container:""Board"" components:{""CannonOutline""}) Forward distance:2) Orthogonal includeSelf:True)}))) (= (value Piece at:(site)) (id Mover))) (set Value at:(site) 0))) (forEach Site (sites Occupied by:All container:""Board"" components:{""Triangle""}) (if (and (is In (site) (union {(sites Around (sites Occupied by:Mover container:""Board"") includeSelf:True) (sites Around (sites Direction from:(sites Occupied by:Mover container:""Board"" components:{""TinSoldier"" ""Bishop""}) Forward distance:1) Orthogonal includeSelf:True) (sites Around (sites Direction from:(sites Occupied by:Mover container:""Board"" components:{""RegimentalOutline""}) Forward distance:1) Orthogonal includeSelf:True) (sites Around (sites Direction from:(sites Occupied by:Mover container:""Board"" components:{""CannonOutline""}) Forward distance:1) Orthogonal includeSelf:True) (sites Around (sites Direction from:(sites Occupied by:Mover container:""Board"" components:{""CannonOutline""}) Forward distance:2) Orthogonal includeSelf:True)})) (= (value Piece at:(site)) 0)) (set Value at:(site) (id Mover))))) (if (= (id Mover) 1) (forEach Site (sites (values Remembered ""Fires1"")) (remove (site))) (forEach Site (sites (values Remembered ""Fires2"")) (remove (site))))}))))) (nextPhase (was Pass) ""FireSpread""))} (end {(if (is In 1323 (sites Occupied by:P2 container:""Board"")) (result P2 Win)) (if (is In 293 (sites Occupied by:P1 container:""Board"")) (result P1 Win))})))" "Played on a board of 10x10 squares. The board has three 2x2 zones which cannot be entered, represented as water on the battlefield. each player controls 36 pieces which have individual army ranks. The goal is to capture the opponent's flag. Pieces can move only one space orthogonally. the Scout piece can move any number of spaces orthogonally. Pieces may attempt to capture an opposing piece; when doing so the ranks are revealed and the lower ranking piece is captured; if they are of equal rank they are both removed. There are bomb pieces which cannot move. Bombs eliminate other pieces attacking it and can only be removed by a miner. The spy can only attack the Marshall or the Flag. The scouts can not take each other, and winning is only possible in capturing the opponent flag","(game ""L'attaque"" (players 2) (equipment {(board (hole (hole (hole (rectangle 10 9) (poly {{2 4} {2 6} {3 6} {3 4}})) (poly {{4 4} {4 6} {5 6} {5 4}})) (poly {{6 4} {6 6} {7 6} {7 4}}))) (hand Each size:12) (piece ""Marshal"" Each) (piece ""General"" Each) (piece ""Colonel"" Each) (piece ""Major"" Each) (piece ""Captain"" Each) (piece ""Lieutenant"" Each) (piece ""Sergeant"" Each) (piece ""Miner"" Each) (piece ""Scout"" Each) (piece ""Spy"" Each) (piece ""Flag"" Each) (piece ""Bomb"" Each) (regions ""HomeP1"" P1 (expand (sites Bottom) steps:3)) (regions ""HomeP2"" P2 (expand (sites Top) steps:3)) (map {(pair 1 84) (pair 2 96) (pair 3 85) (pair 4 97) (pair 5 86) (pair 6 98) (pair 7 87) (pair 8 99) (pair 9 88) (pair 10 100) (pair 11 89) (pair 12 101) (pair 13 90) (pair 14 102) (pair 15 91) (pair 16 103) (pair 17 92) (pair 18 104) (pair 19 93) (pair 20 105) (pair 21 94) (pair 22 106) (pair 23 95) (pair 24 107)})}) (rules (start {(place ""Marshal1"" 84 value:10) (place ""General1"" 85 value:9) (place ""Colonel1"" 86 count:2 value:8) (place ""Major1"" 87 count:2 value:7) (place ""Captain1"" 88 count:4 value:6) (place ""Lieutenant1"" 89 count:4 value:5) (place ""Sergeant1"" 90 count:4 value:4) (place ""Miner1"" 91 count:4 value:3) (place ""Scout1"" 92 count:8 value:2) (place ""Spy1"" 93 value:1) (place ""Flag1"" 94) (place ""Bomb1"" 95 count:4) (set Hidden (sites Hand P1) to:P2) (place ""Marshal2"" 96 value:10) (place ""General2"" 97 value:9) (place ""Colonel2"" 98 count:2 value:8) (place ""Major2"" 99 count:2 value:7) (place ""Captain2"" 100 count:4 value:6) (place ""Lieutenant2"" 101 count:4 value:5) (place ""Sergeant2"" 102 count:4 value:4) (place ""Miner2"" 103 count:4 value:3) (place ""Scout2"" 104 count:8 value:2) (place ""Spy2"" 105 value:1) (place ""Flag2"" 106) (place ""Bomb2"" 107 count:4) (set Hidden (sites Hand P2) to:P1)}) phases:{(phase ""Placement"" (play (move (from (sites Occupied by:Mover container:(mover))) (to (intersection (sites Mover ""Home"") (sites Empty))) (then (if (all Sites (sites Hand P2) if:(= 0 (count Cell at:(site)))) (and {(set Hidden (sites P2 ""Home"") False to:P1) (set Hidden (sites P1 ""Home"") False to:P2) (set Hidden What (sites P2 ""Home"") to:P1) (set Hidden What (sites P1 ""Home"") to:P2) (set Hidden Value (sites P2 ""Home"") to:P1) (set Hidden Value (sites P1 ""Home"") to:P2)}))))) (nextPhase (all Sites (sites Hand P2) if:(= 0 (count Cell at:(site)))) ""Movement"")) (phase ""Movement"" (play (or (forEach Piece {""Marshal"" ""General"" ""Colonel"" ""Major"" ""Captain"" ""Lieutenant"" ""Sergeant"" ""Miner"" ""Spy""} (move Step Orthogonal (to if:(not (is Friend (who at:(to)))) (apply (if (is Enemy (who at:(to))) (and (if (and (not (= (what at:(to)) (id ""Bomb"" Next))) (not (= (what at:(to)) (id ""Flag"" Next)))) (if (= (value Piece at:(to)) (value Piece at:(from))) (and {(fromTo (from) (to (mapEntry (what at:(from))))) (fromTo (from (to)) (to (mapEntry (what at:(to))))) (set Hidden What at:(mapEntry (what at:(from))) False to:P1) (set Hidden What at:(mapEntry (what at:(from))) False to:P2) (set Hidden What at:(mapEntry (what at:(to))) False to:P1) (set Hidden What at:(mapEntry (what at:(to))) False to:P2) (set Hidden Value at:(mapEntry (what at:(from))) False to:P1) (set Hidden Value at:(mapEntry (what at:(from))) False to:P2) (set Hidden Value at:(mapEntry (what at:(to))) False to:P1) (set Hidden Value at:(mapEntry (what at:(to))) False to:P2)}) (if (< (value Piece at:(to)) (value Piece at:(from))) (and {(fromTo (from (to)) (to (mapEntry (what at:(to))))) (fromTo (from) (to)) (set Hidden What at:(mapEntry (what at:(to))) False to:P1) (set Hidden What at:(mapEntry (what at:(to))) False to:P2) (set Hidden What at:(to) False to:Next) (set Hidden Value at:(mapEntry (what at:(to))) False to:P1) (set Hidden Value at:(mapEntry (what at:(to))) False to:P2) (set Hidden Value at:(to) False to:Next)}) (if (< (value Piece at:(from)) (value Piece at:(to))) (if (and (= (what at:(from)) (id ""Spy"" Mover)) (= (what at:(to)) (id ""Marshal"" Next))) (and {(fromTo (from (to)) (to (mapEntry (what at:(to))))) (fromTo (from) (to)) (set Hidden What at:(mapEntry (what at:(to))) False to:P1) (set Hidden What at:(mapEntry (what at:(to))) False to:P2) (set Hidden What at:(from) False to:Next) (set Hidden Value at:(mapEntry (what at:(to))) False to:P1) (set Hidden Value at:(mapEntry (what at:(to))) False to:P2) (set Hidden Value at:(from) False to:Next)}) (and {(fromTo (from) (to (mapEntry (what at:(from))))) (set Hidden What at:(mapEntry (what at:(from))) False to:P1) (set Hidden What at:(mapEntry (what at:(from))) False to:P2) (set Hidden What at:(to) False to:Mover) (set Hidden Value at:(mapEntry (what at:(from))) False to:P1) (set Hidden Value at:(mapEntry (what at:(from))) False to:P2) (set Hidden Value at:(to) False to:Mover)}))))) (if (= (what at:(to)) (id ""Bomb"" Next)) (if (= (what at:(from)) (id ""Miner"" Mover)) (and {(fromTo (from (to)) (to (mapEntry (what at:(to))))) (set Hidden What at:(mapEntry (what at:(to))) False to:P1) (set Hidden What at:(mapEntry (what at:(to))) False to:P2) (set Hidden Value at:(mapEntry (what at:(to))) False to:P1) (set Hidden Value at:(mapEntry (what at:(to))) False to:P2) (fromTo (from) (to)) (set Hidden What at:(from) False to:Next) (set Hidden Value at:(from) False to:Next)}) (and {(fromTo (from) (to (mapEntry (what at:(from))))) (set Hidden What at:(mapEntry (what at:(from))) False to:P1) (set Hidden What at:(mapEntry (what at:(from))) False to:P2) (set Hidden What at:(to) False to:Mover) (set Hidden Value at:(mapEntry (what at:(from))) False to:P1) (set Hidden Value at:(mapEntry (what at:(from))) False to:P2) (set Hidden Value at:(to) False to:Mover)})) (if (= (what at:(to)) (id ""Flag"" Next)) (and (trigger ""FlagCaptured"" (next)) (remove (to)))))) (note player:Mover ""attacks"" to:Next))))))) (forEach Piece ""Scout"" (or (move Select (from) (to (sites LineOfSight Empty at:(from) Orthogonal)) (then (fromTo (from (last From)) (to (last To))))) (move Select (from) (to (sites LineOfSight Piece at:(from) Orthogonal) if:(is Enemy (who at:(to)))) (then (and (if (and (not (= (what at:(last To)) (id ""Bomb"" Next))) (not (= (what at:(last To)) (id ""Flag"" Next)))) (if (= (value Piece at:(last To)) (value Piece at:(last From))) (and {(set Hidden What at:(last To) False to:Mover) (set Hidden What at:(last From) False to:Next) (set Hidden Value at:(last To) False to:Mover) (set Hidden Value at:(last From) False to:Next)}) (if (< (value Piece at:(last To)) (value Piece at:(last From))) (and {(fromTo (from (last To)) (to (mapEntry (what at:(last To))))) (fromTo (from (last From)) (to (last To))) (set Hidden What at:(mapEntry (what at:(last To))) False to:P1) (set Hidden What at:(mapEntry (what at:(last To))) False to:P2) (set Hidden What at:(last To) False to:Next) (set Hidden Value at:(mapEntry (what at:(last To))) False to:P1) (set Hidden Value at:(mapEntry (what at:(last To))) False to:P2) (set Hidden Value at:(last To) False to:Next)}) (and {(fromTo (from (last From)) (to (mapEntry (what at:(last From))))) (set Hidden What at:(mapEntry (what at:(last From))) False to:P1) (set Hidden What at:(mapEntry (what at:(last From))) False to:P2) (set Hidden What at:(last To) False to:Mover) (set Hidden Value at:(mapEntry (what at:(last From))) False to:P1) (set Hidden Value at:(mapEntry (what at:(last From))) False to:P2) (set Hidden Value at:(last To) False to:Mover)}))) (if (= (what at:(last To)) (id ""Bomb"" Next)) (and {(fromTo (from (last From)) (to (mapEntry (what at:(last From))))) (set Hidden What at:(mapEntry (what at:(last From))) False to:P1) (set Hidden What at:(mapEntry (what at:(last From))) False to:P2) (set Hidden What at:(last To) False to:Mover) (set Hidden Value at:(mapEntry (what at:(last From))) False to:P1) (set Hidden Value at:(mapEntry (what at:(last From))) False to:P2) (set Hidden Value at:(last To) False to:Mover)}) (and {(trigger ""FlagCaptured"" (next)) (remove (last To)) (fromTo (from (last From)) (to (last To)))}))) (note player:Mover ""attacks"" to:Next)))))))) (end (if (is Triggered ""FlagCaptured"" (next)) (result Mover Win))))}))","###Description Played on a board of 10x10 squares. The board has three 2x2 zones which cannot be entered, represented as water on the battlefield. each player controls 36 pieces which have individual army ranks. The goal is to capture the opponent's flag. Pieces can move only one space orthogonally. the Scout piece can move any number of spaces orthogonally. Pieces may attempt to capture an opposing piece; when doing so the ranks are revealed and the lower ranking piece is captured; if they are of equal rank they are both removed. There are bomb pieces which cannot move. Bombs eliminate other pieces attacking it and can only be removed by a miner. The spy can only attack the Marshall or the Flag. The scouts can not take each other, and winning is only possible in capturing the opponent flag @@ -5114,11 +4944,6 @@ Each turn you must move one of your stacks, in a straight line orthogonally or d ###Ludii (game ""Lielow"" (players 2) (equipment {(board (square 10)) (piece ""Disc"" Each)}) (rules (start {(place ""Disc1"" (difference (difference (expand (sites Bottom) steps:2) (expand (sites Bottom) steps:1)) (sites Outer))) (place ""Disc2"" (difference (difference (expand (sites Top) steps:2) (expand (sites Top) steps:1)) (sites Outer)))}) (play (forEach Piece (or (move (from) (to (sites Around (from) Empty distance:(size Stack at:(from))) (apply (if (and {(= 1 (state at:(from))) (is In (to) (sites Outer))}) (set Var ""MoverHasLost"" 1)))) count:(size Stack at:(from)) stack:True (then (add (to (last To) level:0) stack:True))) (move (from) (to (sites Around (from) Enemy distance:(size Stack at:(from))) (apply (and {(if (= 1 (state at:(to))) (set Var ""MoverHasWon"" 1)) (set Var (state at:(from))) (remove (to) count:(size Stack at:(to)))}))) count:(size Stack at:(from)) stack:True (then (if (< 1 (size Stack at:(last To))) (and (remove (last To) count:(- (size Stack at:(last To)) 1)) (set State at:(last To) (var))))))) Mover top:True (then (do (remove (sites Outer) count:(size Stack at:(last To))) next:(if (= 1 (count Sites in:(forEach (sites Occupied by:Mover) if:(= (size Stack at:(site)) (max (results from:(sites Occupied by:Mover) to:0 (size Stack at:(from)))))))) (forEach Piece (if (= (size Stack at:(from)) (max (results from:(sites Occupied by:Mover) to:0 (size Stack at:(from))))) (set State at:(from) 1) (set State at:(from) 0)) Mover top:True)))))) (end {(if (= 1 (var ""MoverHasLost"")) (result Mover Loss)) (if (= 1 (var ""MoverHasWon"")) (result Mover Win))})))" -"//------------------------------------------------------------------------------ General Rules: The following rules apply to all units, unless stated otherwise in their description: - All units move and measure distance orthogonally. - Units may move up to their maximum movement limit and can then attack an adjacent site. - Attacking a unit will deal damage to it (see damage calculation section). - If an attacked unit's health reaches zero, it will be removed from the battlefield. - Defending units that survive an attack, will then deal counter damage to their attacker. - Units can reinforce an adjacent unit of the same type, instead of attacking. - Both units must be owned by the same player. - Reinforcing will convert health from one unit to the other, transferring as much health as possible. - Any units that are left with zero health after reinforcing are removed. - A unit which has been reinforced cannot perform any further actions this turn. The following rules apply to all buildings: - There are five types of building: Town, Factory, Airport, Dock and Base. - Attacking a building will deal damage to it (see damage calculation section). - If an attacked building's health reaches zero, it will gain 50 health and change ownership to the player who attacked it. - Buildings that are attacked, will not deal counter damage. - Units can heal at an adjacent building that you own, instead of attacking. - Healing at a building, will convert health from the building to the unit, transferring as much health as possible. - Additional units can be purchased using gold at their corresponding production building. - To purchase a unit, drag it from your hand to an available site next to a production building that you own. - The cost of purchasing a unit is represented by its count. - Purchased units cannot move, attack or heal, on the same turn they are purchased. - Each player receives 10 gold for every Town they own and 20 gold for every Base they own, at the start of their turn. - Buildings gain 10 health at the end of the owning player's turn, up to a maximum of 100. - Grey buildings are neutral, and are not owned by any player. - If a player loses ownership of all their Bases, they lose the game. //------------------------------------------------------------------------------ Units: Human (Purchased from Towns) Soldier Move: 3 Health: 30 Cost: 30 Damage Factor: 50% Motorbike Move: 5 Health: 40 Cost: 50 Damage Factor: 50% Vehicle (Purchased from Factories) Speeder Move: 6 Health: 60 Cost: 60 Damage Factor: 40% Shooter Move: 4 Health: 60 Cost: 80 Damage Factor: 40% - Deals double damage against Humans. Tank Move: 4 Health: 80 Cost: 100 Damage Factor: 50% Anti-Aircraft Move: 4 Health: 50 Cost: 80 Damage Factor: 100% - Can only attack Aircraft. - Can attack units 1-2 spaces away. - Does not deal or receive counter damage during an attack. Missile Launcher Move: 3 Health: 50 Cost: 80 Damage Factor: 50% - Cannot attack Aircraft. - Can only attack units 2-3 spaces away. - Does not deal or receive counter damage during an attack. Artillery Move: 3 Health: 40 Cost: 100 Damage Factor: 100% - Cannot attack Aircraft. - Can only attack units 3-5 spaces away. - Does not deal or receive counter damage during an attack. - Cannot attack or heal in the same turn that it moved. Aircraft (Purchased from Airports) Helicopter Move: 4 Health: 40 Cost: 60 Damage Factor: 70% Fighter Jet Move: 6 Health: 100 Cost: 100 Damage Factor: 100% - Can only attack Aircraft. Bomber Move: 5 Health: 100 Cost: 120 Damage Factor: 80% - Cannot attack Aircraft. Boat (Purchased from Docks) Cruiser Move: 5 Health: 70 Cost: 60 Damage Factor: 50% Submarine Move: 5 Health: 100 Cost: 100 Damage Factor: 80% - Can only attack Boats. Battleship Move: 4 Health: 120 Cost: 120 Damage Factor: 50% - Cannot attack Aircraft. - Can only attack units 2-4 spaces away. - Does not deal or receive counter damage during an attack. //------------------------------------------------------------------------------ Movement Restrictions: Humans may travel across plains, forests, and shallow water. They may also move 1 space into mountains instead of their regular movement. Vehicles may travel across plains. They may also move 1 space into forests or shallow water instead of their regular movement. Aircraft may travel across all spaces. Boats may travel across shallow and deep water. Buildings cannot move (obviously). Units cannot move over enemy or neutral occupied spaces. //------------------------------------------------------------------------------ Damage Calculation: An attacking unit deals damage equal to its health, multiplied by its damage factor. For example, A submarine has a damage factor of 80%, so a submarine with 20 health will deal 16 damage when it attacks (20 x 0.8). If the defending unit is in shallow or deep water, it takes 25% more damage. If the defending unit is in a forest, it takes 25% less damage. Aircraft are unaffected by terrain when calculating damage against them. All damage values are rounded down to the nearest whole number. //------------------------------------------------------------------------------ Fog of War: (Optional) All friendly units and buildings can see tiles up to 2 spaces away. Aircraft can see tiles up to 3 spaces away. Boats can see shallow and deep water tiles up to 3 spaces away. Humans on a mountain can see tiles up to 3 spaces away. Forest and mountain tiles can only be seen if adjacent to them. Enemy units and buildings that are not visible cannot be attacked, and have their type and health hidden. //------------------------------------------------------------------------------ Army Doctrine: At the start of the game (selected via the game options) you may pick a doctrine for your army. None - No effect. Special Forces - Human units do 50% more damage, all other units do 25% less damage. Brute Strength - Direct Vehicle units (no range on their attack distance) do 50% more damage, all other units do 25% less damage. Sharpshooter - Indirect Vehicle units (range on their attack distance) do 50% more damage, all other units do 25% less damage. Ace Pilot - Aircraft units do 50% more damage, all other units do 25% less damage. Sea Dog - Boat units do 50% more damage, all other units do 25% less damage. Guerrilla Warfare - Attacks against buildings deal 50% more damage, but attacks against units deal 25% less damage. Foreign Invader - Attacks against buildings deal 50% less damage, but attacks against units deal 25% more damage. Conscription - Units cost 50% less gold, but do 50% less damage. Elite Training - Units cost 50% more gold, but do 50% more damage. Glass Cannon - Units do 50% more damage, but take 50% more damage. Hardened Resolve - Units do 50% less damage, but take 50% less damage. Preemptive Strike - Units do 50% more damage when attacking, but never deal counter damage. Retaliation - Units do 50% less damage when attacking, but deal 100% more counter damage. Lady Luck - All attack damage is randomly selected between 50% and 150% of the normal amount. //------------------------------------------------------------------------------ Scenario - First Encounter No Fog of War. Player 1 - No Doctrine. Player 2 - No Doctrine. Player 3 - No Doctrine. Player 4 - No Doctrine.","(game ""Mini Wars"" (players 2) (equipment {(board (hex 5)) (regions ""ShallowWater"" (sites {""A3"" ""B3"" ""C3"" ""C1""})) (regions ""DeepWater"" (sites {""A1"" ""A2"" ""B2"" ""B1""})) (regions ""Forest"" (sites {""I9"" ""H9"" ""G9"" ""A4"" ""A5"" ""D1"" ""E1"" ""E7"" ""D2"" ""E2""})) (regions ""Mountain"" (sites {""I8"" ""H7"" ""G7"" ""F6""})) (hand Shared size:14) (piece ""Base"" Each) (piece ""Factory"" Each) (piece ""Town"" Each) (piece ""Airport"" Each) (piece ""Dock"" Each) (piece ""Soldier"" Each (or {(or (move (from (from) if:(> (state at:(from)) 1)) (to (sites Distance (step Orthogonal (to if:(is In (to) (difference (union (sites Empty) (sites Occupied by:Friend container:""Board"")) (union (sites ""DeepWater"") (sites ""Mountain"")))))) from:(from) (range 1 (- (state at:(from)) 1))) if:(is Empty (to)) (apply (set State at:(from) 1)))) (move (from (from) if:(> (state at:(from)) 1)) (to (sites Distance (step Orthogonal (to if:(is In (to) (intersection (sites Empty) (sites ""Mountain""))))) from:(from) (range 1 (- 2 1))) if:(is Empty (to)) (apply (set State at:(from) 1))))) (move Select (from (from) if:(> (state at:(from)) 0)) (to (sites Distance Orthogonal from:(from) (range 1 1)) if:(and {(if (is In (from) (sites Occupied by:Mover container:""Board"" components:{""Bomber"" ""Battleship"" ""Artillery"" ""Launcher""})) (is In (to) (union (sites Occupied by:Enemy container:""Board"" components:{""Soldier"" ""Motorbike"" ""Tank"" ""Speeder"" ""Shooter"" ""Launcher"" ""Antiair"" ""Battleship"" ""Artillery"" ""Base"" ""Town"" ""Factory"" ""Dock"" ""Airport"" ""Cruiser"" ""Submarine""}) (sites Occupied by:Neutral container:""Board""))) (is In (to) (union (sites Occupied by:Enemy container:""Board"") (sites Occupied by:Neutral container:""Board"")))) (if (is In (from) (sites Occupied by:Mover container:""Board"" components:{""Antiair"" ""Fighter""})) (is In (to) (sites Occupied by:Enemy container:""Board"" components:{""Fighter"" ""Helicopter"" ""Bomber""})) (is In (to) (union (sites Occupied by:Enemy container:""Board"") (sites Occupied by:Neutral container:""Board"")))) (if (is In (from) (sites Occupied by:Mover container:""Board"" components:{""Submarine""})) (is In (to) (sites Occupied by:Enemy container:""Board"" components:{""Submarine"" ""Battleship"" ""Cruiser""})) (is In (to) (union (sites Occupied by:Enemy container:""Board"") (sites Occupied by:Neutral container:""Board""))))})) (then (do (and (set Value at:(last To) (max 0 (- (value Piece at:(last To)) (/ (* (if (is In (last To) (sites Occupied by:All container:""Board"" components:{""Fighter"" ""Bomber"" ""Helicopter""})) (max (/ (* (* (value Piece at:(last From)) 4) (mapEntry ""DamageMultiplier"" (what at:(last From)))) 100) 1) (if (and (is In (last To) (sites Occupied by:All container:""Board"" components:{""Soldier"" ""Motorbike""})) (is In (last From) (sites Occupied by:All component:""Shooter""))) (if (is In (last To) (sites ""Forest"")) (max (/ (* (* (value Piece at:(last From)) 6) (mapEntry ""DamageMultiplier"" (what at:(last From)))) 100) 1) (if (is In (last To) (union (sites ""ShallowWater"") (sites ""DeepWater""))) (max (/ (* (* (value Piece at:(last From)) 10) (mapEntry ""DamageMultiplier"" (what at:(last From)))) 100) 1) (max (/ (* (* (value Piece at:(last From)) 8) (mapEntry ""DamageMultiplier"" (what at:(last From)))) 100) 1))) (if (is In (last To) (sites ""Forest"")) (max (/ (* (* (value Piece at:(last From)) 3) (mapEntry ""DamageMultiplier"" (what at:(last From)))) 100) 1) (if (is In (last To) (union (sites ""ShallowWater"") (sites ""DeepWater""))) (max (/ (* (* (value Piece at:(last From)) 5) (mapEntry ""DamageMultiplier"" (what at:(last From)))) 100) 1) (max (/ (* (* (value Piece at:(last From)) 4) (mapEntry ""DamageMultiplier"" (what at:(last From)))) 100) 1))))) (* {(if (is In (last From) (sites Occupied by:All container:""Board"" components:{""Soldier"" ""Motorbike""})) (if (= (who at:(last From)) 1) (mapEntry ""NoDoctrine"" 1) (if (= (who at:(last From)) 2) (mapEntry ""NoDoctrine"" 1) (if (= (who at:(last From)) 3) (mapEntry ""NoDoctrine"" 1) (if (= (who at:(last From)) 4) (mapEntry ""NoDoctrine"" 1) 0)))) (if (is In (last From) (sites Occupied by:All container:""Board"" components:{""Tank"" ""Speeder"" ""Shooter""})) (if (= (who at:(last From)) 1) (mapEntry ""NoDoctrine"" 2) (if (= (who at:(last From)) 2) (mapEntry ""NoDoctrine"" 2) (if (= (who at:(last From)) 3) (mapEntry ""NoDoctrine"" 2) (if (= (who at:(last From)) 4) (mapEntry ""NoDoctrine"" 2) 0)))) (if (is In (last From) (sites Occupied by:All container:""Board"" components:{""Launcher"" ""Antiair"" ""Artillery""})) (if (= (who at:(last From)) 1) (mapEntry ""NoDoctrine"" 3) (if (= (who at:(last From)) 2) (mapEntry ""NoDoctrine"" 3) (if (= (who at:(last From)) 3) (mapEntry ""NoDoctrine"" 3) (if (= (who at:(last From)) 4) (mapEntry ""NoDoctrine"" 3) 0)))) (if (is In (last From) (sites Occupied by:All container:""Board"" components:{""Fighter"" ""Bomber"" ""Helicopter""})) (if (= (who at:(last From)) 1) (mapEntry ""NoDoctrine"" 4) (if (= (who at:(last From)) 2) (mapEntry ""NoDoctrine"" 4) (if (= (who at:(last From)) 3) (mapEntry ""NoDoctrine"" 4) (if (= (who at:(last From)) 4) (mapEntry ""NoDoctrine"" 4) 0)))) (if (is In (last From) (sites Occupied by:All container:""Board"" components:{""Submarine"" ""Cruiser"" ""Battleship""})) (if (= (who at:(last From)) 1) (mapEntry ""NoDoctrine"" 5) (if (= (who at:(last From)) 2) (mapEntry ""NoDoctrine"" 5) (if (= (who at:(last From)) 3) (mapEntry ""NoDoctrine"" 5) (if (= (who at:(last From)) 4) (mapEntry ""NoDoctrine"" 5) 0)))) 4))))) (if (and (= 8 (state at:(last To))) (!= (mover) (who at:(last To)))) (if (= (who at:(last From)) 1) (mapEntry ""NoDoctrine"" 6) (if (= (who at:(last From)) 2) (mapEntry ""NoDoctrine"" 6) (if (= (who at:(last From)) 3) (mapEntry ""NoDoctrine"" 6) (if (= (who at:(last From)) 4) (mapEntry ""NoDoctrine"" 6) 0)))) 5) (if (> (who at:(last To)) 0) (if (= (who at:(last To)) 1) (mapEntry ""NoDoctrine"" 8) (if (= (who at:(last To)) 2) (mapEntry ""NoDoctrine"" 8) (if (= (who at:(last To)) 3) (mapEntry ""NoDoctrine"" 8) (if (= (who at:(last To)) 4) (mapEntry ""NoDoctrine"" 8) 0)))) 4) (if False (if (= (who at:(last From)) 1) (mapEntry ""NoDoctrine"" 10) (if (= (who at:(last From)) 2) (mapEntry ""NoDoctrine"" 10) (if (= (who at:(last From)) 3) (mapEntry ""NoDoctrine"" 10) (if (= (who at:(last From)) 4) (mapEntry ""NoDoctrine"" 10) 0)))) (if (= (who at:(last From)) 1) (mapEntry ""NoDoctrine"" 9) (if (= (who at:(last From)) 2) (mapEntry ""NoDoctrine"" 9) (if (= (who at:(last From)) 3) (mapEntry ""NoDoctrine"" 9) (if (= (who at:(last From)) 4) (mapEntry ""NoDoctrine"" 9) 0))))) (value Random (range (if (= (who at:(last From)) 1) (mapEntry ""NoDoctrine"" 11) (if (= (who at:(last From)) 2) (mapEntry ""NoDoctrine"" 11) (if (= (who at:(last From)) 3) (mapEntry ""NoDoctrine"" 11) (if (= (who at:(last From)) 4) (mapEntry ""NoDoctrine"" 11) 0)))) (if (= (who at:(last From)) 1) (mapEntry ""NoDoctrine"" 12) (if (= (who at:(last From)) 2) (mapEntry ""NoDoctrine"" 12) (if (= (who at:(last From)) 3) (mapEntry ""NoDoctrine"" 12) (if (= (who at:(last From)) 4) (mapEntry ""NoDoctrine"" 12) 0))))))})) 128000)))) (set State at:(last From) 0)) next:(if (and (= 8 (state at:(last To))) (!= (mover) (who at:(last To)))) (if (= (value Piece at:(last To)) 0) (and {(take Control of:All by:Mover at:(last To)) (set Value at:(last To) 50)}) (set Value at:(last To) (value Piece at:(last To)))) (if (= (value Piece at:(last To)) 0) (remove (last To)) (if (and {(= 0 (count Sites in:(intersection (sites {(last To) (last From)}) (sites Occupied by:All components:{""Launcher"" ""Artillery"" ""Battleship"" ""Antiair""})))) (if (is In (last To) (sites Occupied by:Enemy components:{""Bomber"" ""Battleship"" ""Artillery"" ""Launcher""})) (is In (last From) (union (sites Occupied by:Mover components:{""Soldier"" ""Motorbike"" ""Tank"" ""Speeder"" ""Shooter"" ""Launcher"" ""Antiair"" ""Battleship"" ""Artillery"" ""Base"" ""Town"" ""Factory"" ""Dock"" ""Airport"" ""Cruiser"" ""Submarine""}) (sites Occupied by:Neutral container:""Board""))) (is In (last From) (union (sites Occupied by:Mover) (sites Occupied by:Neutral container:""Board"")))) (if (is In (last To) (sites Occupied by:Enemy components:{""Antiair"" ""Fighter""})) (is In (last From) (sites Occupied by:Mover components:{""Fighter"" ""Helicopter"" ""Bomber""})) (is In (last From) (union (sites Occupied by:Mover) (sites Occupied by:Neutral container:""Board"")))) (if (is In (last To) (sites Occupied by:Enemy components:{""Submarine""})) (is In (last From) (sites Occupied by:Mover components:{""Submarine"" ""Battleship"" ""Cruiser""})) (is In (last From) (union (sites Occupied by:Mover) (sites Occupied by:Neutral container:""Board""))))}) (if (<= (- (value Piece at:(last From)) (/ (* (if (is In (last From) (sites Occupied by:All container:""Board"" components:{""Fighter"" ""Bomber"" ""Helicopter""})) (max (/ (* (* (value Piece at:(last To)) 4) (mapEntry ""DamageMultiplier"" (what at:(last To)))) 100) 1) (if (and (is In (last From) (sites Occupied by:All container:""Board"" components:{""Soldier"" ""Motorbike""})) (is In (last To) (sites Occupied by:All component:""Shooter""))) (if (is In (last From) (sites ""Forest"")) (max (/ (* (* (value Piece at:(last To)) 6) (mapEntry ""DamageMultiplier"" (what at:(last To)))) 100) 1) (if (is In (last From) (union (sites ""ShallowWater"") (sites ""DeepWater""))) (max (/ (* (* (value Piece at:(last To)) 10) (mapEntry ""DamageMultiplier"" (what at:(last To)))) 100) 1) (max (/ (* (* (value Piece at:(last To)) 8) (mapEntry ""DamageMultiplier"" (what at:(last To)))) 100) 1))) (if (is In (last From) (sites ""Forest"")) (max (/ (* (* (value Piece at:(last To)) 3) (mapEntry ""DamageMultiplier"" (what at:(last To)))) 100) 1) (if (is In (last From) (union (sites ""ShallowWater"") (sites ""DeepWater""))) (max (/ (* (* (value Piece at:(last To)) 5) (mapEntry ""DamageMultiplier"" (what at:(last To)))) 100) 1) (max (/ (* (* (value Piece at:(last To)) 4) (mapEntry ""DamageMultiplier"" (what at:(last To)))) 100) 1))))) (* {(if (is In (last To) (sites Occupied by:All container:""Board"" components:{""Soldier"" ""Motorbike""})) (if (= (who at:(last To)) 1) (mapEntry ""NoDoctrine"" 1) (if (= (who at:(last To)) 2) (mapEntry ""NoDoctrine"" 1) (if (= (who at:(last To)) 3) (mapEntry ""NoDoctrine"" 1) (if (= (who at:(last To)) 4) (mapEntry ""NoDoctrine"" 1) 0)))) (if (is In (last To) (sites Occupied by:All container:""Board"" components:{""Tank"" ""Speeder"" ""Shooter""})) (if (= (who at:(last To)) 1) (mapEntry ""NoDoctrine"" 2) (if (= (who at:(last To)) 2) (mapEntry ""NoDoctrine"" 2) (if (= (who at:(last To)) 3) (mapEntry ""NoDoctrine"" 2) (if (= (who at:(last To)) 4) (mapEntry ""NoDoctrine"" 2) 0)))) (if (is In (last To) (sites Occupied by:All container:""Board"" components:{""Launcher"" ""Antiair"" ""Artillery""})) (if (= (who at:(last To)) 1) (mapEntry ""NoDoctrine"" 3) (if (= (who at:(last To)) 2) (mapEntry ""NoDoctrine"" 3) (if (= (who at:(last To)) 3) (mapEntry ""NoDoctrine"" 3) (if (= (who at:(last To)) 4) (mapEntry ""NoDoctrine"" 3) 0)))) (if (is In (last To) (sites Occupied by:All container:""Board"" components:{""Fighter"" ""Bomber"" ""Helicopter""})) (if (= (who at:(last To)) 1) (mapEntry ""NoDoctrine"" 4) (if (= (who at:(last To)) 2) (mapEntry ""NoDoctrine"" 4) (if (= (who at:(last To)) 3) (mapEntry ""NoDoctrine"" 4) (if (= (who at:(last To)) 4) (mapEntry ""NoDoctrine"" 4) 0)))) (if (is In (last To) (sites Occupied by:All container:""Board"" components:{""Submarine"" ""Cruiser"" ""Battleship""})) (if (= (who at:(last To)) 1) (mapEntry ""NoDoctrine"" 5) (if (= (who at:(last To)) 2) (mapEntry ""NoDoctrine"" 5) (if (= (who at:(last To)) 3) (mapEntry ""NoDoctrine"" 5) (if (= (who at:(last To)) 4) (mapEntry ""NoDoctrine"" 5) 0)))) 4))))) (if (and (= 8 (state at:(last From))) (!= (mover) (who at:(last From)))) (if (= (who at:(last To)) 1) (mapEntry ""NoDoctrine"" 6) (if (= (who at:(last To)) 2) (mapEntry ""NoDoctrine"" 6) (if (= (who at:(last To)) 3) (mapEntry ""NoDoctrine"" 6) (if (= (who at:(last To)) 4) (mapEntry ""NoDoctrine"" 6) 0)))) 5) (if (> (who at:(last From)) 0) (if (= (who at:(last From)) 1) (mapEntry ""NoDoctrine"" 8) (if (= (who at:(last From)) 2) (mapEntry ""NoDoctrine"" 8) (if (= (who at:(last From)) 3) (mapEntry ""NoDoctrine"" 8) (if (= (who at:(last From)) 4) (mapEntry ""NoDoctrine"" 8) 0)))) 4) (if True (if (= (who at:(last To)) 1) (mapEntry ""NoDoctrine"" 10) (if (= (who at:(last To)) 2) (mapEntry ""NoDoctrine"" 10) (if (= (who at:(last To)) 3) (mapEntry ""NoDoctrine"" 10) (if (= (who at:(last To)) 4) (mapEntry ""NoDoctrine"" 10) 0)))) (if (= (who at:(last To)) 1) (mapEntry ""NoDoctrine"" 9) (if (= (who at:(last To)) 2) (mapEntry ""NoDoctrine"" 9) (if (= (who at:(last To)) 3) (mapEntry ""NoDoctrine"" 9) (if (= (who at:(last To)) 4) (mapEntry ""NoDoctrine"" 9) 0))))) (value Random (range (if (= (who at:(last To)) 1) (mapEntry ""NoDoctrine"" 11) (if (= (who at:(last To)) 2) (mapEntry ""NoDoctrine"" 11) (if (= (who at:(last To)) 3) (mapEntry ""NoDoctrine"" 11) (if (= (who at:(last To)) 4) (mapEntry ""NoDoctrine"" 11) 0)))) (if (= (who at:(last To)) 1) (mapEntry ""NoDoctrine"" 12) (if (= (who at:(last To)) 2) (mapEntry ""NoDoctrine"" 12) (if (= (who at:(last To)) 3) (mapEntry ""NoDoctrine"" 12) (if (= (who at:(last To)) 4) (mapEntry ""NoDoctrine"" 12) 0))))))})) 128000)) 0) (remove (last From)) (set Value at:(last From) (- (value Piece at:(last From)) (/ (* (if (is In (last From) (sites Occupied by:All container:""Board"" components:{""Fighter"" ""Bomber"" ""Helicopter""})) (max (/ (* (* (value Piece at:(last To)) 4) (mapEntry ""DamageMultiplier"" (what at:(last To)))) 100) 1) (if (and (is In (last From) (sites Occupied by:All container:""Board"" components:{""Soldier"" ""Motorbike""})) (is In (last To) (sites Occupied by:All component:""Shooter""))) (if (is In (last From) (sites ""Forest"")) (max (/ (* (* (value Piece at:(last To)) 6) (mapEntry ""DamageMultiplier"" (what at:(last To)))) 100) 1) (if (is In (last From) (union (sites ""ShallowWater"") (sites ""DeepWater""))) (max (/ (* (* (value Piece at:(last To)) 10) (mapEntry ""DamageMultiplier"" (what at:(last To)))) 100) 1) (max (/ (* (* (value Piece at:(last To)) 8) (mapEntry ""DamageMultiplier"" (what at:(last To)))) 100) 1))) (if (is In (last From) (sites ""Forest"")) (max (/ (* (* (value Piece at:(last To)) 3) (mapEntry ""DamageMultiplier"" (what at:(last To)))) 100) 1) (if (is In (last From) (union (sites ""ShallowWater"") (sites ""DeepWater""))) (max (/ (* (* (value Piece at:(last To)) 5) (mapEntry ""DamageMultiplier"" (what at:(last To)))) 100) 1) (max (/ (* (* (value Piece at:(last To)) 4) (mapEntry ""DamageMultiplier"" (what at:(last To)))) 100) 1))))) (* {(if (is In (last To) (sites Occupied by:All container:""Board"" components:{""Soldier"" ""Motorbike""})) (if (= (who at:(last To)) 1) (mapEntry ""NoDoctrine"" 1) (if (= (who at:(last To)) 2) (mapEntry ""NoDoctrine"" 1) (if (= (who at:(last To)) 3) (mapEntry ""NoDoctrine"" 1) (if (= (who at:(last To)) 4) (mapEntry ""NoDoctrine"" 1) 0)))) (if (is In (last To) (sites Occupied by:All container:""Board"" components:{""Tank"" ""Speeder"" ""Shooter""})) (if (= (who at:(last To)) 1) (mapEntry ""NoDoctrine"" 2) (if (= (who at:(last To)) 2) (mapEntry ""NoDoctrine"" 2) (if (= (who at:(last To)) 3) (mapEntry ""NoDoctrine"" 2) (if (= (who at:(last To)) 4) (mapEntry ""NoDoctrine"" 2) 0)))) (if (is In (last To) (sites Occupied by:All container:""Board"" components:{""Launcher"" ""Antiair"" ""Artillery""})) (if (= (who at:(last To)) 1) (mapEntry ""NoDoctrine"" 3) (if (= (who at:(last To)) 2) (mapEntry ""NoDoctrine"" 3) (if (= (who at:(last To)) 3) (mapEntry ""NoDoctrine"" 3) (if (= (who at:(last To)) 4) (mapEntry ""NoDoctrine"" 3) 0)))) (if (is In (last To) (sites Occupied by:All container:""Board"" components:{""Fighter"" ""Bomber"" ""Helicopter""})) (if (= (who at:(last To)) 1) (mapEntry ""NoDoctrine"" 4) (if (= (who at:(last To)) 2) (mapEntry ""NoDoctrine"" 4) (if (= (who at:(last To)) 3) (mapEntry ""NoDoctrine"" 4) (if (= (who at:(last To)) 4) (mapEntry ""NoDoctrine"" 4) 0)))) (if (is In (last To) (sites Occupied by:All container:""Board"" components:{""Submarine"" ""Cruiser"" ""Battleship""})) (if (= (who at:(last To)) 1) (mapEntry ""NoDoctrine"" 5) (if (= (who at:(last To)) 2) (mapEntry ""NoDoctrine"" 5) (if (= (who at:(last To)) 3) (mapEntry ""NoDoctrine"" 5) (if (= (who at:(last To)) 4) (mapEntry ""NoDoctrine"" 5) 0)))) 4))))) (if (and (= 8 (state at:(last From))) (!= (mover) (who at:(last From)))) (if (= (who at:(last To)) 1) (mapEntry ""NoDoctrine"" 6) (if (= (who at:(last To)) 2) (mapEntry ""NoDoctrine"" 6) (if (= (who at:(last To)) 3) (mapEntry ""NoDoctrine"" 6) (if (= (who at:(last To)) 4) (mapEntry ""NoDoctrine"" 6) 0)))) 5) (if (> (who at:(last From)) 0) (if (= (who at:(last From)) 1) (mapEntry ""NoDoctrine"" 8) (if (= (who at:(last From)) 2) (mapEntry ""NoDoctrine"" 8) (if (= (who at:(last From)) 3) (mapEntry ""NoDoctrine"" 8) (if (= (who at:(last From)) 4) (mapEntry ""NoDoctrine"" 8) 0)))) 4) (if True (if (= (who at:(last To)) 1) (mapEntry ""NoDoctrine"" 10) (if (= (who at:(last To)) 2) (mapEntry ""NoDoctrine"" 10) (if (= (who at:(last To)) 3) (mapEntry ""NoDoctrine"" 10) (if (= (who at:(last To)) 4) (mapEntry ""NoDoctrine"" 10) 0)))) (if (= (who at:(last To)) 1) (mapEntry ""NoDoctrine"" 9) (if (= (who at:(last To)) 2) (mapEntry ""NoDoctrine"" 9) (if (= (who at:(last To)) 3) (mapEntry ""NoDoctrine"" 9) (if (= (who at:(last To)) 4) (mapEntry ""NoDoctrine"" 9) 0))))) (value Random (range (if (= (who at:(last To)) 1) (mapEntry ""NoDoctrine"" 11) (if (= (who at:(last To)) 2) (mapEntry ""NoDoctrine"" 11) (if (= (who at:(last To)) 3) (mapEntry ""NoDoctrine"" 11) (if (= (who at:(last To)) 4) (mapEntry ""NoDoctrine"" 11) 0)))) (if (= (who at:(last To)) 1) (mapEntry ""NoDoctrine"" 12) (if (= (who at:(last To)) 2) (mapEntry ""NoDoctrine"" 12) (if (= (who at:(last To)) 3) (mapEntry ""NoDoctrine"" 12) (if (= (who at:(last To)) 4) (mapEntry ""NoDoctrine"" 12) 0))))))})) 128000)))) (set Value at:(last From) (value Piece at:(last From))))))))) (move Select (from (from) if:(and (> (state at:(from)) 0) (< (value Piece at:(from)) (mapEntry ""MaxHealth"" (what at:(from)))))) (to (sites Around (from) Orthogonal if:(is In (to) (sites Occupied by:Mover container:""Board"" components:{""Town"" ""Dock"" ""Base"" ""Factory"" ""Airport""})))) (then (and {(set Value at:(last From) (min (mapEntry ""MaxHealth"" (what at:(last From))) (- (+ (value Piece at:(last From)) (value Piece at:(last To))) 1))) (set Value at:(last To) (max (- (value Piece at:(last To)) (- (mapEntry ""MaxHealth"" (what at:(last From))) (value Piece at:(last From)))) 1)) (set State at:(last From) 0)}))) (move Select (from (from) if:(> (state at:(from)) 0)) (to (sites Around (from) Orthogonal if:(and (= (what at:(from)) (what at:(to))) (< (value Piece at:(to)) (mapEntry ""MaxHealth"" (what at:(to))))))) (then (and {(if (<= (+ (value Piece at:(last To)) (value Piece at:(last From))) (mapEntry ""MaxHealth"" (what at:(last From)))) (and (set Value at:(last To) (min (mapEntry ""MaxHealth"" (what at:(last From))) (+ (value Piece at:(last From)) (value Piece at:(last To))))) (remove (last From))) (and (set Value at:(last To) (min (mapEntry ""MaxHealth"" (what at:(last From))) (- (+ (value Piece at:(last From)) (value Piece at:(last To))) 1))) (set Value at:(last From) (max (- (value Piece at:(last To)) (- (mapEntry ""MaxHealth"" (what at:(last From))) (value Piece at:(last From)))) 1)))) (set State at:(last From) 0) (set State at:(last To) 0)})))})) (piece ""Motorbike"" Each (or {(or (move (from (from) if:(> (state at:(from)) 1)) (to (sites Distance (step Orthogonal (to if:(is In (to) (difference (union (sites Empty) (sites Occupied by:Friend container:""Board"")) (union (sites ""DeepWater"") (sites ""Mountain"")))))) from:(from) (range 1 (- (state at:(from)) 1))) if:(is Empty (to)) (apply (set State at:(from) 1)))) (move (from (from) if:(> (state at:(from)) 1)) (to (sites Distance (step Orthogonal (to if:(is In (to) (intersection (sites Empty) (sites ""Mountain""))))) from:(from) (range 1 (- 2 1))) if:(is Empty (to)) (apply (set State at:(from) 1))))) (move Select (from (from) if:(> (state at:(from)) 0)) (to (sites Distance Orthogonal from:(from) (range 1 1)) if:(and {(if (is In (from) (sites Occupied by:Mover container:""Board"" components:{""Bomber"" ""Battleship"" ""Artillery"" ""Launcher""})) (is In (to) (union (sites Occupied by:Enemy container:""Board"" components:{""Soldier"" ""Motorbike"" ""Tank"" ""Speeder"" ""Shooter"" ""Launcher"" ""Antiair"" ""Battleship"" ""Artillery"" ""Base"" ""Town"" ""Factory"" ""Dock"" ""Airport"" ""Cruiser"" ""Submarine""}) (sites Occupied by:Neutral container:""Board""))) (is In (to) (union (sites Occupied by:Enemy container:""Board"") (sites Occupied by:Neutral container:""Board"")))) (if (is In (from) (sites Occupied by:Mover container:""Board"" components:{""Antiair"" ""Fighter""})) (is In (to) (sites Occupied by:Enemy container:""Board"" components:{""Fighter"" ""Helicopter"" ""Bomber""})) (is In (to) (union (sites Occupied by:Enemy container:""Board"") (sites Occupied by:Neutral container:""Board"")))) (if (is In (from) (sites Occupied by:Mover container:""Board"" components:{""Submarine""})) (is In (to) (sites Occupied by:Enemy container:""Board"" components:{""Submarine"" ""Battleship"" ""Cruiser""})) (is In (to) (union (sites Occupied by:Enemy container:""Board"") (sites Occupied by:Neutral container:""Board""))))})) (then (do (and (set Value at:(last To) (max 0 (- (value Piece at:(last To)) (/ (* (if (is In (last To) (sites Occupied by:All container:""Board"" components:{""Fighter"" ""Bomber"" ""Helicopter""})) (max (/ (* (* (value Piece at:(last From)) 4) (mapEntry ""DamageMultiplier"" (what at:(last From)))) 100) 1) (if (and (is In (last To) (sites Occupied by:All container:""Board"" components:{""Soldier"" ""Motorbike""})) (is In (last From) (sites Occupied by:All component:""Shooter""))) (if (is In (last To) (sites ""Forest"")) (max (/ (* (* (value Piece at:(last From)) 6) (mapEntry ""DamageMultiplier"" (what at:(last From)))) 100) 1) (if (is In (last To) (union (sites ""ShallowWater"") (sites ""DeepWater""))) (max (/ (* (* (value Piece at:(last From)) 10) (mapEntry ""DamageMultiplier"" (what at:(last From)))) 100) 1) (max (/ (* (* (value Piece at:(last From)) 8) (mapEntry ""DamageMultiplier"" (what at:(last From)))) 100) 1))) (if (is In (last To) (sites ""Forest"")) (max (/ (* (* (value Piece at:(last From)) 3) (mapEntry ""DamageMultiplier"" (what at:(last From)))) 100) 1) (if (is In (last To) (union (sites ""ShallowWater"") (sites ""DeepWater""))) (max (/ (* (* (value Piece at:(last From)) 5) (mapEntry ""DamageMultiplier"" (what at:(last From)))) 100) 1) (max (/ (* (* (value Piece at:(last From)) 4) (mapEntry ""DamageMultiplier"" (what at:(last From)))) 100) 1))))) (* {(if (is In (last From) (sites Occupied by:All container:""Board"" components:{""Soldier"" ""Motorbike""})) (if (= (who at:(last From)) 1) (mapEntry ""NoDoctrine"" 1) (if (= (who at:(last From)) 2) (mapEntry ""NoDoctrine"" 1) (if (= (who at:(last From)) 3) (mapEntry ""NoDoctrine"" 1) (if (= (who at:(last From)) 4) (mapEntry ""NoDoctrine"" 1) 0)))) (if (is In (last From) (sites Occupied by:All container:""Board"" components:{""Tank"" ""Speeder"" ""Shooter""})) (if (= (who at:(last From)) 1) (mapEntry ""NoDoctrine"" 2) (if (= (who at:(last From)) 2) (mapEntry ""NoDoctrine"" 2) (if (= (who at:(last From)) 3) (mapEntry ""NoDoctrine"" 2) (if (= (who at:(last From)) 4) (mapEntry ""NoDoctrine"" 2) 0)))) (if (is In (last From) (sites Occupied by:All container:""Board"" components:{""Launcher"" ""Antiair"" ""Artillery""})) (if (= (who at:(last From)) 1) (mapEntry ""NoDoctrine"" 3) (if (= (who at:(last From)) 2) (mapEntry ""NoDoctrine"" 3) (if (= (who at:(last From)) 3) (mapEntry ""NoDoctrine"" 3) (if (= (who at:(last From)) 4) (mapEntry ""NoDoctrine"" 3) 0)))) (if (is In (last From) (sites Occupied by:All container:""Board"" components:{""Fighter"" ""Bomber"" ""Helicopter""})) (if (= (who at:(last From)) 1) (mapEntry ""NoDoctrine"" 4) (if (= (who at:(last From)) 2) (mapEntry ""NoDoctrine"" 4) (if (= (who at:(last From)) 3) (mapEntry ""NoDoctrine"" 4) (if (= (who at:(last From)) 4) (mapEntry ""NoDoctrine"" 4) 0)))) (if (is In (last From) (sites Occupied by:All container:""Board"" components:{""Submarine"" ""Cruiser"" ""Battleship""})) (if (= (who at:(last From)) 1) (mapEntry ""NoDoctrine"" 5) (if (= (who at:(last From)) 2) (mapEntry ""NoDoctrine"" 5) (if (= (who at:(last From)) 3) (mapEntry ""NoDoctrine"" 5) (if (= (who at:(last From)) 4) (mapEntry ""NoDoctrine"" 5) 0)))) 4))))) (if (and (= 8 (state at:(last To))) (!= (mover) (who at:(last To)))) (if (= (who at:(last From)) 1) (mapEntry ""NoDoctrine"" 6) (if (= (who at:(last From)) 2) (mapEntry ""NoDoctrine"" 6) (if (= (who at:(last From)) 3) (mapEntry ""NoDoctrine"" 6) (if (= (who at:(last From)) 4) (mapEntry ""NoDoctrine"" 6) 0)))) 5) (if (> (who at:(last To)) 0) (if (= (who at:(last To)) 1) (mapEntry ""NoDoctrine"" 8) (if (= (who at:(last To)) 2) (mapEntry ""NoDoctrine"" 8) (if (= (who at:(last To)) 3) (mapEntry ""NoDoctrine"" 8) (if (= (who at:(last To)) 4) (mapEntry ""NoDoctrine"" 8) 0)))) 4) (if False (if (= (who at:(last From)) 1) (mapEntry ""NoDoctrine"" 10) (if (= (who at:(last From)) 2) (mapEntry ""NoDoctrine"" 10) (if (= (who at:(last From)) 3) (mapEntry ""NoDoctrine"" 10) (if (= (who at:(last From)) 4) (mapEntry ""NoDoctrine"" 10) 0)))) (if (= (who at:(last From)) 1) (mapEntry ""NoDoctrine"" 9) (if (= (who at:(last From)) 2) (mapEntry ""NoDoctrine"" 9) (if (= (who at:(last From)) 3) (mapEntry ""NoDoctrine"" 9) (if (= (who at:(last From)) 4) (mapEntry ""NoDoctrine"" 9) 0))))) (value Random (range (if (= (who at:(last From)) 1) (mapEntry ""NoDoctrine"" 11) (if (= (who at:(last From)) 2) (mapEntry ""NoDoctrine"" 11) (if (= (who at:(last From)) 3) (mapEntry ""NoDoctrine"" 11) (if (= (who at:(last From)) 4) (mapEntry ""NoDoctrine"" 11) 0)))) (if (= (who at:(last From)) 1) (mapEntry ""NoDoctrine"" 12) (if (= (who at:(last From)) 2) (mapEntry ""NoDoctrine"" 12) (if (= (who at:(last From)) 3) (mapEntry ""NoDoctrine"" 12) (if (= (who at:(last From)) 4) (mapEntry ""NoDoctrine"" 12) 0))))))})) 128000)))) (set State at:(last From) 0)) next:(if (and (= 8 (state at:(last To))) (!= (mover) (who at:(last To)))) (if (= (value Piece at:(last To)) 0) (and {(take Control of:All by:Mover at:(last To)) (set Value at:(last To) 50)}) (set Value at:(last To) (value Piece at:(last To)))) (if (= (value Piece at:(last To)) 0) (remove (last To)) (if (and {(= 0 (count Sites in:(intersection (sites {(last To) (last From)}) (sites Occupied by:All components:{""Launcher"" ""Artillery"" ""Battleship"" ""Antiair""})))) (if (is In (last To) (sites Occupied by:Enemy components:{""Bomber"" ""Battleship"" ""Artillery"" ""Launcher""})) (is In (last From) (union (sites Occupied by:Mover components:{""Soldier"" ""Motorbike"" ""Tank"" ""Speeder"" ""Shooter"" ""Launcher"" ""Antiair"" ""Battleship"" ""Artillery"" ""Base"" ""Town"" ""Factory"" ""Dock"" ""Airport"" ""Cruiser"" ""Submarine""}) (sites Occupied by:Neutral container:""Board""))) (is In (last From) (union (sites Occupied by:Mover) (sites Occupied by:Neutral container:""Board"")))) (if (is In (last To) (sites Occupied by:Enemy components:{""Antiair"" ""Fighter""})) (is In (last From) (sites Occupied by:Mover components:{""Fighter"" ""Helicopter"" ""Bomber""})) (is In (last From) (union (sites Occupied by:Mover) (sites Occupied by:Neutral container:""Board"")))) (if (is In (last To) (sites Occupied by:Enemy components:{""Submarine""})) (is In (last From) (sites Occupied by:Mover components:{""Submarine"" ""Battleship"" ""Cruiser""})) (is In (last From) (union (sites Occupied by:Mover) (sites Occupied by:Neutral container:""Board""))))}) (if (<= (- (value Piece at:(last From)) (/ (* (if (is In (last From) (sites Occupied by:All container:""Board"" components:{""Fighter"" ""Bomber"" ""Helicopter""})) (max (/ (* (* (value Piece at:(last To)) 4) (mapEntry ""DamageMultiplier"" (what at:(last To)))) 100) 1) (if (and (is In (last From) (sites Occupied by:All container:""Board"" components:{""Soldier"" ""Motorbike""})) (is In (last To) (sites Occupied by:All component:""Shooter""))) (if (is In (last From) (sites ""Forest"")) (max (/ (* (* (value Piece at:(last To)) 6) (mapEntry ""DamageMultiplier"" (what at:(last To)))) 100) 1) (if (is In (last From) (union (sites ""ShallowWater"") (sites ""DeepWater""))) (max (/ (* (* (value Piece at:(last To)) 10) (mapEntry ""DamageMultiplier"" (what at:(last To)))) 100) 1) (max (/ (* (* (value Piece at:(last To)) 8) (mapEntry ""DamageMultiplier"" (what at:(last To)))) 100) 1))) (if (is In (last From) (sites ""Forest"")) (max (/ (* (* (value Piece at:(last To)) 3) (mapEntry ""DamageMultiplier"" (what at:(last To)))) 100) 1) (if (is In (last From) (union (sites ""ShallowWater"") (sites ""DeepWater""))) (max (/ (* (* (value Piece at:(last To)) 5) (mapEntry ""DamageMultiplier"" (what at:(last To)))) 100) 1) (max (/ (* (* (value Piece at:(last To)) 4) (mapEntry ""DamageMultiplier"" (what at:(last To)))) 100) 1))))) (* {(if (is In (last To) (sites Occupied by:All container:""Board"" components:{""Soldier"" ""Motorbike""})) (if (= (who at:(last To)) 1) (mapEntry ""NoDoctrine"" 1) (if (= (who at:(last To)) 2) (mapEntry ""NoDoctrine"" 1) (if (= (who at:(last To)) 3) (mapEntry ""NoDoctrine"" 1) (if (= (who at:(last To)) 4) (mapEntry ""NoDoctrine"" 1) 0)))) (if (is In (last To) (sites Occupied by:All container:""Board"" components:{""Tank"" ""Speeder"" ""Shooter""})) (if (= (who at:(last To)) 1) (mapEntry ""NoDoctrine"" 2) (if (= (who at:(last To)) 2) (mapEntry ""NoDoctrine"" 2) (if (= (who at:(last To)) 3) (mapEntry ""NoDoctrine"" 2) (if (= (who at:(last To)) 4) (mapEntry ""NoDoctrine"" 2) 0)))) (if (is In (last To) (sites Occupied by:All container:""Board"" components:{""Launcher"" ""Antiair"" ""Artillery""})) (if (= (who at:(last To)) 1) (mapEntry ""NoDoctrine"" 3) (if (= (who at:(last To)) 2) (mapEntry ""NoDoctrine"" 3) (if (= (who at:(last To)) 3) (mapEntry ""NoDoctrine"" 3) (if (= (who at:(last To)) 4) (mapEntry ""NoDoctrine"" 3) 0)))) (if (is In (last To) (sites Occupied by:All container:""Board"" components:{""Fighter"" ""Bomber"" ""Helicopter""})) (if (= (who at:(last To)) 1) (mapEntry ""NoDoctrine"" 4) (if (= (who at:(last To)) 2) (mapEntry ""NoDoctrine"" 4) (if (= (who at:(last To)) 3) (mapEntry ""NoDoctrine"" 4) (if (= (who at:(last To)) 4) (mapEntry ""NoDoctrine"" 4) 0)))) (if (is In (last To) (sites Occupied by:All container:""Board"" components:{""Submarine"" ""Cruiser"" ""Battleship""})) (if (= (who at:(last To)) 1) (mapEntry ""NoDoctrine"" 5) (if (= (who at:(last To)) 2) (mapEntry ""NoDoctrine"" 5) (if (= (who at:(last To)) 3) (mapEntry ""NoDoctrine"" 5) (if (= (who at:(last To)) 4) (mapEntry ""NoDoctrine"" 5) 0)))) 4))))) (if (and (= 8 (state at:(last From))) (!= (mover) (who at:(last From)))) (if (= (who at:(last To)) 1) (mapEntry ""NoDoctrine"" 6) (if (= (who at:(last To)) 2) (mapEntry ""NoDoctrine"" 6) (if (= (who at:(last To)) 3) (mapEntry ""NoDoctrine"" 6) (if (= (who at:(last To)) 4) (mapEntry ""NoDoctrine"" 6) 0)))) 5) (if (> (who at:(last From)) 0) (if (= (who at:(last From)) 1) (mapEntry ""NoDoctrine"" 8) (if (= (who at:(last From)) 2) (mapEntry ""NoDoctrine"" 8) (if (= (who at:(last From)) 3) (mapEntry ""NoDoctrine"" 8) (if (= (who at:(last From)) 4) (mapEntry ""NoDoctrine"" 8) 0)))) 4) (if True (if (= (who at:(last To)) 1) (mapEntry ""NoDoctrine"" 10) (if (= (who at:(last To)) 2) (mapEntry ""NoDoctrine"" 10) (if (= (who at:(last To)) 3) (mapEntry ""NoDoctrine"" 10) (if (= (who at:(last To)) 4) (mapEntry ""NoDoctrine"" 10) 0)))) (if (= (who at:(last To)) 1) (mapEntry ""NoDoctrine"" 9) (if (= (who at:(last To)) 2) (mapEntry ""NoDoctrine"" 9) (if (= (who at:(last To)) 3) (mapEntry ""NoDoctrine"" 9) (if (= (who at:(last To)) 4) (mapEntry ""NoDoctrine"" 9) 0))))) (value Random (range (if (= (who at:(last To)) 1) (mapEntry ""NoDoctrine"" 11) (if (= (who at:(last To)) 2) (mapEntry ""NoDoctrine"" 11) (if (= (who at:(last To)) 3) (mapEntry ""NoDoctrine"" 11) (if (= (who at:(last To)) 4) (mapEntry ""NoDoctrine"" 11) 0)))) (if (= (who at:(last To)) 1) (mapEntry ""NoDoctrine"" 12) (if (= (who at:(last To)) 2) (mapEntry ""NoDoctrine"" 12) (if (= (who at:(last To)) 3) (mapEntry ""NoDoctrine"" 12) (if (= (who at:(last To)) 4) (mapEntry ""NoDoctrine"" 12) 0))))))})) 128000)) 0) (remove (last From)) (set Value at:(last From) (- (value Piece at:(last From)) (/ (* (if (is In (last From) (sites Occupied by:All container:""Board"" components:{""Fighter"" ""Bomber"" ""Helicopter""})) (max (/ (* (* (value Piece at:(last To)) 4) (mapEntry ""DamageMultiplier"" (what at:(last To)))) 100) 1) (if (and (is In (last From) (sites Occupied by:All container:""Board"" components:{""Soldier"" ""Motorbike""})) (is In (last To) (sites Occupied by:All component:""Shooter""))) (if (is In (last From) (sites ""Forest"")) (max (/ (* (* (value Piece at:(last To)) 6) (mapEntry ""DamageMultiplier"" (what at:(last To)))) 100) 1) (if (is In (last From) (union (sites ""ShallowWater"") (sites ""DeepWater""))) (max (/ (* (* (value Piece at:(last To)) 10) (mapEntry ""DamageMultiplier"" (what at:(last To)))) 100) 1) (max (/ (* (* (value Piece at:(last To)) 8) (mapEntry ""DamageMultiplier"" (what at:(last To)))) 100) 1))) (if (is In (last From) (sites ""Forest"")) (max (/ (* (* (value Piece at:(last To)) 3) (mapEntry ""DamageMultiplier"" (what at:(last To)))) 100) 1) (if (is In (last From) (union (sites ""ShallowWater"") (sites ""DeepWater""))) (max (/ (* (* (value Piece at:(last To)) 5) (mapEntry ""DamageMultiplier"" (what at:(last To)))) 100) 1) (max (/ (* (* (value Piece at:(last To)) 4) (mapEntry ""DamageMultiplier"" (what at:(last To)))) 100) 1))))) (* {(if (is In (last To) (sites Occupied by:All container:""Board"" components:{""Soldier"" ""Motorbike""})) (if (= (who at:(last To)) 1) (mapEntry ""NoDoctrine"" 1) (if (= (who at:(last To)) 2) (mapEntry ""NoDoctrine"" 1) (if (= (who at:(last To)) 3) (mapEntry ""NoDoctrine"" 1) (if (= (who at:(last To)) 4) (mapEntry ""NoDoctrine"" 1) 0)))) (if (is In (last To) (sites Occupied by:All container:""Board"" components:{""Tank"" ""Speeder"" ""Shooter""})) (if (= (who at:(last To)) 1) (mapEntry ""NoDoctrine"" 2) (if (= (who at:(last To)) 2) (mapEntry ""NoDoctrine"" 2) (if (= (who at:(last To)) 3) (mapEntry ""NoDoctrine"" 2) (if (= (who at:(last To)) 4) (mapEntry ""NoDoctrine"" 2) 0)))) (if (is In (last To) (sites Occupied by:All container:""Board"" components:{""Launcher"" ""Antiair"" ""Artillery""})) (if (= (who at:(last To)) 1) (mapEntry ""NoDoctrine"" 3) (if (= (who at:(last To)) 2) (mapEntry ""NoDoctrine"" 3) (if (= (who at:(last To)) 3) (mapEntry ""NoDoctrine"" 3) (if (= (who at:(last To)) 4) (mapEntry ""NoDoctrine"" 3) 0)))) (if (is In (last To) (sites Occupied by:All container:""Board"" components:{""Fighter"" ""Bomber"" ""Helicopter""})) (if (= (who at:(last To)) 1) (mapEntry ""NoDoctrine"" 4) (if (= (who at:(last To)) 2) (mapEntry ""NoDoctrine"" 4) (if (= (who at:(last To)) 3) (mapEntry ""NoDoctrine"" 4) (if (= (who at:(last To)) 4) (mapEntry ""NoDoctrine"" 4) 0)))) (if (is In (last To) (sites Occupied by:All container:""Board"" components:{""Submarine"" ""Cruiser"" ""Battleship""})) (if (= (who at:(last To)) 1) (mapEntry ""NoDoctrine"" 5) (if (= (who at:(last To)) 2) (mapEntry ""NoDoctrine"" 5) (if (= (who at:(last To)) 3) (mapEntry ""NoDoctrine"" 5) (if (= (who at:(last To)) 4) (mapEntry ""NoDoctrine"" 5) 0)))) 4))))) (if (and (= 8 (state at:(last From))) (!= (mover) (who at:(last From)))) (if (= (who at:(last To)) 1) (mapEntry ""NoDoctrine"" 6) (if (= (who at:(last To)) 2) (mapEntry ""NoDoctrine"" 6) (if (= (who at:(last To)) 3) (mapEntry ""NoDoctrine"" 6) (if (= (who at:(last To)) 4) (mapEntry ""NoDoctrine"" 6) 0)))) 5) (if (> (who at:(last From)) 0) (if (= (who at:(last From)) 1) (mapEntry ""NoDoctrine"" 8) (if (= (who at:(last From)) 2) (mapEntry ""NoDoctrine"" 8) (if (= (who at:(last From)) 3) (mapEntry ""NoDoctrine"" 8) (if (= (who at:(last From)) 4) (mapEntry ""NoDoctrine"" 8) 0)))) 4) (if True (if (= (who at:(last To)) 1) (mapEntry ""NoDoctrine"" 10) (if (= (who at:(last To)) 2) (mapEntry ""NoDoctrine"" 10) (if (= (who at:(last To)) 3) (mapEntry ""NoDoctrine"" 10) (if (= (who at:(last To)) 4) (mapEntry ""NoDoctrine"" 10) 0)))) (if (= (who at:(last To)) 1) (mapEntry ""NoDoctrine"" 9) (if (= (who at:(last To)) 2) (mapEntry ""NoDoctrine"" 9) (if (= (who at:(last To)) 3) (mapEntry ""NoDoctrine"" 9) (if (= (who at:(last To)) 4) (mapEntry ""NoDoctrine"" 9) 0))))) (value Random (range (if (= (who at:(last To)) 1) (mapEntry ""NoDoctrine"" 11) (if (= (who at:(last To)) 2) (mapEntry ""NoDoctrine"" 11) (if (= (who at:(last To)) 3) (mapEntry ""NoDoctrine"" 11) (if (= (who at:(last To)) 4) (mapEntry ""NoDoctrine"" 11) 0)))) (if (= (who at:(last To)) 1) (mapEntry ""NoDoctrine"" 12) (if (= (who at:(last To)) 2) (mapEntry ""NoDoctrine"" 12) (if (= (who at:(last To)) 3) (mapEntry ""NoDoctrine"" 12) (if (= (who at:(last To)) 4) (mapEntry ""NoDoctrine"" 12) 0))))))})) 128000)))) (set Value at:(last From) (value Piece at:(last From))))))))) (move Select (from (from) if:(and (> (state at:(from)) 0) (< (value Piece at:(from)) (mapEntry ""MaxHealth"" (what at:(from)))))) (to (sites Around (from) Orthogonal if:(is In (to) (sites Occupied by:Mover container:""Board"" components:{""Town"" ""Dock"" ""Base"" ""Factory"" ""Airport""})))) (then (and {(set Value at:(last From) (min (mapEntry ""MaxHealth"" (what at:(last From))) (- (+ (value Piece at:(last From)) (value Piece at:(last To))) 1))) (set Value at:(last To) (max (- (value Piece at:(last To)) (- (mapEntry ""MaxHealth"" (what at:(last From))) (value Piece at:(last From)))) 1)) (set State at:(last From) 0)}))) (move Select (from (from) if:(> (state at:(from)) 0)) (to (sites Around (from) Orthogonal if:(and (= (what at:(from)) (what at:(to))) (< (value Piece at:(to)) (mapEntry ""MaxHealth"" (what at:(to))))))) (then (and {(if (<= (+ (value Piece at:(last To)) (value Piece at:(last From))) (mapEntry ""MaxHealth"" (what at:(last From)))) (and (set Value at:(last To) (min (mapEntry ""MaxHealth"" (what at:(last From))) (+ (value Piece at:(last From)) (value Piece at:(last To))))) (remove (last From))) (and (set Value at:(last To) (min (mapEntry ""MaxHealth"" (what at:(last From))) (- (+ (value Piece at:(last From)) (value Piece at:(last To))) 1))) (set Value at:(last From) (max (- (value Piece at:(last To)) (- (mapEntry ""MaxHealth"" (what at:(last From))) (value Piece at:(last From)))) 1)))) (set State at:(last From) 0) (set State at:(last To) 0)})))})) (piece ""Speeder"" Each (or {(or (move (from (from) if:(> (state at:(from)) 1)) (to (sites Distance (step Orthogonal (to if:(is In (to) (difference (union (sites Empty) (sites Occupied by:Friend container:""Board"")) (union (union (sites ""Mountain"") (sites ""DeepWater"")) (union (sites ""Forest"") (sites ""ShallowWater""))))))) from:(from) (range 1 (- (state at:(from)) 1))) if:(is Empty (to)) (apply (set State at:(from) 1)))) (move (from (from) if:(> (state at:(from)) 1)) (to (sites Distance (step Orthogonal (to if:(is In (to) (intersection (sites Empty) (union (sites ""Forest"") (sites ""ShallowWater"")))))) from:(from) (range 1 (- 2 1))) if:(is Empty (to)) (apply (set State at:(from) 1))))) (move Select (from (from) if:(> (state at:(from)) 0)) (to (sites Distance Orthogonal from:(from) (range 1 1)) if:(and {(if (is In (from) (sites Occupied by:Mover container:""Board"" components:{""Bomber"" ""Battleship"" ""Artillery"" ""Launcher""})) (is In (to) (union (sites Occupied by:Enemy container:""Board"" components:{""Soldier"" ""Motorbike"" ""Tank"" ""Speeder"" ""Shooter"" ""Launcher"" ""Antiair"" ""Battleship"" ""Artillery"" ""Base"" ""Town"" ""Factory"" ""Dock"" ""Airport"" ""Cruiser"" ""Submarine""}) (sites Occupied by:Neutral container:""Board""))) (is In (to) (union (sites Occupied by:Enemy container:""Board"") (sites Occupied by:Neutral container:""Board"")))) (if (is In (from) (sites Occupied by:Mover container:""Board"" components:{""Antiair"" ""Fighter""})) (is In (to) (sites Occupied by:Enemy container:""Board"" components:{""Fighter"" ""Helicopter"" ""Bomber""})) (is In (to) (union (sites Occupied by:Enemy container:""Board"") (sites Occupied by:Neutral container:""Board"")))) (if (is In (from) (sites Occupied by:Mover container:""Board"" components:{""Submarine""})) (is In (to) (sites Occupied by:Enemy container:""Board"" components:{""Submarine"" ""Battleship"" ""Cruiser""})) (is In (to) (union (sites Occupied by:Enemy container:""Board"") (sites Occupied by:Neutral container:""Board""))))})) (then (do (and (set Value at:(last To) (max 0 (- (value Piece at:(last To)) (/ (* (if (is In (last To) (sites Occupied by:All container:""Board"" components:{""Fighter"" ""Bomber"" ""Helicopter""})) (max (/ (* (* (value Piece at:(last From)) 4) (mapEntry ""DamageMultiplier"" (what at:(last From)))) 100) 1) (if (and (is In (last To) (sites Occupied by:All container:""Board"" components:{""Soldier"" ""Motorbike""})) (is In (last From) (sites Occupied by:All component:""Shooter""))) (if (is In (last To) (sites ""Forest"")) (max (/ (* (* (value Piece at:(last From)) 6) (mapEntry ""DamageMultiplier"" (what at:(last From)))) 100) 1) (if (is In (last To) (union (sites ""ShallowWater"") (sites ""DeepWater""))) (max (/ (* (* (value Piece at:(last From)) 10) (mapEntry ""DamageMultiplier"" (what at:(last From)))) 100) 1) (max (/ (* (* (value Piece at:(last From)) 8) (mapEntry ""DamageMultiplier"" (what at:(last From)))) 100) 1))) (if (is In (last To) (sites ""Forest"")) (max (/ (* (* (value Piece at:(last From)) 3) (mapEntry ""DamageMultiplier"" (what at:(last From)))) 100) 1) (if (is In (last To) (union (sites ""ShallowWater"") (sites ""DeepWater""))) (max (/ (* (* (value Piece at:(last From)) 5) (mapEntry ""DamageMultiplier"" (what at:(last From)))) 100) 1) (max (/ (* (* (value Piece at:(last From)) 4) (mapEntry ""DamageMultiplier"" (what at:(last From)))) 100) 1))))) (* {(if (is In (last From) (sites Occupied by:All container:""Board"" components:{""Soldier"" ""Motorbike""})) (if (= (who at:(last From)) 1) (mapEntry ""NoDoctrine"" 1) (if (= (who at:(last From)) 2) (mapEntry ""NoDoctrine"" 1) (if (= (who at:(last From)) 3) (mapEntry ""NoDoctrine"" 1) (if (= (who at:(last From)) 4) (mapEntry ""NoDoctrine"" 1) 0)))) (if (is In (last From) (sites Occupied by:All container:""Board"" components:{""Tank"" ""Speeder"" ""Shooter""})) (if (= (who at:(last From)) 1) (mapEntry ""NoDoctrine"" 2) (if (= (who at:(last From)) 2) (mapEntry ""NoDoctrine"" 2) (if (= (who at:(last From)) 3) (mapEntry ""NoDoctrine"" 2) (if (= (who at:(last From)) 4) (mapEntry ""NoDoctrine"" 2) 0)))) (if (is In (last From) (sites Occupied by:All container:""Board"" components:{""Launcher"" ""Antiair"" ""Artillery""})) (if (= (who at:(last From)) 1) (mapEntry ""NoDoctrine"" 3) (if (= (who at:(last From)) 2) (mapEntry ""NoDoctrine"" 3) (if (= (who at:(last From)) 3) (mapEntry ""NoDoctrine"" 3) (if (= (who at:(last From)) 4) (mapEntry ""NoDoctrine"" 3) 0)))) (if (is In (last From) (sites Occupied by:All container:""Board"" components:{""Fighter"" ""Bomber"" ""Helicopter""})) (if (= (who at:(last From)) 1) (mapEntry ""NoDoctrine"" 4) (if (= (who at:(last From)) 2) (mapEntry ""NoDoctrine"" 4) (if (= (who at:(last From)) 3) (mapEntry ""NoDoctrine"" 4) (if (= (who at:(last From)) 4) (mapEntry ""NoDoctrine"" 4) 0)))) (if (is In (last From) (sites Occupied by:All container:""Board"" components:{""Submarine"" ""Cruiser"" ""Battleship""})) (if (= (who at:(last From)) 1) (mapEntry ""NoDoctrine"" 5) (if (= (who at:(last From)) 2) (mapEntry ""NoDoctrine"" 5) (if (= (who at:(last From)) 3) (mapEntry ""NoDoctrine"" 5) (if (= (who at:(last From)) 4) (mapEntry ""NoDoctrine"" 5) 0)))) 4))))) (if (and (= 8 (state at:(last To))) (!= (mover) (who at:(last To)))) (if (= (who at:(last From)) 1) (mapEntry ""NoDoctrine"" 6) (if (= (who at:(last From)) 2) (mapEntry ""NoDoctrine"" 6) (if (= (who at:(last From)) 3) (mapEntry ""NoDoctrine"" 6) (if (= (who at:(last From)) 4) (mapEntry ""NoDoctrine"" 6) 0)))) 5) (if (> (who at:(last To)) 0) (if (= (who at:(last To)) 1) (mapEntry ""NoDoctrine"" 8) (if (= (who at:(last To)) 2) (mapEntry ""NoDoctrine"" 8) (if (= (who at:(last To)) 3) (mapEntry ""NoDoctrine"" 8) (if (= (who at:(last To)) 4) (mapEntry ""NoDoctrine"" 8) 0)))) 4) (if False (if (= (who at:(last From)) 1) (mapEntry ""NoDoctrine"" 10) (if (= (who at:(last From)) 2) (mapEntry ""NoDoctrine"" 10) (if (= (who at:(last From)) 3) (mapEntry ""NoDoctrine"" 10) (if (= (who at:(last From)) 4) (mapEntry ""NoDoctrine"" 10) 0)))) (if (= (who at:(last From)) 1) (mapEntry ""NoDoctrine"" 9) (if (= (who at:(last From)) 2) (mapEntry ""NoDoctrine"" 9) (if (= (who at:(last From)) 3) (mapEntry ""NoDoctrine"" 9) (if (= (who at:(last From)) 4) (mapEntry ""NoDoctrine"" 9) 0))))) (value Random (range (if (= (who at:(last From)) 1) (mapEntry ""NoDoctrine"" 11) (if (= (who at:(last From)) 2) (mapEntry ""NoDoctrine"" 11) (if (= (who at:(last From)) 3) (mapEntry ""NoDoctrine"" 11) (if (= (who at:(last From)) 4) (mapEntry ""NoDoctrine"" 11) 0)))) (if (= (who at:(last From)) 1) (mapEntry ""NoDoctrine"" 12) (if (= (who at:(last From)) 2) (mapEntry ""NoDoctrine"" 12) (if (= (who at:(last From)) 3) (mapEntry ""NoDoctrine"" 12) (if (= (who at:(last From)) 4) (mapEntry ""NoDoctrine"" 12) 0))))))})) 128000)))) (set State at:(last From) 0)) next:(if (and (= 8 (state at:(last To))) (!= (mover) (who at:(last To)))) (if (= (value Piece at:(last To)) 0) (and {(take Control of:All by:Mover at:(last To)) (set Value at:(last To) 50)}) (set Value at:(last To) (value Piece at:(last To)))) (if (= (value Piece at:(last To)) 0) (remove (last To)) (if (and {(= 0 (count Sites in:(intersection (sites {(last To) (last From)}) (sites Occupied by:All components:{""Launcher"" ""Artillery"" ""Battleship"" ""Antiair""})))) (if (is In (last To) (sites Occupied by:Enemy components:{""Bomber"" ""Battleship"" ""Artillery"" ""Launcher""})) (is In (last From) (union (sites Occupied by:Mover components:{""Soldier"" ""Motorbike"" ""Tank"" ""Speeder"" ""Shooter"" ""Launcher"" ""Antiair"" ""Battleship"" ""Artillery"" ""Base"" ""Town"" ""Factory"" ""Dock"" ""Airport"" ""Cruiser"" ""Submarine""}) (sites Occupied by:Neutral container:""Board""))) (is In (last From) (union (sites Occupied by:Mover) (sites Occupied by:Neutral container:""Board"")))) (if (is In (last To) (sites Occupied by:Enemy components:{""Antiair"" ""Fighter""})) (is In (last From) (sites Occupied by:Mover components:{""Fighter"" ""Helicopter"" ""Bomber""})) (is In (last From) (union (sites Occupied by:Mover) (sites Occupied by:Neutral container:""Board"")))) (if (is In (last To) (sites Occupied by:Enemy components:{""Submarine""})) (is In (last From) (sites Occupied by:Mover components:{""Submarine"" ""Battleship"" ""Cruiser""})) (is In (last From) (union (sites Occupied by:Mover) (sites Occupied by:Neutral container:""Board""))))}) (if (<= (- (value Piece at:(last From)) (/ (* (if (is In (last From) (sites Occupied by:All container:""Board"" components:{""Fighter"" ""Bomber"" ""Helicopter""})) (max (/ (* (* (value Piece at:(last To)) 4) (mapEntry ""DamageMultiplier"" (what at:(last To)))) 100) 1) (if (and (is In (last From) (sites Occupied by:All container:""Board"" components:{""Soldier"" ""Motorbike""})) (is In (last To) (sites Occupied by:All component:""Shooter""))) (if (is In (last From) (sites ""Forest"")) (max (/ (* (* (value Piece at:(last To)) 6) (mapEntry ""DamageMultiplier"" (what at:(last To)))) 100) 1) (if (is In (last From) (union (sites ""ShallowWater"") (sites ""DeepWater""))) (max (/ (* (* (value Piece at:(last To)) 10) (mapEntry ""DamageMultiplier"" (what at:(last To)))) 100) 1) (max (/ (* (* (value Piece at:(last To)) 8) (mapEntry ""DamageMultiplier"" (what at:(last To)))) 100) 1))) (if (is In (last From) (sites ""Forest"")) (max (/ (* (* (value Piece at:(last To)) 3) (mapEntry ""DamageMultiplier"" (what at:(last To)))) 100) 1) (if (is In (last From) (union (sites ""ShallowWater"") (sites ""DeepWater""))) (max (/ (* (* (value Piece at:(last To)) 5) (mapEntry ""DamageMultiplier"" (what at:(last To)))) 100) 1) (max (/ (* (* (value Piece at:(last To)) 4) (mapEntry ""DamageMultiplier"" (what at:(last To)))) 100) 1))))) (* {(if (is In (last To) (sites Occupied by:All container:""Board"" components:{""Soldier"" ""Motorbike""})) (if (= (who at:(last To)) 1) (mapEntry ""NoDoctrine"" 1) (if (= (who at:(last To)) 2) (mapEntry ""NoDoctrine"" 1) (if (= (who at:(last To)) 3) (mapEntry ""NoDoctrine"" 1) (if (= (who at:(last To)) 4) (mapEntry ""NoDoctrine"" 1) 0)))) (if (is In (last To) (sites Occupied by:All container:""Board"" components:{""Tank"" ""Speeder"" ""Shooter""})) (if (= (who at:(last To)) 1) (mapEntry ""NoDoctrine"" 2) (if (= (who at:(last To)) 2) (mapEntry ""NoDoctrine"" 2) (if (= (who at:(last To)) 3) (mapEntry ""NoDoctrine"" 2) (if (= (who at:(last To)) 4) (mapEntry ""NoDoctrine"" 2) 0)))) (if (is In (last To) (sites Occupied by:All container:""Board"" components:{""Launcher"" ""Antiair"" ""Artillery""})) (if (= (who at:(last To)) 1) (mapEntry ""NoDoctrine"" 3) (if (= (who at:(last To)) 2) (mapEntry ""NoDoctrine"" 3) (if (= (who at:(last To)) 3) (mapEntry ""NoDoctrine"" 3) (if (= (who at:(last To)) 4) (mapEntry ""NoDoctrine"" 3) 0)))) (if (is In (last To) (sites Occupied by:All container:""Board"" components:{""Fighter"" ""Bomber"" ""Helicopter""})) (if (= (who at:(last To)) 1) (mapEntry ""NoDoctrine"" 4) (if (= (who at:(last To)) 2) (mapEntry ""NoDoctrine"" 4) (if (= (who at:(last To)) 3) (mapEntry ""NoDoctrine"" 4) (if (= (who at:(last To)) 4) (mapEntry ""NoDoctrine"" 4) 0)))) (if (is In (last To) (sites Occupied by:All container:""Board"" components:{""Submarine"" ""Cruiser"" ""Battleship""})) (if (= (who at:(last To)) 1) (mapEntry ""NoDoctrine"" 5) (if (= (who at:(last To)) 2) (mapEntry ""NoDoctrine"" 5) (if (= (who at:(last To)) 3) (mapEntry ""NoDoctrine"" 5) (if (= (who at:(last To)) 4) (mapEntry ""NoDoctrine"" 5) 0)))) 4))))) (if (and (= 8 (state at:(last From))) (!= (mover) (who at:(last From)))) (if (= (who at:(last To)) 1) (mapEntry ""NoDoctrine"" 6) (if (= (who at:(last To)) 2) (mapEntry ""NoDoctrine"" 6) (if (= (who at:(last To)) 3) (mapEntry ""NoDoctrine"" 6) (if (= (who at:(last To)) 4) (mapEntry ""NoDoctrine"" 6) 0)))) 5) (if (> (who at:(last From)) 0) (if (= (who at:(last From)) 1) (mapEntry ""NoDoctrine"" 8) (if (= (who at:(last From)) 2) (mapEntry ""NoDoctrine"" 8) (if (= (who at:(last From)) 3) (mapEntry ""NoDoctrine"" 8) (if (= (who at:(last From)) 4) (mapEntry ""NoDoctrine"" 8) 0)))) 4) (if True (if (= (who at:(last To)) 1) (mapEntry ""NoDoctrine"" 10) (if (= (who at:(last To)) 2) (mapEntry ""NoDoctrine"" 10) (if (= (who at:(last To)) 3) (mapEntry ""NoDoctrine"" 10) (if (= (who at:(last To)) 4) (mapEntry ""NoDoctrine"" 10) 0)))) (if (= (who at:(last To)) 1) (mapEntry ""NoDoctrine"" 9) (if (= (who at:(last To)) 2) (mapEntry ""NoDoctrine"" 9) (if (= (who at:(last To)) 3) (mapEntry ""NoDoctrine"" 9) (if (= (who at:(last To)) 4) (mapEntry ""NoDoctrine"" 9) 0))))) (value Random (range (if (= (who at:(last To)) 1) (mapEntry ""NoDoctrine"" 11) (if (= (who at:(last To)) 2) (mapEntry ""NoDoctrine"" 11) (if (= (who at:(last To)) 3) (mapEntry ""NoDoctrine"" 11) (if (= (who at:(last To)) 4) (mapEntry ""NoDoctrine"" 11) 0)))) (if (= (who at:(last To)) 1) (mapEntry ""NoDoctrine"" 12) (if (= (who at:(last To)) 2) (mapEntry ""NoDoctrine"" 12) (if (= (who at:(last To)) 3) (mapEntry ""NoDoctrine"" 12) (if (= (who at:(last To)) 4) (mapEntry ""NoDoctrine"" 12) 0))))))})) 128000)) 0) (remove (last From)) (set Value at:(last From) (- (value Piece at:(last From)) (/ (* (if (is In (last From) (sites Occupied by:All container:""Board"" components:{""Fighter"" ""Bomber"" ""Helicopter""})) (max (/ (* (* (value Piece at:(last To)) 4) (mapEntry ""DamageMultiplier"" (what at:(last To)))) 100) 1) (if (and (is In (last From) (sites Occupied by:All container:""Board"" components:{""Soldier"" ""Motorbike""})) (is In (last To) (sites Occupied by:All component:""Shooter""))) (if (is In (last From) (sites ""Forest"")) (max (/ (* (* (value Piece at:(last To)) 6) (mapEntry ""DamageMultiplier"" (what at:(last To)))) 100) 1) (if (is In (last From) (union (sites ""ShallowWater"") (sites ""DeepWater""))) (max (/ (* (* (value Piece at:(last To)) 10) (mapEntry ""DamageMultiplier"" (what at:(last To)))) 100) 1) (max (/ (* (* (value Piece at:(last To)) 8) (mapEntry ""DamageMultiplier"" (what at:(last To)))) 100) 1))) (if (is In (last From) (sites ""Forest"")) (max (/ (* (* (value Piece at:(last To)) 3) (mapEntry ""DamageMultiplier"" (what at:(last To)))) 100) 1) (if (is In (last From) (union (sites ""ShallowWater"") (sites ""DeepWater""))) (max (/ (* (* (value Piece at:(last To)) 5) (mapEntry ""DamageMultiplier"" (what at:(last To)))) 100) 1) (max (/ (* (* (value Piece at:(last To)) 4) (mapEntry ""DamageMultiplier"" (what at:(last To)))) 100) 1))))) (* {(if (is In (last To) (sites Occupied by:All container:""Board"" components:{""Soldier"" ""Motorbike""})) (if (= (who at:(last To)) 1) (mapEntry ""NoDoctrine"" 1) (if (= (who at:(last To)) 2) (mapEntry ""NoDoctrine"" 1) (if (= (who at:(last To)) 3) (mapEntry ""NoDoctrine"" 1) (if (= (who at:(last To)) 4) (mapEntry ""NoDoctrine"" 1) 0)))) (if (is In (last To) (sites Occupied by:All container:""Board"" components:{""Tank"" ""Speeder"" ""Shooter""})) (if (= (who at:(last To)) 1) (mapEntry ""NoDoctrine"" 2) (if (= (who at:(last To)) 2) (mapEntry ""NoDoctrine"" 2) (if (= (who at:(last To)) 3) (mapEntry ""NoDoctrine"" 2) (if (= (who at:(last To)) 4) (mapEntry ""NoDoctrine"" 2) 0)))) (if (is In (last To) (sites Occupied by:All container:""Board"" components:{""Launcher"" ""Antiair"" ""Artillery""})) (if (= (who at:(last To)) 1) (mapEntry ""NoDoctrine"" 3) (if (= (who at:(last To)) 2) (mapEntry ""NoDoctrine"" 3) (if (= (who at:(last To)) 3) (mapEntry ""NoDoctrine"" 3) (if (= (who at:(last To)) 4) (mapEntry ""NoDoctrine"" 3) 0)))) (if (is In (last To) (sites Occupied by:All container:""Board"" components:{""Fighter"" ""Bomber"" ""Helicopter""})) (if (= (who at:(last To)) 1) (mapEntry ""NoDoctrine"" 4) (if (= (who at:(last To)) 2) (mapEntry ""NoDoctrine"" 4) (if (= (who at:(last To)) 3) (mapEntry ""NoDoctrine"" 4) (if (= (who at:(last To)) 4) (mapEntry ""NoDoctrine"" 4) 0)))) (if (is In (last To) (sites Occupied by:All container:""Board"" components:{""Submarine"" ""Cruiser"" ""Battleship""})) (if (= (who at:(last To)) 1) (mapEntry ""NoDoctrine"" 5) (if (= (who at:(last To)) 2) (mapEntry ""NoDoctrine"" 5) (if (= (who at:(last To)) 3) (mapEntry ""NoDoctrine"" 5) (if (= (who at:(last To)) 4) (mapEntry ""NoDoctrine"" 5) 0)))) 4))))) (if (and (= 8 (state at:(last From))) (!= (mover) (who at:(last From)))) (if (= (who at:(last To)) 1) (mapEntry ""NoDoctrine"" 6) (if (= (who at:(last To)) 2) (mapEntry ""NoDoctrine"" 6) (if (= (who at:(last To)) 3) (mapEntry ""NoDoctrine"" 6) (if (= (who at:(last To)) 4) (mapEntry ""NoDoctrine"" 6) 0)))) 5) (if (> (who at:(last From)) 0) (if (= (who at:(last From)) 1) (mapEntry ""NoDoctrine"" 8) (if (= (who at:(last From)) 2) (mapEntry ""NoDoctrine"" 8) (if (= (who at:(last From)) 3) (mapEntry ""NoDoctrine"" 8) (if (= (who at:(last From)) 4) (mapEntry ""NoDoctrine"" 8) 0)))) 4) (if True (if (= (who at:(last To)) 1) (mapEntry ""NoDoctrine"" 10) (if (= (who at:(last To)) 2) (mapEntry ""NoDoctrine"" 10) (if (= (who at:(last To)) 3) (mapEntry ""NoDoctrine"" 10) (if (= (who at:(last To)) 4) (mapEntry ""NoDoctrine"" 10) 0)))) (if (= (who at:(last To)) 1) (mapEntry ""NoDoctrine"" 9) (if (= (who at:(last To)) 2) (mapEntry ""NoDoctrine"" 9) (if (= (who at:(last To)) 3) (mapEntry ""NoDoctrine"" 9) (if (= (who at:(last To)) 4) (mapEntry ""NoDoctrine"" 9) 0))))) (value Random (range (if (= (who at:(last To)) 1) (mapEntry ""NoDoctrine"" 11) (if (= (who at:(last To)) 2) (mapEntry ""NoDoctrine"" 11) (if (= (who at:(last To)) 3) (mapEntry ""NoDoctrine"" 11) (if (= (who at:(last To)) 4) (mapEntry ""NoDoctrine"" 11) 0)))) (if (= (who at:(last To)) 1) (mapEntry ""NoDoctrine"" 12) (if (= (who at:(last To)) 2) (mapEntry ""NoDoctrine"" 12) (if (= (who at:(last To)) 3) (mapEntry ""NoDoctrine"" 12) (if (= (who at:(last To)) 4) (mapEntry ""NoDoctrine"" 12) 0))))))})) 128000)))) (set Value at:(last From) (value Piece at:(last From))))))))) (move Select (from (from) if:(and (> (state at:(from)) 0) (< (value Piece at:(from)) (mapEntry ""MaxHealth"" (what at:(from)))))) (to (sites Around (from) Orthogonal if:(is In (to) (sites Occupied by:Mover container:""Board"" components:{""Town"" ""Dock"" ""Base"" ""Factory"" ""Airport""})))) (then (and {(set Value at:(last From) (min (mapEntry ""MaxHealth"" (what at:(last From))) (- (+ (value Piece at:(last From)) (value Piece at:(last To))) 1))) (set Value at:(last To) (max (- (value Piece at:(last To)) (- (mapEntry ""MaxHealth"" (what at:(last From))) (value Piece at:(last From)))) 1)) (set State at:(last From) 0)}))) (move Select (from (from) if:(> (state at:(from)) 0)) (to (sites Around (from) Orthogonal if:(and (= (what at:(from)) (what at:(to))) (< (value Piece at:(to)) (mapEntry ""MaxHealth"" (what at:(to))))))) (then (and {(if (<= (+ (value Piece at:(last To)) (value Piece at:(last From))) (mapEntry ""MaxHealth"" (what at:(last From)))) (and (set Value at:(last To) (min (mapEntry ""MaxHealth"" (what at:(last From))) (+ (value Piece at:(last From)) (value Piece at:(last To))))) (remove (last From))) (and (set Value at:(last To) (min (mapEntry ""MaxHealth"" (what at:(last From))) (- (+ (value Piece at:(last From)) (value Piece at:(last To))) 1))) (set Value at:(last From) (max (- (value Piece at:(last To)) (- (mapEntry ""MaxHealth"" (what at:(last From))) (value Piece at:(last From)))) 1)))) (set State at:(last From) 0) (set State at:(last To) 0)})))})) (piece ""Shooter"" Each (or {(or (move (from (from) if:(> (state at:(from)) 1)) (to (sites Distance (step Orthogonal (to if:(is In (to) (difference (union (sites Empty) (sites Occupied by:Friend container:""Board"")) (union (union (sites ""Mountain"") (sites ""DeepWater"")) (union (sites ""Forest"") (sites ""ShallowWater""))))))) from:(from) (range 1 (- (state at:(from)) 1))) if:(is Empty (to)) (apply (set State at:(from) 1)))) (move (from (from) if:(> (state at:(from)) 1)) (to (sites Distance (step Orthogonal (to if:(is In (to) (intersection (sites Empty) (union (sites ""Forest"") (sites ""ShallowWater"")))))) from:(from) (range 1 (- 2 1))) if:(is Empty (to)) (apply (set State at:(from) 1))))) (move Select (from (from) if:(> (state at:(from)) 0)) (to (sites Distance Orthogonal from:(from) (range 1 1)) if:(and {(if (is In (from) (sites Occupied by:Mover container:""Board"" components:{""Bomber"" ""Battleship"" ""Artillery"" ""Launcher""})) (is In (to) (union (sites Occupied by:Enemy container:""Board"" components:{""Soldier"" ""Motorbike"" ""Tank"" ""Speeder"" ""Shooter"" ""Launcher"" ""Antiair"" ""Battleship"" ""Artillery"" ""Base"" ""Town"" ""Factory"" ""Dock"" ""Airport"" ""Cruiser"" ""Submarine""}) (sites Occupied by:Neutral container:""Board""))) (is In (to) (union (sites Occupied by:Enemy container:""Board"") (sites Occupied by:Neutral container:""Board"")))) (if (is In (from) (sites Occupied by:Mover container:""Board"" components:{""Antiair"" ""Fighter""})) (is In (to) (sites Occupied by:Enemy container:""Board"" components:{""Fighter"" ""Helicopter"" ""Bomber""})) (is In (to) (union (sites Occupied by:Enemy container:""Board"") (sites Occupied by:Neutral container:""Board"")))) (if (is In (from) (sites Occupied by:Mover container:""Board"" components:{""Submarine""})) (is In (to) (sites Occupied by:Enemy container:""Board"" components:{""Submarine"" ""Battleship"" ""Cruiser""})) (is In (to) (union (sites Occupied by:Enemy container:""Board"") (sites Occupied by:Neutral container:""Board""))))})) (then (do (and (set Value at:(last To) (max 0 (- (value Piece at:(last To)) (/ (* (if (is In (last To) (sites Occupied by:All container:""Board"" components:{""Fighter"" ""Bomber"" ""Helicopter""})) (max (/ (* (* (value Piece at:(last From)) 4) (mapEntry ""DamageMultiplier"" (what at:(last From)))) 100) 1) (if (and (is In (last To) (sites Occupied by:All container:""Board"" components:{""Soldier"" ""Motorbike""})) (is In (last From) (sites Occupied by:All component:""Shooter""))) (if (is In (last To) (sites ""Forest"")) (max (/ (* (* (value Piece at:(last From)) 6) (mapEntry ""DamageMultiplier"" (what at:(last From)))) 100) 1) (if (is In (last To) (union (sites ""ShallowWater"") (sites ""DeepWater""))) (max (/ (* (* (value Piece at:(last From)) 10) (mapEntry ""DamageMultiplier"" (what at:(last From)))) 100) 1) (max (/ (* (* (value Piece at:(last From)) 8) (mapEntry ""DamageMultiplier"" (what at:(last From)))) 100) 1))) (if (is In (last To) (sites ""Forest"")) (max (/ (* (* (value Piece at:(last From)) 3) (mapEntry ""DamageMultiplier"" (what at:(last From)))) 100) 1) (if (is In (last To) (union (sites ""ShallowWater"") (sites ""DeepWater""))) (max (/ (* (* (value Piece at:(last From)) 5) (mapEntry ""DamageMultiplier"" (what at:(last From)))) 100) 1) (max (/ (* (* (value Piece at:(last From)) 4) (mapEntry ""DamageMultiplier"" (what at:(last From)))) 100) 1))))) (* {(if (is In (last From) (sites Occupied by:All container:""Board"" components:{""Soldier"" ""Motorbike""})) (if (= (who at:(last From)) 1) (mapEntry ""NoDoctrine"" 1) (if (= (who at:(last From)) 2) (mapEntry ""NoDoctrine"" 1) (if (= (who at:(last From)) 3) (mapEntry ""NoDoctrine"" 1) (if (= (who at:(last From)) 4) (mapEntry ""NoDoctrine"" 1) 0)))) (if (is In (last From) (sites Occupied by:All container:""Board"" components:{""Tank"" ""Speeder"" ""Shooter""})) (if (= (who at:(last From)) 1) (mapEntry ""NoDoctrine"" 2) (if (= (who at:(last From)) 2) (mapEntry ""NoDoctrine"" 2) (if (= (who at:(last From)) 3) (mapEntry ""NoDoctrine"" 2) (if (= (who at:(last From)) 4) (mapEntry ""NoDoctrine"" 2) 0)))) (if (is In (last From) (sites Occupied by:All container:""Board"" components:{""Launcher"" ""Antiair"" ""Artillery""})) (if (= (who at:(last From)) 1) (mapEntry ""NoDoctrine"" 3) (if (= (who at:(last From)) 2) (mapEntry ""NoDoctrine"" 3) (if (= (who at:(last From)) 3) (mapEntry ""NoDoctrine"" 3) (if (= (who at:(last From)) 4) (mapEntry ""NoDoctrine"" 3) 0)))) (if (is In (last From) (sites Occupied by:All container:""Board"" components:{""Fighter"" ""Bomber"" ""Helicopter""})) (if (= (who at:(last From)) 1) (mapEntry ""NoDoctrine"" 4) (if (= (who at:(last From)) 2) (mapEntry ""NoDoctrine"" 4) (if (= (who at:(last From)) 3) (mapEntry ""NoDoctrine"" 4) (if (= (who at:(last From)) 4) (mapEntry ""NoDoctrine"" 4) 0)))) (if (is In (last From) (sites Occupied by:All container:""Board"" components:{""Submarine"" ""Cruiser"" ""Battleship""})) (if (= (who at:(last From)) 1) (mapEntry ""NoDoctrine"" 5) (if (= (who at:(last From)) 2) (mapEntry ""NoDoctrine"" 5) (if (= (who at:(last From)) 3) (mapEntry ""NoDoctrine"" 5) (if (= (who at:(last From)) 4) (mapEntry ""NoDoctrine"" 5) 0)))) 4))))) (if (and (= 8 (state at:(last To))) (!= (mover) (who at:(last To)))) (if (= (who at:(last From)) 1) (mapEntry ""NoDoctrine"" 6) (if (= (who at:(last From)) 2) (mapEntry ""NoDoctrine"" 6) (if (= (who at:(last From)) 3) (mapEntry ""NoDoctrine"" 6) (if (= (who at:(last From)) 4) (mapEntry ""NoDoctrine"" 6) 0)))) 5) (if (> (who at:(last To)) 0) (if (= (who at:(last To)) 1) (mapEntry ""NoDoctrine"" 8) (if (= (who at:(last To)) 2) (mapEntry ""NoDoctrine"" 8) (if (= (who at:(last To)) 3) (mapEntry ""NoDoctrine"" 8) (if (= (who at:(last To)) 4) (mapEntry ""NoDoctrine"" 8) 0)))) 4) (if False (if (= (who at:(last From)) 1) (mapEntry ""NoDoctrine"" 10) (if (= (who at:(last From)) 2) (mapEntry ""NoDoctrine"" 10) (if (= (who at:(last From)) 3) (mapEntry ""NoDoctrine"" 10) (if (= (who at:(last From)) 4) (mapEntry ""NoDoctrine"" 10) 0)))) (if (= (who at:(last From)) 1) (mapEntry ""NoDoctrine"" 9) (if (= (who at:(last From)) 2) (mapEntry ""NoDoctrine"" 9) (if (= (who at:(last From)) 3) (mapEntry ""NoDoctrine"" 9) (if (= (who at:(last From)) 4) (mapEntry ""NoDoctrine"" 9) 0))))) (value Random (range (if (= (who at:(last From)) 1) (mapEntry ""NoDoctrine"" 11) (if (= (who at:(last From)) 2) (mapEntry ""NoDoctrine"" 11) (if (= (who at:(last From)) 3) (mapEntry ""NoDoctrine"" 11) (if (= (who at:(last From)) 4) (mapEntry ""NoDoctrine"" 11) 0)))) (if (= (who at:(last From)) 1) (mapEntry ""NoDoctrine"" 12) (if (= (who at:(last From)) 2) (mapEntry ""NoDoctrine"" 12) (if (= (who at:(last From)) 3) (mapEntry ""NoDoctrine"" 12) (if (= (who at:(last From)) 4) (mapEntry ""NoDoctrine"" 12) 0))))))})) 128000)))) (set State at:(last From) 0)) next:(if (and (= 8 (state at:(last To))) (!= (mover) (who at:(last To)))) (if (= (value Piece at:(last To)) 0) (and {(take Control of:All by:Mover at:(last To)) (set Value at:(last To) 50)}) (set Value at:(last To) (value Piece at:(last To)))) (if (= (value Piece at:(last To)) 0) (remove (last To)) (if (and {(= 0 (count Sites in:(intersection (sites {(last To) (last From)}) (sites Occupied by:All components:{""Launcher"" ""Artillery"" ""Battleship"" ""Antiair""})))) (if (is In (last To) (sites Occupied by:Enemy components:{""Bomber"" ""Battleship"" ""Artillery"" ""Launcher""})) (is In (last From) (union (sites Occupied by:Mover components:{""Soldier"" ""Motorbike"" ""Tank"" ""Speeder"" ""Shooter"" ""Launcher"" ""Antiair"" ""Battleship"" ""Artillery"" ""Base"" ""Town"" ""Factory"" ""Dock"" ""Airport"" ""Cruiser"" ""Submarine""}) (sites Occupied by:Neutral container:""Board""))) (is In (last From) (union (sites Occupied by:Mover) (sites Occupied by:Neutral container:""Board"")))) (if (is In (last To) (sites Occupied by:Enemy components:{""Antiair"" ""Fighter""})) (is In (last From) (sites Occupied by:Mover components:{""Fighter"" ""Helicopter"" ""Bomber""})) (is In (last From) (union (sites Occupied by:Mover) (sites Occupied by:Neutral container:""Board"")))) (if (is In (last To) (sites Occupied by:Enemy components:{""Submarine""})) (is In (last From) (sites Occupied by:Mover components:{""Submarine"" ""Battleship"" ""Cruiser""})) (is In (last From) (union (sites Occupied by:Mover) (sites Occupied by:Neutral container:""Board""))))}) (if (<= (- (value Piece at:(last From)) (/ (* (if (is In (last From) (sites Occupied by:All container:""Board"" components:{""Fighter"" ""Bomber"" ""Helicopter""})) (max (/ (* (* (value Piece at:(last To)) 4) (mapEntry ""DamageMultiplier"" (what at:(last To)))) 100) 1) (if (and (is In (last From) (sites Occupied by:All container:""Board"" components:{""Soldier"" ""Motorbike""})) (is In (last To) (sites Occupied by:All component:""Shooter""))) (if (is In (last From) (sites ""Forest"")) (max (/ (* (* (value Piece at:(last To)) 6) (mapEntry ""DamageMultiplier"" (what at:(last To)))) 100) 1) (if (is In (last From) (union (sites ""ShallowWater"") (sites ""DeepWater""))) (max (/ (* (* (value Piece at:(last To)) 10) (mapEntry ""DamageMultiplier"" (what at:(last To)))) 100) 1) (max (/ (* (* (value Piece at:(last To)) 8) (mapEntry ""DamageMultiplier"" (what at:(last To)))) 100) 1))) (if (is In (last From) (sites ""Forest"")) (max (/ (* (* (value Piece at:(last To)) 3) (mapEntry ""DamageMultiplier"" (what at:(last To)))) 100) 1) (if (is In (last From) (union (sites ""ShallowWater"") (sites ""DeepWater""))) (max (/ (* (* (value Piece at:(last To)) 5) (mapEntry ""DamageMultiplier"" (what at:(last To)))) 100) 1) (max (/ (* (* (value Piece at:(last To)) 4) (mapEntry ""DamageMultiplier"" (what at:(last To)))) 100) 1))))) (* {(if (is In (last To) (sites Occupied by:All container:""Board"" components:{""Soldier"" ""Motorbike""})) (if (= (who at:(last To)) 1) (mapEntry ""NoDoctrine"" 1) (if (= (who at:(last To)) 2) (mapEntry ""NoDoctrine"" 1) (if (= (who at:(last To)) 3) (mapEntry ""NoDoctrine"" 1) (if (= (who at:(last To)) 4) (mapEntry ""NoDoctrine"" 1) 0)))) (if (is In (last To) (sites Occupied by:All container:""Board"" components:{""Tank"" ""Speeder"" ""Shooter""})) (if (= (who at:(last To)) 1) (mapEntry ""NoDoctrine"" 2) (if (= (who at:(last To)) 2) (mapEntry ""NoDoctrine"" 2) (if (= (who at:(last To)) 3) (mapEntry ""NoDoctrine"" 2) (if (= (who at:(last To)) 4) (mapEntry ""NoDoctrine"" 2) 0)))) (if (is In (last To) (sites Occupied by:All container:""Board"" components:{""Launcher"" ""Antiair"" ""Artillery""})) (if (= (who at:(last To)) 1) (mapEntry ""NoDoctrine"" 3) (if (= (who at:(last To)) 2) (mapEntry ""NoDoctrine"" 3) (if (= (who at:(last To)) 3) (mapEntry ""NoDoctrine"" 3) (if (= (who at:(last To)) 4) (mapEntry ""NoDoctrine"" 3) 0)))) (if (is In (last To) (sites Occupied by:All container:""Board"" components:{""Fighter"" ""Bomber"" ""Helicopter""})) (if (= (who at:(last To)) 1) (mapEntry ""NoDoctrine"" 4) (if (= (who at:(last To)) 2) (mapEntry ""NoDoctrine"" 4) (if (= (who at:(last To)) 3) (mapEntry ""NoDoctrine"" 4) (if (= (who at:(last To)) 4) (mapEntry ""NoDoctrine"" 4) 0)))) (if (is In (last To) (sites Occupied by:All container:""Board"" components:{""Submarine"" ""Cruiser"" ""Battleship""})) (if (= (who at:(last To)) 1) (mapEntry ""NoDoctrine"" 5) (if (= (who at:(last To)) 2) (mapEntry ""NoDoctrine"" 5) (if (= (who at:(last To)) 3) (mapEntry ""NoDoctrine"" 5) (if (= (who at:(last To)) 4) (mapEntry ""NoDoctrine"" 5) 0)))) 4))))) (if (and (= 8 (state at:(last From))) (!= (mover) (who at:(last From)))) (if (= (who at:(last To)) 1) (mapEntry ""NoDoctrine"" 6) (if (= (who at:(last To)) 2) (mapEntry ""NoDoctrine"" 6) (if (= (who at:(last To)) 3) (mapEntry ""NoDoctrine"" 6) (if (= (who at:(last To)) 4) (mapEntry ""NoDoctrine"" 6) 0)))) 5) (if (> (who at:(last From)) 0) (if (= (who at:(last From)) 1) (mapEntry ""NoDoctrine"" 8) (if (= (who at:(last From)) 2) (mapEntry ""NoDoctrine"" 8) (if (= (who at:(last From)) 3) (mapEntry ""NoDoctrine"" 8) (if (= (who at:(last From)) 4) (mapEntry ""NoDoctrine"" 8) 0)))) 4) (if True (if (= (who at:(last To)) 1) (mapEntry ""NoDoctrine"" 10) (if (= (who at:(last To)) 2) (mapEntry ""NoDoctrine"" 10) (if (= (who at:(last To)) 3) (mapEntry ""NoDoctrine"" 10) (if (= (who at:(last To)) 4) (mapEntry ""NoDoctrine"" 10) 0)))) (if (= (who at:(last To)) 1) (mapEntry ""NoDoctrine"" 9) (if (= (who at:(last To)) 2) (mapEntry ""NoDoctrine"" 9) (if (= (who at:(last To)) 3) (mapEntry ""NoDoctrine"" 9) (if (= (who at:(last To)) 4) (mapEntry ""NoDoctrine"" 9) 0))))) (value Random (range (if (= (who at:(last To)) 1) (mapEntry ""NoDoctrine"" 11) (if (= (who at:(last To)) 2) (mapEntry ""NoDoctrine"" 11) (if (= (who at:(last To)) 3) (mapEntry ""NoDoctrine"" 11) (if (= (who at:(last To)) 4) (mapEntry ""NoDoctrine"" 11) 0)))) (if (= (who at:(last To)) 1) (mapEntry ""NoDoctrine"" 12) (if (= (who at:(last To)) 2) (mapEntry ""NoDoctrine"" 12) (if (= (who at:(last To)) 3) (mapEntry ""NoDoctrine"" 12) (if (= (who at:(last To)) 4) (mapEntry ""NoDoctrine"" 12) 0))))))})) 128000)) 0) (remove (last From)) (set Value at:(last From) (- (value Piece at:(last From)) (/ (* (if (is In (last From) (sites Occupied by:All container:""Board"" components:{""Fighter"" ""Bomber"" ""Helicopter""})) (max (/ (* (* (value Piece at:(last To)) 4) (mapEntry ""DamageMultiplier"" (what at:(last To)))) 100) 1) (if (and (is In (last From) (sites Occupied by:All container:""Board"" components:{""Soldier"" ""Motorbike""})) (is In (last To) (sites Occupied by:All component:""Shooter""))) (if (is In (last From) (sites ""Forest"")) (max (/ (* (* (value Piece at:(last To)) 6) (mapEntry ""DamageMultiplier"" (what at:(last To)))) 100) 1) (if (is In (last From) (union (sites ""ShallowWater"") (sites ""DeepWater""))) (max (/ (* (* (value Piece at:(last To)) 10) (mapEntry ""DamageMultiplier"" (what at:(last To)))) 100) 1) (max (/ (* (* (value Piece at:(last To)) 8) (mapEntry ""DamageMultiplier"" (what at:(last To)))) 100) 1))) (if (is In (last From) (sites ""Forest"")) (max (/ (* (* (value Piece at:(last To)) 3) (mapEntry ""DamageMultiplier"" (what at:(last To)))) 100) 1) (if (is In (last From) (union (sites ""ShallowWater"") (sites ""DeepWater""))) (max (/ (* (* (value Piece at:(last To)) 5) (mapEntry ""DamageMultiplier"" (what at:(last To)))) 100) 1) (max (/ (* (* (value Piece at:(last To)) 4) (mapEntry ""DamageMultiplier"" (what at:(last To)))) 100) 1))))) (* {(if (is In (last To) (sites Occupied by:All container:""Board"" components:{""Soldier"" ""Motorbike""})) (if (= (who at:(last To)) 1) (mapEntry ""NoDoctrine"" 1) (if (= (who at:(last To)) 2) (mapEntry ""NoDoctrine"" 1) (if (= (who at:(last To)) 3) (mapEntry ""NoDoctrine"" 1) (if (= (who at:(last To)) 4) (mapEntry ""NoDoctrine"" 1) 0)))) (if (is In (last To) (sites Occupied by:All container:""Board"" components:{""Tank"" ""Speeder"" ""Shooter""})) (if (= (who at:(last To)) 1) (mapEntry ""NoDoctrine"" 2) (if (= (who at:(last To)) 2) (mapEntry ""NoDoctrine"" 2) (if (= (who at:(last To)) 3) (mapEntry ""NoDoctrine"" 2) (if (= (who at:(last To)) 4) (mapEntry ""NoDoctrine"" 2) 0)))) (if (is In (last To) (sites Occupied by:All container:""Board"" components:{""Launcher"" ""Antiair"" ""Artillery""})) (if (= (who at:(last To)) 1) (mapEntry ""NoDoctrine"" 3) (if (= (who at:(last To)) 2) (mapEntry ""NoDoctrine"" 3) (if (= (who at:(last To)) 3) (mapEntry ""NoDoctrine"" 3) (if (= (who at:(last To)) 4) (mapEntry ""NoDoctrine"" 3) 0)))) (if (is In (last To) (sites Occupied by:All container:""Board"" components:{""Fighter"" ""Bomber"" ""Helicopter""})) (if (= (who at:(last To)) 1) (mapEntry ""NoDoctrine"" 4) (if (= (who at:(last To)) 2) (mapEntry ""NoDoctrine"" 4) (if (= (who at:(last To)) 3) (mapEntry ""NoDoctrine"" 4) (if (= (who at:(last To)) 4) (mapEntry ""NoDoctrine"" 4) 0)))) (if (is In (last To) (sites Occupied by:All container:""Board"" components:{""Submarine"" ""Cruiser"" ""Battleship""})) (if (= (who at:(last To)) 1) (mapEntry ""NoDoctrine"" 5) (if (= (who at:(last To)) 2) (mapEntry ""NoDoctrine"" 5) (if (= (who at:(last To)) 3) (mapEntry ""NoDoctrine"" 5) (if (= (who at:(last To)) 4) (mapEntry ""NoDoctrine"" 5) 0)))) 4))))) (if (and (= 8 (state at:(last From))) (!= (mover) (who at:(last From)))) (if (= (who at:(last To)) 1) (mapEntry ""NoDoctrine"" 6) (if (= (who at:(last To)) 2) (mapEntry ""NoDoctrine"" 6) (if (= (who at:(last To)) 3) (mapEntry ""NoDoctrine"" 6) (if (= (who at:(last To)) 4) (mapEntry ""NoDoctrine"" 6) 0)))) 5) (if (> (who at:(last From)) 0) (if (= (who at:(last From)) 1) (mapEntry ""NoDoctrine"" 8) (if (= (who at:(last From)) 2) (mapEntry ""NoDoctrine"" 8) (if (= (who at:(last From)) 3) (mapEntry ""NoDoctrine"" 8) (if (= (who at:(last From)) 4) (mapEntry ""NoDoctrine"" 8) 0)))) 4) (if True (if (= (who at:(last To)) 1) (mapEntry ""NoDoctrine"" 10) (if (= (who at:(last To)) 2) (mapEntry ""NoDoctrine"" 10) (if (= (who at:(last To)) 3) (mapEntry ""NoDoctrine"" 10) (if (= (who at:(last To)) 4) (mapEntry ""NoDoctrine"" 10) 0)))) (if (= (who at:(last To)) 1) (mapEntry ""NoDoctrine"" 9) (if (= (who at:(last To)) 2) (mapEntry ""NoDoctrine"" 9) (if (= (who at:(last To)) 3) (mapEntry ""NoDoctrine"" 9) (if (= (who at:(last To)) 4) (mapEntry ""NoDoctrine"" 9) 0))))) (value Random (range (if (= (who at:(last To)) 1) (mapEntry ""NoDoctrine"" 11) (if (= (who at:(last To)) 2) (mapEntry ""NoDoctrine"" 11) (if (= (who at:(last To)) 3) (mapEntry ""NoDoctrine"" 11) (if (= (who at:(last To)) 4) (mapEntry ""NoDoctrine"" 11) 0)))) (if (= (who at:(last To)) 1) (mapEntry ""NoDoctrine"" 12) (if (= (who at:(last To)) 2) (mapEntry ""NoDoctrine"" 12) (if (= (who at:(last To)) 3) (mapEntry ""NoDoctrine"" 12) (if (= (who at:(last To)) 4) (mapEntry ""NoDoctrine"" 12) 0))))))})) 128000)))) (set Value at:(last From) (value Piece at:(last From))))))))) (move Select (from (from) if:(and (> (state at:(from)) 0) (< (value Piece at:(from)) (mapEntry ""MaxHealth"" (what at:(from)))))) (to (sites Around (from) Orthogonal if:(is In (to) (sites Occupied by:Mover container:""Board"" components:{""Town"" ""Dock"" ""Base"" ""Factory"" ""Airport""})))) (then (and {(set Value at:(last From) (min (mapEntry ""MaxHealth"" (what at:(last From))) (- (+ (value Piece at:(last From)) (value Piece at:(last To))) 1))) (set Value at:(last To) (max (- (value Piece at:(last To)) (- (mapEntry ""MaxHealth"" (what at:(last From))) (value Piece at:(last From)))) 1)) (set State at:(last From) 0)}))) (move Select (from (from) if:(> (state at:(from)) 0)) (to (sites Around (from) Orthogonal if:(and (= (what at:(from)) (what at:(to))) (< (value Piece at:(to)) (mapEntry ""MaxHealth"" (what at:(to))))))) (then (and {(if (<= (+ (value Piece at:(last To)) (value Piece at:(last From))) (mapEntry ""MaxHealth"" (what at:(last From)))) (and (set Value at:(last To) (min (mapEntry ""MaxHealth"" (what at:(last From))) (+ (value Piece at:(last From)) (value Piece at:(last To))))) (remove (last From))) (and (set Value at:(last To) (min (mapEntry ""MaxHealth"" (what at:(last From))) (- (+ (value Piece at:(last From)) (value Piece at:(last To))) 1))) (set Value at:(last From) (max (- (value Piece at:(last To)) (- (mapEntry ""MaxHealth"" (what at:(last From))) (value Piece at:(last From)))) 1)))) (set State at:(last From) 0) (set State at:(last To) 0)})))})) (piece ""Tank"" Each (or {(or (move (from (from) if:(> (state at:(from)) 1)) (to (sites Distance (step Orthogonal (to if:(is In (to) (difference (union (sites Empty) (sites Occupied by:Friend container:""Board"")) (union (union (sites ""Mountain"") (sites ""DeepWater"")) (union (sites ""Forest"") (sites ""ShallowWater""))))))) from:(from) (range 1 (- (state at:(from)) 1))) if:(is Empty (to)) (apply (set State at:(from) 1)))) (move (from (from) if:(> (state at:(from)) 1)) (to (sites Distance (step Orthogonal (to if:(is In (to) (intersection (sites Empty) (union (sites ""Forest"") (sites ""ShallowWater"")))))) from:(from) (range 1 (- 2 1))) if:(is Empty (to)) (apply (set State at:(from) 1))))) (move Select (from (from) if:(> (state at:(from)) 0)) (to (sites Distance Orthogonal from:(from) (range 1 1)) if:(and {(if (is In (from) (sites Occupied by:Mover container:""Board"" components:{""Bomber"" ""Battleship"" ""Artillery"" ""Launcher""})) (is In (to) (union (sites Occupied by:Enemy container:""Board"" components:{""Soldier"" ""Motorbike"" ""Tank"" ""Speeder"" ""Shooter"" ""Launcher"" ""Antiair"" ""Battleship"" ""Artillery"" ""Base"" ""Town"" ""Factory"" ""Dock"" ""Airport"" ""Cruiser"" ""Submarine""}) (sites Occupied by:Neutral container:""Board""))) (is In (to) (union (sites Occupied by:Enemy container:""Board"") (sites Occupied by:Neutral container:""Board"")))) (if (is In (from) (sites Occupied by:Mover container:""Board"" components:{""Antiair"" ""Fighter""})) (is In (to) (sites Occupied by:Enemy container:""Board"" components:{""Fighter"" ""Helicopter"" ""Bomber""})) (is In (to) (union (sites Occupied by:Enemy container:""Board"") (sites Occupied by:Neutral container:""Board"")))) (if (is In (from) (sites Occupied by:Mover container:""Board"" components:{""Submarine""})) (is In (to) (sites Occupied by:Enemy container:""Board"" components:{""Submarine"" ""Battleship"" ""Cruiser""})) (is In (to) (union (sites Occupied by:Enemy container:""Board"") (sites Occupied by:Neutral container:""Board""))))})) (then (do (and (set Value at:(last To) (max 0 (- (value Piece at:(last To)) (/ (* (if (is In (last To) (sites Occupied by:All container:""Board"" components:{""Fighter"" ""Bomber"" ""Helicopter""})) (max (/ (* (* (value Piece at:(last From)) 4) (mapEntry ""DamageMultiplier"" (what at:(last From)))) 100) 1) (if (and (is In (last To) (sites Occupied by:All container:""Board"" components:{""Soldier"" ""Motorbike""})) (is In (last From) (sites Occupied by:All component:""Shooter""))) (if (is In (last To) (sites ""Forest"")) (max (/ (* (* (value Piece at:(last From)) 6) (mapEntry ""DamageMultiplier"" (what at:(last From)))) 100) 1) (if (is In (last To) (union (sites ""ShallowWater"") (sites ""DeepWater""))) (max (/ (* (* (value Piece at:(last From)) 10) (mapEntry ""DamageMultiplier"" (what at:(last From)))) 100) 1) (max (/ (* (* (value Piece at:(last From)) 8) (mapEntry ""DamageMultiplier"" (what at:(last From)))) 100) 1))) (if (is In (last To) (sites ""Forest"")) (max (/ (* (* (value Piece at:(last From)) 3) (mapEntry ""DamageMultiplier"" (what at:(last From)))) 100) 1) (if (is In (last To) (union (sites ""ShallowWater"") (sites ""DeepWater""))) (max (/ (* (* (value Piece at:(last From)) 5) (mapEntry ""DamageMultiplier"" (what at:(last From)))) 100) 1) (max (/ (* (* (value Piece at:(last From)) 4) (mapEntry ""DamageMultiplier"" (what at:(last From)))) 100) 1))))) (* {(if (is In (last From) (sites Occupied by:All container:""Board"" components:{""Soldier"" ""Motorbike""})) (if (= (who at:(last From)) 1) (mapEntry ""NoDoctrine"" 1) (if (= (who at:(last From)) 2) (mapEntry ""NoDoctrine"" 1) (if (= (who at:(last From)) 3) (mapEntry ""NoDoctrine"" 1) (if (= (who at:(last From)) 4) (mapEntry ""NoDoctrine"" 1) 0)))) (if (is In (last From) (sites Occupied by:All container:""Board"" components:{""Tank"" ""Speeder"" ""Shooter""})) (if (= (who at:(last From)) 1) (mapEntry ""NoDoctrine"" 2) (if (= (who at:(last From)) 2) (mapEntry ""NoDoctrine"" 2) (if (= (who at:(last From)) 3) (mapEntry ""NoDoctrine"" 2) (if (= (who at:(last From)) 4) (mapEntry ""NoDoctrine"" 2) 0)))) (if (is In (last From) (sites Occupied by:All container:""Board"" components:{""Launcher"" ""Antiair"" ""Artillery""})) (if (= (who at:(last From)) 1) (mapEntry ""NoDoctrine"" 3) (if (= (who at:(last From)) 2) (mapEntry ""NoDoctrine"" 3) (if (= (who at:(last From)) 3) (mapEntry ""NoDoctrine"" 3) (if (= (who at:(last From)) 4) (mapEntry ""NoDoctrine"" 3) 0)))) (if (is In (last From) (sites Occupied by:All container:""Board"" components:{""Fighter"" ""Bomber"" ""Helicopter""})) (if (= (who at:(last From)) 1) (mapEntry ""NoDoctrine"" 4) (if (= (who at:(last From)) 2) (mapEntry ""NoDoctrine"" 4) (if (= (who at:(last From)) 3) (mapEntry ""NoDoctrine"" 4) (if (= (who at:(last From)) 4) (mapEntry ""NoDoctrine"" 4) 0)))) (if (is In (last From) (sites Occupied by:All container:""Board"" components:{""Submarine"" ""Cruiser"" ""Battleship""})) (if (= (who at:(last From)) 1) (mapEntry ""NoDoctrine"" 5) (if (= (who at:(last From)) 2) (mapEntry ""NoDoctrine"" 5) (if (= (who at:(last From)) 3) (mapEntry ""NoDoctrine"" 5) (if (= (who at:(last From)) 4) (mapEntry ""NoDoctrine"" 5) 0)))) 4))))) (if (and (= 8 (state at:(last To))) (!= (mover) (who at:(last To)))) (if (= (who at:(last From)) 1) (mapEntry ""NoDoctrine"" 6) (if (= (who at:(last From)) 2) (mapEntry ""NoDoctrine"" 6) (if (= (who at:(last From)) 3) (mapEntry ""NoDoctrine"" 6) (if (= (who at:(last From)) 4) (mapEntry ""NoDoctrine"" 6) 0)))) 5) (if (> (who at:(last To)) 0) (if (= (who at:(last To)) 1) (mapEntry ""NoDoctrine"" 8) (if (= (who at:(last To)) 2) (mapEntry ""NoDoctrine"" 8) (if (= (who at:(last To)) 3) (mapEntry ""NoDoctrine"" 8) (if (= (who at:(last To)) 4) (mapEntry ""NoDoctrine"" 8) 0)))) 4) (if False (if (= (who at:(last From)) 1) (mapEntry ""NoDoctrine"" 10) (if (= (who at:(last From)) 2) (mapEntry ""NoDoctrine"" 10) (if (= (who at:(last From)) 3) (mapEntry ""NoDoctrine"" 10) (if (= (who at:(last From)) 4) (mapEntry ""NoDoctrine"" 10) 0)))) (if (= (who at:(last From)) 1) (mapEntry ""NoDoctrine"" 9) (if (= (who at:(last From)) 2) (mapEntry ""NoDoctrine"" 9) (if (= (who at:(last From)) 3) (mapEntry ""NoDoctrine"" 9) (if (= (who at:(last From)) 4) (mapEntry ""NoDoctrine"" 9) 0))))) (value Random (range (if (= (who at:(last From)) 1) (mapEntry ""NoDoctrine"" 11) (if (= (who at:(last From)) 2) (mapEntry ""NoDoctrine"" 11) (if (= (who at:(last From)) 3) (mapEntry ""NoDoctrine"" 11) (if (= (who at:(last From)) 4) (mapEntry ""NoDoctrine"" 11) 0)))) (if (= (who at:(last From)) 1) (mapEntry ""NoDoctrine"" 12) (if (= (who at:(last From)) 2) (mapEntry ""NoDoctrine"" 12) (if (= (who at:(last From)) 3) (mapEntry ""NoDoctrine"" 12) (if (= (who at:(last From)) 4) (mapEntry ""NoDoctrine"" 12) 0))))))})) 128000)))) (set State at:(last From) 0)) next:(if (and (= 8 (state at:(last To))) (!= (mover) (who at:(last To)))) (if (= (value Piece at:(last To)) 0) (and {(take Control of:All by:Mover at:(last To)) (set Value at:(last To) 50)}) (set Value at:(last To) (value Piece at:(last To)))) (if (= (value Piece at:(last To)) 0) (remove (last To)) (if (and {(= 0 (count Sites in:(intersection (sites {(last To) (last From)}) (sites Occupied by:All components:{""Launcher"" ""Artillery"" ""Battleship"" ""Antiair""})))) (if (is In (last To) (sites Occupied by:Enemy components:{""Bomber"" ""Battleship"" ""Artillery"" ""Launcher""})) (is In (last From) (union (sites Occupied by:Mover components:{""Soldier"" ""Motorbike"" ""Tank"" ""Speeder"" ""Shooter"" ""Launcher"" ""Antiair"" ""Battleship"" ""Artillery"" ""Base"" ""Town"" ""Factory"" ""Dock"" ""Airport"" ""Cruiser"" ""Submarine""}) (sites Occupied by:Neutral container:""Board""))) (is In (last From) (union (sites Occupied by:Mover) (sites Occupied by:Neutral container:""Board"")))) (if (is In (last To) (sites Occupied by:Enemy components:{""Antiair"" ""Fighter""})) (is In (last From) (sites Occupied by:Mover components:{""Fighter"" ""Helicopter"" ""Bomber""})) (is In (last From) (union (sites Occupied by:Mover) (sites Occupied by:Neutral container:""Board"")))) (if (is In (last To) (sites Occupied by:Enemy components:{""Submarine""})) (is In (last From) (sites Occupied by:Mover components:{""Submarine"" ""Battleship"" ""Cruiser""})) (is In (last From) (union (sites Occupied by:Mover) (sites Occupied by:Neutral container:""Board""))))}) (if (<= (- (value Piece at:(last From)) (/ (* (if (is In (last From) (sites Occupied by:All container:""Board"" components:{""Fighter"" ""Bomber"" ""Helicopter""})) (max (/ (* (* (value Piece at:(last To)) 4) (mapEntry ""DamageMultiplier"" (what at:(last To)))) 100) 1) (if (and (is In (last From) (sites Occupied by:All container:""Board"" components:{""Soldier"" ""Motorbike""})) (is In (last To) (sites Occupied by:All component:""Shooter""))) (if (is In (last From) (sites ""Forest"")) (max (/ (* (* (value Piece at:(last To)) 6) (mapEntry ""DamageMultiplier"" (what at:(last To)))) 100) 1) (if (is In (last From) (union (sites ""ShallowWater"") (sites ""DeepWater""))) (max (/ (* (* (value Piece at:(last To)) 10) (mapEntry ""DamageMultiplier"" (what at:(last To)))) 100) 1) (max (/ (* (* (value Piece at:(last To)) 8) (mapEntry ""DamageMultiplier"" (what at:(last To)))) 100) 1))) (if (is In (last From) (sites ""Forest"")) (max (/ (* (* (value Piece at:(last To)) 3) (mapEntry ""DamageMultiplier"" (what at:(last To)))) 100) 1) (if (is In (last From) (union (sites ""ShallowWater"") (sites ""DeepWater""))) (max (/ (* (* (value Piece at:(last To)) 5) (mapEntry ""DamageMultiplier"" (what at:(last To)))) 100) 1) (max (/ (* (* (value Piece at:(last To)) 4) (mapEntry ""DamageMultiplier"" (what at:(last To)))) 100) 1))))) (* {(if (is In (last To) (sites Occupied by:All container:""Board"" components:{""Soldier"" ""Motorbike""})) (if (= (who at:(last To)) 1) (mapEntry ""NoDoctrine"" 1) (if (= (who at:(last To)) 2) (mapEntry ""NoDoctrine"" 1) (if (= (who at:(last To)) 3) (mapEntry ""NoDoctrine"" 1) (if (= (who at:(last To)) 4) (mapEntry ""NoDoctrine"" 1) 0)))) (if (is In (last To) (sites Occupied by:All container:""Board"" components:{""Tank"" ""Speeder"" ""Shooter""})) (if (= (who at:(last To)) 1) (mapEntry ""NoDoctrine"" 2) (if (= (who at:(last To)) 2) (mapEntry ""NoDoctrine"" 2) (if (= (who at:(last To)) 3) (mapEntry ""NoDoctrine"" 2) (if (= (who at:(last To)) 4) (mapEntry ""NoDoctrine"" 2) 0)))) (if (is In (last To) (sites Occupied by:All container:""Board"" components:{""Launcher"" ""Antiair"" ""Artillery""})) (if (= (who at:(last To)) 1) (mapEntry ""NoDoctrine"" 3) (if (= (who at:(last To)) 2) (mapEntry ""NoDoctrine"" 3) (if (= (who at:(last To)) 3) (mapEntry ""NoDoctrine"" 3) (if (= (who at:(last To)) 4) (mapEntry ""NoDoctrine"" 3) 0)))) (if (is In (last To) (sites Occupied by:All container:""Board"" components:{""Fighter"" ""Bomber"" ""Helicopter""})) (if (= (who at:(last To)) 1) (mapEntry ""NoDoctrine"" 4) (if (= (who at:(last To)) 2) (mapEntry ""NoDoctrine"" 4) (if (= (who at:(last To)) 3) (mapEntry ""NoDoctrine"" 4) (if (= (who at:(last To)) 4) (mapEntry ""NoDoctrine"" 4) 0)))) (if (is In (last To) (sites Occupied by:All container:""Board"" components:{""Submarine"" ""Cruiser"" ""Battleship""})) (if (= (who at:(last To)) 1) (mapEntry ""NoDoctrine"" 5) (if (= (who at:(last To)) 2) (mapEntry ""NoDoctrine"" 5) (if (= (who at:(last To)) 3) (mapEntry ""NoDoctrine"" 5) (if (= (who at:(last To)) 4) (mapEntry ""NoDoctrine"" 5) 0)))) 4))))) (if (and (= 8 (state at:(last From))) (!= (mover) (who at:(last From)))) (if (= (who at:(last To)) 1) (mapEntry ""NoDoctrine"" 6) (if (= (who at:(last To)) 2) (mapEntry ""NoDoctrine"" 6) (if (= (who at:(last To)) 3) (mapEntry ""NoDoctrine"" 6) (if (= (who at:(last To)) 4) (mapEntry ""NoDoctrine"" 6) 0)))) 5) (if (> (who at:(last From)) 0) (if (= (who at:(last From)) 1) (mapEntry ""NoDoctrine"" 8) (if (= (who at:(last From)) 2) (mapEntry ""NoDoctrine"" 8) (if (= (who at:(last From)) 3) (mapEntry ""NoDoctrine"" 8) (if (= (who at:(last From)) 4) (mapEntry ""NoDoctrine"" 8) 0)))) 4) (if True (if (= (who at:(last To)) 1) (mapEntry ""NoDoctrine"" 10) (if (= (who at:(last To)) 2) (mapEntry ""NoDoctrine"" 10) (if (= (who at:(last To)) 3) (mapEntry ""NoDoctrine"" 10) (if (= (who at:(last To)) 4) (mapEntry ""NoDoctrine"" 10) 0)))) (if (= (who at:(last To)) 1) (mapEntry ""NoDoctrine"" 9) (if (= (who at:(last To)) 2) (mapEntry ""NoDoctrine"" 9) (if (= (who at:(last To)) 3) (mapEntry ""NoDoctrine"" 9) (if (= (who at:(last To)) 4) (mapEntry ""NoDoctrine"" 9) 0))))) (value Random (range (if (= (who at:(last To)) 1) (mapEntry ""NoDoctrine"" 11) (if (= (who at:(last To)) 2) (mapEntry ""NoDoctrine"" 11) (if (= (who at:(last To)) 3) (mapEntry ""NoDoctrine"" 11) (if (= (who at:(last To)) 4) (mapEntry ""NoDoctrine"" 11) 0)))) (if (= (who at:(last To)) 1) (mapEntry ""NoDoctrine"" 12) (if (= (who at:(last To)) 2) (mapEntry ""NoDoctrine"" 12) (if (= (who at:(last To)) 3) (mapEntry ""NoDoctrine"" 12) (if (= (who at:(last To)) 4) (mapEntry ""NoDoctrine"" 12) 0))))))})) 128000)) 0) (remove (last From)) (set Value at:(last From) (- (value Piece at:(last From)) (/ (* (if (is In (last From) (sites Occupied by:All container:""Board"" components:{""Fighter"" ""Bomber"" ""Helicopter""})) (max (/ (* (* (value Piece at:(last To)) 4) (mapEntry ""DamageMultiplier"" (what at:(last To)))) 100) 1) (if (and (is In (last From) (sites Occupied by:All container:""Board"" components:{""Soldier"" ""Motorbike""})) (is In (last To) (sites Occupied by:All component:""Shooter""))) (if (is In (last From) (sites ""Forest"")) (max (/ (* (* (value Piece at:(last To)) 6) (mapEntry ""DamageMultiplier"" (what at:(last To)))) 100) 1) (if (is In (last From) (union (sites ""ShallowWater"") (sites ""DeepWater""))) (max (/ (* (* (value Piece at:(last To)) 10) (mapEntry ""DamageMultiplier"" (what at:(last To)))) 100) 1) (max (/ (* (* (value Piece at:(last To)) 8) (mapEntry ""DamageMultiplier"" (what at:(last To)))) 100) 1))) (if (is In (last From) (sites ""Forest"")) (max (/ (* (* (value Piece at:(last To)) 3) (mapEntry ""DamageMultiplier"" (what at:(last To)))) 100) 1) (if (is In (last From) (union (sites ""ShallowWater"") (sites ""DeepWater""))) (max (/ (* (* (value Piece at:(last To)) 5) (mapEntry ""DamageMultiplier"" (what at:(last To)))) 100) 1) (max (/ (* (* (value Piece at:(last To)) 4) (mapEntry ""DamageMultiplier"" (what at:(last To)))) 100) 1))))) (* {(if (is In (last To) (sites Occupied by:All container:""Board"" components:{""Soldier"" ""Motorbike""})) (if (= (who at:(last To)) 1) (mapEntry ""NoDoctrine"" 1) (if (= (who at:(last To)) 2) (mapEntry ""NoDoctrine"" 1) (if (= (who at:(last To)) 3) (mapEntry ""NoDoctrine"" 1) (if (= (who at:(last To)) 4) (mapEntry ""NoDoctrine"" 1) 0)))) (if (is In (last To) (sites Occupied by:All container:""Board"" components:{""Tank"" ""Speeder"" ""Shooter""})) (if (= (who at:(last To)) 1) (mapEntry ""NoDoctrine"" 2) (if (= (who at:(last To)) 2) (mapEntry ""NoDoctrine"" 2) (if (= (who at:(last To)) 3) (mapEntry ""NoDoctrine"" 2) (if (= (who at:(last To)) 4) (mapEntry ""NoDoctrine"" 2) 0)))) (if (is In (last To) (sites Occupied by:All container:""Board"" components:{""Launcher"" ""Antiair"" ""Artillery""})) (if (= (who at:(last To)) 1) (mapEntry ""NoDoctrine"" 3) (if (= (who at:(last To)) 2) (mapEntry ""NoDoctrine"" 3) (if (= (who at:(last To)) 3) (mapEntry ""NoDoctrine"" 3) (if (= (who at:(last To)) 4) (mapEntry ""NoDoctrine"" 3) 0)))) (if (is In (last To) (sites Occupied by:All container:""Board"" components:{""Fighter"" ""Bomber"" ""Helicopter""})) (if (= (who at:(last To)) 1) (mapEntry ""NoDoctrine"" 4) (if (= (who at:(last To)) 2) (mapEntry ""NoDoctrine"" 4) (if (= (who at:(last To)) 3) (mapEntry ""NoDoctrine"" 4) (if (= (who at:(last To)) 4) (mapEntry ""NoDoctrine"" 4) 0)))) (if (is In (last To) (sites Occupied by:All container:""Board"" components:{""Submarine"" ""Cruiser"" ""Battleship""})) (if (= (who at:(last To)) 1) (mapEntry ""NoDoctrine"" 5) (if (= (who at:(last To)) 2) (mapEntry ""NoDoctrine"" 5) (if (= (who at:(last To)) 3) (mapEntry ""NoDoctrine"" 5) (if (= (who at:(last To)) 4) (mapEntry ""NoDoctrine"" 5) 0)))) 4))))) (if (and (= 8 (state at:(last From))) (!= (mover) (who at:(last From)))) (if (= (who at:(last To)) 1) (mapEntry ""NoDoctrine"" 6) (if (= (who at:(last To)) 2) (mapEntry ""NoDoctrine"" 6) (if (= (who at:(last To)) 3) (mapEntry ""NoDoctrine"" 6) (if (= (who at:(last To)) 4) (mapEntry ""NoDoctrine"" 6) 0)))) 5) (if (> (who at:(last From)) 0) (if (= (who at:(last From)) 1) (mapEntry ""NoDoctrine"" 8) (if (= (who at:(last From)) 2) (mapEntry ""NoDoctrine"" 8) (if (= (who at:(last From)) 3) (mapEntry ""NoDoctrine"" 8) (if (= (who at:(last From)) 4) (mapEntry ""NoDoctrine"" 8) 0)))) 4) (if True (if (= (who at:(last To)) 1) (mapEntry ""NoDoctrine"" 10) (if (= (who at:(last To)) 2) (mapEntry ""NoDoctrine"" 10) (if (= (who at:(last To)) 3) (mapEntry ""NoDoctrine"" 10) (if (= (who at:(last To)) 4) (mapEntry ""NoDoctrine"" 10) 0)))) (if (= (who at:(last To)) 1) (mapEntry ""NoDoctrine"" 9) (if (= (who at:(last To)) 2) (mapEntry ""NoDoctrine"" 9) (if (= (who at:(last To)) 3) (mapEntry ""NoDoctrine"" 9) (if (= (who at:(last To)) 4) (mapEntry ""NoDoctrine"" 9) 0))))) (value Random (range (if (= (who at:(last To)) 1) (mapEntry ""NoDoctrine"" 11) (if (= (who at:(last To)) 2) (mapEntry ""NoDoctrine"" 11) (if (= (who at:(last To)) 3) (mapEntry ""NoDoctrine"" 11) (if (= (who at:(last To)) 4) (mapEntry ""NoDoctrine"" 11) 0)))) (if (= (who at:(last To)) 1) (mapEntry ""NoDoctrine"" 12) (if (= (who at:(last To)) 2) (mapEntry ""NoDoctrine"" 12) (if (= (who at:(last To)) 3) (mapEntry ""NoDoctrine"" 12) (if (= (who at:(last To)) 4) (mapEntry ""NoDoctrine"" 12) 0))))))})) 128000)))) (set Value at:(last From) (value Piece at:(last From))))))))) (move Select (from (from) if:(and (> (state at:(from)) 0) (< (value Piece at:(from)) (mapEntry ""MaxHealth"" (what at:(from)))))) (to (sites Around (from) Orthogonal if:(is In (to) (sites Occupied by:Mover container:""Board"" components:{""Town"" ""Dock"" ""Base"" ""Factory"" ""Airport""})))) (then (and {(set Value at:(last From) (min (mapEntry ""MaxHealth"" (what at:(last From))) (- (+ (value Piece at:(last From)) (value Piece at:(last To))) 1))) (set Value at:(last To) (max (- (value Piece at:(last To)) (- (mapEntry ""MaxHealth"" (what at:(last From))) (value Piece at:(last From)))) 1)) (set State at:(last From) 0)}))) (move Select (from (from) if:(> (state at:(from)) 0)) (to (sites Around (from) Orthogonal if:(and (= (what at:(from)) (what at:(to))) (< (value Piece at:(to)) (mapEntry ""MaxHealth"" (what at:(to))))))) (then (and {(if (<= (+ (value Piece at:(last To)) (value Piece at:(last From))) (mapEntry ""MaxHealth"" (what at:(last From)))) (and (set Value at:(last To) (min (mapEntry ""MaxHealth"" (what at:(last From))) (+ (value Piece at:(last From)) (value Piece at:(last To))))) (remove (last From))) (and (set Value at:(last To) (min (mapEntry ""MaxHealth"" (what at:(last From))) (- (+ (value Piece at:(last From)) (value Piece at:(last To))) 1))) (set Value at:(last From) (max (- (value Piece at:(last To)) (- (mapEntry ""MaxHealth"" (what at:(last From))) (value Piece at:(last From)))) 1)))) (set State at:(last From) 0) (set State at:(last To) 0)})))})) (piece ""Antiair"" Each (or {(or (move (from (from) if:(> (state at:(from)) 1)) (to (sites Distance (step Orthogonal (to if:(is In (to) (difference (union (sites Empty) (sites Occupied by:Friend container:""Board"")) (union (union (sites ""Mountain"") (sites ""DeepWater"")) (union (sites ""Forest"") (sites ""ShallowWater""))))))) from:(from) (range 1 (- (state at:(from)) 1))) if:(is Empty (to)) (apply (set State at:(from) 1)))) (move (from (from) if:(> (state at:(from)) 1)) (to (sites Distance (step Orthogonal (to if:(is In (to) (intersection (sites Empty) (union (sites ""Forest"") (sites ""ShallowWater"")))))) from:(from) (range 1 (- 2 1))) if:(is Empty (to)) (apply (set State at:(from) 1))))) (move Select (from (from) if:(> (state at:(from)) 0)) (to (sites Distance Orthogonal from:(from) (range 1 2)) if:(and {(if (is In (from) (sites Occupied by:Mover container:""Board"" components:{""Bomber"" ""Battleship"" ""Artillery"" ""Launcher""})) (is In (to) (union (sites Occupied by:Enemy container:""Board"" components:{""Soldier"" ""Motorbike"" ""Tank"" ""Speeder"" ""Shooter"" ""Launcher"" ""Antiair"" ""Battleship"" ""Artillery"" ""Base"" ""Town"" ""Factory"" ""Dock"" ""Airport"" ""Cruiser"" ""Submarine""}) (sites Occupied by:Neutral container:""Board""))) (is In (to) (union (sites Occupied by:Enemy container:""Board"") (sites Occupied by:Neutral container:""Board"")))) (if (is In (from) (sites Occupied by:Mover container:""Board"" components:{""Antiair"" ""Fighter""})) (is In (to) (sites Occupied by:Enemy container:""Board"" components:{""Fighter"" ""Helicopter"" ""Bomber""})) (is In (to) (union (sites Occupied by:Enemy container:""Board"") (sites Occupied by:Neutral container:""Board"")))) (if (is In (from) (sites Occupied by:Mover container:""Board"" components:{""Submarine""})) (is In (to) (sites Occupied by:Enemy container:""Board"" components:{""Submarine"" ""Battleship"" ""Cruiser""})) (is In (to) (union (sites Occupied by:Enemy container:""Board"") (sites Occupied by:Neutral container:""Board""))))})) (then (do (and (set Value at:(last To) (max 0 (- (value Piece at:(last To)) (/ (* (if (is In (last To) (sites Occupied by:All container:""Board"" components:{""Fighter"" ""Bomber"" ""Helicopter""})) (max (/ (* (* (value Piece at:(last From)) 4) (mapEntry ""DamageMultiplier"" (what at:(last From)))) 100) 1) (if (and (is In (last To) (sites Occupied by:All container:""Board"" components:{""Soldier"" ""Motorbike""})) (is In (last From) (sites Occupied by:All component:""Shooter""))) (if (is In (last To) (sites ""Forest"")) (max (/ (* (* (value Piece at:(last From)) 6) (mapEntry ""DamageMultiplier"" (what at:(last From)))) 100) 1) (if (is In (last To) (union (sites ""ShallowWater"") (sites ""DeepWater""))) (max (/ (* (* (value Piece at:(last From)) 10) (mapEntry ""DamageMultiplier"" (what at:(last From)))) 100) 1) (max (/ (* (* (value Piece at:(last From)) 8) (mapEntry ""DamageMultiplier"" (what at:(last From)))) 100) 1))) (if (is In (last To) (sites ""Forest"")) (max (/ (* (* (value Piece at:(last From)) 3) (mapEntry ""DamageMultiplier"" (what at:(last From)))) 100) 1) (if (is In (last To) (union (sites ""ShallowWater"") (sites ""DeepWater""))) (max (/ (* (* (value Piece at:(last From)) 5) (mapEntry ""DamageMultiplier"" (what at:(last From)))) 100) 1) (max (/ (* (* (value Piece at:(last From)) 4) (mapEntry ""DamageMultiplier"" (what at:(last From)))) 100) 1))))) (* {(if (is In (last From) (sites Occupied by:All container:""Board"" components:{""Soldier"" ""Motorbike""})) (if (= (who at:(last From)) 1) (mapEntry ""NoDoctrine"" 1) (if (= (who at:(last From)) 2) (mapEntry ""NoDoctrine"" 1) (if (= (who at:(last From)) 3) (mapEntry ""NoDoctrine"" 1) (if (= (who at:(last From)) 4) (mapEntry ""NoDoctrine"" 1) 0)))) (if (is In (last From) (sites Occupied by:All container:""Board"" components:{""Tank"" ""Speeder"" ""Shooter""})) (if (= (who at:(last From)) 1) (mapEntry ""NoDoctrine"" 2) (if (= (who at:(last From)) 2) (mapEntry ""NoDoctrine"" 2) (if (= (who at:(last From)) 3) (mapEntry ""NoDoctrine"" 2) (if (= (who at:(last From)) 4) (mapEntry ""NoDoctrine"" 2) 0)))) (if (is In (last From) (sites Occupied by:All container:""Board"" components:{""Launcher"" ""Antiair"" ""Artillery""})) (if (= (who at:(last From)) 1) (mapEntry ""NoDoctrine"" 3) (if (= (who at:(last From)) 2) (mapEntry ""NoDoctrine"" 3) (if (= (who at:(last From)) 3) (mapEntry ""NoDoctrine"" 3) (if (= (who at:(last From)) 4) (mapEntry ""NoDoctrine"" 3) 0)))) (if (is In (last From) (sites Occupied by:All container:""Board"" components:{""Fighter"" ""Bomber"" ""Helicopter""})) (if (= (who at:(last From)) 1) (mapEntry ""NoDoctrine"" 4) (if (= (who at:(last From)) 2) (mapEntry ""NoDoctrine"" 4) (if (= (who at:(last From)) 3) (mapEntry ""NoDoctrine"" 4) (if (= (who at:(last From)) 4) (mapEntry ""NoDoctrine"" 4) 0)))) (if (is In (last From) (sites Occupied by:All container:""Board"" components:{""Submarine"" ""Cruiser"" ""Battleship""})) (if (= (who at:(last From)) 1) (mapEntry ""NoDoctrine"" 5) (if (= (who at:(last From)) 2) (mapEntry ""NoDoctrine"" 5) (if (= (who at:(last From)) 3) (mapEntry ""NoDoctrine"" 5) (if (= (who at:(last From)) 4) (mapEntry ""NoDoctrine"" 5) 0)))) 4))))) (if (and (= 8 (state at:(last To))) (!= (mover) (who at:(last To)))) (if (= (who at:(last From)) 1) (mapEntry ""NoDoctrine"" 6) (if (= (who at:(last From)) 2) (mapEntry ""NoDoctrine"" 6) (if (= (who at:(last From)) 3) (mapEntry ""NoDoctrine"" 6) (if (= (who at:(last From)) 4) (mapEntry ""NoDoctrine"" 6) 0)))) 5) (if (> (who at:(last To)) 0) (if (= (who at:(last To)) 1) (mapEntry ""NoDoctrine"" 8) (if (= (who at:(last To)) 2) (mapEntry ""NoDoctrine"" 8) (if (= (who at:(last To)) 3) (mapEntry ""NoDoctrine"" 8) (if (= (who at:(last To)) 4) (mapEntry ""NoDoctrine"" 8) 0)))) 4) (if False (if (= (who at:(last From)) 1) (mapEntry ""NoDoctrine"" 10) (if (= (who at:(last From)) 2) (mapEntry ""NoDoctrine"" 10) (if (= (who at:(last From)) 3) (mapEntry ""NoDoctrine"" 10) (if (= (who at:(last From)) 4) (mapEntry ""NoDoctrine"" 10) 0)))) (if (= (who at:(last From)) 1) (mapEntry ""NoDoctrine"" 9) (if (= (who at:(last From)) 2) (mapEntry ""NoDoctrine"" 9) (if (= (who at:(last From)) 3) (mapEntry ""NoDoctrine"" 9) (if (= (who at:(last From)) 4) (mapEntry ""NoDoctrine"" 9) 0))))) (value Random (range (if (= (who at:(last From)) 1) (mapEntry ""NoDoctrine"" 11) (if (= (who at:(last From)) 2) (mapEntry ""NoDoctrine"" 11) (if (= (who at:(last From)) 3) (mapEntry ""NoDoctrine"" 11) (if (= (who at:(last From)) 4) (mapEntry ""NoDoctrine"" 11) 0)))) (if (= (who at:(last From)) 1) (mapEntry ""NoDoctrine"" 12) (if (= (who at:(last From)) 2) (mapEntry ""NoDoctrine"" 12) (if (= (who at:(last From)) 3) (mapEntry ""NoDoctrine"" 12) (if (= (who at:(last From)) 4) (mapEntry ""NoDoctrine"" 12) 0))))))})) 128000)))) (set State at:(last From) 0)) next:(if (and (= 8 (state at:(last To))) (!= (mover) (who at:(last To)))) (if (= (value Piece at:(last To)) 0) (and {(take Control of:All by:Mover at:(last To)) (set Value at:(last To) 50)}) (set Value at:(last To) (value Piece at:(last To)))) (if (= (value Piece at:(last To)) 0) (remove (last To)) (if (and {(= 0 (count Sites in:(intersection (sites {(last To) (last From)}) (sites Occupied by:All components:{""Launcher"" ""Artillery"" ""Battleship"" ""Antiair""})))) (if (is In (last To) (sites Occupied by:Enemy components:{""Bomber"" ""Battleship"" ""Artillery"" ""Launcher""})) (is In (last From) (union (sites Occupied by:Mover components:{""Soldier"" ""Motorbike"" ""Tank"" ""Speeder"" ""Shooter"" ""Launcher"" ""Antiair"" ""Battleship"" ""Artillery"" ""Base"" ""Town"" ""Factory"" ""Dock"" ""Airport"" ""Cruiser"" ""Submarine""}) (sites Occupied by:Neutral container:""Board""))) (is In (last From) (union (sites Occupied by:Mover) (sites Occupied by:Neutral container:""Board"")))) (if (is In (last To) (sites Occupied by:Enemy components:{""Antiair"" ""Fighter""})) (is In (last From) (sites Occupied by:Mover components:{""Fighter"" ""Helicopter"" ""Bomber""})) (is In (last From) (union (sites Occupied by:Mover) (sites Occupied by:Neutral container:""Board"")))) (if (is In (last To) (sites Occupied by:Enemy components:{""Submarine""})) (is In (last From) (sites Occupied by:Mover components:{""Submarine"" ""Battleship"" ""Cruiser""})) (is In (last From) (union (sites Occupied by:Mover) (sites Occupied by:Neutral container:""Board""))))}) (if (<= (- (value Piece at:(last From)) (/ (* (if (is In (last From) (sites Occupied by:All container:""Board"" components:{""Fighter"" ""Bomber"" ""Helicopter""})) (max (/ (* (* (value Piece at:(last To)) 4) (mapEntry ""DamageMultiplier"" (what at:(last To)))) 100) 1) (if (and (is In (last From) (sites Occupied by:All container:""Board"" components:{""Soldier"" ""Motorbike""})) (is In (last To) (sites Occupied by:All component:""Shooter""))) (if (is In (last From) (sites ""Forest"")) (max (/ (* (* (value Piece at:(last To)) 6) (mapEntry ""DamageMultiplier"" (what at:(last To)))) 100) 1) (if (is In (last From) (union (sites ""ShallowWater"") (sites ""DeepWater""))) (max (/ (* (* (value Piece at:(last To)) 10) (mapEntry ""DamageMultiplier"" (what at:(last To)))) 100) 1) (max (/ (* (* (value Piece at:(last To)) 8) (mapEntry ""DamageMultiplier"" (what at:(last To)))) 100) 1))) (if (is In (last From) (sites ""Forest"")) (max (/ (* (* (value Piece at:(last To)) 3) (mapEntry ""DamageMultiplier"" (what at:(last To)))) 100) 1) (if (is In (last From) (union (sites ""ShallowWater"") (sites ""DeepWater""))) (max (/ (* (* (value Piece at:(last To)) 5) (mapEntry ""DamageMultiplier"" (what at:(last To)))) 100) 1) (max (/ (* (* (value Piece at:(last To)) 4) (mapEntry ""DamageMultiplier"" (what at:(last To)))) 100) 1))))) (* {(if (is In (last To) (sites Occupied by:All container:""Board"" components:{""Soldier"" ""Motorbike""})) (if (= (who at:(last To)) 1) (mapEntry ""NoDoctrine"" 1) (if (= (who at:(last To)) 2) (mapEntry ""NoDoctrine"" 1) (if (= (who at:(last To)) 3) (mapEntry ""NoDoctrine"" 1) (if (= (who at:(last To)) 4) (mapEntry ""NoDoctrine"" 1) 0)))) (if (is In (last To) (sites Occupied by:All container:""Board"" components:{""Tank"" ""Speeder"" ""Shooter""})) (if (= (who at:(last To)) 1) (mapEntry ""NoDoctrine"" 2) (if (= (who at:(last To)) 2) (mapEntry ""NoDoctrine"" 2) (if (= (who at:(last To)) 3) (mapEntry ""NoDoctrine"" 2) (if (= (who at:(last To)) 4) (mapEntry ""NoDoctrine"" 2) 0)))) (if (is In (last To) (sites Occupied by:All container:""Board"" components:{""Launcher"" ""Antiair"" ""Artillery""})) (if (= (who at:(last To)) 1) (mapEntry ""NoDoctrine"" 3) (if (= (who at:(last To)) 2) (mapEntry ""NoDoctrine"" 3) (if (= (who at:(last To)) 3) (mapEntry ""NoDoctrine"" 3) (if (= (who at:(last To)) 4) (mapEntry ""NoDoctrine"" 3) 0)))) (if (is In (last To) (sites Occupied by:All container:""Board"" components:{""Fighter"" ""Bomber"" ""Helicopter""})) (if (= (who at:(last To)) 1) (mapEntry ""NoDoctrine"" 4) (if (= (who at:(last To)) 2) (mapEntry ""NoDoctrine"" 4) (if (= (who at:(last To)) 3) (mapEntry ""NoDoctrine"" 4) (if (= (who at:(last To)) 4) (mapEntry ""NoDoctrine"" 4) 0)))) (if (is In (last To) (sites Occupied by:All container:""Board"" components:{""Submarine"" ""Cruiser"" ""Battleship""})) (if (= (who at:(last To)) 1) (mapEntry ""NoDoctrine"" 5) (if (= (who at:(last To)) 2) (mapEntry ""NoDoctrine"" 5) (if (= (who at:(last To)) 3) (mapEntry ""NoDoctrine"" 5) (if (= (who at:(last To)) 4) (mapEntry ""NoDoctrine"" 5) 0)))) 4))))) (if (and (= 8 (state at:(last From))) (!= (mover) (who at:(last From)))) (if (= (who at:(last To)) 1) (mapEntry ""NoDoctrine"" 6) (if (= (who at:(last To)) 2) (mapEntry ""NoDoctrine"" 6) (if (= (who at:(last To)) 3) (mapEntry ""NoDoctrine"" 6) (if (= (who at:(last To)) 4) (mapEntry ""NoDoctrine"" 6) 0)))) 5) (if (> (who at:(last From)) 0) (if (= (who at:(last From)) 1) (mapEntry ""NoDoctrine"" 8) (if (= (who at:(last From)) 2) (mapEntry ""NoDoctrine"" 8) (if (= (who at:(last From)) 3) (mapEntry ""NoDoctrine"" 8) (if (= (who at:(last From)) 4) (mapEntry ""NoDoctrine"" 8) 0)))) 4) (if True (if (= (who at:(last To)) 1) (mapEntry ""NoDoctrine"" 10) (if (= (who at:(last To)) 2) (mapEntry ""NoDoctrine"" 10) (if (= (who at:(last To)) 3) (mapEntry ""NoDoctrine"" 10) (if (= (who at:(last To)) 4) (mapEntry ""NoDoctrine"" 10) 0)))) (if (= (who at:(last To)) 1) (mapEntry ""NoDoctrine"" 9) (if (= (who at:(last To)) 2) (mapEntry ""NoDoctrine"" 9) (if (= (who at:(last To)) 3) (mapEntry ""NoDoctrine"" 9) (if (= (who at:(last To)) 4) (mapEntry ""NoDoctrine"" 9) 0))))) (value Random (range (if (= (who at:(last To)) 1) (mapEntry ""NoDoctrine"" 11) (if (= (who at:(last To)) 2) (mapEntry ""NoDoctrine"" 11) (if (= (who at:(last To)) 3) (mapEntry ""NoDoctrine"" 11) (if (= (who at:(last To)) 4) (mapEntry ""NoDoctrine"" 11) 0)))) (if (= (who at:(last To)) 1) (mapEntry ""NoDoctrine"" 12) (if (= (who at:(last To)) 2) (mapEntry ""NoDoctrine"" 12) (if (= (who at:(last To)) 3) (mapEntry ""NoDoctrine"" 12) (if (= (who at:(last To)) 4) (mapEntry ""NoDoctrine"" 12) 0))))))})) 128000)) 0) (remove (last From)) (set Value at:(last From) (- (value Piece at:(last From)) (/ (* (if (is In (last From) (sites Occupied by:All container:""Board"" components:{""Fighter"" ""Bomber"" ""Helicopter""})) (max (/ (* (* (value Piece at:(last To)) 4) (mapEntry ""DamageMultiplier"" (what at:(last To)))) 100) 1) (if (and (is In (last From) (sites Occupied by:All container:""Board"" components:{""Soldier"" ""Motorbike""})) (is In (last To) (sites Occupied by:All component:""Shooter""))) (if (is In (last From) (sites ""Forest"")) (max (/ (* (* (value Piece at:(last To)) 6) (mapEntry ""DamageMultiplier"" (what at:(last To)))) 100) 1) (if (is In (last From) (union (sites ""ShallowWater"") (sites ""DeepWater""))) (max (/ (* (* (value Piece at:(last To)) 10) (mapEntry ""DamageMultiplier"" (what at:(last To)))) 100) 1) (max (/ (* (* (value Piece at:(last To)) 8) (mapEntry ""DamageMultiplier"" (what at:(last To)))) 100) 1))) (if (is In (last From) (sites ""Forest"")) (max (/ (* (* (value Piece at:(last To)) 3) (mapEntry ""DamageMultiplier"" (what at:(last To)))) 100) 1) (if (is In (last From) (union (sites ""ShallowWater"") (sites ""DeepWater""))) (max (/ (* (* (value Piece at:(last To)) 5) (mapEntry ""DamageMultiplier"" (what at:(last To)))) 100) 1) (max (/ (* (* (value Piece at:(last To)) 4) (mapEntry ""DamageMultiplier"" (what at:(last To)))) 100) 1))))) (* {(if (is In (last To) (sites Occupied by:All container:""Board"" components:{""Soldier"" ""Motorbike""})) (if (= (who at:(last To)) 1) (mapEntry ""NoDoctrine"" 1) (if (= (who at:(last To)) 2) (mapEntry ""NoDoctrine"" 1) (if (= (who at:(last To)) 3) (mapEntry ""NoDoctrine"" 1) (if (= (who at:(last To)) 4) (mapEntry ""NoDoctrine"" 1) 0)))) (if (is In (last To) (sites Occupied by:All container:""Board"" components:{""Tank"" ""Speeder"" ""Shooter""})) (if (= (who at:(last To)) 1) (mapEntry ""NoDoctrine"" 2) (if (= (who at:(last To)) 2) (mapEntry ""NoDoctrine"" 2) (if (= (who at:(last To)) 3) (mapEntry ""NoDoctrine"" 2) (if (= (who at:(last To)) 4) (mapEntry ""NoDoctrine"" 2) 0)))) (if (is In (last To) (sites Occupied by:All container:""Board"" components:{""Launcher"" ""Antiair"" ""Artillery""})) (if (= (who at:(last To)) 1) (mapEntry ""NoDoctrine"" 3) (if (= (who at:(last To)) 2) (mapEntry ""NoDoctrine"" 3) (if (= (who at:(last To)) 3) (mapEntry ""NoDoctrine"" 3) (if (= (who at:(last To)) 4) (mapEntry ""NoDoctrine"" 3) 0)))) (if (is In (last To) (sites Occupied by:All container:""Board"" components:{""Fighter"" ""Bomber"" ""Helicopter""})) (if (= (who at:(last To)) 1) (mapEntry ""NoDoctrine"" 4) (if (= (who at:(last To)) 2) (mapEntry ""NoDoctrine"" 4) (if (= (who at:(last To)) 3) (mapEntry ""NoDoctrine"" 4) (if (= (who at:(last To)) 4) (mapEntry ""NoDoctrine"" 4) 0)))) (if (is In (last To) (sites Occupied by:All container:""Board"" components:{""Submarine"" ""Cruiser"" ""Battleship""})) (if (= (who at:(last To)) 1) (mapEntry ""NoDoctrine"" 5) (if (= (who at:(last To)) 2) (mapEntry ""NoDoctrine"" 5) (if (= (who at:(last To)) 3) (mapEntry ""NoDoctrine"" 5) (if (= (who at:(last To)) 4) (mapEntry ""NoDoctrine"" 5) 0)))) 4))))) (if (and (= 8 (state at:(last From))) (!= (mover) (who at:(last From)))) (if (= (who at:(last To)) 1) (mapEntry ""NoDoctrine"" 6) (if (= (who at:(last To)) 2) (mapEntry ""NoDoctrine"" 6) (if (= (who at:(last To)) 3) (mapEntry ""NoDoctrine"" 6) (if (= (who at:(last To)) 4) (mapEntry ""NoDoctrine"" 6) 0)))) 5) (if (> (who at:(last From)) 0) (if (= (who at:(last From)) 1) (mapEntry ""NoDoctrine"" 8) (if (= (who at:(last From)) 2) (mapEntry ""NoDoctrine"" 8) (if (= (who at:(last From)) 3) (mapEntry ""NoDoctrine"" 8) (if (= (who at:(last From)) 4) (mapEntry ""NoDoctrine"" 8) 0)))) 4) (if True (if (= (who at:(last To)) 1) (mapEntry ""NoDoctrine"" 10) (if (= (who at:(last To)) 2) (mapEntry ""NoDoctrine"" 10) (if (= (who at:(last To)) 3) (mapEntry ""NoDoctrine"" 10) (if (= (who at:(last To)) 4) (mapEntry ""NoDoctrine"" 10) 0)))) (if (= (who at:(last To)) 1) (mapEntry ""NoDoctrine"" 9) (if (= (who at:(last To)) 2) (mapEntry ""NoDoctrine"" 9) (if (= (who at:(last To)) 3) (mapEntry ""NoDoctrine"" 9) (if (= (who at:(last To)) 4) (mapEntry ""NoDoctrine"" 9) 0))))) (value Random (range (if (= (who at:(last To)) 1) (mapEntry ""NoDoctrine"" 11) (if (= (who at:(last To)) 2) (mapEntry ""NoDoctrine"" 11) (if (= (who at:(last To)) 3) (mapEntry ""NoDoctrine"" 11) (if (= (who at:(last To)) 4) (mapEntry ""NoDoctrine"" 11) 0)))) (if (= (who at:(last To)) 1) (mapEntry ""NoDoctrine"" 12) (if (= (who at:(last To)) 2) (mapEntry ""NoDoctrine"" 12) (if (= (who at:(last To)) 3) (mapEntry ""NoDoctrine"" 12) (if (= (who at:(last To)) 4) (mapEntry ""NoDoctrine"" 12) 0))))))})) 128000)))) (set Value at:(last From) (value Piece at:(last From))))))))) (move Select (from (from) if:(and (> (state at:(from)) 0) (< (value Piece at:(from)) (mapEntry ""MaxHealth"" (what at:(from)))))) (to (sites Around (from) Orthogonal if:(is In (to) (sites Occupied by:Mover container:""Board"" components:{""Town"" ""Dock"" ""Base"" ""Factory"" ""Airport""})))) (then (and {(set Value at:(last From) (min (mapEntry ""MaxHealth"" (what at:(last From))) (- (+ (value Piece at:(last From)) (value Piece at:(last To))) 1))) (set Value at:(last To) (max (- (value Piece at:(last To)) (- (mapEntry ""MaxHealth"" (what at:(last From))) (value Piece at:(last From)))) 1)) (set State at:(last From) 0)}))) (move Select (from (from) if:(> (state at:(from)) 0)) (to (sites Around (from) Orthogonal if:(and (= (what at:(from)) (what at:(to))) (< (value Piece at:(to)) (mapEntry ""MaxHealth"" (what at:(to))))))) (then (and {(if (<= (+ (value Piece at:(last To)) (value Piece at:(last From))) (mapEntry ""MaxHealth"" (what at:(last From)))) (and (set Value at:(last To) (min (mapEntry ""MaxHealth"" (what at:(last From))) (+ (value Piece at:(last From)) (value Piece at:(last To))))) (remove (last From))) (and (set Value at:(last To) (min (mapEntry ""MaxHealth"" (what at:(last From))) (- (+ (value Piece at:(last From)) (value Piece at:(last To))) 1))) (set Value at:(last From) (max (- (value Piece at:(last To)) (- (mapEntry ""MaxHealth"" (what at:(last From))) (value Piece at:(last From)))) 1)))) (set State at:(last From) 0) (set State at:(last To) 0)})))})) (piece ""Launcher"" Each (or {(or (move (from (from) if:(> (state at:(from)) 1)) (to (sites Distance (step Orthogonal (to if:(is In (to) (difference (union (sites Empty) (sites Occupied by:Friend container:""Board"")) (union (union (sites ""Mountain"") (sites ""DeepWater"")) (union (sites ""Forest"") (sites ""ShallowWater""))))))) from:(from) (range 1 (- (state at:(from)) 1))) if:(is Empty (to)) (apply (set State at:(from) 1)))) (move (from (from) if:(> (state at:(from)) 1)) (to (sites Distance (step Orthogonal (to if:(is In (to) (intersection (sites Empty) (union (sites ""Forest"") (sites ""ShallowWater"")))))) from:(from) (range 1 (- 2 1))) if:(is Empty (to)) (apply (set State at:(from) 1))))) (move Select (from (from) if:(> (state at:(from)) 0)) (to (sites Distance Orthogonal from:(from) (range 2 3)) if:(and {(if (is In (from) (sites Occupied by:Mover container:""Board"" components:{""Bomber"" ""Battleship"" ""Artillery"" ""Launcher""})) (is In (to) (union (sites Occupied by:Enemy container:""Board"" components:{""Soldier"" ""Motorbike"" ""Tank"" ""Speeder"" ""Shooter"" ""Launcher"" ""Antiair"" ""Battleship"" ""Artillery"" ""Base"" ""Town"" ""Factory"" ""Dock"" ""Airport"" ""Cruiser"" ""Submarine""}) (sites Occupied by:Neutral container:""Board""))) (is In (to) (union (sites Occupied by:Enemy container:""Board"") (sites Occupied by:Neutral container:""Board"")))) (if (is In (from) (sites Occupied by:Mover container:""Board"" components:{""Antiair"" ""Fighter""})) (is In (to) (sites Occupied by:Enemy container:""Board"" components:{""Fighter"" ""Helicopter"" ""Bomber""})) (is In (to) (union (sites Occupied by:Enemy container:""Board"") (sites Occupied by:Neutral container:""Board"")))) (if (is In (from) (sites Occupied by:Mover container:""Board"" components:{""Submarine""})) (is In (to) (sites Occupied by:Enemy container:""Board"" components:{""Submarine"" ""Battleship"" ""Cruiser""})) (is In (to) (union (sites Occupied by:Enemy container:""Board"") (sites Occupied by:Neutral container:""Board""))))})) (then (do (and (set Value at:(last To) (max 0 (- (value Piece at:(last To)) (/ (* (if (is In (last To) (sites Occupied by:All container:""Board"" components:{""Fighter"" ""Bomber"" ""Helicopter""})) (max (/ (* (* (value Piece at:(last From)) 4) (mapEntry ""DamageMultiplier"" (what at:(last From)))) 100) 1) (if (and (is In (last To) (sites Occupied by:All container:""Board"" components:{""Soldier"" ""Motorbike""})) (is In (last From) (sites Occupied by:All component:""Shooter""))) (if (is In (last To) (sites ""Forest"")) (max (/ (* (* (value Piece at:(last From)) 6) (mapEntry ""DamageMultiplier"" (what at:(last From)))) 100) 1) (if (is In (last To) (union (sites ""ShallowWater"") (sites ""DeepWater""))) (max (/ (* (* (value Piece at:(last From)) 10) (mapEntry ""DamageMultiplier"" (what at:(last From)))) 100) 1) (max (/ (* (* (value Piece at:(last From)) 8) (mapEntry ""DamageMultiplier"" (what at:(last From)))) 100) 1))) (if (is In (last To) (sites ""Forest"")) (max (/ (* (* (value Piece at:(last From)) 3) (mapEntry ""DamageMultiplier"" (what at:(last From)))) 100) 1) (if (is In (last To) (union (sites ""ShallowWater"") (sites ""DeepWater""))) (max (/ (* (* (value Piece at:(last From)) 5) (mapEntry ""DamageMultiplier"" (what at:(last From)))) 100) 1) (max (/ (* (* (value Piece at:(last From)) 4) (mapEntry ""DamageMultiplier"" (what at:(last From)))) 100) 1))))) (* {(if (is In (last From) (sites Occupied by:All container:""Board"" components:{""Soldier"" ""Motorbike""})) (if (= (who at:(last From)) 1) (mapEntry ""NoDoctrine"" 1) (if (= (who at:(last From)) 2) (mapEntry ""NoDoctrine"" 1) (if (= (who at:(last From)) 3) (mapEntry ""NoDoctrine"" 1) (if (= (who at:(last From)) 4) (mapEntry ""NoDoctrine"" 1) 0)))) (if (is In (last From) (sites Occupied by:All container:""Board"" components:{""Tank"" ""Speeder"" ""Shooter""})) (if (= (who at:(last From)) 1) (mapEntry ""NoDoctrine"" 2) (if (= (who at:(last From)) 2) (mapEntry ""NoDoctrine"" 2) (if (= (who at:(last From)) 3) (mapEntry ""NoDoctrine"" 2) (if (= (who at:(last From)) 4) (mapEntry ""NoDoctrine"" 2) 0)))) (if (is In (last From) (sites Occupied by:All container:""Board"" components:{""Launcher"" ""Antiair"" ""Artillery""})) (if (= (who at:(last From)) 1) (mapEntry ""NoDoctrine"" 3) (if (= (who at:(last From)) 2) (mapEntry ""NoDoctrine"" 3) (if (= (who at:(last From)) 3) (mapEntry ""NoDoctrine"" 3) (if (= (who at:(last From)) 4) (mapEntry ""NoDoctrine"" 3) 0)))) (if (is In (last From) (sites Occupied by:All container:""Board"" components:{""Fighter"" ""Bomber"" ""Helicopter""})) (if (= (who at:(last From)) 1) (mapEntry ""NoDoctrine"" 4) (if (= (who at:(last From)) 2) (mapEntry ""NoDoctrine"" 4) (if (= (who at:(last From)) 3) (mapEntry ""NoDoctrine"" 4) (if (= (who at:(last From)) 4) (mapEntry ""NoDoctrine"" 4) 0)))) (if (is In (last From) (sites Occupied by:All container:""Board"" components:{""Submarine"" ""Cruiser"" ""Battleship""})) (if (= (who at:(last From)) 1) (mapEntry ""NoDoctrine"" 5) (if (= (who at:(last From)) 2) (mapEntry ""NoDoctrine"" 5) (if (= (who at:(last From)) 3) (mapEntry ""NoDoctrine"" 5) (if (= (who at:(last From)) 4) (mapEntry ""NoDoctrine"" 5) 0)))) 4))))) (if (and (= 8 (state at:(last To))) (!= (mover) (who at:(last To)))) (if (= (who at:(last From)) 1) (mapEntry ""NoDoctrine"" 6) (if (= (who at:(last From)) 2) (mapEntry ""NoDoctrine"" 6) (if (= (who at:(last From)) 3) (mapEntry ""NoDoctrine"" 6) (if (= (who at:(last From)) 4) (mapEntry ""NoDoctrine"" 6) 0)))) 5) (if (> (who at:(last To)) 0) (if (= (who at:(last To)) 1) (mapEntry ""NoDoctrine"" 8) (if (= (who at:(last To)) 2) (mapEntry ""NoDoctrine"" 8) (if (= (who at:(last To)) 3) (mapEntry ""NoDoctrine"" 8) (if (= (who at:(last To)) 4) (mapEntry ""NoDoctrine"" 8) 0)))) 4) (if False (if (= (who at:(last From)) 1) (mapEntry ""NoDoctrine"" 10) (if (= (who at:(last From)) 2) (mapEntry ""NoDoctrine"" 10) (if (= (who at:(last From)) 3) (mapEntry ""NoDoctrine"" 10) (if (= (who at:(last From)) 4) (mapEntry ""NoDoctrine"" 10) 0)))) (if (= (who at:(last From)) 1) (mapEntry ""NoDoctrine"" 9) (if (= (who at:(last From)) 2) (mapEntry ""NoDoctrine"" 9) (if (= (who at:(last From)) 3) (mapEntry ""NoDoctrine"" 9) (if (= (who at:(last From)) 4) (mapEntry ""NoDoctrine"" 9) 0))))) (value Random (range (if (= (who at:(last From)) 1) (mapEntry ""NoDoctrine"" 11) (if (= (who at:(last From)) 2) (mapEntry ""NoDoctrine"" 11) (if (= (who at:(last From)) 3) (mapEntry ""NoDoctrine"" 11) (if (= (who at:(last From)) 4) (mapEntry ""NoDoctrine"" 11) 0)))) (if (= (who at:(last From)) 1) (mapEntry ""NoDoctrine"" 12) (if (= (who at:(last From)) 2) (mapEntry ""NoDoctrine"" 12) (if (= (who at:(last From)) 3) (mapEntry ""NoDoctrine"" 12) (if (= (who at:(last From)) 4) (mapEntry ""NoDoctrine"" 12) 0))))))})) 128000)))) (set State at:(last From) 0)) next:(if (and (= 8 (state at:(last To))) (!= (mover) (who at:(last To)))) (if (= (value Piece at:(last To)) 0) (and {(take Control of:All by:Mover at:(last To)) (set Value at:(last To) 50)}) (set Value at:(last To) (value Piece at:(last To)))) (if (= (value Piece at:(last To)) 0) (remove (last To)) (if (and {(= 0 (count Sites in:(intersection (sites {(last To) (last From)}) (sites Occupied by:All components:{""Launcher"" ""Artillery"" ""Battleship"" ""Antiair""})))) (if (is In (last To) (sites Occupied by:Enemy components:{""Bomber"" ""Battleship"" ""Artillery"" ""Launcher""})) (is In (last From) (union (sites Occupied by:Mover components:{""Soldier"" ""Motorbike"" ""Tank"" ""Speeder"" ""Shooter"" ""Launcher"" ""Antiair"" ""Battleship"" ""Artillery"" ""Base"" ""Town"" ""Factory"" ""Dock"" ""Airport"" ""Cruiser"" ""Submarine""}) (sites Occupied by:Neutral container:""Board""))) (is In (last From) (union (sites Occupied by:Mover) (sites Occupied by:Neutral container:""Board"")))) (if (is In (last To) (sites Occupied by:Enemy components:{""Antiair"" ""Fighter""})) (is In (last From) (sites Occupied by:Mover components:{""Fighter"" ""Helicopter"" ""Bomber""})) (is In (last From) (union (sites Occupied by:Mover) (sites Occupied by:Neutral container:""Board"")))) (if (is In (last To) (sites Occupied by:Enemy components:{""Submarine""})) (is In (last From) (sites Occupied by:Mover components:{""Submarine"" ""Battleship"" ""Cruiser""})) (is In (last From) (union (sites Occupied by:Mover) (sites Occupied by:Neutral container:""Board""))))}) (if (<= (- (value Piece at:(last From)) (/ (* (if (is In (last From) (sites Occupied by:All container:""Board"" components:{""Fighter"" ""Bomber"" ""Helicopter""})) (max (/ (* (* (value Piece at:(last To)) 4) (mapEntry ""DamageMultiplier"" (what at:(last To)))) 100) 1) (if (and (is In (last From) (sites Occupied by:All container:""Board"" components:{""Soldier"" ""Motorbike""})) (is In (last To) (sites Occupied by:All component:""Shooter""))) (if (is In (last From) (sites ""Forest"")) (max (/ (* (* (value Piece at:(last To)) 6) (mapEntry ""DamageMultiplier"" (what at:(last To)))) 100) 1) (if (is In (last From) (union (sites ""ShallowWater"") (sites ""DeepWater""))) (max (/ (* (* (value Piece at:(last To)) 10) (mapEntry ""DamageMultiplier"" (what at:(last To)))) 100) 1) (max (/ (* (* (value Piece at:(last To)) 8) (mapEntry ""DamageMultiplier"" (what at:(last To)))) 100) 1))) (if (is In (last From) (sites ""Forest"")) (max (/ (* (* (value Piece at:(last To)) 3) (mapEntry ""DamageMultiplier"" (what at:(last To)))) 100) 1) (if (is In (last From) (union (sites ""ShallowWater"") (sites ""DeepWater""))) (max (/ (* (* (value Piece at:(last To)) 5) (mapEntry ""DamageMultiplier"" (what at:(last To)))) 100) 1) (max (/ (* (* (value Piece at:(last To)) 4) (mapEntry ""DamageMultiplier"" (what at:(last To)))) 100) 1))))) (* {(if (is In (last To) (sites Occupied by:All container:""Board"" components:{""Soldier"" ""Motorbike""})) (if (= (who at:(last To)) 1) (mapEntry ""NoDoctrine"" 1) (if (= (who at:(last To)) 2) (mapEntry ""NoDoctrine"" 1) (if (= (who at:(last To)) 3) (mapEntry ""NoDoctrine"" 1) (if (= (who at:(last To)) 4) (mapEntry ""NoDoctrine"" 1) 0)))) (if (is In (last To) (sites Occupied by:All container:""Board"" components:{""Tank"" ""Speeder"" ""Shooter""})) (if (= (who at:(last To)) 1) (mapEntry ""NoDoctrine"" 2) (if (= (who at:(last To)) 2) (mapEntry ""NoDoctrine"" 2) (if (= (who at:(last To)) 3) (mapEntry ""NoDoctrine"" 2) (if (= (who at:(last To)) 4) (mapEntry ""NoDoctrine"" 2) 0)))) (if (is In (last To) (sites Occupied by:All container:""Board"" components:{""Launcher"" ""Antiair"" ""Artillery""})) (if (= (who at:(last To)) 1) (mapEntry ""NoDoctrine"" 3) (if (= (who at:(last To)) 2) (mapEntry ""NoDoctrine"" 3) (if (= (who at:(last To)) 3) (mapEntry ""NoDoctrine"" 3) (if (= (who at:(last To)) 4) (mapEntry ""NoDoctrine"" 3) 0)))) (if (is In (last To) (sites Occupied by:All container:""Board"" components:{""Fighter"" ""Bomber"" ""Helicopter""})) (if (= (who at:(last To)) 1) (mapEntry ""NoDoctrine"" 4) (if (= (who at:(last To)) 2) (mapEntry ""NoDoctrine"" 4) (if (= (who at:(last To)) 3) (mapEntry ""NoDoctrine"" 4) (if (= (who at:(last To)) 4) (mapEntry ""NoDoctrine"" 4) 0)))) (if (is In (last To) (sites Occupied by:All container:""Board"" components:{""Submarine"" ""Cruiser"" ""Battleship""})) (if (= (who at:(last To)) 1) (mapEntry ""NoDoctrine"" 5) (if (= (who at:(last To)) 2) (mapEntry ""NoDoctrine"" 5) (if (= (who at:(last To)) 3) (mapEntry ""NoDoctrine"" 5) (if (= (who at:(last To)) 4) (mapEntry ""NoDoctrine"" 5) 0)))) 4))))) (if (and (= 8 (state at:(last From))) (!= (mover) (who at:(last From)))) (if (= (who at:(last To)) 1) (mapEntry ""NoDoctrine"" 6) (if (= (who at:(last To)) 2) (mapEntry ""NoDoctrine"" 6) (if (= (who at:(last To)) 3) (mapEntry ""NoDoctrine"" 6) (if (= (who at:(last To)) 4) (mapEntry ""NoDoctrine"" 6) 0)))) 5) (if (> (who at:(last From)) 0) (if (= (who at:(last From)) 1) (mapEntry ""NoDoctrine"" 8) (if (= (who at:(last From)) 2) (mapEntry ""NoDoctrine"" 8) (if (= (who at:(last From)) 3) (mapEntry ""NoDoctrine"" 8) (if (= (who at:(last From)) 4) (mapEntry ""NoDoctrine"" 8) 0)))) 4) (if True (if (= (who at:(last To)) 1) (mapEntry ""NoDoctrine"" 10) (if (= (who at:(last To)) 2) (mapEntry ""NoDoctrine"" 10) (if (= (who at:(last To)) 3) (mapEntry ""NoDoctrine"" 10) (if (= (who at:(last To)) 4) (mapEntry ""NoDoctrine"" 10) 0)))) (if (= (who at:(last To)) 1) (mapEntry ""NoDoctrine"" 9) (if (= (who at:(last To)) 2) (mapEntry ""NoDoctrine"" 9) (if (= (who at:(last To)) 3) (mapEntry ""NoDoctrine"" 9) (if (= (who at:(last To)) 4) (mapEntry ""NoDoctrine"" 9) 0))))) (value Random (range (if (= (who at:(last To)) 1) (mapEntry ""NoDoctrine"" 11) (if (= (who at:(last To)) 2) (mapEntry ""NoDoctrine"" 11) (if (= (who at:(last To)) 3) (mapEntry ""NoDoctrine"" 11) (if (= (who at:(last To)) 4) (mapEntry ""NoDoctrine"" 11) 0)))) (if (= (who at:(last To)) 1) (mapEntry ""NoDoctrine"" 12) (if (= (who at:(last To)) 2) (mapEntry ""NoDoctrine"" 12) (if (= (who at:(last To)) 3) (mapEntry ""NoDoctrine"" 12) (if (= (who at:(last To)) 4) (mapEntry ""NoDoctrine"" 12) 0))))))})) 128000)) 0) (remove (last From)) (set Value at:(last From) (- (value Piece at:(last From)) (/ (* (if (is In (last From) (sites Occupied by:All container:""Board"" components:{""Fighter"" ""Bomber"" ""Helicopter""})) (max (/ (* (* (value Piece at:(last To)) 4) (mapEntry ""DamageMultiplier"" (what at:(last To)))) 100) 1) (if (and (is In (last From) (sites Occupied by:All container:""Board"" components:{""Soldier"" ""Motorbike""})) (is In (last To) (sites Occupied by:All component:""Shooter""))) (if (is In (last From) (sites ""Forest"")) (max (/ (* (* (value Piece at:(last To)) 6) (mapEntry ""DamageMultiplier"" (what at:(last To)))) 100) 1) (if (is In (last From) (union (sites ""ShallowWater"") (sites ""DeepWater""))) (max (/ (* (* (value Piece at:(last To)) 10) (mapEntry ""DamageMultiplier"" (what at:(last To)))) 100) 1) (max (/ (* (* (value Piece at:(last To)) 8) (mapEntry ""DamageMultiplier"" (what at:(last To)))) 100) 1))) (if (is In (last From) (sites ""Forest"")) (max (/ (* (* (value Piece at:(last To)) 3) (mapEntry ""DamageMultiplier"" (what at:(last To)))) 100) 1) (if (is In (last From) (union (sites ""ShallowWater"") (sites ""DeepWater""))) (max (/ (* (* (value Piece at:(last To)) 5) (mapEntry ""DamageMultiplier"" (what at:(last To)))) 100) 1) (max (/ (* (* (value Piece at:(last To)) 4) (mapEntry ""DamageMultiplier"" (what at:(last To)))) 100) 1))))) (* {(if (is In (last To) (sites Occupied by:All container:""Board"" components:{""Soldier"" ""Motorbike""})) (if (= (who at:(last To)) 1) (mapEntry ""NoDoctrine"" 1) (if (= (who at:(last To)) 2) (mapEntry ""NoDoctrine"" 1) (if (= (who at:(last To)) 3) (mapEntry ""NoDoctrine"" 1) (if (= (who at:(last To)) 4) (mapEntry ""NoDoctrine"" 1) 0)))) (if (is In (last To) (sites Occupied by:All container:""Board"" components:{""Tank"" ""Speeder"" ""Shooter""})) (if (= (who at:(last To)) 1) (mapEntry ""NoDoctrine"" 2) (if (= (who at:(last To)) 2) (mapEntry ""NoDoctrine"" 2) (if (= (who at:(last To)) 3) (mapEntry ""NoDoctrine"" 2) (if (= (who at:(last To)) 4) (mapEntry ""NoDoctrine"" 2) 0)))) (if (is In (last To) (sites Occupied by:All container:""Board"" components:{""Launcher"" ""Antiair"" ""Artillery""})) (if (= (who at:(last To)) 1) (mapEntry ""NoDoctrine"" 3) (if (= (who at:(last To)) 2) (mapEntry ""NoDoctrine"" 3) (if (= (who at:(last To)) 3) (mapEntry ""NoDoctrine"" 3) (if (= (who at:(last To)) 4) (mapEntry ""NoDoctrine"" 3) 0)))) (if (is In (last To) (sites Occupied by:All container:""Board"" components:{""Fighter"" ""Bomber"" ""Helicopter""})) (if (= (who at:(last To)) 1) (mapEntry ""NoDoctrine"" 4) (if (= (who at:(last To)) 2) (mapEntry ""NoDoctrine"" 4) (if (= (who at:(last To)) 3) (mapEntry ""NoDoctrine"" 4) (if (= (who at:(last To)) 4) (mapEntry ""NoDoctrine"" 4) 0)))) (if (is In (last To) (sites Occupied by:All container:""Board"" components:{""Submarine"" ""Cruiser"" ""Battleship""})) (if (= (who at:(last To)) 1) (mapEntry ""NoDoctrine"" 5) (if (= (who at:(last To)) 2) (mapEntry ""NoDoctrine"" 5) (if (= (who at:(last To)) 3) (mapEntry ""NoDoctrine"" 5) (if (= (who at:(last To)) 4) (mapEntry ""NoDoctrine"" 5) 0)))) 4))))) (if (and (= 8 (state at:(last From))) (!= (mover) (who at:(last From)))) (if (= (who at:(last To)) 1) (mapEntry ""NoDoctrine"" 6) (if (= (who at:(last To)) 2) (mapEntry ""NoDoctrine"" 6) (if (= (who at:(last To)) 3) (mapEntry ""NoDoctrine"" 6) (if (= (who at:(last To)) 4) (mapEntry ""NoDoctrine"" 6) 0)))) 5) (if (> (who at:(last From)) 0) (if (= (who at:(last From)) 1) (mapEntry ""NoDoctrine"" 8) (if (= (who at:(last From)) 2) (mapEntry ""NoDoctrine"" 8) (if (= (who at:(last From)) 3) (mapEntry ""NoDoctrine"" 8) (if (= (who at:(last From)) 4) (mapEntry ""NoDoctrine"" 8) 0)))) 4) (if True (if (= (who at:(last To)) 1) (mapEntry ""NoDoctrine"" 10) (if (= (who at:(last To)) 2) (mapEntry ""NoDoctrine"" 10) (if (= (who at:(last To)) 3) (mapEntry ""NoDoctrine"" 10) (if (= (who at:(last To)) 4) (mapEntry ""NoDoctrine"" 10) 0)))) (if (= (who at:(last To)) 1) (mapEntry ""NoDoctrine"" 9) (if (= (who at:(last To)) 2) (mapEntry ""NoDoctrine"" 9) (if (= (who at:(last To)) 3) (mapEntry ""NoDoctrine"" 9) (if (= (who at:(last To)) 4) (mapEntry ""NoDoctrine"" 9) 0))))) (value Random (range (if (= (who at:(last To)) 1) (mapEntry ""NoDoctrine"" 11) (if (= (who at:(last To)) 2) (mapEntry ""NoDoctrine"" 11) (if (= (who at:(last To)) 3) (mapEntry ""NoDoctrine"" 11) (if (= (who at:(last To)) 4) (mapEntry ""NoDoctrine"" 11) 0)))) (if (= (who at:(last To)) 1) (mapEntry ""NoDoctrine"" 12) (if (= (who at:(last To)) 2) (mapEntry ""NoDoctrine"" 12) (if (= (who at:(last To)) 3) (mapEntry ""NoDoctrine"" 12) (if (= (who at:(last To)) 4) (mapEntry ""NoDoctrine"" 12) 0))))))})) 128000)))) (set Value at:(last From) (value Piece at:(last From))))))))) (move Select (from (from) if:(and (> (state at:(from)) 0) (< (value Piece at:(from)) (mapEntry ""MaxHealth"" (what at:(from)))))) (to (sites Around (from) Orthogonal if:(is In (to) (sites Occupied by:Mover container:""Board"" components:{""Town"" ""Dock"" ""Base"" ""Factory"" ""Airport""})))) (then (and {(set Value at:(last From) (min (mapEntry ""MaxHealth"" (what at:(last From))) (- (+ (value Piece at:(last From)) (value Piece at:(last To))) 1))) (set Value at:(last To) (max (- (value Piece at:(last To)) (- (mapEntry ""MaxHealth"" (what at:(last From))) (value Piece at:(last From)))) 1)) (set State at:(last From) 0)}))) (move Select (from (from) if:(> (state at:(from)) 0)) (to (sites Around (from) Orthogonal if:(and (= (what at:(from)) (what at:(to))) (< (value Piece at:(to)) (mapEntry ""MaxHealth"" (what at:(to))))))) (then (and {(if (<= (+ (value Piece at:(last To)) (value Piece at:(last From))) (mapEntry ""MaxHealth"" (what at:(last From)))) (and (set Value at:(last To) (min (mapEntry ""MaxHealth"" (what at:(last From))) (+ (value Piece at:(last From)) (value Piece at:(last To))))) (remove (last From))) (and (set Value at:(last To) (min (mapEntry ""MaxHealth"" (what at:(last From))) (- (+ (value Piece at:(last From)) (value Piece at:(last To))) 1))) (set Value at:(last From) (max (- (value Piece at:(last To)) (- (mapEntry ""MaxHealth"" (what at:(last From))) (value Piece at:(last From)))) 1)))) (set State at:(last From) 0) (set State at:(last To) 0)})))})) (piece ""Artillery"" Each (or {(or (move (from (from) if:(> (state at:(from)) 1)) (to (sites Distance (step Orthogonal (to if:(is In (to) (difference (union (sites Empty) (sites Occupied by:Friend container:""Board"")) (union (union (sites ""Mountain"") (sites ""DeepWater"")) (union (sites ""Forest"") (sites ""ShallowWater""))))))) from:(from) (range 1 (- (state at:(from)) 1))) if:(is Empty (to)) (apply (set State at:(from) 0)))) (move (from (from) if:(> (state at:(from)) 1)) (to (sites Distance (step Orthogonal (to if:(is In (to) (intersection (sites Empty) (union (sites ""Forest"") (sites ""ShallowWater"")))))) from:(from) (range 1 (- 2 1))) if:(is Empty (to)) (apply (set State at:(from) 0))))) (move Select (from (from) if:(> (state at:(from)) 0)) (to (sites Distance Orthogonal from:(from) (range 3 5)) if:(and {(if (is In (from) (sites Occupied by:Mover container:""Board"" components:{""Bomber"" ""Battleship"" ""Artillery"" ""Launcher""})) (is In (to) (union (sites Occupied by:Enemy container:""Board"" components:{""Soldier"" ""Motorbike"" ""Tank"" ""Speeder"" ""Shooter"" ""Launcher"" ""Antiair"" ""Battleship"" ""Artillery"" ""Base"" ""Town"" ""Factory"" ""Dock"" ""Airport"" ""Cruiser"" ""Submarine""}) (sites Occupied by:Neutral container:""Board""))) (is In (to) (union (sites Occupied by:Enemy container:""Board"") (sites Occupied by:Neutral container:""Board"")))) (if (is In (from) (sites Occupied by:Mover container:""Board"" components:{""Antiair"" ""Fighter""})) (is In (to) (sites Occupied by:Enemy container:""Board"" components:{""Fighter"" ""Helicopter"" ""Bomber""})) (is In (to) (union (sites Occupied by:Enemy container:""Board"") (sites Occupied by:Neutral container:""Board"")))) (if (is In (from) (sites Occupied by:Mover container:""Board"" components:{""Submarine""})) (is In (to) (sites Occupied by:Enemy container:""Board"" components:{""Submarine"" ""Battleship"" ""Cruiser""})) (is In (to) (union (sites Occupied by:Enemy container:""Board"") (sites Occupied by:Neutral container:""Board""))))})) (then (do (and (set Value at:(last To) (max 0 (- (value Piece at:(last To)) (/ (* (if (is In (last To) (sites Occupied by:All container:""Board"" components:{""Fighter"" ""Bomber"" ""Helicopter""})) (max (/ (* (* (value Piece at:(last From)) 4) (mapEntry ""DamageMultiplier"" (what at:(last From)))) 100) 1) (if (and (is In (last To) (sites Occupied by:All container:""Board"" components:{""Soldier"" ""Motorbike""})) (is In (last From) (sites Occupied by:All component:""Shooter""))) (if (is In (last To) (sites ""Forest"")) (max (/ (* (* (value Piece at:(last From)) 6) (mapEntry ""DamageMultiplier"" (what at:(last From)))) 100) 1) (if (is In (last To) (union (sites ""ShallowWater"") (sites ""DeepWater""))) (max (/ (* (* (value Piece at:(last From)) 10) (mapEntry ""DamageMultiplier"" (what at:(last From)))) 100) 1) (max (/ (* (* (value Piece at:(last From)) 8) (mapEntry ""DamageMultiplier"" (what at:(last From)))) 100) 1))) (if (is In (last To) (sites ""Forest"")) (max (/ (* (* (value Piece at:(last From)) 3) (mapEntry ""DamageMultiplier"" (what at:(last From)))) 100) 1) (if (is In (last To) (union (sites ""ShallowWater"") (sites ""DeepWater""))) (max (/ (* (* (value Piece at:(last From)) 5) (mapEntry ""DamageMultiplier"" (what at:(last From)))) 100) 1) (max (/ (* (* (value Piece at:(last From)) 4) (mapEntry ""DamageMultiplier"" (what at:(last From)))) 100) 1))))) (* {(if (is In (last From) (sites Occupied by:All container:""Board"" components:{""Soldier"" ""Motorbike""})) (if (= (who at:(last From)) 1) (mapEntry ""NoDoctrine"" 1) (if (= (who at:(last From)) 2) (mapEntry ""NoDoctrine"" 1) (if (= (who at:(last From)) 3) (mapEntry ""NoDoctrine"" 1) (if (= (who at:(last From)) 4) (mapEntry ""NoDoctrine"" 1) 0)))) (if (is In (last From) (sites Occupied by:All container:""Board"" components:{""Tank"" ""Speeder"" ""Shooter""})) (if (= (who at:(last From)) 1) (mapEntry ""NoDoctrine"" 2) (if (= (who at:(last From)) 2) (mapEntry ""NoDoctrine"" 2) (if (= (who at:(last From)) 3) (mapEntry ""NoDoctrine"" 2) (if (= (who at:(last From)) 4) (mapEntry ""NoDoctrine"" 2) 0)))) (if (is In (last From) (sites Occupied by:All container:""Board"" components:{""Launcher"" ""Antiair"" ""Artillery""})) (if (= (who at:(last From)) 1) (mapEntry ""NoDoctrine"" 3) (if (= (who at:(last From)) 2) (mapEntry ""NoDoctrine"" 3) (if (= (who at:(last From)) 3) (mapEntry ""NoDoctrine"" 3) (if (= (who at:(last From)) 4) (mapEntry ""NoDoctrine"" 3) 0)))) (if (is In (last From) (sites Occupied by:All container:""Board"" components:{""Fighter"" ""Bomber"" ""Helicopter""})) (if (= (who at:(last From)) 1) (mapEntry ""NoDoctrine"" 4) (if (= (who at:(last From)) 2) (mapEntry ""NoDoctrine"" 4) (if (= (who at:(last From)) 3) (mapEntry ""NoDoctrine"" 4) (if (= (who at:(last From)) 4) (mapEntry ""NoDoctrine"" 4) 0)))) (if (is In (last From) (sites Occupied by:All container:""Board"" components:{""Submarine"" ""Cruiser"" ""Battleship""})) (if (= (who at:(last From)) 1) (mapEntry ""NoDoctrine"" 5) (if (= (who at:(last From)) 2) (mapEntry ""NoDoctrine"" 5) (if (= (who at:(last From)) 3) (mapEntry ""NoDoctrine"" 5) (if (= (who at:(last From)) 4) (mapEntry ""NoDoctrine"" 5) 0)))) 4))))) (if (and (= 8 (state at:(last To))) (!= (mover) (who at:(last To)))) (if (= (who at:(last From)) 1) (mapEntry ""NoDoctrine"" 6) (if (= (who at:(last From)) 2) (mapEntry ""NoDoctrine"" 6) (if (= (who at:(last From)) 3) (mapEntry ""NoDoctrine"" 6) (if (= (who at:(last From)) 4) (mapEntry ""NoDoctrine"" 6) 0)))) 5) (if (> (who at:(last To)) 0) (if (= (who at:(last To)) 1) (mapEntry ""NoDoctrine"" 8) (if (= (who at:(last To)) 2) (mapEntry ""NoDoctrine"" 8) (if (= (who at:(last To)) 3) (mapEntry ""NoDoctrine"" 8) (if (= (who at:(last To)) 4) (mapEntry ""NoDoctrine"" 8) 0)))) 4) (if False (if (= (who at:(last From)) 1) (mapEntry ""NoDoctrine"" 10) (if (= (who at:(last From)) 2) (mapEntry ""NoDoctrine"" 10) (if (= (who at:(last From)) 3) (mapEntry ""NoDoctrine"" 10) (if (= (who at:(last From)) 4) (mapEntry ""NoDoctrine"" 10) 0)))) (if (= (who at:(last From)) 1) (mapEntry ""NoDoctrine"" 9) (if (= (who at:(last From)) 2) (mapEntry ""NoDoctrine"" 9) (if (= (who at:(last From)) 3) (mapEntry ""NoDoctrine"" 9) (if (= (who at:(last From)) 4) (mapEntry ""NoDoctrine"" 9) 0))))) (value Random (range (if (= (who at:(last From)) 1) (mapEntry ""NoDoctrine"" 11) (if (= (who at:(last From)) 2) (mapEntry ""NoDoctrine"" 11) (if (= (who at:(last From)) 3) (mapEntry ""NoDoctrine"" 11) (if (= (who at:(last From)) 4) (mapEntry ""NoDoctrine"" 11) 0)))) (if (= (who at:(last From)) 1) (mapEntry ""NoDoctrine"" 12) (if (= (who at:(last From)) 2) (mapEntry ""NoDoctrine"" 12) (if (= (who at:(last From)) 3) (mapEntry ""NoDoctrine"" 12) (if (= (who at:(last From)) 4) (mapEntry ""NoDoctrine"" 12) 0))))))})) 128000)))) (set State at:(last From) 0)) next:(if (and (= 8 (state at:(last To))) (!= (mover) (who at:(last To)))) (if (= (value Piece at:(last To)) 0) (and {(take Control of:All by:Mover at:(last To)) (set Value at:(last To) 50)}) (set Value at:(last To) (value Piece at:(last To)))) (if (= (value Piece at:(last To)) 0) (remove (last To)) (if (and {(= 0 (count Sites in:(intersection (sites {(last To) (last From)}) (sites Occupied by:All components:{""Launcher"" ""Artillery"" ""Battleship"" ""Antiair""})))) (if (is In (last To) (sites Occupied by:Enemy components:{""Bomber"" ""Battleship"" ""Artillery"" ""Launcher""})) (is In (last From) (union (sites Occupied by:Mover components:{""Soldier"" ""Motorbike"" ""Tank"" ""Speeder"" ""Shooter"" ""Launcher"" ""Antiair"" ""Battleship"" ""Artillery"" ""Base"" ""Town"" ""Factory"" ""Dock"" ""Airport"" ""Cruiser"" ""Submarine""}) (sites Occupied by:Neutral container:""Board""))) (is In (last From) (union (sites Occupied by:Mover) (sites Occupied by:Neutral container:""Board"")))) (if (is In (last To) (sites Occupied by:Enemy components:{""Antiair"" ""Fighter""})) (is In (last From) (sites Occupied by:Mover components:{""Fighter"" ""Helicopter"" ""Bomber""})) (is In (last From) (union (sites Occupied by:Mover) (sites Occupied by:Neutral container:""Board"")))) (if (is In (last To) (sites Occupied by:Enemy components:{""Submarine""})) (is In (last From) (sites Occupied by:Mover components:{""Submarine"" ""Battleship"" ""Cruiser""})) (is In (last From) (union (sites Occupied by:Mover) (sites Occupied by:Neutral container:""Board""))))}) (if (<= (- (value Piece at:(last From)) (/ (* (if (is In (last From) (sites Occupied by:All container:""Board"" components:{""Fighter"" ""Bomber"" ""Helicopter""})) (max (/ (* (* (value Piece at:(last To)) 4) (mapEntry ""DamageMultiplier"" (what at:(last To)))) 100) 1) (if (and (is In (last From) (sites Occupied by:All container:""Board"" components:{""Soldier"" ""Motorbike""})) (is In (last To) (sites Occupied by:All component:""Shooter""))) (if (is In (last From) (sites ""Forest"")) (max (/ (* (* (value Piece at:(last To)) 6) (mapEntry ""DamageMultiplier"" (what at:(last To)))) 100) 1) (if (is In (last From) (union (sites ""ShallowWater"") (sites ""DeepWater""))) (max (/ (* (* (value Piece at:(last To)) 10) (mapEntry ""DamageMultiplier"" (what at:(last To)))) 100) 1) (max (/ (* (* (value Piece at:(last To)) 8) (mapEntry ""DamageMultiplier"" (what at:(last To)))) 100) 1))) (if (is In (last From) (sites ""Forest"")) (max (/ (* (* (value Piece at:(last To)) 3) (mapEntry ""DamageMultiplier"" (what at:(last To)))) 100) 1) (if (is In (last From) (union (sites ""ShallowWater"") (sites ""DeepWater""))) (max (/ (* (* (value Piece at:(last To)) 5) (mapEntry ""DamageMultiplier"" (what at:(last To)))) 100) 1) (max (/ (* (* (value Piece at:(last To)) 4) (mapEntry ""DamageMultiplier"" (what at:(last To)))) 100) 1))))) (* {(if (is In (last To) (sites Occupied by:All container:""Board"" components:{""Soldier"" ""Motorbike""})) (if (= (who at:(last To)) 1) (mapEntry ""NoDoctrine"" 1) (if (= (who at:(last To)) 2) (mapEntry ""NoDoctrine"" 1) (if (= (who at:(last To)) 3) (mapEntry ""NoDoctrine"" 1) (if (= (who at:(last To)) 4) (mapEntry ""NoDoctrine"" 1) 0)))) (if (is In (last To) (sites Occupied by:All container:""Board"" components:{""Tank"" ""Speeder"" ""Shooter""})) (if (= (who at:(last To)) 1) (mapEntry ""NoDoctrine"" 2) (if (= (who at:(last To)) 2) (mapEntry ""NoDoctrine"" 2) (if (= (who at:(last To)) 3) (mapEntry ""NoDoctrine"" 2) (if (= (who at:(last To)) 4) (mapEntry ""NoDoctrine"" 2) 0)))) (if (is In (last To) (sites Occupied by:All container:""Board"" components:{""Launcher"" ""Antiair"" ""Artillery""})) (if (= (who at:(last To)) 1) (mapEntry ""NoDoctrine"" 3) (if (= (who at:(last To)) 2) (mapEntry ""NoDoctrine"" 3) (if (= (who at:(last To)) 3) (mapEntry ""NoDoctrine"" 3) (if (= (who at:(last To)) 4) (mapEntry ""NoDoctrine"" 3) 0)))) (if (is In (last To) (sites Occupied by:All container:""Board"" components:{""Fighter"" ""Bomber"" ""Helicopter""})) (if (= (who at:(last To)) 1) (mapEntry ""NoDoctrine"" 4) (if (= (who at:(last To)) 2) (mapEntry ""NoDoctrine"" 4) (if (= (who at:(last To)) 3) (mapEntry ""NoDoctrine"" 4) (if (= (who at:(last To)) 4) (mapEntry ""NoDoctrine"" 4) 0)))) (if (is In (last To) (sites Occupied by:All container:""Board"" components:{""Submarine"" ""Cruiser"" ""Battleship""})) (if (= (who at:(last To)) 1) (mapEntry ""NoDoctrine"" 5) (if (= (who at:(last To)) 2) (mapEntry ""NoDoctrine"" 5) (if (= (who at:(last To)) 3) (mapEntry ""NoDoctrine"" 5) (if (= (who at:(last To)) 4) (mapEntry ""NoDoctrine"" 5) 0)))) 4))))) (if (and (= 8 (state at:(last From))) (!= (mover) (who at:(last From)))) (if (= (who at:(last To)) 1) (mapEntry ""NoDoctrine"" 6) (if (= (who at:(last To)) 2) (mapEntry ""NoDoctrine"" 6) (if (= (who at:(last To)) 3) (mapEntry ""NoDoctrine"" 6) (if (= (who at:(last To)) 4) (mapEntry ""NoDoctrine"" 6) 0)))) 5) (if (> (who at:(last From)) 0) (if (= (who at:(last From)) 1) (mapEntry ""NoDoctrine"" 8) (if (= (who at:(last From)) 2) (mapEntry ""NoDoctrine"" 8) (if (= (who at:(last From)) 3) (mapEntry ""NoDoctrine"" 8) (if (= (who at:(last From)) 4) (mapEntry ""NoDoctrine"" 8) 0)))) 4) (if True (if (= (who at:(last To)) 1) (mapEntry ""NoDoctrine"" 10) (if (= (who at:(last To)) 2) (mapEntry ""NoDoctrine"" 10) (if (= (who at:(last To)) 3) (mapEntry ""NoDoctrine"" 10) (if (= (who at:(last To)) 4) (mapEntry ""NoDoctrine"" 10) 0)))) (if (= (who at:(last To)) 1) (mapEntry ""NoDoctrine"" 9) (if (= (who at:(last To)) 2) (mapEntry ""NoDoctrine"" 9) (if (= (who at:(last To)) 3) (mapEntry ""NoDoctrine"" 9) (if (= (who at:(last To)) 4) (mapEntry ""NoDoctrine"" 9) 0))))) (value Random (range (if (= (who at:(last To)) 1) (mapEntry ""NoDoctrine"" 11) (if (= (who at:(last To)) 2) (mapEntry ""NoDoctrine"" 11) (if (= (who at:(last To)) 3) (mapEntry ""NoDoctrine"" 11) (if (= (who at:(last To)) 4) (mapEntry ""NoDoctrine"" 11) 0)))) (if (= (who at:(last To)) 1) (mapEntry ""NoDoctrine"" 12) (if (= (who at:(last To)) 2) (mapEntry ""NoDoctrine"" 12) (if (= (who at:(last To)) 3) (mapEntry ""NoDoctrine"" 12) (if (= (who at:(last To)) 4) (mapEntry ""NoDoctrine"" 12) 0))))))})) 128000)) 0) (remove (last From)) (set Value at:(last From) (- (value Piece at:(last From)) (/ (* (if (is In (last From) (sites Occupied by:All container:""Board"" components:{""Fighter"" ""Bomber"" ""Helicopter""})) (max (/ (* (* (value Piece at:(last To)) 4) (mapEntry ""DamageMultiplier"" (what at:(last To)))) 100) 1) (if (and (is In (last From) (sites Occupied by:All container:""Board"" components:{""Soldier"" ""Motorbike""})) (is In (last To) (sites Occupied by:All component:""Shooter""))) (if (is In (last From) (sites ""Forest"")) (max (/ (* (* (value Piece at:(last To)) 6) (mapEntry ""DamageMultiplier"" (what at:(last To)))) 100) 1) (if (is In (last From) (union (sites ""ShallowWater"") (sites ""DeepWater""))) (max (/ (* (* (value Piece at:(last To)) 10) (mapEntry ""DamageMultiplier"" (what at:(last To)))) 100) 1) (max (/ (* (* (value Piece at:(last To)) 8) (mapEntry ""DamageMultiplier"" (what at:(last To)))) 100) 1))) (if (is In (last From) (sites ""Forest"")) (max (/ (* (* (value Piece at:(last To)) 3) (mapEntry ""DamageMultiplier"" (what at:(last To)))) 100) 1) (if (is In (last From) (union (sites ""ShallowWater"") (sites ""DeepWater""))) (max (/ (* (* (value Piece at:(last To)) 5) (mapEntry ""DamageMultiplier"" (what at:(last To)))) 100) 1) (max (/ (* (* (value Piece at:(last To)) 4) (mapEntry ""DamageMultiplier"" (what at:(last To)))) 100) 1))))) (* {(if (is In (last To) (sites Occupied by:All container:""Board"" components:{""Soldier"" ""Motorbike""})) (if (= (who at:(last To)) 1) (mapEntry ""NoDoctrine"" 1) (if (= (who at:(last To)) 2) (mapEntry ""NoDoctrine"" 1) (if (= (who at:(last To)) 3) (mapEntry ""NoDoctrine"" 1) (if (= (who at:(last To)) 4) (mapEntry ""NoDoctrine"" 1) 0)))) (if (is In (last To) (sites Occupied by:All container:""Board"" components:{""Tank"" ""Speeder"" ""Shooter""})) (if (= (who at:(last To)) 1) (mapEntry ""NoDoctrine"" 2) (if (= (who at:(last To)) 2) (mapEntry ""NoDoctrine"" 2) (if (= (who at:(last To)) 3) (mapEntry ""NoDoctrine"" 2) (if (= (who at:(last To)) 4) (mapEntry ""NoDoctrine"" 2) 0)))) (if (is In (last To) (sites Occupied by:All container:""Board"" components:{""Launcher"" ""Antiair"" ""Artillery""})) (if (= (who at:(last To)) 1) (mapEntry ""NoDoctrine"" 3) (if (= (who at:(last To)) 2) (mapEntry ""NoDoctrine"" 3) (if (= (who at:(last To)) 3) (mapEntry ""NoDoctrine"" 3) (if (= (who at:(last To)) 4) (mapEntry ""NoDoctrine"" 3) 0)))) (if (is In (last To) (sites Occupied by:All container:""Board"" components:{""Fighter"" ""Bomber"" ""Helicopter""})) (if (= (who at:(last To)) 1) (mapEntry ""NoDoctrine"" 4) (if (= (who at:(last To)) 2) (mapEntry ""NoDoctrine"" 4) (if (= (who at:(last To)) 3) (mapEntry ""NoDoctrine"" 4) (if (= (who at:(last To)) 4) (mapEntry ""NoDoctrine"" 4) 0)))) (if (is In (last To) (sites Occupied by:All container:""Board"" components:{""Submarine"" ""Cruiser"" ""Battleship""})) (if (= (who at:(last To)) 1) (mapEntry ""NoDoctrine"" 5) (if (= (who at:(last To)) 2) (mapEntry ""NoDoctrine"" 5) (if (= (who at:(last To)) 3) (mapEntry ""NoDoctrine"" 5) (if (= (who at:(last To)) 4) (mapEntry ""NoDoctrine"" 5) 0)))) 4))))) (if (and (= 8 (state at:(last From))) (!= (mover) (who at:(last From)))) (if (= (who at:(last To)) 1) (mapEntry ""NoDoctrine"" 6) (if (= (who at:(last To)) 2) (mapEntry ""NoDoctrine"" 6) (if (= (who at:(last To)) 3) (mapEntry ""NoDoctrine"" 6) (if (= (who at:(last To)) 4) (mapEntry ""NoDoctrine"" 6) 0)))) 5) (if (> (who at:(last From)) 0) (if (= (who at:(last From)) 1) (mapEntry ""NoDoctrine"" 8) (if (= (who at:(last From)) 2) (mapEntry ""NoDoctrine"" 8) (if (= (who at:(last From)) 3) (mapEntry ""NoDoctrine"" 8) (if (= (who at:(last From)) 4) (mapEntry ""NoDoctrine"" 8) 0)))) 4) (if True (if (= (who at:(last To)) 1) (mapEntry ""NoDoctrine"" 10) (if (= (who at:(last To)) 2) (mapEntry ""NoDoctrine"" 10) (if (= (who at:(last To)) 3) (mapEntry ""NoDoctrine"" 10) (if (= (who at:(last To)) 4) (mapEntry ""NoDoctrine"" 10) 0)))) (if (= (who at:(last To)) 1) (mapEntry ""NoDoctrine"" 9) (if (= (who at:(last To)) 2) (mapEntry ""NoDoctrine"" 9) (if (= (who at:(last To)) 3) (mapEntry ""NoDoctrine"" 9) (if (= (who at:(last To)) 4) (mapEntry ""NoDoctrine"" 9) 0))))) (value Random (range (if (= (who at:(last To)) 1) (mapEntry ""NoDoctrine"" 11) (if (= (who at:(last To)) 2) (mapEntry ""NoDoctrine"" 11) (if (= (who at:(last To)) 3) (mapEntry ""NoDoctrine"" 11) (if (= (who at:(last To)) 4) (mapEntry ""NoDoctrine"" 11) 0)))) (if (= (who at:(last To)) 1) (mapEntry ""NoDoctrine"" 12) (if (= (who at:(last To)) 2) (mapEntry ""NoDoctrine"" 12) (if (= (who at:(last To)) 3) (mapEntry ""NoDoctrine"" 12) (if (= (who at:(last To)) 4) (mapEntry ""NoDoctrine"" 12) 0))))))})) 128000)))) (set Value at:(last From) (value Piece at:(last From))))))))) (move Select (from (from) if:(and (> (state at:(from)) 0) (< (value Piece at:(from)) (mapEntry ""MaxHealth"" (what at:(from)))))) (to (sites Around (from) Orthogonal if:(is In (to) (sites Occupied by:Mover container:""Board"" components:{""Town"" ""Dock"" ""Base"" ""Factory"" ""Airport""})))) (then (and {(set Value at:(last From) (min (mapEntry ""MaxHealth"" (what at:(last From))) (- (+ (value Piece at:(last From)) (value Piece at:(last To))) 1))) (set Value at:(last To) (max (- (value Piece at:(last To)) (- (mapEntry ""MaxHealth"" (what at:(last From))) (value Piece at:(last From)))) 1)) (set State at:(last From) 0)}))) (move Select (from (from) if:(> (state at:(from)) 0)) (to (sites Around (from) Orthogonal if:(and (= (what at:(from)) (what at:(to))) (< (value Piece at:(to)) (mapEntry ""MaxHealth"" (what at:(to))))))) (then (and {(if (<= (+ (value Piece at:(last To)) (value Piece at:(last From))) (mapEntry ""MaxHealth"" (what at:(last From)))) (and (set Value at:(last To) (min (mapEntry ""MaxHealth"" (what at:(last From))) (+ (value Piece at:(last From)) (value Piece at:(last To))))) (remove (last From))) (and (set Value at:(last To) (min (mapEntry ""MaxHealth"" (what at:(last From))) (- (+ (value Piece at:(last From)) (value Piece at:(last To))) 1))) (set Value at:(last From) (max (- (value Piece at:(last To)) (- (mapEntry ""MaxHealth"" (what at:(last From))) (value Piece at:(last From)))) 1)))) (set State at:(last From) 0) (set State at:(last To) 0)})))})) (piece ""Helicopter"" Each (or {(move (from (from) if:(> (state at:(from)) 1)) (to (sites Distance (step Orthogonal (to if:(is In (to) (union (sites Empty) (sites Occupied by:Friend container:""Board""))))) from:(from) (range 1 (- (state at:(from)) 1))) if:(is Empty (to)) (apply (set State at:(from) 1)))) (move Select (from (from) if:(> (state at:(from)) 0)) (to (sites Distance Orthogonal from:(from) (range 1 1)) if:(and {(if (is In (from) (sites Occupied by:Mover container:""Board"" components:{""Bomber"" ""Battleship"" ""Artillery"" ""Launcher""})) (is In (to) (union (sites Occupied by:Enemy container:""Board"" components:{""Soldier"" ""Motorbike"" ""Tank"" ""Speeder"" ""Shooter"" ""Launcher"" ""Antiair"" ""Battleship"" ""Artillery"" ""Base"" ""Town"" ""Factory"" ""Dock"" ""Airport"" ""Cruiser"" ""Submarine""}) (sites Occupied by:Neutral container:""Board""))) (is In (to) (union (sites Occupied by:Enemy container:""Board"") (sites Occupied by:Neutral container:""Board"")))) (if (is In (from) (sites Occupied by:Mover container:""Board"" components:{""Antiair"" ""Fighter""})) (is In (to) (sites Occupied by:Enemy container:""Board"" components:{""Fighter"" ""Helicopter"" ""Bomber""})) (is In (to) (union (sites Occupied by:Enemy container:""Board"") (sites Occupied by:Neutral container:""Board"")))) (if (is In (from) (sites Occupied by:Mover container:""Board"" components:{""Submarine""})) (is In (to) (sites Occupied by:Enemy container:""Board"" components:{""Submarine"" ""Battleship"" ""Cruiser""})) (is In (to) (union (sites Occupied by:Enemy container:""Board"") (sites Occupied by:Neutral container:""Board""))))})) (then (do (and (set Value at:(last To) (max 0 (- (value Piece at:(last To)) (/ (* (if (is In (last To) (sites Occupied by:All container:""Board"" components:{""Fighter"" ""Bomber"" ""Helicopter""})) (max (/ (* (* (value Piece at:(last From)) 4) (mapEntry ""DamageMultiplier"" (what at:(last From)))) 100) 1) (if (and (is In (last To) (sites Occupied by:All container:""Board"" components:{""Soldier"" ""Motorbike""})) (is In (last From) (sites Occupied by:All component:""Shooter""))) (if (is In (last To) (sites ""Forest"")) (max (/ (* (* (value Piece at:(last From)) 6) (mapEntry ""DamageMultiplier"" (what at:(last From)))) 100) 1) (if (is In (last To) (union (sites ""ShallowWater"") (sites ""DeepWater""))) (max (/ (* (* (value Piece at:(last From)) 10) (mapEntry ""DamageMultiplier"" (what at:(last From)))) 100) 1) (max (/ (* (* (value Piece at:(last From)) 8) (mapEntry ""DamageMultiplier"" (what at:(last From)))) 100) 1))) (if (is In (last To) (sites ""Forest"")) (max (/ (* (* (value Piece at:(last From)) 3) (mapEntry ""DamageMultiplier"" (what at:(last From)))) 100) 1) (if (is In (last To) (union (sites ""ShallowWater"") (sites ""DeepWater""))) (max (/ (* (* (value Piece at:(last From)) 5) (mapEntry ""DamageMultiplier"" (what at:(last From)))) 100) 1) (max (/ (* (* (value Piece at:(last From)) 4) (mapEntry ""DamageMultiplier"" (what at:(last From)))) 100) 1))))) (* {(if (is In (last From) (sites Occupied by:All container:""Board"" components:{""Soldier"" ""Motorbike""})) (if (= (who at:(last From)) 1) (mapEntry ""NoDoctrine"" 1) (if (= (who at:(last From)) 2) (mapEntry ""NoDoctrine"" 1) (if (= (who at:(last From)) 3) (mapEntry ""NoDoctrine"" 1) (if (= (who at:(last From)) 4) (mapEntry ""NoDoctrine"" 1) 0)))) (if (is In (last From) (sites Occupied by:All container:""Board"" components:{""Tank"" ""Speeder"" ""Shooter""})) (if (= (who at:(last From)) 1) (mapEntry ""NoDoctrine"" 2) (if (= (who at:(last From)) 2) (mapEntry ""NoDoctrine"" 2) (if (= (who at:(last From)) 3) (mapEntry ""NoDoctrine"" 2) (if (= (who at:(last From)) 4) (mapEntry ""NoDoctrine"" 2) 0)))) (if (is In (last From) (sites Occupied by:All container:""Board"" components:{""Launcher"" ""Antiair"" ""Artillery""})) (if (= (who at:(last From)) 1) (mapEntry ""NoDoctrine"" 3) (if (= (who at:(last From)) 2) (mapEntry ""NoDoctrine"" 3) (if (= (who at:(last From)) 3) (mapEntry ""NoDoctrine"" 3) (if (= (who at:(last From)) 4) (mapEntry ""NoDoctrine"" 3) 0)))) (if (is In (last From) (sites Occupied by:All container:""Board"" components:{""Fighter"" ""Bomber"" ""Helicopter""})) (if (= (who at:(last From)) 1) (mapEntry ""NoDoctrine"" 4) (if (= (who at:(last From)) 2) (mapEntry ""NoDoctrine"" 4) (if (= (who at:(last From)) 3) (mapEntry ""NoDoctrine"" 4) (if (= (who at:(last From)) 4) (mapEntry ""NoDoctrine"" 4) 0)))) (if (is In (last From) (sites Occupied by:All container:""Board"" components:{""Submarine"" ""Cruiser"" ""Battleship""})) (if (= (who at:(last From)) 1) (mapEntry ""NoDoctrine"" 5) (if (= (who at:(last From)) 2) (mapEntry ""NoDoctrine"" 5) (if (= (who at:(last From)) 3) (mapEntry ""NoDoctrine"" 5) (if (= (who at:(last From)) 4) (mapEntry ""NoDoctrine"" 5) 0)))) 4))))) (if (and (= 8 (state at:(last To))) (!= (mover) (who at:(last To)))) (if (= (who at:(last From)) 1) (mapEntry ""NoDoctrine"" 6) (if (= (who at:(last From)) 2) (mapEntry ""NoDoctrine"" 6) (if (= (who at:(last From)) 3) (mapEntry ""NoDoctrine"" 6) (if (= (who at:(last From)) 4) (mapEntry ""NoDoctrine"" 6) 0)))) 5) (if (> (who at:(last To)) 0) (if (= (who at:(last To)) 1) (mapEntry ""NoDoctrine"" 8) (if (= (who at:(last To)) 2) (mapEntry ""NoDoctrine"" 8) (if (= (who at:(last To)) 3) (mapEntry ""NoDoctrine"" 8) (if (= (who at:(last To)) 4) (mapEntry ""NoDoctrine"" 8) 0)))) 4) (if False (if (= (who at:(last From)) 1) (mapEntry ""NoDoctrine"" 10) (if (= (who at:(last From)) 2) (mapEntry ""NoDoctrine"" 10) (if (= (who at:(last From)) 3) (mapEntry ""NoDoctrine"" 10) (if (= (who at:(last From)) 4) (mapEntry ""NoDoctrine"" 10) 0)))) (if (= (who at:(last From)) 1) (mapEntry ""NoDoctrine"" 9) (if (= (who at:(last From)) 2) (mapEntry ""NoDoctrine"" 9) (if (= (who at:(last From)) 3) (mapEntry ""NoDoctrine"" 9) (if (= (who at:(last From)) 4) (mapEntry ""NoDoctrine"" 9) 0))))) (value Random (range (if (= (who at:(last From)) 1) (mapEntry ""NoDoctrine"" 11) (if (= (who at:(last From)) 2) (mapEntry ""NoDoctrine"" 11) (if (= (who at:(last From)) 3) (mapEntry ""NoDoctrine"" 11) (if (= (who at:(last From)) 4) (mapEntry ""NoDoctrine"" 11) 0)))) (if (= (who at:(last From)) 1) (mapEntry ""NoDoctrine"" 12) (if (= (who at:(last From)) 2) (mapEntry ""NoDoctrine"" 12) (if (= (who at:(last From)) 3) (mapEntry ""NoDoctrine"" 12) (if (= (who at:(last From)) 4) (mapEntry ""NoDoctrine"" 12) 0))))))})) 128000)))) (set State at:(last From) 0)) next:(if (and (= 8 (state at:(last To))) (!= (mover) (who at:(last To)))) (if (= (value Piece at:(last To)) 0) (and {(take Control of:All by:Mover at:(last To)) (set Value at:(last To) 50)}) (set Value at:(last To) (value Piece at:(last To)))) (if (= (value Piece at:(last To)) 0) (remove (last To)) (if (and {(= 0 (count Sites in:(intersection (sites {(last To) (last From)}) (sites Occupied by:All components:{""Launcher"" ""Artillery"" ""Battleship"" ""Antiair""})))) (if (is In (last To) (sites Occupied by:Enemy components:{""Bomber"" ""Battleship"" ""Artillery"" ""Launcher""})) (is In (last From) (union (sites Occupied by:Mover components:{""Soldier"" ""Motorbike"" ""Tank"" ""Speeder"" ""Shooter"" ""Launcher"" ""Antiair"" ""Battleship"" ""Artillery"" ""Base"" ""Town"" ""Factory"" ""Dock"" ""Airport"" ""Cruiser"" ""Submarine""}) (sites Occupied by:Neutral container:""Board""))) (is In (last From) (union (sites Occupied by:Mover) (sites Occupied by:Neutral container:""Board"")))) (if (is In (last To) (sites Occupied by:Enemy components:{""Antiair"" ""Fighter""})) (is In (last From) (sites Occupied by:Mover components:{""Fighter"" ""Helicopter"" ""Bomber""})) (is In (last From) (union (sites Occupied by:Mover) (sites Occupied by:Neutral container:""Board"")))) (if (is In (last To) (sites Occupied by:Enemy components:{""Submarine""})) (is In (last From) (sites Occupied by:Mover components:{""Submarine"" ""Battleship"" ""Cruiser""})) (is In (last From) (union (sites Occupied by:Mover) (sites Occupied by:Neutral container:""Board""))))}) (if (<= (- (value Piece at:(last From)) (/ (* (if (is In (last From) (sites Occupied by:All container:""Board"" components:{""Fighter"" ""Bomber"" ""Helicopter""})) (max (/ (* (* (value Piece at:(last To)) 4) (mapEntry ""DamageMultiplier"" (what at:(last To)))) 100) 1) (if (and (is In (last From) (sites Occupied by:All container:""Board"" components:{""Soldier"" ""Motorbike""})) (is In (last To) (sites Occupied by:All component:""Shooter""))) (if (is In (last From) (sites ""Forest"")) (max (/ (* (* (value Piece at:(last To)) 6) (mapEntry ""DamageMultiplier"" (what at:(last To)))) 100) 1) (if (is In (last From) (union (sites ""ShallowWater"") (sites ""DeepWater""))) (max (/ (* (* (value Piece at:(last To)) 10) (mapEntry ""DamageMultiplier"" (what at:(last To)))) 100) 1) (max (/ (* (* (value Piece at:(last To)) 8) (mapEntry ""DamageMultiplier"" (what at:(last To)))) 100) 1))) (if (is In (last From) (sites ""Forest"")) (max (/ (* (* (value Piece at:(last To)) 3) (mapEntry ""DamageMultiplier"" (what at:(last To)))) 100) 1) (if (is In (last From) (union (sites ""ShallowWater"") (sites ""DeepWater""))) (max (/ (* (* (value Piece at:(last To)) 5) (mapEntry ""DamageMultiplier"" (what at:(last To)))) 100) 1) (max (/ (* (* (value Piece at:(last To)) 4) (mapEntry ""DamageMultiplier"" (what at:(last To)))) 100) 1))))) (* {(if (is In (last To) (sites Occupied by:All container:""Board"" components:{""Soldier"" ""Motorbike""})) (if (= (who at:(last To)) 1) (mapEntry ""NoDoctrine"" 1) (if (= (who at:(last To)) 2) (mapEntry ""NoDoctrine"" 1) (if (= (who at:(last To)) 3) (mapEntry ""NoDoctrine"" 1) (if (= (who at:(last To)) 4) (mapEntry ""NoDoctrine"" 1) 0)))) (if (is In (last To) (sites Occupied by:All container:""Board"" components:{""Tank"" ""Speeder"" ""Shooter""})) (if (= (who at:(last To)) 1) (mapEntry ""NoDoctrine"" 2) (if (= (who at:(last To)) 2) (mapEntry ""NoDoctrine"" 2) (if (= (who at:(last To)) 3) (mapEntry ""NoDoctrine"" 2) (if (= (who at:(last To)) 4) (mapEntry ""NoDoctrine"" 2) 0)))) (if (is In (last To) (sites Occupied by:All container:""Board"" components:{""Launcher"" ""Antiair"" ""Artillery""})) (if (= (who at:(last To)) 1) (mapEntry ""NoDoctrine"" 3) (if (= (who at:(last To)) 2) (mapEntry ""NoDoctrine"" 3) (if (= (who at:(last To)) 3) (mapEntry ""NoDoctrine"" 3) (if (= (who at:(last To)) 4) (mapEntry ""NoDoctrine"" 3) 0)))) (if (is In (last To) (sites Occupied by:All container:""Board"" components:{""Fighter"" ""Bomber"" ""Helicopter""})) (if (= (who at:(last To)) 1) (mapEntry ""NoDoctrine"" 4) (if (= (who at:(last To)) 2) (mapEntry ""NoDoctrine"" 4) (if (= (who at:(last To)) 3) (mapEntry ""NoDoctrine"" 4) (if (= (who at:(last To)) 4) (mapEntry ""NoDoctrine"" 4) 0)))) (if (is In (last To) (sites Occupied by:All container:""Board"" components:{""Submarine"" ""Cruiser"" ""Battleship""})) (if (= (who at:(last To)) 1) (mapEntry ""NoDoctrine"" 5) (if (= (who at:(last To)) 2) (mapEntry ""NoDoctrine"" 5) (if (= (who at:(last To)) 3) (mapEntry ""NoDoctrine"" 5) (if (= (who at:(last To)) 4) (mapEntry ""NoDoctrine"" 5) 0)))) 4))))) (if (and (= 8 (state at:(last From))) (!= (mover) (who at:(last From)))) (if (= (who at:(last To)) 1) (mapEntry ""NoDoctrine"" 6) (if (= (who at:(last To)) 2) (mapEntry ""NoDoctrine"" 6) (if (= (who at:(last To)) 3) (mapEntry ""NoDoctrine"" 6) (if (= (who at:(last To)) 4) (mapEntry ""NoDoctrine"" 6) 0)))) 5) (if (> (who at:(last From)) 0) (if (= (who at:(last From)) 1) (mapEntry ""NoDoctrine"" 8) (if (= (who at:(last From)) 2) (mapEntry ""NoDoctrine"" 8) (if (= (who at:(last From)) 3) (mapEntry ""NoDoctrine"" 8) (if (= (who at:(last From)) 4) (mapEntry ""NoDoctrine"" 8) 0)))) 4) (if True (if (= (who at:(last To)) 1) (mapEntry ""NoDoctrine"" 10) (if (= (who at:(last To)) 2) (mapEntry ""NoDoctrine"" 10) (if (= (who at:(last To)) 3) (mapEntry ""NoDoctrine"" 10) (if (= (who at:(last To)) 4) (mapEntry ""NoDoctrine"" 10) 0)))) (if (= (who at:(last To)) 1) (mapEntry ""NoDoctrine"" 9) (if (= (who at:(last To)) 2) (mapEntry ""NoDoctrine"" 9) (if (= (who at:(last To)) 3) (mapEntry ""NoDoctrine"" 9) (if (= (who at:(last To)) 4) (mapEntry ""NoDoctrine"" 9) 0))))) (value Random (range (if (= (who at:(last To)) 1) (mapEntry ""NoDoctrine"" 11) (if (= (who at:(last To)) 2) (mapEntry ""NoDoctrine"" 11) (if (= (who at:(last To)) 3) (mapEntry ""NoDoctrine"" 11) (if (= (who at:(last To)) 4) (mapEntry ""NoDoctrine"" 11) 0)))) (if (= (who at:(last To)) 1) (mapEntry ""NoDoctrine"" 12) (if (= (who at:(last To)) 2) (mapEntry ""NoDoctrine"" 12) (if (= (who at:(last To)) 3) (mapEntry ""NoDoctrine"" 12) (if (= (who at:(last To)) 4) (mapEntry ""NoDoctrine"" 12) 0))))))})) 128000)) 0) (remove (last From)) (set Value at:(last From) (- (value Piece at:(last From)) (/ (* (if (is In (last From) (sites Occupied by:All container:""Board"" components:{""Fighter"" ""Bomber"" ""Helicopter""})) (max (/ (* (* (value Piece at:(last To)) 4) (mapEntry ""DamageMultiplier"" (what at:(last To)))) 100) 1) (if (and (is In (last From) (sites Occupied by:All container:""Board"" components:{""Soldier"" ""Motorbike""})) (is In (last To) (sites Occupied by:All component:""Shooter""))) (if (is In (last From) (sites ""Forest"")) (max (/ (* (* (value Piece at:(last To)) 6) (mapEntry ""DamageMultiplier"" (what at:(last To)))) 100) 1) (if (is In (last From) (union (sites ""ShallowWater"") (sites ""DeepWater""))) (max (/ (* (* (value Piece at:(last To)) 10) (mapEntry ""DamageMultiplier"" (what at:(last To)))) 100) 1) (max (/ (* (* (value Piece at:(last To)) 8) (mapEntry ""DamageMultiplier"" (what at:(last To)))) 100) 1))) (if (is In (last From) (sites ""Forest"")) (max (/ (* (* (value Piece at:(last To)) 3) (mapEntry ""DamageMultiplier"" (what at:(last To)))) 100) 1) (if (is In (last From) (union (sites ""ShallowWater"") (sites ""DeepWater""))) (max (/ (* (* (value Piece at:(last To)) 5) (mapEntry ""DamageMultiplier"" (what at:(last To)))) 100) 1) (max (/ (* (* (value Piece at:(last To)) 4) (mapEntry ""DamageMultiplier"" (what at:(last To)))) 100) 1))))) (* {(if (is In (last To) (sites Occupied by:All container:""Board"" components:{""Soldier"" ""Motorbike""})) (if (= (who at:(last To)) 1) (mapEntry ""NoDoctrine"" 1) (if (= (who at:(last To)) 2) (mapEntry ""NoDoctrine"" 1) (if (= (who at:(last To)) 3) (mapEntry ""NoDoctrine"" 1) (if (= (who at:(last To)) 4) (mapEntry ""NoDoctrine"" 1) 0)))) (if (is In (last To) (sites Occupied by:All container:""Board"" components:{""Tank"" ""Speeder"" ""Shooter""})) (if (= (who at:(last To)) 1) (mapEntry ""NoDoctrine"" 2) (if (= (who at:(last To)) 2) (mapEntry ""NoDoctrine"" 2) (if (= (who at:(last To)) 3) (mapEntry ""NoDoctrine"" 2) (if (= (who at:(last To)) 4) (mapEntry ""NoDoctrine"" 2) 0)))) (if (is In (last To) (sites Occupied by:All container:""Board"" components:{""Launcher"" ""Antiair"" ""Artillery""})) (if (= (who at:(last To)) 1) (mapEntry ""NoDoctrine"" 3) (if (= (who at:(last To)) 2) (mapEntry ""NoDoctrine"" 3) (if (= (who at:(last To)) 3) (mapEntry ""NoDoctrine"" 3) (if (= (who at:(last To)) 4) (mapEntry ""NoDoctrine"" 3) 0)))) (if (is In (last To) (sites Occupied by:All container:""Board"" components:{""Fighter"" ""Bomber"" ""Helicopter""})) (if (= (who at:(last To)) 1) (mapEntry ""NoDoctrine"" 4) (if (= (who at:(last To)) 2) (mapEntry ""NoDoctrine"" 4) (if (= (who at:(last To)) 3) (mapEntry ""NoDoctrine"" 4) (if (= (who at:(last To)) 4) (mapEntry ""NoDoctrine"" 4) 0)))) (if (is In (last To) (sites Occupied by:All container:""Board"" components:{""Submarine"" ""Cruiser"" ""Battleship""})) (if (= (who at:(last To)) 1) (mapEntry ""NoDoctrine"" 5) (if (= (who at:(last To)) 2) (mapEntry ""NoDoctrine"" 5) (if (= (who at:(last To)) 3) (mapEntry ""NoDoctrine"" 5) (if (= (who at:(last To)) 4) (mapEntry ""NoDoctrine"" 5) 0)))) 4))))) (if (and (= 8 (state at:(last From))) (!= (mover) (who at:(last From)))) (if (= (who at:(last To)) 1) (mapEntry ""NoDoctrine"" 6) (if (= (who at:(last To)) 2) (mapEntry ""NoDoctrine"" 6) (if (= (who at:(last To)) 3) (mapEntry ""NoDoctrine"" 6) (if (= (who at:(last To)) 4) (mapEntry ""NoDoctrine"" 6) 0)))) 5) (if (> (who at:(last From)) 0) (if (= (who at:(last From)) 1) (mapEntry ""NoDoctrine"" 8) (if (= (who at:(last From)) 2) (mapEntry ""NoDoctrine"" 8) (if (= (who at:(last From)) 3) (mapEntry ""NoDoctrine"" 8) (if (= (who at:(last From)) 4) (mapEntry ""NoDoctrine"" 8) 0)))) 4) (if True (if (= (who at:(last To)) 1) (mapEntry ""NoDoctrine"" 10) (if (= (who at:(last To)) 2) (mapEntry ""NoDoctrine"" 10) (if (= (who at:(last To)) 3) (mapEntry ""NoDoctrine"" 10) (if (= (who at:(last To)) 4) (mapEntry ""NoDoctrine"" 10) 0)))) (if (= (who at:(last To)) 1) (mapEntry ""NoDoctrine"" 9) (if (= (who at:(last To)) 2) (mapEntry ""NoDoctrine"" 9) (if (= (who at:(last To)) 3) (mapEntry ""NoDoctrine"" 9) (if (= (who at:(last To)) 4) (mapEntry ""NoDoctrine"" 9) 0))))) (value Random (range (if (= (who at:(last To)) 1) (mapEntry ""NoDoctrine"" 11) (if (= (who at:(last To)) 2) (mapEntry ""NoDoctrine"" 11) (if (= (who at:(last To)) 3) (mapEntry ""NoDoctrine"" 11) (if (= (who at:(last To)) 4) (mapEntry ""NoDoctrine"" 11) 0)))) (if (= (who at:(last To)) 1) (mapEntry ""NoDoctrine"" 12) (if (= (who at:(last To)) 2) (mapEntry ""NoDoctrine"" 12) (if (= (who at:(last To)) 3) (mapEntry ""NoDoctrine"" 12) (if (= (who at:(last To)) 4) (mapEntry ""NoDoctrine"" 12) 0))))))})) 128000)))) (set Value at:(last From) (value Piece at:(last From))))))))) (move Select (from (from) if:(and (> (state at:(from)) 0) (< (value Piece at:(from)) (mapEntry ""MaxHealth"" (what at:(from)))))) (to (sites Around (from) Orthogonal if:(is In (to) (sites Occupied by:Mover container:""Board"" components:{""Town"" ""Dock"" ""Base"" ""Factory"" ""Airport""})))) (then (and {(set Value at:(last From) (min (mapEntry ""MaxHealth"" (what at:(last From))) (- (+ (value Piece at:(last From)) (value Piece at:(last To))) 1))) (set Value at:(last To) (max (- (value Piece at:(last To)) (- (mapEntry ""MaxHealth"" (what at:(last From))) (value Piece at:(last From)))) 1)) (set State at:(last From) 0)}))) (move Select (from (from) if:(> (state at:(from)) 0)) (to (sites Around (from) Orthogonal if:(and (= (what at:(from)) (what at:(to))) (< (value Piece at:(to)) (mapEntry ""MaxHealth"" (what at:(to))))))) (then (and {(if (<= (+ (value Piece at:(last To)) (value Piece at:(last From))) (mapEntry ""MaxHealth"" (what at:(last From)))) (and (set Value at:(last To) (min (mapEntry ""MaxHealth"" (what at:(last From))) (+ (value Piece at:(last From)) (value Piece at:(last To))))) (remove (last From))) (and (set Value at:(last To) (min (mapEntry ""MaxHealth"" (what at:(last From))) (- (+ (value Piece at:(last From)) (value Piece at:(last To))) 1))) (set Value at:(last From) (max (- (value Piece at:(last To)) (- (mapEntry ""MaxHealth"" (what at:(last From))) (value Piece at:(last From)))) 1)))) (set State at:(last From) 0) (set State at:(last To) 0)})))})) (piece ""Fighter"" Each (or {(move (from (from) if:(> (state at:(from)) 1)) (to (sites Distance (step Orthogonal (to if:(is In (to) (union (sites Empty) (sites Occupied by:Friend container:""Board""))))) from:(from) (range 1 (- (state at:(from)) 1))) if:(is Empty (to)) (apply (set State at:(from) 1)))) (move Select (from (from) if:(> (state at:(from)) 0)) (to (sites Distance Orthogonal from:(from) (range 1 1)) if:(and {(if (is In (from) (sites Occupied by:Mover container:""Board"" components:{""Bomber"" ""Battleship"" ""Artillery"" ""Launcher""})) (is In (to) (union (sites Occupied by:Enemy container:""Board"" components:{""Soldier"" ""Motorbike"" ""Tank"" ""Speeder"" ""Shooter"" ""Launcher"" ""Antiair"" ""Battleship"" ""Artillery"" ""Base"" ""Town"" ""Factory"" ""Dock"" ""Airport"" ""Cruiser"" ""Submarine""}) (sites Occupied by:Neutral container:""Board""))) (is In (to) (union (sites Occupied by:Enemy container:""Board"") (sites Occupied by:Neutral container:""Board"")))) (if (is In (from) (sites Occupied by:Mover container:""Board"" components:{""Antiair"" ""Fighter""})) (is In (to) (sites Occupied by:Enemy container:""Board"" components:{""Fighter"" ""Helicopter"" ""Bomber""})) (is In (to) (union (sites Occupied by:Enemy container:""Board"") (sites Occupied by:Neutral container:""Board"")))) (if (is In (from) (sites Occupied by:Mover container:""Board"" components:{""Submarine""})) (is In (to) (sites Occupied by:Enemy container:""Board"" components:{""Submarine"" ""Battleship"" ""Cruiser""})) (is In (to) (union (sites Occupied by:Enemy container:""Board"") (sites Occupied by:Neutral container:""Board""))))})) (then (do (and (set Value at:(last To) (max 0 (- (value Piece at:(last To)) (/ (* (if (is In (last To) (sites Occupied by:All container:""Board"" components:{""Fighter"" ""Bomber"" ""Helicopter""})) (max (/ (* (* (value Piece at:(last From)) 4) (mapEntry ""DamageMultiplier"" (what at:(last From)))) 100) 1) (if (and (is In (last To) (sites Occupied by:All container:""Board"" components:{""Soldier"" ""Motorbike""})) (is In (last From) (sites Occupied by:All component:""Shooter""))) (if (is In (last To) (sites ""Forest"")) (max (/ (* (* (value Piece at:(last From)) 6) (mapEntry ""DamageMultiplier"" (what at:(last From)))) 100) 1) (if (is In (last To) (union (sites ""ShallowWater"") (sites ""DeepWater""))) (max (/ (* (* (value Piece at:(last From)) 10) (mapEntry ""DamageMultiplier"" (what at:(last From)))) 100) 1) (max (/ (* (* (value Piece at:(last From)) 8) (mapEntry ""DamageMultiplier"" (what at:(last From)))) 100) 1))) (if (is In (last To) (sites ""Forest"")) (max (/ (* (* (value Piece at:(last From)) 3) (mapEntry ""DamageMultiplier"" (what at:(last From)))) 100) 1) (if (is In (last To) (union (sites ""ShallowWater"") (sites ""DeepWater""))) (max (/ (* (* (value Piece at:(last From)) 5) (mapEntry ""DamageMultiplier"" (what at:(last From)))) 100) 1) (max (/ (* (* (value Piece at:(last From)) 4) (mapEntry ""DamageMultiplier"" (what at:(last From)))) 100) 1))))) (* {(if (is In (last From) (sites Occupied by:All container:""Board"" components:{""Soldier"" ""Motorbike""})) (if (= (who at:(last From)) 1) (mapEntry ""NoDoctrine"" 1) (if (= (who at:(last From)) 2) (mapEntry ""NoDoctrine"" 1) (if (= (who at:(last From)) 3) (mapEntry ""NoDoctrine"" 1) (if (= (who at:(last From)) 4) (mapEntry ""NoDoctrine"" 1) 0)))) (if (is In (last From) (sites Occupied by:All container:""Board"" components:{""Tank"" ""Speeder"" ""Shooter""})) (if (= (who at:(last From)) 1) (mapEntry ""NoDoctrine"" 2) (if (= (who at:(last From)) 2) (mapEntry ""NoDoctrine"" 2) (if (= (who at:(last From)) 3) (mapEntry ""NoDoctrine"" 2) (if (= (who at:(last From)) 4) (mapEntry ""NoDoctrine"" 2) 0)))) (if (is In (last From) (sites Occupied by:All container:""Board"" components:{""Launcher"" ""Antiair"" ""Artillery""})) (if (= (who at:(last From)) 1) (mapEntry ""NoDoctrine"" 3) (if (= (who at:(last From)) 2) (mapEntry ""NoDoctrine"" 3) (if (= (who at:(last From)) 3) (mapEntry ""NoDoctrine"" 3) (if (= (who at:(last From)) 4) (mapEntry ""NoDoctrine"" 3) 0)))) (if (is In (last From) (sites Occupied by:All container:""Board"" components:{""Fighter"" ""Bomber"" ""Helicopter""})) (if (= (who at:(last From)) 1) (mapEntry ""NoDoctrine"" 4) (if (= (who at:(last From)) 2) (mapEntry ""NoDoctrine"" 4) (if (= (who at:(last From)) 3) (mapEntry ""NoDoctrine"" 4) (if (= (who at:(last From)) 4) (mapEntry ""NoDoctrine"" 4) 0)))) (if (is In (last From) (sites Occupied by:All container:""Board"" components:{""Submarine"" ""Cruiser"" ""Battleship""})) (if (= (who at:(last From)) 1) (mapEntry ""NoDoctrine"" 5) (if (= (who at:(last From)) 2) (mapEntry ""NoDoctrine"" 5) (if (= (who at:(last From)) 3) (mapEntry ""NoDoctrine"" 5) (if (= (who at:(last From)) 4) (mapEntry ""NoDoctrine"" 5) 0)))) 4))))) (if (and (= 8 (state at:(last To))) (!= (mover) (who at:(last To)))) (if (= (who at:(last From)) 1) (mapEntry ""NoDoctrine"" 6) (if (= (who at:(last From)) 2) (mapEntry ""NoDoctrine"" 6) (if (= (who at:(last From)) 3) (mapEntry ""NoDoctrine"" 6) (if (= (who at:(last From)) 4) (mapEntry ""NoDoctrine"" 6) 0)))) 5) (if (> (who at:(last To)) 0) (if (= (who at:(last To)) 1) (mapEntry ""NoDoctrine"" 8) (if (= (who at:(last To)) 2) (mapEntry ""NoDoctrine"" 8) (if (= (who at:(last To)) 3) (mapEntry ""NoDoctrine"" 8) (if (= (who at:(last To)) 4) (mapEntry ""NoDoctrine"" 8) 0)))) 4) (if False (if (= (who at:(last From)) 1) (mapEntry ""NoDoctrine"" 10) (if (= (who at:(last From)) 2) (mapEntry ""NoDoctrine"" 10) (if (= (who at:(last From)) 3) (mapEntry ""NoDoctrine"" 10) (if (= (who at:(last From)) 4) (mapEntry ""NoDoctrine"" 10) 0)))) (if (= (who at:(last From)) 1) (mapEntry ""NoDoctrine"" 9) (if (= (who at:(last From)) 2) (mapEntry ""NoDoctrine"" 9) (if (= (who at:(last From)) 3) (mapEntry ""NoDoctrine"" 9) (if (= (who at:(last From)) 4) (mapEntry ""NoDoctrine"" 9) 0))))) (value Random (range (if (= (who at:(last From)) 1) (mapEntry ""NoDoctrine"" 11) (if (= (who at:(last From)) 2) (mapEntry ""NoDoctrine"" 11) (if (= (who at:(last From)) 3) (mapEntry ""NoDoctrine"" 11) (if (= (who at:(last From)) 4) (mapEntry ""NoDoctrine"" 11) 0)))) (if (= (who at:(last From)) 1) (mapEntry ""NoDoctrine"" 12) (if (= (who at:(last From)) 2) (mapEntry ""NoDoctrine"" 12) (if (= (who at:(last From)) 3) (mapEntry ""NoDoctrine"" 12) (if (= (who at:(last From)) 4) (mapEntry ""NoDoctrine"" 12) 0))))))})) 128000)))) (set State at:(last From) 0)) next:(if (and (= 8 (state at:(last To))) (!= (mover) (who at:(last To)))) (if (= (value Piece at:(last To)) 0) (and {(take Control of:All by:Mover at:(last To)) (set Value at:(last To) 50)}) (set Value at:(last To) (value Piece at:(last To)))) (if (= (value Piece at:(last To)) 0) (remove (last To)) (if (and {(= 0 (count Sites in:(intersection (sites {(last To) (last From)}) (sites Occupied by:All components:{""Launcher"" ""Artillery"" ""Battleship"" ""Antiair""})))) (if (is In (last To) (sites Occupied by:Enemy components:{""Bomber"" ""Battleship"" ""Artillery"" ""Launcher""})) (is In (last From) (union (sites Occupied by:Mover components:{""Soldier"" ""Motorbike"" ""Tank"" ""Speeder"" ""Shooter"" ""Launcher"" ""Antiair"" ""Battleship"" ""Artillery"" ""Base"" ""Town"" ""Factory"" ""Dock"" ""Airport"" ""Cruiser"" ""Submarine""}) (sites Occupied by:Neutral container:""Board""))) (is In (last From) (union (sites Occupied by:Mover) (sites Occupied by:Neutral container:""Board"")))) (if (is In (last To) (sites Occupied by:Enemy components:{""Antiair"" ""Fighter""})) (is In (last From) (sites Occupied by:Mover components:{""Fighter"" ""Helicopter"" ""Bomber""})) (is In (last From) (union (sites Occupied by:Mover) (sites Occupied by:Neutral container:""Board"")))) (if (is In (last To) (sites Occupied by:Enemy components:{""Submarine""})) (is In (last From) (sites Occupied by:Mover components:{""Submarine"" ""Battleship"" ""Cruiser""})) (is In (last From) (union (sites Occupied by:Mover) (sites Occupied by:Neutral container:""Board""))))}) (if (<= (- (value Piece at:(last From)) (/ (* (if (is In (last From) (sites Occupied by:All container:""Board"" components:{""Fighter"" ""Bomber"" ""Helicopter""})) (max (/ (* (* (value Piece at:(last To)) 4) (mapEntry ""DamageMultiplier"" (what at:(last To)))) 100) 1) (if (and (is In (last From) (sites Occupied by:All container:""Board"" components:{""Soldier"" ""Motorbike""})) (is In (last To) (sites Occupied by:All component:""Shooter""))) (if (is In (last From) (sites ""Forest"")) (max (/ (* (* (value Piece at:(last To)) 6) (mapEntry ""DamageMultiplier"" (what at:(last To)))) 100) 1) (if (is In (last From) (union (sites ""ShallowWater"") (sites ""DeepWater""))) (max (/ (* (* (value Piece at:(last To)) 10) (mapEntry ""DamageMultiplier"" (what at:(last To)))) 100) 1) (max (/ (* (* (value Piece at:(last To)) 8) (mapEntry ""DamageMultiplier"" (what at:(last To)))) 100) 1))) (if (is In (last From) (sites ""Forest"")) (max (/ (* (* (value Piece at:(last To)) 3) (mapEntry ""DamageMultiplier"" (what at:(last To)))) 100) 1) (if (is In (last From) (union (sites ""ShallowWater"") (sites ""DeepWater""))) (max (/ (* (* (value Piece at:(last To)) 5) (mapEntry ""DamageMultiplier"" (what at:(last To)))) 100) 1) (max (/ (* (* (value Piece at:(last To)) 4) (mapEntry ""DamageMultiplier"" (what at:(last To)))) 100) 1))))) (* {(if (is In (last To) (sites Occupied by:All container:""Board"" components:{""Soldier"" ""Motorbike""})) (if (= (who at:(last To)) 1) (mapEntry ""NoDoctrine"" 1) (if (= (who at:(last To)) 2) (mapEntry ""NoDoctrine"" 1) (if (= (who at:(last To)) 3) (mapEntry ""NoDoctrine"" 1) (if (= (who at:(last To)) 4) (mapEntry ""NoDoctrine"" 1) 0)))) (if (is In (last To) (sites Occupied by:All container:""Board"" components:{""Tank"" ""Speeder"" ""Shooter""})) (if (= (who at:(last To)) 1) (mapEntry ""NoDoctrine"" 2) (if (= (who at:(last To)) 2) (mapEntry ""NoDoctrine"" 2) (if (= (who at:(last To)) 3) (mapEntry ""NoDoctrine"" 2) (if (= (who at:(last To)) 4) (mapEntry ""NoDoctrine"" 2) 0)))) (if (is In (last To) (sites Occupied by:All container:""Board"" components:{""Launcher"" ""Antiair"" ""Artillery""})) (if (= (who at:(last To)) 1) (mapEntry ""NoDoctrine"" 3) (if (= (who at:(last To)) 2) (mapEntry ""NoDoctrine"" 3) (if (= (who at:(last To)) 3) (mapEntry ""NoDoctrine"" 3) (if (= (who at:(last To)) 4) (mapEntry ""NoDoctrine"" 3) 0)))) (if (is In (last To) (sites Occupied by:All container:""Board"" components:{""Fighter"" ""Bomber"" ""Helicopter""})) (if (= (who at:(last To)) 1) (mapEntry ""NoDoctrine"" 4) (if (= (who at:(last To)) 2) (mapEntry ""NoDoctrine"" 4) (if (= (who at:(last To)) 3) (mapEntry ""NoDoctrine"" 4) (if (= (who at:(last To)) 4) (mapEntry ""NoDoctrine"" 4) 0)))) (if (is In (last To) (sites Occupied by:All container:""Board"" components:{""Submarine"" ""Cruiser"" ""Battleship""})) (if (= (who at:(last To)) 1) (mapEntry ""NoDoctrine"" 5) (if (= (who at:(last To)) 2) (mapEntry ""NoDoctrine"" 5) (if (= (who at:(last To)) 3) (mapEntry ""NoDoctrine"" 5) (if (= (who at:(last To)) 4) (mapEntry ""NoDoctrine"" 5) 0)))) 4))))) (if (and (= 8 (state at:(last From))) (!= (mover) (who at:(last From)))) (if (= (who at:(last To)) 1) (mapEntry ""NoDoctrine"" 6) (if (= (who at:(last To)) 2) (mapEntry ""NoDoctrine"" 6) (if (= (who at:(last To)) 3) (mapEntry ""NoDoctrine"" 6) (if (= (who at:(last To)) 4) (mapEntry ""NoDoctrine"" 6) 0)))) 5) (if (> (who at:(last From)) 0) (if (= (who at:(last From)) 1) (mapEntry ""NoDoctrine"" 8) (if (= (who at:(last From)) 2) (mapEntry ""NoDoctrine"" 8) (if (= (who at:(last From)) 3) (mapEntry ""NoDoctrine"" 8) (if (= (who at:(last From)) 4) (mapEntry ""NoDoctrine"" 8) 0)))) 4) (if True (if (= (who at:(last To)) 1) (mapEntry ""NoDoctrine"" 10) (if (= (who at:(last To)) 2) (mapEntry ""NoDoctrine"" 10) (if (= (who at:(last To)) 3) (mapEntry ""NoDoctrine"" 10) (if (= (who at:(last To)) 4) (mapEntry ""NoDoctrine"" 10) 0)))) (if (= (who at:(last To)) 1) (mapEntry ""NoDoctrine"" 9) (if (= (who at:(last To)) 2) (mapEntry ""NoDoctrine"" 9) (if (= (who at:(last To)) 3) (mapEntry ""NoDoctrine"" 9) (if (= (who at:(last To)) 4) (mapEntry ""NoDoctrine"" 9) 0))))) (value Random (range (if (= (who at:(last To)) 1) (mapEntry ""NoDoctrine"" 11) (if (= (who at:(last To)) 2) (mapEntry ""NoDoctrine"" 11) (if (= (who at:(last To)) 3) (mapEntry ""NoDoctrine"" 11) (if (= (who at:(last To)) 4) (mapEntry ""NoDoctrine"" 11) 0)))) (if (= (who at:(last To)) 1) (mapEntry ""NoDoctrine"" 12) (if (= (who at:(last To)) 2) (mapEntry ""NoDoctrine"" 12) (if (= (who at:(last To)) 3) (mapEntry ""NoDoctrine"" 12) (if (= (who at:(last To)) 4) (mapEntry ""NoDoctrine"" 12) 0))))))})) 128000)) 0) (remove (last From)) (set Value at:(last From) (- (value Piece at:(last From)) (/ (* (if (is In (last From) (sites Occupied by:All container:""Board"" components:{""Fighter"" ""Bomber"" ""Helicopter""})) (max (/ (* (* (value Piece at:(last To)) 4) (mapEntry ""DamageMultiplier"" (what at:(last To)))) 100) 1) (if (and (is In (last From) (sites Occupied by:All container:""Board"" components:{""Soldier"" ""Motorbike""})) (is In (last To) (sites Occupied by:All component:""Shooter""))) (if (is In (last From) (sites ""Forest"")) (max (/ (* (* (value Piece at:(last To)) 6) (mapEntry ""DamageMultiplier"" (what at:(last To)))) 100) 1) (if (is In (last From) (union (sites ""ShallowWater"") (sites ""DeepWater""))) (max (/ (* (* (value Piece at:(last To)) 10) (mapEntry ""DamageMultiplier"" (what at:(last To)))) 100) 1) (max (/ (* (* (value Piece at:(last To)) 8) (mapEntry ""DamageMultiplier"" (what at:(last To)))) 100) 1))) (if (is In (last From) (sites ""Forest"")) (max (/ (* (* (value Piece at:(last To)) 3) (mapEntry ""DamageMultiplier"" (what at:(last To)))) 100) 1) (if (is In (last From) (union (sites ""ShallowWater"") (sites ""DeepWater""))) (max (/ (* (* (value Piece at:(last To)) 5) (mapEntry ""DamageMultiplier"" (what at:(last To)))) 100) 1) (max (/ (* (* (value Piece at:(last To)) 4) (mapEntry ""DamageMultiplier"" (what at:(last To)))) 100) 1))))) (* {(if (is In (last To) (sites Occupied by:All container:""Board"" components:{""Soldier"" ""Motorbike""})) (if (= (who at:(last To)) 1) (mapEntry ""NoDoctrine"" 1) (if (= (who at:(last To)) 2) (mapEntry ""NoDoctrine"" 1) (if (= (who at:(last To)) 3) (mapEntry ""NoDoctrine"" 1) (if (= (who at:(last To)) 4) (mapEntry ""NoDoctrine"" 1) 0)))) (if (is In (last To) (sites Occupied by:All container:""Board"" components:{""Tank"" ""Speeder"" ""Shooter""})) (if (= (who at:(last To)) 1) (mapEntry ""NoDoctrine"" 2) (if (= (who at:(last To)) 2) (mapEntry ""NoDoctrine"" 2) (if (= (who at:(last To)) 3) (mapEntry ""NoDoctrine"" 2) (if (= (who at:(last To)) 4) (mapEntry ""NoDoctrine"" 2) 0)))) (if (is In (last To) (sites Occupied by:All container:""Board"" components:{""Launcher"" ""Antiair"" ""Artillery""})) (if (= (who at:(last To)) 1) (mapEntry ""NoDoctrine"" 3) (if (= (who at:(last To)) 2) (mapEntry ""NoDoctrine"" 3) (if (= (who at:(last To)) 3) (mapEntry ""NoDoctrine"" 3) (if (= (who at:(last To)) 4) (mapEntry ""NoDoctrine"" 3) 0)))) (if (is In (last To) (sites Occupied by:All container:""Board"" components:{""Fighter"" ""Bomber"" ""Helicopter""})) (if (= (who at:(last To)) 1) (mapEntry ""NoDoctrine"" 4) (if (= (who at:(last To)) 2) (mapEntry ""NoDoctrine"" 4) (if (= (who at:(last To)) 3) (mapEntry ""NoDoctrine"" 4) (if (= (who at:(last To)) 4) (mapEntry ""NoDoctrine"" 4) 0)))) (if (is In (last To) (sites Occupied by:All container:""Board"" components:{""Submarine"" ""Cruiser"" ""Battleship""})) (if (= (who at:(last To)) 1) (mapEntry ""NoDoctrine"" 5) (if (= (who at:(last To)) 2) (mapEntry ""NoDoctrine"" 5) (if (= (who at:(last To)) 3) (mapEntry ""NoDoctrine"" 5) (if (= (who at:(last To)) 4) (mapEntry ""NoDoctrine"" 5) 0)))) 4))))) (if (and (= 8 (state at:(last From))) (!= (mover) (who at:(last From)))) (if (= (who at:(last To)) 1) (mapEntry ""NoDoctrine"" 6) (if (= (who at:(last To)) 2) (mapEntry ""NoDoctrine"" 6) (if (= (who at:(last To)) 3) (mapEntry ""NoDoctrine"" 6) (if (= (who at:(last To)) 4) (mapEntry ""NoDoctrine"" 6) 0)))) 5) (if (> (who at:(last From)) 0) (if (= (who at:(last From)) 1) (mapEntry ""NoDoctrine"" 8) (if (= (who at:(last From)) 2) (mapEntry ""NoDoctrine"" 8) (if (= (who at:(last From)) 3) (mapEntry ""NoDoctrine"" 8) (if (= (who at:(last From)) 4) (mapEntry ""NoDoctrine"" 8) 0)))) 4) (if True (if (= (who at:(last To)) 1) (mapEntry ""NoDoctrine"" 10) (if (= (who at:(last To)) 2) (mapEntry ""NoDoctrine"" 10) (if (= (who at:(last To)) 3) (mapEntry ""NoDoctrine"" 10) (if (= (who at:(last To)) 4) (mapEntry ""NoDoctrine"" 10) 0)))) (if (= (who at:(last To)) 1) (mapEntry ""NoDoctrine"" 9) (if (= (who at:(last To)) 2) (mapEntry ""NoDoctrine"" 9) (if (= (who at:(last To)) 3) (mapEntry ""NoDoctrine"" 9) (if (= (who at:(last To)) 4) (mapEntry ""NoDoctrine"" 9) 0))))) (value Random (range (if (= (who at:(last To)) 1) (mapEntry ""NoDoctrine"" 11) (if (= (who at:(last To)) 2) (mapEntry ""NoDoctrine"" 11) (if (= (who at:(last To)) 3) (mapEntry ""NoDoctrine"" 11) (if (= (who at:(last To)) 4) (mapEntry ""NoDoctrine"" 11) 0)))) (if (= (who at:(last To)) 1) (mapEntry ""NoDoctrine"" 12) (if (= (who at:(last To)) 2) (mapEntry ""NoDoctrine"" 12) (if (= (who at:(last To)) 3) (mapEntry ""NoDoctrine"" 12) (if (= (who at:(last To)) 4) (mapEntry ""NoDoctrine"" 12) 0))))))})) 128000)))) (set Value at:(last From) (value Piece at:(last From))))))))) (move Select (from (from) if:(and (> (state at:(from)) 0) (< (value Piece at:(from)) (mapEntry ""MaxHealth"" (what at:(from)))))) (to (sites Around (from) Orthogonal if:(is In (to) (sites Occupied by:Mover container:""Board"" components:{""Town"" ""Dock"" ""Base"" ""Factory"" ""Airport""})))) (then (and {(set Value at:(last From) (min (mapEntry ""MaxHealth"" (what at:(last From))) (- (+ (value Piece at:(last From)) (value Piece at:(last To))) 1))) (set Value at:(last To) (max (- (value Piece at:(last To)) (- (mapEntry ""MaxHealth"" (what at:(last From))) (value Piece at:(last From)))) 1)) (set State at:(last From) 0)}))) (move Select (from (from) if:(> (state at:(from)) 0)) (to (sites Around (from) Orthogonal if:(and (= (what at:(from)) (what at:(to))) (< (value Piece at:(to)) (mapEntry ""MaxHealth"" (what at:(to))))))) (then (and {(if (<= (+ (value Piece at:(last To)) (value Piece at:(last From))) (mapEntry ""MaxHealth"" (what at:(last From)))) (and (set Value at:(last To) (min (mapEntry ""MaxHealth"" (what at:(last From))) (+ (value Piece at:(last From)) (value Piece at:(last To))))) (remove (last From))) (and (set Value at:(last To) (min (mapEntry ""MaxHealth"" (what at:(last From))) (- (+ (value Piece at:(last From)) (value Piece at:(last To))) 1))) (set Value at:(last From) (max (- (value Piece at:(last To)) (- (mapEntry ""MaxHealth"" (what at:(last From))) (value Piece at:(last From)))) 1)))) (set State at:(last From) 0) (set State at:(last To) 0)})))})) (piece ""Bomber"" Each (or {(move (from (from) if:(> (state at:(from)) 1)) (to (sites Distance (step Orthogonal (to if:(is In (to) (union (sites Empty) (sites Occupied by:Friend container:""Board""))))) from:(from) (range 1 (- (state at:(from)) 1))) if:(is Empty (to)) (apply (set State at:(from) 1)))) (move Select (from (from) if:(> (state at:(from)) 0)) (to (sites Distance Orthogonal from:(from) (range 1 1)) if:(and {(if (is In (from) (sites Occupied by:Mover container:""Board"" components:{""Bomber"" ""Battleship"" ""Artillery"" ""Launcher""})) (is In (to) (union (sites Occupied by:Enemy container:""Board"" components:{""Soldier"" ""Motorbike"" ""Tank"" ""Speeder"" ""Shooter"" ""Launcher"" ""Antiair"" ""Battleship"" ""Artillery"" ""Base"" ""Town"" ""Factory"" ""Dock"" ""Airport"" ""Cruiser"" ""Submarine""}) (sites Occupied by:Neutral container:""Board""))) (is In (to) (union (sites Occupied by:Enemy container:""Board"") (sites Occupied by:Neutral container:""Board"")))) (if (is In (from) (sites Occupied by:Mover container:""Board"" components:{""Antiair"" ""Fighter""})) (is In (to) (sites Occupied by:Enemy container:""Board"" components:{""Fighter"" ""Helicopter"" ""Bomber""})) (is In (to) (union (sites Occupied by:Enemy container:""Board"") (sites Occupied by:Neutral container:""Board"")))) (if (is In (from) (sites Occupied by:Mover container:""Board"" components:{""Submarine""})) (is In (to) (sites Occupied by:Enemy container:""Board"" components:{""Submarine"" ""Battleship"" ""Cruiser""})) (is In (to) (union (sites Occupied by:Enemy container:""Board"") (sites Occupied by:Neutral container:""Board""))))})) (then (do (and (set Value at:(last To) (max 0 (- (value Piece at:(last To)) (/ (* (if (is In (last To) (sites Occupied by:All container:""Board"" components:{""Fighter"" ""Bomber"" ""Helicopter""})) (max (/ (* (* (value Piece at:(last From)) 4) (mapEntry ""DamageMultiplier"" (what at:(last From)))) 100) 1) (if (and (is In (last To) (sites Occupied by:All container:""Board"" components:{""Soldier"" ""Motorbike""})) (is In (last From) (sites Occupied by:All component:""Shooter""))) (if (is In (last To) (sites ""Forest"")) (max (/ (* (* (value Piece at:(last From)) 6) (mapEntry ""DamageMultiplier"" (what at:(last From)))) 100) 1) (if (is In (last To) (union (sites ""ShallowWater"") (sites ""DeepWater""))) (max (/ (* (* (value Piece at:(last From)) 10) (mapEntry ""DamageMultiplier"" (what at:(last From)))) 100) 1) (max (/ (* (* (value Piece at:(last From)) 8) (mapEntry ""DamageMultiplier"" (what at:(last From)))) 100) 1))) (if (is In (last To) (sites ""Forest"")) (max (/ (* (* (value Piece at:(last From)) 3) (mapEntry ""DamageMultiplier"" (what at:(last From)))) 100) 1) (if (is In (last To) (union (sites ""ShallowWater"") (sites ""DeepWater""))) (max (/ (* (* (value Piece at:(last From)) 5) (mapEntry ""DamageMultiplier"" (what at:(last From)))) 100) 1) (max (/ (* (* (value Piece at:(last From)) 4) (mapEntry ""DamageMultiplier"" (what at:(last From)))) 100) 1))))) (* {(if (is In (last From) (sites Occupied by:All container:""Board"" components:{""Soldier"" ""Motorbike""})) (if (= (who at:(last From)) 1) (mapEntry ""NoDoctrine"" 1) (if (= (who at:(last From)) 2) (mapEntry ""NoDoctrine"" 1) (if (= (who at:(last From)) 3) (mapEntry ""NoDoctrine"" 1) (if (= (who at:(last From)) 4) (mapEntry ""NoDoctrine"" 1) 0)))) (if (is In (last From) (sites Occupied by:All container:""Board"" components:{""Tank"" ""Speeder"" ""Shooter""})) (if (= (who at:(last From)) 1) (mapEntry ""NoDoctrine"" 2) (if (= (who at:(last From)) 2) (mapEntry ""NoDoctrine"" 2) (if (= (who at:(last From)) 3) (mapEntry ""NoDoctrine"" 2) (if (= (who at:(last From)) 4) (mapEntry ""NoDoctrine"" 2) 0)))) (if (is In (last From) (sites Occupied by:All container:""Board"" components:{""Launcher"" ""Antiair"" ""Artillery""})) (if (= (who at:(last From)) 1) (mapEntry ""NoDoctrine"" 3) (if (= (who at:(last From)) 2) (mapEntry ""NoDoctrine"" 3) (if (= (who at:(last From)) 3) (mapEntry ""NoDoctrine"" 3) (if (= (who at:(last From)) 4) (mapEntry ""NoDoctrine"" 3) 0)))) (if (is In (last From) (sites Occupied by:All container:""Board"" components:{""Fighter"" ""Bomber"" ""Helicopter""})) (if (= (who at:(last From)) 1) (mapEntry ""NoDoctrine"" 4) (if (= (who at:(last From)) 2) (mapEntry ""NoDoctrine"" 4) (if (= (who at:(last From)) 3) (mapEntry ""NoDoctrine"" 4) (if (= (who at:(last From)) 4) (mapEntry ""NoDoctrine"" 4) 0)))) (if (is In (last From) (sites Occupied by:All container:""Board"" components:{""Submarine"" ""Cruiser"" ""Battleship""})) (if (= (who at:(last From)) 1) (mapEntry ""NoDoctrine"" 5) (if (= (who at:(last From)) 2) (mapEntry ""NoDoctrine"" 5) (if (= (who at:(last From)) 3) (mapEntry ""NoDoctrine"" 5) (if (= (who at:(last From)) 4) (mapEntry ""NoDoctrine"" 5) 0)))) 4))))) (if (and (= 8 (state at:(last To))) (!= (mover) (who at:(last To)))) (if (= (who at:(last From)) 1) (mapEntry ""NoDoctrine"" 6) (if (= (who at:(last From)) 2) (mapEntry ""NoDoctrine"" 6) (if (= (who at:(last From)) 3) (mapEntry ""NoDoctrine"" 6) (if (= (who at:(last From)) 4) (mapEntry ""NoDoctrine"" 6) 0)))) 5) (if (> (who at:(last To)) 0) (if (= (who at:(last To)) 1) (mapEntry ""NoDoctrine"" 8) (if (= (who at:(last To)) 2) (mapEntry ""NoDoctrine"" 8) (if (= (who at:(last To)) 3) (mapEntry ""NoDoctrine"" 8) (if (= (who at:(last To)) 4) (mapEntry ""NoDoctrine"" 8) 0)))) 4) (if False (if (= (who at:(last From)) 1) (mapEntry ""NoDoctrine"" 10) (if (= (who at:(last From)) 2) (mapEntry ""NoDoctrine"" 10) (if (= (who at:(last From)) 3) (mapEntry ""NoDoctrine"" 10) (if (= (who at:(last From)) 4) (mapEntry ""NoDoctrine"" 10) 0)))) (if (= (who at:(last From)) 1) (mapEntry ""NoDoctrine"" 9) (if (= (who at:(last From)) 2) (mapEntry ""NoDoctrine"" 9) (if (= (who at:(last From)) 3) (mapEntry ""NoDoctrine"" 9) (if (= (who at:(last From)) 4) (mapEntry ""NoDoctrine"" 9) 0))))) (value Random (range (if (= (who at:(last From)) 1) (mapEntry ""NoDoctrine"" 11) (if (= (who at:(last From)) 2) (mapEntry ""NoDoctrine"" 11) (if (= (who at:(last From)) 3) (mapEntry ""NoDoctrine"" 11) (if (= (who at:(last From)) 4) (mapEntry ""NoDoctrine"" 11) 0)))) (if (= (who at:(last From)) 1) (mapEntry ""NoDoctrine"" 12) (if (= (who at:(last From)) 2) (mapEntry ""NoDoctrine"" 12) (if (= (who at:(last From)) 3) (mapEntry ""NoDoctrine"" 12) (if (= (who at:(last From)) 4) (mapEntry ""NoDoctrine"" 12) 0))))))})) 128000)))) (set State at:(last From) 0)) next:(if (and (= 8 (state at:(last To))) (!= (mover) (who at:(last To)))) (if (= (value Piece at:(last To)) 0) (and {(take Control of:All by:Mover at:(last To)) (set Value at:(last To) 50)}) (set Value at:(last To) (value Piece at:(last To)))) (if (= (value Piece at:(last To)) 0) (remove (last To)) (if (and {(= 0 (count Sites in:(intersection (sites {(last To) (last From)}) (sites Occupied by:All components:{""Launcher"" ""Artillery"" ""Battleship"" ""Antiair""})))) (if (is In (last To) (sites Occupied by:Enemy components:{""Bomber"" ""Battleship"" ""Artillery"" ""Launcher""})) (is In (last From) (union (sites Occupied by:Mover components:{""Soldier"" ""Motorbike"" ""Tank"" ""Speeder"" ""Shooter"" ""Launcher"" ""Antiair"" ""Battleship"" ""Artillery"" ""Base"" ""Town"" ""Factory"" ""Dock"" ""Airport"" ""Cruiser"" ""Submarine""}) (sites Occupied by:Neutral container:""Board""))) (is In (last From) (union (sites Occupied by:Mover) (sites Occupied by:Neutral container:""Board"")))) (if (is In (last To) (sites Occupied by:Enemy components:{""Antiair"" ""Fighter""})) (is In (last From) (sites Occupied by:Mover components:{""Fighter"" ""Helicopter"" ""Bomber""})) (is In (last From) (union (sites Occupied by:Mover) (sites Occupied by:Neutral container:""Board"")))) (if (is In (last To) (sites Occupied by:Enemy components:{""Submarine""})) (is In (last From) (sites Occupied by:Mover components:{""Submarine"" ""Battleship"" ""Cruiser""})) (is In (last From) (union (sites Occupied by:Mover) (sites Occupied by:Neutral container:""Board""))))}) (if (<= (- (value Piece at:(last From)) (/ (* (if (is In (last From) (sites Occupied by:All container:""Board"" components:{""Fighter"" ""Bomber"" ""Helicopter""})) (max (/ (* (* (value Piece at:(last To)) 4) (mapEntry ""DamageMultiplier"" (what at:(last To)))) 100) 1) (if (and (is In (last From) (sites Occupied by:All container:""Board"" components:{""Soldier"" ""Motorbike""})) (is In (last To) (sites Occupied by:All component:""Shooter""))) (if (is In (last From) (sites ""Forest"")) (max (/ (* (* (value Piece at:(last To)) 6) (mapEntry ""DamageMultiplier"" (what at:(last To)))) 100) 1) (if (is In (last From) (union (sites ""ShallowWater"") (sites ""DeepWater""))) (max (/ (* (* (value Piece at:(last To)) 10) (mapEntry ""DamageMultiplier"" (what at:(last To)))) 100) 1) (max (/ (* (* (value Piece at:(last To)) 8) (mapEntry ""DamageMultiplier"" (what at:(last To)))) 100) 1))) (if (is In (last From) (sites ""Forest"")) (max (/ (* (* (value Piece at:(last To)) 3) (mapEntry ""DamageMultiplier"" (what at:(last To)))) 100) 1) (if (is In (last From) (union (sites ""ShallowWater"") (sites ""DeepWater""))) (max (/ (* (* (value Piece at:(last To)) 5) (mapEntry ""DamageMultiplier"" (what at:(last To)))) 100) 1) (max (/ (* (* (value Piece at:(last To)) 4) (mapEntry ""DamageMultiplier"" (what at:(last To)))) 100) 1))))) (* {(if (is In (last To) (sites Occupied by:All container:""Board"" components:{""Soldier"" ""Motorbike""})) (if (= (who at:(last To)) 1) (mapEntry ""NoDoctrine"" 1) (if (= (who at:(last To)) 2) (mapEntry ""NoDoctrine"" 1) (if (= (who at:(last To)) 3) (mapEntry ""NoDoctrine"" 1) (if (= (who at:(last To)) 4) (mapEntry ""NoDoctrine"" 1) 0)))) (if (is In (last To) (sites Occupied by:All container:""Board"" components:{""Tank"" ""Speeder"" ""Shooter""})) (if (= (who at:(last To)) 1) (mapEntry ""NoDoctrine"" 2) (if (= (who at:(last To)) 2) (mapEntry ""NoDoctrine"" 2) (if (= (who at:(last To)) 3) (mapEntry ""NoDoctrine"" 2) (if (= (who at:(last To)) 4) (mapEntry ""NoDoctrine"" 2) 0)))) (if (is In (last To) (sites Occupied by:All container:""Board"" components:{""Launcher"" ""Antiair"" ""Artillery""})) (if (= (who at:(last To)) 1) (mapEntry ""NoDoctrine"" 3) (if (= (who at:(last To)) 2) (mapEntry ""NoDoctrine"" 3) (if (= (who at:(last To)) 3) (mapEntry ""NoDoctrine"" 3) (if (= (who at:(last To)) 4) (mapEntry ""NoDoctrine"" 3) 0)))) (if (is In (last To) (sites Occupied by:All container:""Board"" components:{""Fighter"" ""Bomber"" ""Helicopter""})) (if (= (who at:(last To)) 1) (mapEntry ""NoDoctrine"" 4) (if (= (who at:(last To)) 2) (mapEntry ""NoDoctrine"" 4) (if (= (who at:(last To)) 3) (mapEntry ""NoDoctrine"" 4) (if (= (who at:(last To)) 4) (mapEntry ""NoDoctrine"" 4) 0)))) (if (is In (last To) (sites Occupied by:All container:""Board"" components:{""Submarine"" ""Cruiser"" ""Battleship""})) (if (= (who at:(last To)) 1) (mapEntry ""NoDoctrine"" 5) (if (= (who at:(last To)) 2) (mapEntry ""NoDoctrine"" 5) (if (= (who at:(last To)) 3) (mapEntry ""NoDoctrine"" 5) (if (= (who at:(last To)) 4) (mapEntry ""NoDoctrine"" 5) 0)))) 4))))) (if (and (= 8 (state at:(last From))) (!= (mover) (who at:(last From)))) (if (= (who at:(last To)) 1) (mapEntry ""NoDoctrine"" 6) (if (= (who at:(last To)) 2) (mapEntry ""NoDoctrine"" 6) (if (= (who at:(last To)) 3) (mapEntry ""NoDoctrine"" 6) (if (= (who at:(last To)) 4) (mapEntry ""NoDoctrine"" 6) 0)))) 5) (if (> (who at:(last From)) 0) (if (= (who at:(last From)) 1) (mapEntry ""NoDoctrine"" 8) (if (= (who at:(last From)) 2) (mapEntry ""NoDoctrine"" 8) (if (= (who at:(last From)) 3) (mapEntry ""NoDoctrine"" 8) (if (= (who at:(last From)) 4) (mapEntry ""NoDoctrine"" 8) 0)))) 4) (if True (if (= (who at:(last To)) 1) (mapEntry ""NoDoctrine"" 10) (if (= (who at:(last To)) 2) (mapEntry ""NoDoctrine"" 10) (if (= (who at:(last To)) 3) (mapEntry ""NoDoctrine"" 10) (if (= (who at:(last To)) 4) (mapEntry ""NoDoctrine"" 10) 0)))) (if (= (who at:(last To)) 1) (mapEntry ""NoDoctrine"" 9) (if (= (who at:(last To)) 2) (mapEntry ""NoDoctrine"" 9) (if (= (who at:(last To)) 3) (mapEntry ""NoDoctrine"" 9) (if (= (who at:(last To)) 4) (mapEntry ""NoDoctrine"" 9) 0))))) (value Random (range (if (= (who at:(last To)) 1) (mapEntry ""NoDoctrine"" 11) (if (= (who at:(last To)) 2) (mapEntry ""NoDoctrine"" 11) (if (= (who at:(last To)) 3) (mapEntry ""NoDoctrine"" 11) (if (= (who at:(last To)) 4) (mapEntry ""NoDoctrine"" 11) 0)))) (if (= (who at:(last To)) 1) (mapEntry ""NoDoctrine"" 12) (if (= (who at:(last To)) 2) (mapEntry ""NoDoctrine"" 12) (if (= (who at:(last To)) 3) (mapEntry ""NoDoctrine"" 12) (if (= (who at:(last To)) 4) (mapEntry ""NoDoctrine"" 12) 0))))))})) 128000)) 0) (remove (last From)) (set Value at:(last From) (- (value Piece at:(last From)) (/ (* (if (is In (last From) (sites Occupied by:All container:""Board"" components:{""Fighter"" ""Bomber"" ""Helicopter""})) (max (/ (* (* (value Piece at:(last To)) 4) (mapEntry ""DamageMultiplier"" (what at:(last To)))) 100) 1) (if (and (is In (last From) (sites Occupied by:All container:""Board"" components:{""Soldier"" ""Motorbike""})) (is In (last To) (sites Occupied by:All component:""Shooter""))) (if (is In (last From) (sites ""Forest"")) (max (/ (* (* (value Piece at:(last To)) 6) (mapEntry ""DamageMultiplier"" (what at:(last To)))) 100) 1) (if (is In (last From) (union (sites ""ShallowWater"") (sites ""DeepWater""))) (max (/ (* (* (value Piece at:(last To)) 10) (mapEntry ""DamageMultiplier"" (what at:(last To)))) 100) 1) (max (/ (* (* (value Piece at:(last To)) 8) (mapEntry ""DamageMultiplier"" (what at:(last To)))) 100) 1))) (if (is In (last From) (sites ""Forest"")) (max (/ (* (* (value Piece at:(last To)) 3) (mapEntry ""DamageMultiplier"" (what at:(last To)))) 100) 1) (if (is In (last From) (union (sites ""ShallowWater"") (sites ""DeepWater""))) (max (/ (* (* (value Piece at:(last To)) 5) (mapEntry ""DamageMultiplier"" (what at:(last To)))) 100) 1) (max (/ (* (* (value Piece at:(last To)) 4) (mapEntry ""DamageMultiplier"" (what at:(last To)))) 100) 1))))) (* {(if (is In (last To) (sites Occupied by:All container:""Board"" components:{""Soldier"" ""Motorbike""})) (if (= (who at:(last To)) 1) (mapEntry ""NoDoctrine"" 1) (if (= (who at:(last To)) 2) (mapEntry ""NoDoctrine"" 1) (if (= (who at:(last To)) 3) (mapEntry ""NoDoctrine"" 1) (if (= (who at:(last To)) 4) (mapEntry ""NoDoctrine"" 1) 0)))) (if (is In (last To) (sites Occupied by:All container:""Board"" components:{""Tank"" ""Speeder"" ""Shooter""})) (if (= (who at:(last To)) 1) (mapEntry ""NoDoctrine"" 2) (if (= (who at:(last To)) 2) (mapEntry ""NoDoctrine"" 2) (if (= (who at:(last To)) 3) (mapEntry ""NoDoctrine"" 2) (if (= (who at:(last To)) 4) (mapEntry ""NoDoctrine"" 2) 0)))) (if (is In (last To) (sites Occupied by:All container:""Board"" components:{""Launcher"" ""Antiair"" ""Artillery""})) (if (= (who at:(last To)) 1) (mapEntry ""NoDoctrine"" 3) (if (= (who at:(last To)) 2) (mapEntry ""NoDoctrine"" 3) (if (= (who at:(last To)) 3) (mapEntry ""NoDoctrine"" 3) (if (= (who at:(last To)) 4) (mapEntry ""NoDoctrine"" 3) 0)))) (if (is In (last To) (sites Occupied by:All container:""Board"" components:{""Fighter"" ""Bomber"" ""Helicopter""})) (if (= (who at:(last To)) 1) (mapEntry ""NoDoctrine"" 4) (if (= (who at:(last To)) 2) (mapEntry ""NoDoctrine"" 4) (if (= (who at:(last To)) 3) (mapEntry ""NoDoctrine"" 4) (if (= (who at:(last To)) 4) (mapEntry ""NoDoctrine"" 4) 0)))) (if (is In (last To) (sites Occupied by:All container:""Board"" components:{""Submarine"" ""Cruiser"" ""Battleship""})) (if (= (who at:(last To)) 1) (mapEntry ""NoDoctrine"" 5) (if (= (who at:(last To)) 2) (mapEntry ""NoDoctrine"" 5) (if (= (who at:(last To)) 3) (mapEntry ""NoDoctrine"" 5) (if (= (who at:(last To)) 4) (mapEntry ""NoDoctrine"" 5) 0)))) 4))))) (if (and (= 8 (state at:(last From))) (!= (mover) (who at:(last From)))) (if (= (who at:(last To)) 1) (mapEntry ""NoDoctrine"" 6) (if (= (who at:(last To)) 2) (mapEntry ""NoDoctrine"" 6) (if (= (who at:(last To)) 3) (mapEntry ""NoDoctrine"" 6) (if (= (who at:(last To)) 4) (mapEntry ""NoDoctrine"" 6) 0)))) 5) (if (> (who at:(last From)) 0) (if (= (who at:(last From)) 1) (mapEntry ""NoDoctrine"" 8) (if (= (who at:(last From)) 2) (mapEntry ""NoDoctrine"" 8) (if (= (who at:(last From)) 3) (mapEntry ""NoDoctrine"" 8) (if (= (who at:(last From)) 4) (mapEntry ""NoDoctrine"" 8) 0)))) 4) (if True (if (= (who at:(last To)) 1) (mapEntry ""NoDoctrine"" 10) (if (= (who at:(last To)) 2) (mapEntry ""NoDoctrine"" 10) (if (= (who at:(last To)) 3) (mapEntry ""NoDoctrine"" 10) (if (= (who at:(last To)) 4) (mapEntry ""NoDoctrine"" 10) 0)))) (if (= (who at:(last To)) 1) (mapEntry ""NoDoctrine"" 9) (if (= (who at:(last To)) 2) (mapEntry ""NoDoctrine"" 9) (if (= (who at:(last To)) 3) (mapEntry ""NoDoctrine"" 9) (if (= (who at:(last To)) 4) (mapEntry ""NoDoctrine"" 9) 0))))) (value Random (range (if (= (who at:(last To)) 1) (mapEntry ""NoDoctrine"" 11) (if (= (who at:(last To)) 2) (mapEntry ""NoDoctrine"" 11) (if (= (who at:(last To)) 3) (mapEntry ""NoDoctrine"" 11) (if (= (who at:(last To)) 4) (mapEntry ""NoDoctrine"" 11) 0)))) (if (= (who at:(last To)) 1) (mapEntry ""NoDoctrine"" 12) (if (= (who at:(last To)) 2) (mapEntry ""NoDoctrine"" 12) (if (= (who at:(last To)) 3) (mapEntry ""NoDoctrine"" 12) (if (= (who at:(last To)) 4) (mapEntry ""NoDoctrine"" 12) 0))))))})) 128000)))) (set Value at:(last From) (value Piece at:(last From))))))))) (move Select (from (from) if:(and (> (state at:(from)) 0) (< (value Piece at:(from)) (mapEntry ""MaxHealth"" (what at:(from)))))) (to (sites Around (from) Orthogonal if:(is In (to) (sites Occupied by:Mover container:""Board"" components:{""Town"" ""Dock"" ""Base"" ""Factory"" ""Airport""})))) (then (and {(set Value at:(last From) (min (mapEntry ""MaxHealth"" (what at:(last From))) (- (+ (value Piece at:(last From)) (value Piece at:(last To))) 1))) (set Value at:(last To) (max (- (value Piece at:(last To)) (- (mapEntry ""MaxHealth"" (what at:(last From))) (value Piece at:(last From)))) 1)) (set State at:(last From) 0)}))) (move Select (from (from) if:(> (state at:(from)) 0)) (to (sites Around (from) Orthogonal if:(and (= (what at:(from)) (what at:(to))) (< (value Piece at:(to)) (mapEntry ""MaxHealth"" (what at:(to))))))) (then (and {(if (<= (+ (value Piece at:(last To)) (value Piece at:(last From))) (mapEntry ""MaxHealth"" (what at:(last From)))) (and (set Value at:(last To) (min (mapEntry ""MaxHealth"" (what at:(last From))) (+ (value Piece at:(last From)) (value Piece at:(last To))))) (remove (last From))) (and (set Value at:(last To) (min (mapEntry ""MaxHealth"" (what at:(last From))) (- (+ (value Piece at:(last From)) (value Piece at:(last To))) 1))) (set Value at:(last From) (max (- (value Piece at:(last To)) (- (mapEntry ""MaxHealth"" (what at:(last From))) (value Piece at:(last From)))) 1)))) (set State at:(last From) 0) (set State at:(last To) 0)})))})) (piece ""Cruiser"" Each (or {(move (from (from) if:(> (state at:(from)) 1)) (to (sites Distance (step Orthogonal (to if:(is In (to) (difference (union (sites Empty) (sites Occupied by:Friend container:""Board"")) (union (sites ""Mountain"") (difference (sites Board) (union (sites ""ShallowWater"") (sites ""DeepWater"")))))))) from:(from) (range 1 (- (state at:(from)) 1))) if:(is Empty (to)) (apply (set State at:(from) 1)))) (move Select (from (from) if:(> (state at:(from)) 0)) (to (sites Distance Orthogonal from:(from) (range 1 1)) if:(and {(if (is In (from) (sites Occupied by:Mover container:""Board"" components:{""Bomber"" ""Battleship"" ""Artillery"" ""Launcher""})) (is In (to) (union (sites Occupied by:Enemy container:""Board"" components:{""Soldier"" ""Motorbike"" ""Tank"" ""Speeder"" ""Shooter"" ""Launcher"" ""Antiair"" ""Battleship"" ""Artillery"" ""Base"" ""Town"" ""Factory"" ""Dock"" ""Airport"" ""Cruiser"" ""Submarine""}) (sites Occupied by:Neutral container:""Board""))) (is In (to) (union (sites Occupied by:Enemy container:""Board"") (sites Occupied by:Neutral container:""Board"")))) (if (is In (from) (sites Occupied by:Mover container:""Board"" components:{""Antiair"" ""Fighter""})) (is In (to) (sites Occupied by:Enemy container:""Board"" components:{""Fighter"" ""Helicopter"" ""Bomber""})) (is In (to) (union (sites Occupied by:Enemy container:""Board"") (sites Occupied by:Neutral container:""Board"")))) (if (is In (from) (sites Occupied by:Mover container:""Board"" components:{""Submarine""})) (is In (to) (sites Occupied by:Enemy container:""Board"" components:{""Submarine"" ""Battleship"" ""Cruiser""})) (is In (to) (union (sites Occupied by:Enemy container:""Board"") (sites Occupied by:Neutral container:""Board""))))})) (then (do (and (set Value at:(last To) (max 0 (- (value Piece at:(last To)) (/ (* (if (is In (last To) (sites Occupied by:All container:""Board"" components:{""Fighter"" ""Bomber"" ""Helicopter""})) (max (/ (* (* (value Piece at:(last From)) 4) (mapEntry ""DamageMultiplier"" (what at:(last From)))) 100) 1) (if (and (is In (last To) (sites Occupied by:All container:""Board"" components:{""Soldier"" ""Motorbike""})) (is In (last From) (sites Occupied by:All component:""Shooter""))) (if (is In (last To) (sites ""Forest"")) (max (/ (* (* (value Piece at:(last From)) 6) (mapEntry ""DamageMultiplier"" (what at:(last From)))) 100) 1) (if (is In (last To) (union (sites ""ShallowWater"") (sites ""DeepWater""))) (max (/ (* (* (value Piece at:(last From)) 10) (mapEntry ""DamageMultiplier"" (what at:(last From)))) 100) 1) (max (/ (* (* (value Piece at:(last From)) 8) (mapEntry ""DamageMultiplier"" (what at:(last From)))) 100) 1))) (if (is In (last To) (sites ""Forest"")) (max (/ (* (* (value Piece at:(last From)) 3) (mapEntry ""DamageMultiplier"" (what at:(last From)))) 100) 1) (if (is In (last To) (union (sites ""ShallowWater"") (sites ""DeepWater""))) (max (/ (* (* (value Piece at:(last From)) 5) (mapEntry ""DamageMultiplier"" (what at:(last From)))) 100) 1) (max (/ (* (* (value Piece at:(last From)) 4) (mapEntry ""DamageMultiplier"" (what at:(last From)))) 100) 1))))) (* {(if (is In (last From) (sites Occupied by:All container:""Board"" components:{""Soldier"" ""Motorbike""})) (if (= (who at:(last From)) 1) (mapEntry ""NoDoctrine"" 1) (if (= (who at:(last From)) 2) (mapEntry ""NoDoctrine"" 1) (if (= (who at:(last From)) 3) (mapEntry ""NoDoctrine"" 1) (if (= (who at:(last From)) 4) (mapEntry ""NoDoctrine"" 1) 0)))) (if (is In (last From) (sites Occupied by:All container:""Board"" components:{""Tank"" ""Speeder"" ""Shooter""})) (if (= (who at:(last From)) 1) (mapEntry ""NoDoctrine"" 2) (if (= (who at:(last From)) 2) (mapEntry ""NoDoctrine"" 2) (if (= (who at:(last From)) 3) (mapEntry ""NoDoctrine"" 2) (if (= (who at:(last From)) 4) (mapEntry ""NoDoctrine"" 2) 0)))) (if (is In (last From) (sites Occupied by:All container:""Board"" components:{""Launcher"" ""Antiair"" ""Artillery""})) (if (= (who at:(last From)) 1) (mapEntry ""NoDoctrine"" 3) (if (= (who at:(last From)) 2) (mapEntry ""NoDoctrine"" 3) (if (= (who at:(last From)) 3) (mapEntry ""NoDoctrine"" 3) (if (= (who at:(last From)) 4) (mapEntry ""NoDoctrine"" 3) 0)))) (if (is In (last From) (sites Occupied by:All container:""Board"" components:{""Fighter"" ""Bomber"" ""Helicopter""})) (if (= (who at:(last From)) 1) (mapEntry ""NoDoctrine"" 4) (if (= (who at:(last From)) 2) (mapEntry ""NoDoctrine"" 4) (if (= (who at:(last From)) 3) (mapEntry ""NoDoctrine"" 4) (if (= (who at:(last From)) 4) (mapEntry ""NoDoctrine"" 4) 0)))) (if (is In (last From) (sites Occupied by:All container:""Board"" components:{""Submarine"" ""Cruiser"" ""Battleship""})) (if (= (who at:(last From)) 1) (mapEntry ""NoDoctrine"" 5) (if (= (who at:(last From)) 2) (mapEntry ""NoDoctrine"" 5) (if (= (who at:(last From)) 3) (mapEntry ""NoDoctrine"" 5) (if (= (who at:(last From)) 4) (mapEntry ""NoDoctrine"" 5) 0)))) 4))))) (if (and (= 8 (state at:(last To))) (!= (mover) (who at:(last To)))) (if (= (who at:(last From)) 1) (mapEntry ""NoDoctrine"" 6) (if (= (who at:(last From)) 2) (mapEntry ""NoDoctrine"" 6) (if (= (who at:(last From)) 3) (mapEntry ""NoDoctrine"" 6) (if (= (who at:(last From)) 4) (mapEntry ""NoDoctrine"" 6) 0)))) 5) (if (> (who at:(last To)) 0) (if (= (who at:(last To)) 1) (mapEntry ""NoDoctrine"" 8) (if (= (who at:(last To)) 2) (mapEntry ""NoDoctrine"" 8) (if (= (who at:(last To)) 3) (mapEntry ""NoDoctrine"" 8) (if (= (who at:(last To)) 4) (mapEntry ""NoDoctrine"" 8) 0)))) 4) (if False (if (= (who at:(last From)) 1) (mapEntry ""NoDoctrine"" 10) (if (= (who at:(last From)) 2) (mapEntry ""NoDoctrine"" 10) (if (= (who at:(last From)) 3) (mapEntry ""NoDoctrine"" 10) (if (= (who at:(last From)) 4) (mapEntry ""NoDoctrine"" 10) 0)))) (if (= (who at:(last From)) 1) (mapEntry ""NoDoctrine"" 9) (if (= (who at:(last From)) 2) (mapEntry ""NoDoctrine"" 9) (if (= (who at:(last From)) 3) (mapEntry ""NoDoctrine"" 9) (if (= (who at:(last From)) 4) (mapEntry ""NoDoctrine"" 9) 0))))) (value Random (range (if (= (who at:(last From)) 1) (mapEntry ""NoDoctrine"" 11) (if (= (who at:(last From)) 2) (mapEntry ""NoDoctrine"" 11) (if (= (who at:(last From)) 3) (mapEntry ""NoDoctrine"" 11) (if (= (who at:(last From)) 4) (mapEntry ""NoDoctrine"" 11) 0)))) (if (= (who at:(last From)) 1) (mapEntry ""NoDoctrine"" 12) (if (= (who at:(last From)) 2) (mapEntry ""NoDoctrine"" 12) (if (= (who at:(last From)) 3) (mapEntry ""NoDoctrine"" 12) (if (= (who at:(last From)) 4) (mapEntry ""NoDoctrine"" 12) 0))))))})) 128000)))) (set State at:(last From) 0)) next:(if (and (= 8 (state at:(last To))) (!= (mover) (who at:(last To)))) (if (= (value Piece at:(last To)) 0) (and {(take Control of:All by:Mover at:(last To)) (set Value at:(last To) 50)}) (set Value at:(last To) (value Piece at:(last To)))) (if (= (value Piece at:(last To)) 0) (remove (last To)) (if (and {(= 0 (count Sites in:(intersection (sites {(last To) (last From)}) (sites Occupied by:All components:{""Launcher"" ""Artillery"" ""Battleship"" ""Antiair""})))) (if (is In (last To) (sites Occupied by:Enemy components:{""Bomber"" ""Battleship"" ""Artillery"" ""Launcher""})) (is In (last From) (union (sites Occupied by:Mover components:{""Soldier"" ""Motorbike"" ""Tank"" ""Speeder"" ""Shooter"" ""Launcher"" ""Antiair"" ""Battleship"" ""Artillery"" ""Base"" ""Town"" ""Factory"" ""Dock"" ""Airport"" ""Cruiser"" ""Submarine""}) (sites Occupied by:Neutral container:""Board""))) (is In (last From) (union (sites Occupied by:Mover) (sites Occupied by:Neutral container:""Board"")))) (if (is In (last To) (sites Occupied by:Enemy components:{""Antiair"" ""Fighter""})) (is In (last From) (sites Occupied by:Mover components:{""Fighter"" ""Helicopter"" ""Bomber""})) (is In (last From) (union (sites Occupied by:Mover) (sites Occupied by:Neutral container:""Board"")))) (if (is In (last To) (sites Occupied by:Enemy components:{""Submarine""})) (is In (last From) (sites Occupied by:Mover components:{""Submarine"" ""Battleship"" ""Cruiser""})) (is In (last From) (union (sites Occupied by:Mover) (sites Occupied by:Neutral container:""Board""))))}) (if (<= (- (value Piece at:(last From)) (/ (* (if (is In (last From) (sites Occupied by:All container:""Board"" components:{""Fighter"" ""Bomber"" ""Helicopter""})) (max (/ (* (* (value Piece at:(last To)) 4) (mapEntry ""DamageMultiplier"" (what at:(last To)))) 100) 1) (if (and (is In (last From) (sites Occupied by:All container:""Board"" components:{""Soldier"" ""Motorbike""})) (is In (last To) (sites Occupied by:All component:""Shooter""))) (if (is In (last From) (sites ""Forest"")) (max (/ (* (* (value Piece at:(last To)) 6) (mapEntry ""DamageMultiplier"" (what at:(last To)))) 100) 1) (if (is In (last From) (union (sites ""ShallowWater"") (sites ""DeepWater""))) (max (/ (* (* (value Piece at:(last To)) 10) (mapEntry ""DamageMultiplier"" (what at:(last To)))) 100) 1) (max (/ (* (* (value Piece at:(last To)) 8) (mapEntry ""DamageMultiplier"" (what at:(last To)))) 100) 1))) (if (is In (last From) (sites ""Forest"")) (max (/ (* (* (value Piece at:(last To)) 3) (mapEntry ""DamageMultiplier"" (what at:(last To)))) 100) 1) (if (is In (last From) (union (sites ""ShallowWater"") (sites ""DeepWater""))) (max (/ (* (* (value Piece at:(last To)) 5) (mapEntry ""DamageMultiplier"" (what at:(last To)))) 100) 1) (max (/ (* (* (value Piece at:(last To)) 4) (mapEntry ""DamageMultiplier"" (what at:(last To)))) 100) 1))))) (* {(if (is In (last To) (sites Occupied by:All container:""Board"" components:{""Soldier"" ""Motorbike""})) (if (= (who at:(last To)) 1) (mapEntry ""NoDoctrine"" 1) (if (= (who at:(last To)) 2) (mapEntry ""NoDoctrine"" 1) (if (= (who at:(last To)) 3) (mapEntry ""NoDoctrine"" 1) (if (= (who at:(last To)) 4) (mapEntry ""NoDoctrine"" 1) 0)))) (if (is In (last To) (sites Occupied by:All container:""Board"" components:{""Tank"" ""Speeder"" ""Shooter""})) (if (= (who at:(last To)) 1) (mapEntry ""NoDoctrine"" 2) (if (= (who at:(last To)) 2) (mapEntry ""NoDoctrine"" 2) (if (= (who at:(last To)) 3) (mapEntry ""NoDoctrine"" 2) (if (= (who at:(last To)) 4) (mapEntry ""NoDoctrine"" 2) 0)))) (if (is In (last To) (sites Occupied by:All container:""Board"" components:{""Launcher"" ""Antiair"" ""Artillery""})) (if (= (who at:(last To)) 1) (mapEntry ""NoDoctrine"" 3) (if (= (who at:(last To)) 2) (mapEntry ""NoDoctrine"" 3) (if (= (who at:(last To)) 3) (mapEntry ""NoDoctrine"" 3) (if (= (who at:(last To)) 4) (mapEntry ""NoDoctrine"" 3) 0)))) (if (is In (last To) (sites Occupied by:All container:""Board"" components:{""Fighter"" ""Bomber"" ""Helicopter""})) (if (= (who at:(last To)) 1) (mapEntry ""NoDoctrine"" 4) (if (= (who at:(last To)) 2) (mapEntry ""NoDoctrine"" 4) (if (= (who at:(last To)) 3) (mapEntry ""NoDoctrine"" 4) (if (= (who at:(last To)) 4) (mapEntry ""NoDoctrine"" 4) 0)))) (if (is In (last To) (sites Occupied by:All container:""Board"" components:{""Submarine"" ""Cruiser"" ""Battleship""})) (if (= (who at:(last To)) 1) (mapEntry ""NoDoctrine"" 5) (if (= (who at:(last To)) 2) (mapEntry ""NoDoctrine"" 5) (if (= (who at:(last To)) 3) (mapEntry ""NoDoctrine"" 5) (if (= (who at:(last To)) 4) (mapEntry ""NoDoctrine"" 5) 0)))) 4))))) (if (and (= 8 (state at:(last From))) (!= (mover) (who at:(last From)))) (if (= (who at:(last To)) 1) (mapEntry ""NoDoctrine"" 6) (if (= (who at:(last To)) 2) (mapEntry ""NoDoctrine"" 6) (if (= (who at:(last To)) 3) (mapEntry ""NoDoctrine"" 6) (if (= (who at:(last To)) 4) (mapEntry ""NoDoctrine"" 6) 0)))) 5) (if (> (who at:(last From)) 0) (if (= (who at:(last From)) 1) (mapEntry ""NoDoctrine"" 8) (if (= (who at:(last From)) 2) (mapEntry ""NoDoctrine"" 8) (if (= (who at:(last From)) 3) (mapEntry ""NoDoctrine"" 8) (if (= (who at:(last From)) 4) (mapEntry ""NoDoctrine"" 8) 0)))) 4) (if True (if (= (who at:(last To)) 1) (mapEntry ""NoDoctrine"" 10) (if (= (who at:(last To)) 2) (mapEntry ""NoDoctrine"" 10) (if (= (who at:(last To)) 3) (mapEntry ""NoDoctrine"" 10) (if (= (who at:(last To)) 4) (mapEntry ""NoDoctrine"" 10) 0)))) (if (= (who at:(last To)) 1) (mapEntry ""NoDoctrine"" 9) (if (= (who at:(last To)) 2) (mapEntry ""NoDoctrine"" 9) (if (= (who at:(last To)) 3) (mapEntry ""NoDoctrine"" 9) (if (= (who at:(last To)) 4) (mapEntry ""NoDoctrine"" 9) 0))))) (value Random (range (if (= (who at:(last To)) 1) (mapEntry ""NoDoctrine"" 11) (if (= (who at:(last To)) 2) (mapEntry ""NoDoctrine"" 11) (if (= (who at:(last To)) 3) (mapEntry ""NoDoctrine"" 11) (if (= (who at:(last To)) 4) (mapEntry ""NoDoctrine"" 11) 0)))) (if (= (who at:(last To)) 1) (mapEntry ""NoDoctrine"" 12) (if (= (who at:(last To)) 2) (mapEntry ""NoDoctrine"" 12) (if (= (who at:(last To)) 3) (mapEntry ""NoDoctrine"" 12) (if (= (who at:(last To)) 4) (mapEntry ""NoDoctrine"" 12) 0))))))})) 128000)) 0) (remove (last From)) (set Value at:(last From) (- (value Piece at:(last From)) (/ (* (if (is In (last From) (sites Occupied by:All container:""Board"" components:{""Fighter"" ""Bomber"" ""Helicopter""})) (max (/ (* (* (value Piece at:(last To)) 4) (mapEntry ""DamageMultiplier"" (what at:(last To)))) 100) 1) (if (and (is In (last From) (sites Occupied by:All container:""Board"" components:{""Soldier"" ""Motorbike""})) (is In (last To) (sites Occupied by:All component:""Shooter""))) (if (is In (last From) (sites ""Forest"")) (max (/ (* (* (value Piece at:(last To)) 6) (mapEntry ""DamageMultiplier"" (what at:(last To)))) 100) 1) (if (is In (last From) (union (sites ""ShallowWater"") (sites ""DeepWater""))) (max (/ (* (* (value Piece at:(last To)) 10) (mapEntry ""DamageMultiplier"" (what at:(last To)))) 100) 1) (max (/ (* (* (value Piece at:(last To)) 8) (mapEntry ""DamageMultiplier"" (what at:(last To)))) 100) 1))) (if (is In (last From) (sites ""Forest"")) (max (/ (* (* (value Piece at:(last To)) 3) (mapEntry ""DamageMultiplier"" (what at:(last To)))) 100) 1) (if (is In (last From) (union (sites ""ShallowWater"") (sites ""DeepWater""))) (max (/ (* (* (value Piece at:(last To)) 5) (mapEntry ""DamageMultiplier"" (what at:(last To)))) 100) 1) (max (/ (* (* (value Piece at:(last To)) 4) (mapEntry ""DamageMultiplier"" (what at:(last To)))) 100) 1))))) (* {(if (is In (last To) (sites Occupied by:All container:""Board"" components:{""Soldier"" ""Motorbike""})) (if (= (who at:(last To)) 1) (mapEntry ""NoDoctrine"" 1) (if (= (who at:(last To)) 2) (mapEntry ""NoDoctrine"" 1) (if (= (who at:(last To)) 3) (mapEntry ""NoDoctrine"" 1) (if (= (who at:(last To)) 4) (mapEntry ""NoDoctrine"" 1) 0)))) (if (is In (last To) (sites Occupied by:All container:""Board"" components:{""Tank"" ""Speeder"" ""Shooter""})) (if (= (who at:(last To)) 1) (mapEntry ""NoDoctrine"" 2) (if (= (who at:(last To)) 2) (mapEntry ""NoDoctrine"" 2) (if (= (who at:(last To)) 3) (mapEntry ""NoDoctrine"" 2) (if (= (who at:(last To)) 4) (mapEntry ""NoDoctrine"" 2) 0)))) (if (is In (last To) (sites Occupied by:All container:""Board"" components:{""Launcher"" ""Antiair"" ""Artillery""})) (if (= (who at:(last To)) 1) (mapEntry ""NoDoctrine"" 3) (if (= (who at:(last To)) 2) (mapEntry ""NoDoctrine"" 3) (if (= (who at:(last To)) 3) (mapEntry ""NoDoctrine"" 3) (if (= (who at:(last To)) 4) (mapEntry ""NoDoctrine"" 3) 0)))) (if (is In (last To) (sites Occupied by:All container:""Board"" components:{""Fighter"" ""Bomber"" ""Helicopter""})) (if (= (who at:(last To)) 1) (mapEntry ""NoDoctrine"" 4) (if (= (who at:(last To)) 2) (mapEntry ""NoDoctrine"" 4) (if (= (who at:(last To)) 3) (mapEntry ""NoDoctrine"" 4) (if (= (who at:(last To)) 4) (mapEntry ""NoDoctrine"" 4) 0)))) (if (is In (last To) (sites Occupied by:All container:""Board"" components:{""Submarine"" ""Cruiser"" ""Battleship""})) (if (= (who at:(last To)) 1) (mapEntry ""NoDoctrine"" 5) (if (= (who at:(last To)) 2) (mapEntry ""NoDoctrine"" 5) (if (= (who at:(last To)) 3) (mapEntry ""NoDoctrine"" 5) (if (= (who at:(last To)) 4) (mapEntry ""NoDoctrine"" 5) 0)))) 4))))) (if (and (= 8 (state at:(last From))) (!= (mover) (who at:(last From)))) (if (= (who at:(last To)) 1) (mapEntry ""NoDoctrine"" 6) (if (= (who at:(last To)) 2) (mapEntry ""NoDoctrine"" 6) (if (= (who at:(last To)) 3) (mapEntry ""NoDoctrine"" 6) (if (= (who at:(last To)) 4) (mapEntry ""NoDoctrine"" 6) 0)))) 5) (if (> (who at:(last From)) 0) (if (= (who at:(last From)) 1) (mapEntry ""NoDoctrine"" 8) (if (= (who at:(last From)) 2) (mapEntry ""NoDoctrine"" 8) (if (= (who at:(last From)) 3) (mapEntry ""NoDoctrine"" 8) (if (= (who at:(last From)) 4) (mapEntry ""NoDoctrine"" 8) 0)))) 4) (if True (if (= (who at:(last To)) 1) (mapEntry ""NoDoctrine"" 10) (if (= (who at:(last To)) 2) (mapEntry ""NoDoctrine"" 10) (if (= (who at:(last To)) 3) (mapEntry ""NoDoctrine"" 10) (if (= (who at:(last To)) 4) (mapEntry ""NoDoctrine"" 10) 0)))) (if (= (who at:(last To)) 1) (mapEntry ""NoDoctrine"" 9) (if (= (who at:(last To)) 2) (mapEntry ""NoDoctrine"" 9) (if (= (who at:(last To)) 3) (mapEntry ""NoDoctrine"" 9) (if (= (who at:(last To)) 4) (mapEntry ""NoDoctrine"" 9) 0))))) (value Random (range (if (= (who at:(last To)) 1) (mapEntry ""NoDoctrine"" 11) (if (= (who at:(last To)) 2) (mapEntry ""NoDoctrine"" 11) (if (= (who at:(last To)) 3) (mapEntry ""NoDoctrine"" 11) (if (= (who at:(last To)) 4) (mapEntry ""NoDoctrine"" 11) 0)))) (if (= (who at:(last To)) 1) (mapEntry ""NoDoctrine"" 12) (if (= (who at:(last To)) 2) (mapEntry ""NoDoctrine"" 12) (if (= (who at:(last To)) 3) (mapEntry ""NoDoctrine"" 12) (if (= (who at:(last To)) 4) (mapEntry ""NoDoctrine"" 12) 0))))))})) 128000)))) (set Value at:(last From) (value Piece at:(last From))))))))) (move Select (from (from) if:(and (> (state at:(from)) 0) (< (value Piece at:(from)) (mapEntry ""MaxHealth"" (what at:(from)))))) (to (sites Around (from) Orthogonal if:(is In (to) (sites Occupied by:Mover container:""Board"" components:{""Town"" ""Dock"" ""Base"" ""Factory"" ""Airport""})))) (then (and {(set Value at:(last From) (min (mapEntry ""MaxHealth"" (what at:(last From))) (- (+ (value Piece at:(last From)) (value Piece at:(last To))) 1))) (set Value at:(last To) (max (- (value Piece at:(last To)) (- (mapEntry ""MaxHealth"" (what at:(last From))) (value Piece at:(last From)))) 1)) (set State at:(last From) 0)}))) (move Select (from (from) if:(> (state at:(from)) 0)) (to (sites Around (from) Orthogonal if:(and (= (what at:(from)) (what at:(to))) (< (value Piece at:(to)) (mapEntry ""MaxHealth"" (what at:(to))))))) (then (and {(if (<= (+ (value Piece at:(last To)) (value Piece at:(last From))) (mapEntry ""MaxHealth"" (what at:(last From)))) (and (set Value at:(last To) (min (mapEntry ""MaxHealth"" (what at:(last From))) (+ (value Piece at:(last From)) (value Piece at:(last To))))) (remove (last From))) (and (set Value at:(last To) (min (mapEntry ""MaxHealth"" (what at:(last From))) (- (+ (value Piece at:(last From)) (value Piece at:(last To))) 1))) (set Value at:(last From) (max (- (value Piece at:(last To)) (- (mapEntry ""MaxHealth"" (what at:(last From))) (value Piece at:(last From)))) 1)))) (set State at:(last From) 0) (set State at:(last To) 0)})))})) (piece ""Submarine"" Each (or {(move (from (from) if:(> (state at:(from)) 1)) (to (sites Distance (step Orthogonal (to if:(is In (to) (difference (union (sites Empty) (sites Occupied by:Friend container:""Board"")) (union (sites ""Mountain"") (difference (sites Board) (union (sites ""ShallowWater"") (sites ""DeepWater"")))))))) from:(from) (range 1 (- (state at:(from)) 1))) if:(is Empty (to)) (apply (set State at:(from) 1)))) (move Select (from (from) if:(> (state at:(from)) 0)) (to (sites Distance Orthogonal from:(from) (range 1 1)) if:(and {(if (is In (from) (sites Occupied by:Mover container:""Board"" components:{""Bomber"" ""Battleship"" ""Artillery"" ""Launcher""})) (is In (to) (union (sites Occupied by:Enemy container:""Board"" components:{""Soldier"" ""Motorbike"" ""Tank"" ""Speeder"" ""Shooter"" ""Launcher"" ""Antiair"" ""Battleship"" ""Artillery"" ""Base"" ""Town"" ""Factory"" ""Dock"" ""Airport"" ""Cruiser"" ""Submarine""}) (sites Occupied by:Neutral container:""Board""))) (is In (to) (union (sites Occupied by:Enemy container:""Board"") (sites Occupied by:Neutral container:""Board"")))) (if (is In (from) (sites Occupied by:Mover container:""Board"" components:{""Antiair"" ""Fighter""})) (is In (to) (sites Occupied by:Enemy container:""Board"" components:{""Fighter"" ""Helicopter"" ""Bomber""})) (is In (to) (union (sites Occupied by:Enemy container:""Board"") (sites Occupied by:Neutral container:""Board"")))) (if (is In (from) (sites Occupied by:Mover container:""Board"" components:{""Submarine""})) (is In (to) (sites Occupied by:Enemy container:""Board"" components:{""Submarine"" ""Battleship"" ""Cruiser""})) (is In (to) (union (sites Occupied by:Enemy container:""Board"") (sites Occupied by:Neutral container:""Board""))))})) (then (do (and (set Value at:(last To) (max 0 (- (value Piece at:(last To)) (/ (* (if (is In (last To) (sites Occupied by:All container:""Board"" components:{""Fighter"" ""Bomber"" ""Helicopter""})) (max (/ (* (* (value Piece at:(last From)) 4) (mapEntry ""DamageMultiplier"" (what at:(last From)))) 100) 1) (if (and (is In (last To) (sites Occupied by:All container:""Board"" components:{""Soldier"" ""Motorbike""})) (is In (last From) (sites Occupied by:All component:""Shooter""))) (if (is In (last To) (sites ""Forest"")) (max (/ (* (* (value Piece at:(last From)) 6) (mapEntry ""DamageMultiplier"" (what at:(last From)))) 100) 1) (if (is In (last To) (union (sites ""ShallowWater"") (sites ""DeepWater""))) (max (/ (* (* (value Piece at:(last From)) 10) (mapEntry ""DamageMultiplier"" (what at:(last From)))) 100) 1) (max (/ (* (* (value Piece at:(last From)) 8) (mapEntry ""DamageMultiplier"" (what at:(last From)))) 100) 1))) (if (is In (last To) (sites ""Forest"")) (max (/ (* (* (value Piece at:(last From)) 3) (mapEntry ""DamageMultiplier"" (what at:(last From)))) 100) 1) (if (is In (last To) (union (sites ""ShallowWater"") (sites ""DeepWater""))) (max (/ (* (* (value Piece at:(last From)) 5) (mapEntry ""DamageMultiplier"" (what at:(last From)))) 100) 1) (max (/ (* (* (value Piece at:(last From)) 4) (mapEntry ""DamageMultiplier"" (what at:(last From)))) 100) 1))))) (* {(if (is In (last From) (sites Occupied by:All container:""Board"" components:{""Soldier"" ""Motorbike""})) (if (= (who at:(last From)) 1) (mapEntry ""NoDoctrine"" 1) (if (= (who at:(last From)) 2) (mapEntry ""NoDoctrine"" 1) (if (= (who at:(last From)) 3) (mapEntry ""NoDoctrine"" 1) (if (= (who at:(last From)) 4) (mapEntry ""NoDoctrine"" 1) 0)))) (if (is In (last From) (sites Occupied by:All container:""Board"" components:{""Tank"" ""Speeder"" ""Shooter""})) (if (= (who at:(last From)) 1) (mapEntry ""NoDoctrine"" 2) (if (= (who at:(last From)) 2) (mapEntry ""NoDoctrine"" 2) (if (= (who at:(last From)) 3) (mapEntry ""NoDoctrine"" 2) (if (= (who at:(last From)) 4) (mapEntry ""NoDoctrine"" 2) 0)))) (if (is In (last From) (sites Occupied by:All container:""Board"" components:{""Launcher"" ""Antiair"" ""Artillery""})) (if (= (who at:(last From)) 1) (mapEntry ""NoDoctrine"" 3) (if (= (who at:(last From)) 2) (mapEntry ""NoDoctrine"" 3) (if (= (who at:(last From)) 3) (mapEntry ""NoDoctrine"" 3) (if (= (who at:(last From)) 4) (mapEntry ""NoDoctrine"" 3) 0)))) (if (is In (last From) (sites Occupied by:All container:""Board"" components:{""Fighter"" ""Bomber"" ""Helicopter""})) (if (= (who at:(last From)) 1) (mapEntry ""NoDoctrine"" 4) (if (= (who at:(last From)) 2) (mapEntry ""NoDoctrine"" 4) (if (= (who at:(last From)) 3) (mapEntry ""NoDoctrine"" 4) (if (= (who at:(last From)) 4) (mapEntry ""NoDoctrine"" 4) 0)))) (if (is In (last From) (sites Occupied by:All container:""Board"" components:{""Submarine"" ""Cruiser"" ""Battleship""})) (if (= (who at:(last From)) 1) (mapEntry ""NoDoctrine"" 5) (if (= (who at:(last From)) 2) (mapEntry ""NoDoctrine"" 5) (if (= (who at:(last From)) 3) (mapEntry ""NoDoctrine"" 5) (if (= (who at:(last From)) 4) (mapEntry ""NoDoctrine"" 5) 0)))) 4))))) (if (and (= 8 (state at:(last To))) (!= (mover) (who at:(last To)))) (if (= (who at:(last From)) 1) (mapEntry ""NoDoctrine"" 6) (if (= (who at:(last From)) 2) (mapEntry ""NoDoctrine"" 6) (if (= (who at:(last From)) 3) (mapEntry ""NoDoctrine"" 6) (if (= (who at:(last From)) 4) (mapEntry ""NoDoctrine"" 6) 0)))) 5) (if (> (who at:(last To)) 0) (if (= (who at:(last To)) 1) (mapEntry ""NoDoctrine"" 8) (if (= (who at:(last To)) 2) (mapEntry ""NoDoctrine"" 8) (if (= (who at:(last To)) 3) (mapEntry ""NoDoctrine"" 8) (if (= (who at:(last To)) 4) (mapEntry ""NoDoctrine"" 8) 0)))) 4) (if False (if (= (who at:(last From)) 1) (mapEntry ""NoDoctrine"" 10) (if (= (who at:(last From)) 2) (mapEntry ""NoDoctrine"" 10) (if (= (who at:(last From)) 3) (mapEntry ""NoDoctrine"" 10) (if (= (who at:(last From)) 4) (mapEntry ""NoDoctrine"" 10) 0)))) (if (= (who at:(last From)) 1) (mapEntry ""NoDoctrine"" 9) (if (= (who at:(last From)) 2) (mapEntry ""NoDoctrine"" 9) (if (= (who at:(last From)) 3) (mapEntry ""NoDoctrine"" 9) (if (= (who at:(last From)) 4) (mapEntry ""NoDoctrine"" 9) 0))))) (value Random (range (if (= (who at:(last From)) 1) (mapEntry ""NoDoctrine"" 11) (if (= (who at:(last From)) 2) (mapEntry ""NoDoctrine"" 11) (if (= (who at:(last From)) 3) (mapEntry ""NoDoctrine"" 11) (if (= (who at:(last From)) 4) (mapEntry ""NoDoctrine"" 11) 0)))) (if (= (who at:(last From)) 1) (mapEntry ""NoDoctrine"" 12) (if (= (who at:(last From)) 2) (mapEntry ""NoDoctrine"" 12) (if (= (who at:(last From)) 3) (mapEntry ""NoDoctrine"" 12) (if (= (who at:(last From)) 4) (mapEntry ""NoDoctrine"" 12) 0))))))})) 128000)))) (set State at:(last From) 0)) next:(if (and (= 8 (state at:(last To))) (!= (mover) (who at:(last To)))) (if (= (value Piece at:(last To)) 0) (and {(take Control of:All by:Mover at:(last To)) (set Value at:(last To) 50)}) (set Value at:(last To) (value Piece at:(last To)))) (if (= (value Piece at:(last To)) 0) (remove (last To)) (if (and {(= 0 (count Sites in:(intersection (sites {(last To) (last From)}) (sites Occupied by:All components:{""Launcher"" ""Artillery"" ""Battleship"" ""Antiair""})))) (if (is In (last To) (sites Occupied by:Enemy components:{""Bomber"" ""Battleship"" ""Artillery"" ""Launcher""})) (is In (last From) (union (sites Occupied by:Mover components:{""Soldier"" ""Motorbike"" ""Tank"" ""Speeder"" ""Shooter"" ""Launcher"" ""Antiair"" ""Battleship"" ""Artillery"" ""Base"" ""Town"" ""Factory"" ""Dock"" ""Airport"" ""Cruiser"" ""Submarine""}) (sites Occupied by:Neutral container:""Board""))) (is In (last From) (union (sites Occupied by:Mover) (sites Occupied by:Neutral container:""Board"")))) (if (is In (last To) (sites Occupied by:Enemy components:{""Antiair"" ""Fighter""})) (is In (last From) (sites Occupied by:Mover components:{""Fighter"" ""Helicopter"" ""Bomber""})) (is In (last From) (union (sites Occupied by:Mover) (sites Occupied by:Neutral container:""Board"")))) (if (is In (last To) (sites Occupied by:Enemy components:{""Submarine""})) (is In (last From) (sites Occupied by:Mover components:{""Submarine"" ""Battleship"" ""Cruiser""})) (is In (last From) (union (sites Occupied by:Mover) (sites Occupied by:Neutral container:""Board""))))}) (if (<= (- (value Piece at:(last From)) (/ (* (if (is In (last From) (sites Occupied by:All container:""Board"" components:{""Fighter"" ""Bomber"" ""Helicopter""})) (max (/ (* (* (value Piece at:(last To)) 4) (mapEntry ""DamageMultiplier"" (what at:(last To)))) 100) 1) (if (and (is In (last From) (sites Occupied by:All container:""Board"" components:{""Soldier"" ""Motorbike""})) (is In (last To) (sites Occupied by:All component:""Shooter""))) (if (is In (last From) (sites ""Forest"")) (max (/ (* (* (value Piece at:(last To)) 6) (mapEntry ""DamageMultiplier"" (what at:(last To)))) 100) 1) (if (is In (last From) (union (sites ""ShallowWater"") (sites ""DeepWater""))) (max (/ (* (* (value Piece at:(last To)) 10) (mapEntry ""DamageMultiplier"" (what at:(last To)))) 100) 1) (max (/ (* (* (value Piece at:(last To)) 8) (mapEntry ""DamageMultiplier"" (what at:(last To)))) 100) 1))) (if (is In (last From) (sites ""Forest"")) (max (/ (* (* (value Piece at:(last To)) 3) (mapEntry ""DamageMultiplier"" (what at:(last To)))) 100) 1) (if (is In (last From) (union (sites ""ShallowWater"") (sites ""DeepWater""))) (max (/ (* (* (value Piece at:(last To)) 5) (mapEntry ""DamageMultiplier"" (what at:(last To)))) 100) 1) (max (/ (* (* (value Piece at:(last To)) 4) (mapEntry ""DamageMultiplier"" (what at:(last To)))) 100) 1))))) (* {(if (is In (last To) (sites Occupied by:All container:""Board"" components:{""Soldier"" ""Motorbike""})) (if (= (who at:(last To)) 1) (mapEntry ""NoDoctrine"" 1) (if (= (who at:(last To)) 2) (mapEntry ""NoDoctrine"" 1) (if (= (who at:(last To)) 3) (mapEntry ""NoDoctrine"" 1) (if (= (who at:(last To)) 4) (mapEntry ""NoDoctrine"" 1) 0)))) (if (is In (last To) (sites Occupied by:All container:""Board"" components:{""Tank"" ""Speeder"" ""Shooter""})) (if (= (who at:(last To)) 1) (mapEntry ""NoDoctrine"" 2) (if (= (who at:(last To)) 2) (mapEntry ""NoDoctrine"" 2) (if (= (who at:(last To)) 3) (mapEntry ""NoDoctrine"" 2) (if (= (who at:(last To)) 4) (mapEntry ""NoDoctrine"" 2) 0)))) (if (is In (last To) (sites Occupied by:All container:""Board"" components:{""Launcher"" ""Antiair"" ""Artillery""})) (if (= (who at:(last To)) 1) (mapEntry ""NoDoctrine"" 3) (if (= (who at:(last To)) 2) (mapEntry ""NoDoctrine"" 3) (if (= (who at:(last To)) 3) (mapEntry ""NoDoctrine"" 3) (if (= (who at:(last To)) 4) (mapEntry ""NoDoctrine"" 3) 0)))) (if (is In (last To) (sites Occupied by:All container:""Board"" components:{""Fighter"" ""Bomber"" ""Helicopter""})) (if (= (who at:(last To)) 1) (mapEntry ""NoDoctrine"" 4) (if (= (who at:(last To)) 2) (mapEntry ""NoDoctrine"" 4) (if (= (who at:(last To)) 3) (mapEntry ""NoDoctrine"" 4) (if (= (who at:(last To)) 4) (mapEntry ""NoDoctrine"" 4) 0)))) (if (is In (last To) (sites Occupied by:All container:""Board"" components:{""Submarine"" ""Cruiser"" ""Battleship""})) (if (= (who at:(last To)) 1) (mapEntry ""NoDoctrine"" 5) (if (= (who at:(last To)) 2) (mapEntry ""NoDoctrine"" 5) (if (= (who at:(last To)) 3) (mapEntry ""NoDoctrine"" 5) (if (= (who at:(last To)) 4) (mapEntry ""NoDoctrine"" 5) 0)))) 4))))) (if (and (= 8 (state at:(last From))) (!= (mover) (who at:(last From)))) (if (= (who at:(last To)) 1) (mapEntry ""NoDoctrine"" 6) (if (= (who at:(last To)) 2) (mapEntry ""NoDoctrine"" 6) (if (= (who at:(last To)) 3) (mapEntry ""NoDoctrine"" 6) (if (= (who at:(last To)) 4) (mapEntry ""NoDoctrine"" 6) 0)))) 5) (if (> (who at:(last From)) 0) (if (= (who at:(last From)) 1) (mapEntry ""NoDoctrine"" 8) (if (= (who at:(last From)) 2) (mapEntry ""NoDoctrine"" 8) (if (= (who at:(last From)) 3) (mapEntry ""NoDoctrine"" 8) (if (= (who at:(last From)) 4) (mapEntry ""NoDoctrine"" 8) 0)))) 4) (if True (if (= (who at:(last To)) 1) (mapEntry ""NoDoctrine"" 10) (if (= (who at:(last To)) 2) (mapEntry ""NoDoctrine"" 10) (if (= (who at:(last To)) 3) (mapEntry ""NoDoctrine"" 10) (if (= (who at:(last To)) 4) (mapEntry ""NoDoctrine"" 10) 0)))) (if (= (who at:(last To)) 1) (mapEntry ""NoDoctrine"" 9) (if (= (who at:(last To)) 2) (mapEntry ""NoDoctrine"" 9) (if (= (who at:(last To)) 3) (mapEntry ""NoDoctrine"" 9) (if (= (who at:(last To)) 4) (mapEntry ""NoDoctrine"" 9) 0))))) (value Random (range (if (= (who at:(last To)) 1) (mapEntry ""NoDoctrine"" 11) (if (= (who at:(last To)) 2) (mapEntry ""NoDoctrine"" 11) (if (= (who at:(last To)) 3) (mapEntry ""NoDoctrine"" 11) (if (= (who at:(last To)) 4) (mapEntry ""NoDoctrine"" 11) 0)))) (if (= (who at:(last To)) 1) (mapEntry ""NoDoctrine"" 12) (if (= (who at:(last To)) 2) (mapEntry ""NoDoctrine"" 12) (if (= (who at:(last To)) 3) (mapEntry ""NoDoctrine"" 12) (if (= (who at:(last To)) 4) (mapEntry ""NoDoctrine"" 12) 0))))))})) 128000)) 0) (remove (last From)) (set Value at:(last From) (- (value Piece at:(last From)) (/ (* (if (is In (last From) (sites Occupied by:All container:""Board"" components:{""Fighter"" ""Bomber"" ""Helicopter""})) (max (/ (* (* (value Piece at:(last To)) 4) (mapEntry ""DamageMultiplier"" (what at:(last To)))) 100) 1) (if (and (is In (last From) (sites Occupied by:All container:""Board"" components:{""Soldier"" ""Motorbike""})) (is In (last To) (sites Occupied by:All component:""Shooter""))) (if (is In (last From) (sites ""Forest"")) (max (/ (* (* (value Piece at:(last To)) 6) (mapEntry ""DamageMultiplier"" (what at:(last To)))) 100) 1) (if (is In (last From) (union (sites ""ShallowWater"") (sites ""DeepWater""))) (max (/ (* (* (value Piece at:(last To)) 10) (mapEntry ""DamageMultiplier"" (what at:(last To)))) 100) 1) (max (/ (* (* (value Piece at:(last To)) 8) (mapEntry ""DamageMultiplier"" (what at:(last To)))) 100) 1))) (if (is In (last From) (sites ""Forest"")) (max (/ (* (* (value Piece at:(last To)) 3) (mapEntry ""DamageMultiplier"" (what at:(last To)))) 100) 1) (if (is In (last From) (union (sites ""ShallowWater"") (sites ""DeepWater""))) (max (/ (* (* (value Piece at:(last To)) 5) (mapEntry ""DamageMultiplier"" (what at:(last To)))) 100) 1) (max (/ (* (* (value Piece at:(last To)) 4) (mapEntry ""DamageMultiplier"" (what at:(last To)))) 100) 1))))) (* {(if (is In (last To) (sites Occupied by:All container:""Board"" components:{""Soldier"" ""Motorbike""})) (if (= (who at:(last To)) 1) (mapEntry ""NoDoctrine"" 1) (if (= (who at:(last To)) 2) (mapEntry ""NoDoctrine"" 1) (if (= (who at:(last To)) 3) (mapEntry ""NoDoctrine"" 1) (if (= (who at:(last To)) 4) (mapEntry ""NoDoctrine"" 1) 0)))) (if (is In (last To) (sites Occupied by:All container:""Board"" components:{""Tank"" ""Speeder"" ""Shooter""})) (if (= (who at:(last To)) 1) (mapEntry ""NoDoctrine"" 2) (if (= (who at:(last To)) 2) (mapEntry ""NoDoctrine"" 2) (if (= (who at:(last To)) 3) (mapEntry ""NoDoctrine"" 2) (if (= (who at:(last To)) 4) (mapEntry ""NoDoctrine"" 2) 0)))) (if (is In (last To) (sites Occupied by:All container:""Board"" components:{""Launcher"" ""Antiair"" ""Artillery""})) (if (= (who at:(last To)) 1) (mapEntry ""NoDoctrine"" 3) (if (= (who at:(last To)) 2) (mapEntry ""NoDoctrine"" 3) (if (= (who at:(last To)) 3) (mapEntry ""NoDoctrine"" 3) (if (= (who at:(last To)) 4) (mapEntry ""NoDoctrine"" 3) 0)))) (if (is In (last To) (sites Occupied by:All container:""Board"" components:{""Fighter"" ""Bomber"" ""Helicopter""})) (if (= (who at:(last To)) 1) (mapEntry ""NoDoctrine"" 4) (if (= (who at:(last To)) 2) (mapEntry ""NoDoctrine"" 4) (if (= (who at:(last To)) 3) (mapEntry ""NoDoctrine"" 4) (if (= (who at:(last To)) 4) (mapEntry ""NoDoctrine"" 4) 0)))) (if (is In (last To) (sites Occupied by:All container:""Board"" components:{""Submarine"" ""Cruiser"" ""Battleship""})) (if (= (who at:(last To)) 1) (mapEntry ""NoDoctrine"" 5) (if (= (who at:(last To)) 2) (mapEntry ""NoDoctrine"" 5) (if (= (who at:(last To)) 3) (mapEntry ""NoDoctrine"" 5) (if (= (who at:(last To)) 4) (mapEntry ""NoDoctrine"" 5) 0)))) 4))))) (if (and (= 8 (state at:(last From))) (!= (mover) (who at:(last From)))) (if (= (who at:(last To)) 1) (mapEntry ""NoDoctrine"" 6) (if (= (who at:(last To)) 2) (mapEntry ""NoDoctrine"" 6) (if (= (who at:(last To)) 3) (mapEntry ""NoDoctrine"" 6) (if (= (who at:(last To)) 4) (mapEntry ""NoDoctrine"" 6) 0)))) 5) (if (> (who at:(last From)) 0) (if (= (who at:(last From)) 1) (mapEntry ""NoDoctrine"" 8) (if (= (who at:(last From)) 2) (mapEntry ""NoDoctrine"" 8) (if (= (who at:(last From)) 3) (mapEntry ""NoDoctrine"" 8) (if (= (who at:(last From)) 4) (mapEntry ""NoDoctrine"" 8) 0)))) 4) (if True (if (= (who at:(last To)) 1) (mapEntry ""NoDoctrine"" 10) (if (= (who at:(last To)) 2) (mapEntry ""NoDoctrine"" 10) (if (= (who at:(last To)) 3) (mapEntry ""NoDoctrine"" 10) (if (= (who at:(last To)) 4) (mapEntry ""NoDoctrine"" 10) 0)))) (if (= (who at:(last To)) 1) (mapEntry ""NoDoctrine"" 9) (if (= (who at:(last To)) 2) (mapEntry ""NoDoctrine"" 9) (if (= (who at:(last To)) 3) (mapEntry ""NoDoctrine"" 9) (if (= (who at:(last To)) 4) (mapEntry ""NoDoctrine"" 9) 0))))) (value Random (range (if (= (who at:(last To)) 1) (mapEntry ""NoDoctrine"" 11) (if (= (who at:(last To)) 2) (mapEntry ""NoDoctrine"" 11) (if (= (who at:(last To)) 3) (mapEntry ""NoDoctrine"" 11) (if (= (who at:(last To)) 4) (mapEntry ""NoDoctrine"" 11) 0)))) (if (= (who at:(last To)) 1) (mapEntry ""NoDoctrine"" 12) (if (= (who at:(last To)) 2) (mapEntry ""NoDoctrine"" 12) (if (= (who at:(last To)) 3) (mapEntry ""NoDoctrine"" 12) (if (= (who at:(last To)) 4) (mapEntry ""NoDoctrine"" 12) 0))))))})) 128000)))) (set Value at:(last From) (value Piece at:(last From))))))))) (move Select (from (from) if:(and (> (state at:(from)) 0) (< (value Piece at:(from)) (mapEntry ""MaxHealth"" (what at:(from)))))) (to (sites Around (from) Orthogonal if:(is In (to) (sites Occupied by:Mover container:""Board"" components:{""Town"" ""Dock"" ""Base"" ""Factory"" ""Airport""})))) (then (and {(set Value at:(last From) (min (mapEntry ""MaxHealth"" (what at:(last From))) (- (+ (value Piece at:(last From)) (value Piece at:(last To))) 1))) (set Value at:(last To) (max (- (value Piece at:(last To)) (- (mapEntry ""MaxHealth"" (what at:(last From))) (value Piece at:(last From)))) 1)) (set State at:(last From) 0)}))) (move Select (from (from) if:(> (state at:(from)) 0)) (to (sites Around (from) Orthogonal if:(and (= (what at:(from)) (what at:(to))) (< (value Piece at:(to)) (mapEntry ""MaxHealth"" (what at:(to))))))) (then (and {(if (<= (+ (value Piece at:(last To)) (value Piece at:(last From))) (mapEntry ""MaxHealth"" (what at:(last From)))) (and (set Value at:(last To) (min (mapEntry ""MaxHealth"" (what at:(last From))) (+ (value Piece at:(last From)) (value Piece at:(last To))))) (remove (last From))) (and (set Value at:(last To) (min (mapEntry ""MaxHealth"" (what at:(last From))) (- (+ (value Piece at:(last From)) (value Piece at:(last To))) 1))) (set Value at:(last From) (max (- (value Piece at:(last To)) (- (mapEntry ""MaxHealth"" (what at:(last From))) (value Piece at:(last From)))) 1)))) (set State at:(last From) 0) (set State at:(last To) 0)})))})) (piece ""Battleship"" Each (or {(move (from (from) if:(> (state at:(from)) 1)) (to (sites Distance (step Orthogonal (to if:(is In (to) (difference (union (sites Empty) (sites Occupied by:Friend container:""Board"")) (union (sites ""Mountain"") (difference (sites Board) (union (sites ""ShallowWater"") (sites ""DeepWater"")))))))) from:(from) (range 1 (- (state at:(from)) 1))) if:(is Empty (to)) (apply (set State at:(from) 1)))) (move Select (from (from) if:(> (state at:(from)) 0)) (to (sites Distance Orthogonal from:(from) (range 2 4)) if:(and {(if (is In (from) (sites Occupied by:Mover container:""Board"" components:{""Bomber"" ""Battleship"" ""Artillery"" ""Launcher""})) (is In (to) (union (sites Occupied by:Enemy container:""Board"" components:{""Soldier"" ""Motorbike"" ""Tank"" ""Speeder"" ""Shooter"" ""Launcher"" ""Antiair"" ""Battleship"" ""Artillery"" ""Base"" ""Town"" ""Factory"" ""Dock"" ""Airport"" ""Cruiser"" ""Submarine""}) (sites Occupied by:Neutral container:""Board""))) (is In (to) (union (sites Occupied by:Enemy container:""Board"") (sites Occupied by:Neutral container:""Board"")))) (if (is In (from) (sites Occupied by:Mover container:""Board"" components:{""Antiair"" ""Fighter""})) (is In (to) (sites Occupied by:Enemy container:""Board"" components:{""Fighter"" ""Helicopter"" ""Bomber""})) (is In (to) (union (sites Occupied by:Enemy container:""Board"") (sites Occupied by:Neutral container:""Board"")))) (if (is In (from) (sites Occupied by:Mover container:""Board"" components:{""Submarine""})) (is In (to) (sites Occupied by:Enemy container:""Board"" components:{""Submarine"" ""Battleship"" ""Cruiser""})) (is In (to) (union (sites Occupied by:Enemy container:""Board"") (sites Occupied by:Neutral container:""Board""))))})) (then (do (and (set Value at:(last To) (max 0 (- (value Piece at:(last To)) (/ (* (if (is In (last To) (sites Occupied by:All container:""Board"" components:{""Fighter"" ""Bomber"" ""Helicopter""})) (max (/ (* (* (value Piece at:(last From)) 4) (mapEntry ""DamageMultiplier"" (what at:(last From)))) 100) 1) (if (and (is In (last To) (sites Occupied by:All container:""Board"" components:{""Soldier"" ""Motorbike""})) (is In (last From) (sites Occupied by:All component:""Shooter""))) (if (is In (last To) (sites ""Forest"")) (max (/ (* (* (value Piece at:(last From)) 6) (mapEntry ""DamageMultiplier"" (what at:(last From)))) 100) 1) (if (is In (last To) (union (sites ""ShallowWater"") (sites ""DeepWater""))) (max (/ (* (* (value Piece at:(last From)) 10) (mapEntry ""DamageMultiplier"" (what at:(last From)))) 100) 1) (max (/ (* (* (value Piece at:(last From)) 8) (mapEntry ""DamageMultiplier"" (what at:(last From)))) 100) 1))) (if (is In (last To) (sites ""Forest"")) (max (/ (* (* (value Piece at:(last From)) 3) (mapEntry ""DamageMultiplier"" (what at:(last From)))) 100) 1) (if (is In (last To) (union (sites ""ShallowWater"") (sites ""DeepWater""))) (max (/ (* (* (value Piece at:(last From)) 5) (mapEntry ""DamageMultiplier"" (what at:(last From)))) 100) 1) (max (/ (* (* (value Piece at:(last From)) 4) (mapEntry ""DamageMultiplier"" (what at:(last From)))) 100) 1))))) (* {(if (is In (last From) (sites Occupied by:All container:""Board"" components:{""Soldier"" ""Motorbike""})) (if (= (who at:(last From)) 1) (mapEntry ""NoDoctrine"" 1) (if (= (who at:(last From)) 2) (mapEntry ""NoDoctrine"" 1) (if (= (who at:(last From)) 3) (mapEntry ""NoDoctrine"" 1) (if (= (who at:(last From)) 4) (mapEntry ""NoDoctrine"" 1) 0)))) (if (is In (last From) (sites Occupied by:All container:""Board"" components:{""Tank"" ""Speeder"" ""Shooter""})) (if (= (who at:(last From)) 1) (mapEntry ""NoDoctrine"" 2) (if (= (who at:(last From)) 2) (mapEntry ""NoDoctrine"" 2) (if (= (who at:(last From)) 3) (mapEntry ""NoDoctrine"" 2) (if (= (who at:(last From)) 4) (mapEntry ""NoDoctrine"" 2) 0)))) (if (is In (last From) (sites Occupied by:All container:""Board"" components:{""Launcher"" ""Antiair"" ""Artillery""})) (if (= (who at:(last From)) 1) (mapEntry ""NoDoctrine"" 3) (if (= (who at:(last From)) 2) (mapEntry ""NoDoctrine"" 3) (if (= (who at:(last From)) 3) (mapEntry ""NoDoctrine"" 3) (if (= (who at:(last From)) 4) (mapEntry ""NoDoctrine"" 3) 0)))) (if (is In (last From) (sites Occupied by:All container:""Board"" components:{""Fighter"" ""Bomber"" ""Helicopter""})) (if (= (who at:(last From)) 1) (mapEntry ""NoDoctrine"" 4) (if (= (who at:(last From)) 2) (mapEntry ""NoDoctrine"" 4) (if (= (who at:(last From)) 3) (mapEntry ""NoDoctrine"" 4) (if (= (who at:(last From)) 4) (mapEntry ""NoDoctrine"" 4) 0)))) (if (is In (last From) (sites Occupied by:All container:""Board"" components:{""Submarine"" ""Cruiser"" ""Battleship""})) (if (= (who at:(last From)) 1) (mapEntry ""NoDoctrine"" 5) (if (= (who at:(last From)) 2) (mapEntry ""NoDoctrine"" 5) (if (= (who at:(last From)) 3) (mapEntry ""NoDoctrine"" 5) (if (= (who at:(last From)) 4) (mapEntry ""NoDoctrine"" 5) 0)))) 4))))) (if (and (= 8 (state at:(last To))) (!= (mover) (who at:(last To)))) (if (= (who at:(last From)) 1) (mapEntry ""NoDoctrine"" 6) (if (= (who at:(last From)) 2) (mapEntry ""NoDoctrine"" 6) (if (= (who at:(last From)) 3) (mapEntry ""NoDoctrine"" 6) (if (= (who at:(last From)) 4) (mapEntry ""NoDoctrine"" 6) 0)))) 5) (if (> (who at:(last To)) 0) (if (= (who at:(last To)) 1) (mapEntry ""NoDoctrine"" 8) (if (= (who at:(last To)) 2) (mapEntry ""NoDoctrine"" 8) (if (= (who at:(last To)) 3) (mapEntry ""NoDoctrine"" 8) (if (= (who at:(last To)) 4) (mapEntry ""NoDoctrine"" 8) 0)))) 4) (if False (if (= (who at:(last From)) 1) (mapEntry ""NoDoctrine"" 10) (if (= (who at:(last From)) 2) (mapEntry ""NoDoctrine"" 10) (if (= (who at:(last From)) 3) (mapEntry ""NoDoctrine"" 10) (if (= (who at:(last From)) 4) (mapEntry ""NoDoctrine"" 10) 0)))) (if (= (who at:(last From)) 1) (mapEntry ""NoDoctrine"" 9) (if (= (who at:(last From)) 2) (mapEntry ""NoDoctrine"" 9) (if (= (who at:(last From)) 3) (mapEntry ""NoDoctrine"" 9) (if (= (who at:(last From)) 4) (mapEntry ""NoDoctrine"" 9) 0))))) (value Random (range (if (= (who at:(last From)) 1) (mapEntry ""NoDoctrine"" 11) (if (= (who at:(last From)) 2) (mapEntry ""NoDoctrine"" 11) (if (= (who at:(last From)) 3) (mapEntry ""NoDoctrine"" 11) (if (= (who at:(last From)) 4) (mapEntry ""NoDoctrine"" 11) 0)))) (if (= (who at:(last From)) 1) (mapEntry ""NoDoctrine"" 12) (if (= (who at:(last From)) 2) (mapEntry ""NoDoctrine"" 12) (if (= (who at:(last From)) 3) (mapEntry ""NoDoctrine"" 12) (if (= (who at:(last From)) 4) (mapEntry ""NoDoctrine"" 12) 0))))))})) 128000)))) (set State at:(last From) 0)) next:(if (and (= 8 (state at:(last To))) (!= (mover) (who at:(last To)))) (if (= (value Piece at:(last To)) 0) (and {(take Control of:All by:Mover at:(last To)) (set Value at:(last To) 50)}) (set Value at:(last To) (value Piece at:(last To)))) (if (= (value Piece at:(last To)) 0) (remove (last To)) (if (and {(= 0 (count Sites in:(intersection (sites {(last To) (last From)}) (sites Occupied by:All components:{""Launcher"" ""Artillery"" ""Battleship"" ""Antiair""})))) (if (is In (last To) (sites Occupied by:Enemy components:{""Bomber"" ""Battleship"" ""Artillery"" ""Launcher""})) (is In (last From) (union (sites Occupied by:Mover components:{""Soldier"" ""Motorbike"" ""Tank"" ""Speeder"" ""Shooter"" ""Launcher"" ""Antiair"" ""Battleship"" ""Artillery"" ""Base"" ""Town"" ""Factory"" ""Dock"" ""Airport"" ""Cruiser"" ""Submarine""}) (sites Occupied by:Neutral container:""Board""))) (is In (last From) (union (sites Occupied by:Mover) (sites Occupied by:Neutral container:""Board"")))) (if (is In (last To) (sites Occupied by:Enemy components:{""Antiair"" ""Fighter""})) (is In (last From) (sites Occupied by:Mover components:{""Fighter"" ""Helicopter"" ""Bomber""})) (is In (last From) (union (sites Occupied by:Mover) (sites Occupied by:Neutral container:""Board"")))) (if (is In (last To) (sites Occupied by:Enemy components:{""Submarine""})) (is In (last From) (sites Occupied by:Mover components:{""Submarine"" ""Battleship"" ""Cruiser""})) (is In (last From) (union (sites Occupied by:Mover) (sites Occupied by:Neutral container:""Board""))))}) (if (<= (- (value Piece at:(last From)) (/ (* (if (is In (last From) (sites Occupied by:All container:""Board"" components:{""Fighter"" ""Bomber"" ""Helicopter""})) (max (/ (* (* (value Piece at:(last To)) 4) (mapEntry ""DamageMultiplier"" (what at:(last To)))) 100) 1) (if (and (is In (last From) (sites Occupied by:All container:""Board"" components:{""Soldier"" ""Motorbike""})) (is In (last To) (sites Occupied by:All component:""Shooter""))) (if (is In (last From) (sites ""Forest"")) (max (/ (* (* (value Piece at:(last To)) 6) (mapEntry ""DamageMultiplier"" (what at:(last To)))) 100) 1) (if (is In (last From) (union (sites ""ShallowWater"") (sites ""DeepWater""))) (max (/ (* (* (value Piece at:(last To)) 10) (mapEntry ""DamageMultiplier"" (what at:(last To)))) 100) 1) (max (/ (* (* (value Piece at:(last To)) 8) (mapEntry ""DamageMultiplier"" (what at:(last To)))) 100) 1))) (if (is In (last From) (sites ""Forest"")) (max (/ (* (* (value Piece at:(last To)) 3) (mapEntry ""DamageMultiplier"" (what at:(last To)))) 100) 1) (if (is In (last From) (union (sites ""ShallowWater"") (sites ""DeepWater""))) (max (/ (* (* (value Piece at:(last To)) 5) (mapEntry ""DamageMultiplier"" (what at:(last To)))) 100) 1) (max (/ (* (* (value Piece at:(last To)) 4) (mapEntry ""DamageMultiplier"" (what at:(last To)))) 100) 1))))) (* {(if (is In (last To) (sites Occupied by:All container:""Board"" components:{""Soldier"" ""Motorbike""})) (if (= (who at:(last To)) 1) (mapEntry ""NoDoctrine"" 1) (if (= (who at:(last To)) 2) (mapEntry ""NoDoctrine"" 1) (if (= (who at:(last To)) 3) (mapEntry ""NoDoctrine"" 1) (if (= (who at:(last To)) 4) (mapEntry ""NoDoctrine"" 1) 0)))) (if (is In (last To) (sites Occupied by:All container:""Board"" components:{""Tank"" ""Speeder"" ""Shooter""})) (if (= (who at:(last To)) 1) (mapEntry ""NoDoctrine"" 2) (if (= (who at:(last To)) 2) (mapEntry ""NoDoctrine"" 2) (if (= (who at:(last To)) 3) (mapEntry ""NoDoctrine"" 2) (if (= (who at:(last To)) 4) (mapEntry ""NoDoctrine"" 2) 0)))) (if (is In (last To) (sites Occupied by:All container:""Board"" components:{""Launcher"" ""Antiair"" ""Artillery""})) (if (= (who at:(last To)) 1) (mapEntry ""NoDoctrine"" 3) (if (= (who at:(last To)) 2) (mapEntry ""NoDoctrine"" 3) (if (= (who at:(last To)) 3) (mapEntry ""NoDoctrine"" 3) (if (= (who at:(last To)) 4) (mapEntry ""NoDoctrine"" 3) 0)))) (if (is In (last To) (sites Occupied by:All container:""Board"" components:{""Fighter"" ""Bomber"" ""Helicopter""})) (if (= (who at:(last To)) 1) (mapEntry ""NoDoctrine"" 4) (if (= (who at:(last To)) 2) (mapEntry ""NoDoctrine"" 4) (if (= (who at:(last To)) 3) (mapEntry ""NoDoctrine"" 4) (if (= (who at:(last To)) 4) (mapEntry ""NoDoctrine"" 4) 0)))) (if (is In (last To) (sites Occupied by:All container:""Board"" components:{""Submarine"" ""Cruiser"" ""Battleship""})) (if (= (who at:(last To)) 1) (mapEntry ""NoDoctrine"" 5) (if (= (who at:(last To)) 2) (mapEntry ""NoDoctrine"" 5) (if (= (who at:(last To)) 3) (mapEntry ""NoDoctrine"" 5) (if (= (who at:(last To)) 4) (mapEntry ""NoDoctrine"" 5) 0)))) 4))))) (if (and (= 8 (state at:(last From))) (!= (mover) (who at:(last From)))) (if (= (who at:(last To)) 1) (mapEntry ""NoDoctrine"" 6) (if (= (who at:(last To)) 2) (mapEntry ""NoDoctrine"" 6) (if (= (who at:(last To)) 3) (mapEntry ""NoDoctrine"" 6) (if (= (who at:(last To)) 4) (mapEntry ""NoDoctrine"" 6) 0)))) 5) (if (> (who at:(last From)) 0) (if (= (who at:(last From)) 1) (mapEntry ""NoDoctrine"" 8) (if (= (who at:(last From)) 2) (mapEntry ""NoDoctrine"" 8) (if (= (who at:(last From)) 3) (mapEntry ""NoDoctrine"" 8) (if (= (who at:(last From)) 4) (mapEntry ""NoDoctrine"" 8) 0)))) 4) (if True (if (= (who at:(last To)) 1) (mapEntry ""NoDoctrine"" 10) (if (= (who at:(last To)) 2) (mapEntry ""NoDoctrine"" 10) (if (= (who at:(last To)) 3) (mapEntry ""NoDoctrine"" 10) (if (= (who at:(last To)) 4) (mapEntry ""NoDoctrine"" 10) 0)))) (if (= (who at:(last To)) 1) (mapEntry ""NoDoctrine"" 9) (if (= (who at:(last To)) 2) (mapEntry ""NoDoctrine"" 9) (if (= (who at:(last To)) 3) (mapEntry ""NoDoctrine"" 9) (if (= (who at:(last To)) 4) (mapEntry ""NoDoctrine"" 9) 0))))) (value Random (range (if (= (who at:(last To)) 1) (mapEntry ""NoDoctrine"" 11) (if (= (who at:(last To)) 2) (mapEntry ""NoDoctrine"" 11) (if (= (who at:(last To)) 3) (mapEntry ""NoDoctrine"" 11) (if (= (who at:(last To)) 4) (mapEntry ""NoDoctrine"" 11) 0)))) (if (= (who at:(last To)) 1) (mapEntry ""NoDoctrine"" 12) (if (= (who at:(last To)) 2) (mapEntry ""NoDoctrine"" 12) (if (= (who at:(last To)) 3) (mapEntry ""NoDoctrine"" 12) (if (= (who at:(last To)) 4) (mapEntry ""NoDoctrine"" 12) 0))))))})) 128000)) 0) (remove (last From)) (set Value at:(last From) (- (value Piece at:(last From)) (/ (* (if (is In (last From) (sites Occupied by:All container:""Board"" components:{""Fighter"" ""Bomber"" ""Helicopter""})) (max (/ (* (* (value Piece at:(last To)) 4) (mapEntry ""DamageMultiplier"" (what at:(last To)))) 100) 1) (if (and (is In (last From) (sites Occupied by:All container:""Board"" components:{""Soldier"" ""Motorbike""})) (is In (last To) (sites Occupied by:All component:""Shooter""))) (if (is In (last From) (sites ""Forest"")) (max (/ (* (* (value Piece at:(last To)) 6) (mapEntry ""DamageMultiplier"" (what at:(last To)))) 100) 1) (if (is In (last From) (union (sites ""ShallowWater"") (sites ""DeepWater""))) (max (/ (* (* (value Piece at:(last To)) 10) (mapEntry ""DamageMultiplier"" (what at:(last To)))) 100) 1) (max (/ (* (* (value Piece at:(last To)) 8) (mapEntry ""DamageMultiplier"" (what at:(last To)))) 100) 1))) (if (is In (last From) (sites ""Forest"")) (max (/ (* (* (value Piece at:(last To)) 3) (mapEntry ""DamageMultiplier"" (what at:(last To)))) 100) 1) (if (is In (last From) (union (sites ""ShallowWater"") (sites ""DeepWater""))) (max (/ (* (* (value Piece at:(last To)) 5) (mapEntry ""DamageMultiplier"" (what at:(last To)))) 100) 1) (max (/ (* (* (value Piece at:(last To)) 4) (mapEntry ""DamageMultiplier"" (what at:(last To)))) 100) 1))))) (* {(if (is In (last To) (sites Occupied by:All container:""Board"" components:{""Soldier"" ""Motorbike""})) (if (= (who at:(last To)) 1) (mapEntry ""NoDoctrine"" 1) (if (= (who at:(last To)) 2) (mapEntry ""NoDoctrine"" 1) (if (= (who at:(last To)) 3) (mapEntry ""NoDoctrine"" 1) (if (= (who at:(last To)) 4) (mapEntry ""NoDoctrine"" 1) 0)))) (if (is In (last To) (sites Occupied by:All container:""Board"" components:{""Tank"" ""Speeder"" ""Shooter""})) (if (= (who at:(last To)) 1) (mapEntry ""NoDoctrine"" 2) (if (= (who at:(last To)) 2) (mapEntry ""NoDoctrine"" 2) (if (= (who at:(last To)) 3) (mapEntry ""NoDoctrine"" 2) (if (= (who at:(last To)) 4) (mapEntry ""NoDoctrine"" 2) 0)))) (if (is In (last To) (sites Occupied by:All container:""Board"" components:{""Launcher"" ""Antiair"" ""Artillery""})) (if (= (who at:(last To)) 1) (mapEntry ""NoDoctrine"" 3) (if (= (who at:(last To)) 2) (mapEntry ""NoDoctrine"" 3) (if (= (who at:(last To)) 3) (mapEntry ""NoDoctrine"" 3) (if (= (who at:(last To)) 4) (mapEntry ""NoDoctrine"" 3) 0)))) (if (is In (last To) (sites Occupied by:All container:""Board"" components:{""Fighter"" ""Bomber"" ""Helicopter""})) (if (= (who at:(last To)) 1) (mapEntry ""NoDoctrine"" 4) (if (= (who at:(last To)) 2) (mapEntry ""NoDoctrine"" 4) (if (= (who at:(last To)) 3) (mapEntry ""NoDoctrine"" 4) (if (= (who at:(last To)) 4) (mapEntry ""NoDoctrine"" 4) 0)))) (if (is In (last To) (sites Occupied by:All container:""Board"" components:{""Submarine"" ""Cruiser"" ""Battleship""})) (if (= (who at:(last To)) 1) (mapEntry ""NoDoctrine"" 5) (if (= (who at:(last To)) 2) (mapEntry ""NoDoctrine"" 5) (if (= (who at:(last To)) 3) (mapEntry ""NoDoctrine"" 5) (if (= (who at:(last To)) 4) (mapEntry ""NoDoctrine"" 5) 0)))) 4))))) (if (and (= 8 (state at:(last From))) (!= (mover) (who at:(last From)))) (if (= (who at:(last To)) 1) (mapEntry ""NoDoctrine"" 6) (if (= (who at:(last To)) 2) (mapEntry ""NoDoctrine"" 6) (if (= (who at:(last To)) 3) (mapEntry ""NoDoctrine"" 6) (if (= (who at:(last To)) 4) (mapEntry ""NoDoctrine"" 6) 0)))) 5) (if (> (who at:(last From)) 0) (if (= (who at:(last From)) 1) (mapEntry ""NoDoctrine"" 8) (if (= (who at:(last From)) 2) (mapEntry ""NoDoctrine"" 8) (if (= (who at:(last From)) 3) (mapEntry ""NoDoctrine"" 8) (if (= (who at:(last From)) 4) (mapEntry ""NoDoctrine"" 8) 0)))) 4) (if True (if (= (who at:(last To)) 1) (mapEntry ""NoDoctrine"" 10) (if (= (who at:(last To)) 2) (mapEntry ""NoDoctrine"" 10) (if (= (who at:(last To)) 3) (mapEntry ""NoDoctrine"" 10) (if (= (who at:(last To)) 4) (mapEntry ""NoDoctrine"" 10) 0)))) (if (= (who at:(last To)) 1) (mapEntry ""NoDoctrine"" 9) (if (= (who at:(last To)) 2) (mapEntry ""NoDoctrine"" 9) (if (= (who at:(last To)) 3) (mapEntry ""NoDoctrine"" 9) (if (= (who at:(last To)) 4) (mapEntry ""NoDoctrine"" 9) 0))))) (value Random (range (if (= (who at:(last To)) 1) (mapEntry ""NoDoctrine"" 11) (if (= (who at:(last To)) 2) (mapEntry ""NoDoctrine"" 11) (if (= (who at:(last To)) 3) (mapEntry ""NoDoctrine"" 11) (if (= (who at:(last To)) 4) (mapEntry ""NoDoctrine"" 11) 0)))) (if (= (who at:(last To)) 1) (mapEntry ""NoDoctrine"" 12) (if (= (who at:(last To)) 2) (mapEntry ""NoDoctrine"" 12) (if (= (who at:(last To)) 3) (mapEntry ""NoDoctrine"" 12) (if (= (who at:(last To)) 4) (mapEntry ""NoDoctrine"" 12) 0))))))})) 128000)))) (set Value at:(last From) (value Piece at:(last From))))))))) (move Select (from (from) if:(and (> (state at:(from)) 0) (< (value Piece at:(from)) (mapEntry ""MaxHealth"" (what at:(from)))))) (to (sites Around (from) Orthogonal if:(is In (to) (sites Occupied by:Mover container:""Board"" components:{""Town"" ""Dock"" ""Base"" ""Factory"" ""Airport""})))) (then (and {(set Value at:(last From) (min (mapEntry ""MaxHealth"" (what at:(last From))) (- (+ (value Piece at:(last From)) (value Piece at:(last To))) 1))) (set Value at:(last To) (max (- (value Piece at:(last To)) (- (mapEntry ""MaxHealth"" (what at:(last From))) (value Piece at:(last From)))) 1)) (set State at:(last From) 0)}))) (move Select (from (from) if:(> (state at:(from)) 0)) (to (sites Around (from) Orthogonal if:(and (= (what at:(from)) (what at:(to))) (< (value Piece at:(to)) (mapEntry ""MaxHealth"" (what at:(to))))))) (then (and {(if (<= (+ (value Piece at:(last To)) (value Piece at:(last From))) (mapEntry ""MaxHealth"" (what at:(last From)))) (and (set Value at:(last To) (min (mapEntry ""MaxHealth"" (what at:(last From))) (+ (value Piece at:(last From)) (value Piece at:(last To))))) (remove (last From))) (and (set Value at:(last To) (min (mapEntry ""MaxHealth"" (what at:(last From))) (- (+ (value Piece at:(last From)) (value Piece at:(last To))) 1))) (set Value at:(last From) (max (- (value Piece at:(last To)) (- (mapEntry ""MaxHealth"" (what at:(last From))) (value Piece at:(last From)))) 1)))) (set State at:(last From) 0) (set State at:(last To) 0)})))})) (piece ""Base"" Neutral) (piece ""Factory"" Neutral) (piece ""Town"" Neutral) (piece ""Airport"" Neutral) (piece ""Dock"" Neutral) (piece ""Soldier"" Neutral) (piece ""Motorbike"" Neutral) (piece ""Speeder"" Neutral) (piece ""Shooter"" Neutral) (piece ""Tank"" Neutral) (piece ""Antiair"" Neutral) (piece ""Launcher"" Neutral) (piece ""Artillery"" Neutral) (piece ""Helicopter"" Neutral) (piece ""Fighter"" Neutral) (piece ""Bomber"" Neutral) (piece ""Cruiser"" Neutral) (piece ""Submarine"" Neutral) (piece ""Battleship"" Neutral) (map ""Movement"" {(pair 1 8) (pair 2 8) (pair 3 8) (pair 4 8) (pair 5 8) (pair 6 8) (pair 7 8) (pair 8 8) (pair 9 8) (pair 10 8) (pair 11 4) (pair 12 4) (pair 13 6) (pair 14 6) (pair 15 7) (pair 16 7) (pair 17 5) (pair 18 5) (pair 19 5) (pair 20 5) (pair 21 5) (pair 22 5) (pair 23 4) (pair 24 4) (pair 25 4) (pair 26 4) (pair 27 5) (pair 28 5) (pair 29 7) (pair 30 7) (pair 31 6) (pair 32 6) (pair 33 6) (pair 34 6) (pair 35 6) (pair 36 6) (pair 37 5) (pair 38 5) (pair 39 8) (pair 40 8) (pair 41 8) (pair 42 8) (pair 43 8)}) (map ""MaxHealth"" {(pair 1 100) (pair 2 100) (pair 3 100) (pair 4 100) (pair 5 100) (pair 6 100) (pair 7 100) (pair 8 100) (pair 9 100) (pair 10 100) (pair 11 30) (pair 12 30) (pair 13 40) (pair 14 40) (pair 15 60) (pair 16 60) (pair 17 60) (pair 18 60) (pair 19 80) (pair 20 80) (pair 21 50) (pair 22 50) (pair 23 50) (pair 24 50) (pair 25 40) (pair 26 40) (pair 27 40) (pair 28 40) (pair 29 100) (pair 30 100) (pair 31 100) (pair 32 100) (pair 33 70) (pair 34 70) (pair 35 100) (pair 36 100) (pair 37 120) (pair 38 120) (pair 39 100) (pair 40 100) (pair 41 100) (pair 42 100) (pair 43 100)}) (map ""DamageMultiplier"" {(pair 1 0) (pair 2 0) (pair 3 0) (pair 4 0) (pair 5 0) (pair 6 0) (pair 7 0) (pair 8 0) (pair 9 0) (pair 10 0) (pair 11 50) (pair 12 50) (pair 13 50) (pair 14 50) (pair 15 40) (pair 16 40) (pair 17 40) (pair 18 40) (pair 19 50) (pair 20 50) (pair 21 100) (pair 22 100) (pair 23 50) (pair 24 50) (pair 25 100) (pair 26 100) (pair 27 70) (pair 28 70) (pair 29 100) (pair 30 100) (pair 31 80) (pair 32 80) (pair 33 50) (pair 34 50) (pair 35 80) (pair 36 80) (pair 37 50) (pair 38 50) (pair 39 0) (pair 40 0) (pair 41 0) (pair 42 0) (pair 43 0)}) (map ""NoDoctrine"" {(pair 1 4) (pair 2 4) (pair 3 4) (pair 4 4) (pair 5 4) (pair 6 5) (pair 7 4) (pair 8 4) (pair 9 4) (pair 10 4) (pair 11 100) (pair 12 100)}) (map ""SpecialForces"" {(pair 1 6) (pair 2 3) (pair 3 3) (pair 4 3) (pair 5 3) (pair 6 5) (pair 7 4) (pair 8 4) (pair 9 4) (pair 10 4) (pair 11 100) (pair 12 100)}) (map ""BruteStrength"" {(pair 1 3) (pair 2 6) (pair 3 3) (pair 4 3) (pair 5 3) (pair 6 5) (pair 7 4) (pair 8 4) (pair 9 4) (pair 10 4) (pair 11 100) (pair 12 100)}) (map ""Sharpshooter"" {(pair 1 3) (pair 2 3) (pair 3 6) (pair 4 3) (pair 5 3) (pair 6 5) (pair 7 4) (pair 8 4) (pair 9 4) (pair 10 4) (pair 11 100) (pair 12 100)}) (map ""AcePilot"" {(pair 1 3) (pair 2 3) (pair 3 3) (pair 4 6) (pair 5 3) (pair 6 5) (pair 7 4) (pair 8 4) (pair 9 4) (pair 10 4) (pair 11 100) (pair 12 100)}) (map ""SeaDog"" {(pair 1 3) (pair 2 3) (pair 3 3) (pair 4 3) (pair 5 6) (pair 6 5) (pair 7 4) (pair 8 4) (pair 9 4) (pair 10 4) (pair 11 100) (pair 12 100)}) (map ""GuerrillaWarfare"" {(pair 1 3) (pair 2 3) (pair 3 3) (pair 4 3) (pair 5 3) (pair 6 10) (pair 7 4) (pair 8 4) (pair 9 4) (pair 10 4) (pair 11 100) (pair 12 100)}) (map ""ForeignInvader"" {(pair 1 5) (pair 2 5) (pair 3 5) (pair 4 5) (pair 5 5) (pair 6 2) (pair 7 4) (pair 8 4) (pair 9 4) (pair 10 4) (pair 11 100) (pair 12 100)}) (map ""Conscription"" {(pair 1 2) (pair 2 2) (pair 3 2) (pair 4 2) (pair 5 2) (pair 6 5) (pair 7 2) (pair 8 4) (pair 9 4) (pair 10 4) (pair 11 100) (pair 12 100)}) (map ""EliteTraining"" {(pair 1 6) (pair 2 6) (pair 3 6) (pair 4 6) (pair 5 6) (pair 6 5) (pair 7 6) (pair 8 4) (pair 9 4) (pair 10 4) (pair 11 100) (pair 12 100)}) (map ""GlassCannon"" {(pair 1 6) (pair 2 6) (pair 3 6) (pair 4 6) (pair 5 6) (pair 6 5) (pair 7 4) (pair 8 6) (pair 9 4) (pair 10 4) (pair 11 100) (pair 12 100)}) (map ""HardenedResolve"" {(pair 1 2) (pair 2 2) (pair 3 2) (pair 4 2) (pair 5 2) (pair 6 5) (pair 7 4) (pair 8 2) (pair 9 4) (pair 10 4) (pair 11 100) (pair 12 100)}) (map ""PreemptiveStrike"" {(pair 1 4) (pair 2 4) (pair 3 4) (pair 4 4) (pair 5 4) (pair 6 5) (pair 7 4) (pair 8 4) (pair 9 6) (pair 10 0) (pair 11 100) (pair 12 100)}) (map ""Retaliation"" {(pair 1 4) (pair 2 4) (pair 3 4) (pair 4 4) (pair 5 4) (pair 6 5) (pair 7 4) (pair 8 4) (pair 9 2) (pair 10 8) (pair 11 100) (pair 12 100)}) (map ""LadyLuck"" {(pair 1 4) (pair 2 4) (pair 3 4) (pair 4 4) (pair 5 4) (pair 6 5) (pair 7 4) (pair 8 4) (pair 9 4) (pair 10 4) (pair 11 50) (pair 12 150)})}) (rules (meta (passEnd NoEnd)) (start {(place ""Base1"" (sites {""C7""}) state:8 value:100) (place ""Base2"" (sites {""G3""}) state:8 value:100) (place ""Airport0"" (sites {""H8""}) state:8 value:100) (place ""Dock0"" (sites {""C2""}) state:8 value:100) (place ""Town2"" (sites {""I5"" ""I6""}) state:8 value:100) (place ""Town1"" (sites {""E9"" ""F9""}) state:8 value:100) (place ""Factory0"" (sites {""C5"" ""F4""}) state:8 value:100) (set Team 1 {P1}) (set Team 2 {P2}) (set Score Each 100) (place ""Soldier0"" (handSite Shared 0) count:30 state:1 value:30) (place ""Motorbike0"" (handSite Shared 1) count:50 state:1 value:40) (place ""Speeder0"" (handSite Shared 2) count:60 state:1 value:60) (place ""Shooter0"" (handSite Shared 3) count:80 state:1 value:60) (place ""Tank0"" (handSite Shared 4) count:100 state:1 value:80) (place ""Antiair0"" (handSite Shared 5) count:80 state:1 value:50) (place ""Launcher0"" (handSite Shared 6) count:80 state:1 value:50) (place ""Artillery0"" (handSite Shared 7) count:100 state:1 value:40) (place ""Helicopter0"" (handSite Shared 8) count:60 state:1 value:40) (place ""Fighter0"" (handSite Shared 9) count:100 state:1 value:100) (place ""Bomber0"" (handSite Shared 10) count:120 state:1 value:100) (place ""Cruiser0"" (handSite Shared 11) count:60 state:1 value:70) (place ""Submarine0"" (handSite Shared 12) count:100 state:1 value:100) (place ""Battleship0"" (handSite Shared 13) count:120 state:1 value:120)}) (play (or (or {(forEach Piece) (forEach Site (sites Occupied by:Neutral container:1 components:{""Soldier"" ""Motorbike""}) (move (from (site)) (to (difference (sites Around (sites Occupied by:Mover component:""Town"") Orthogonal) (sites ""DeepWater"")) if:(and (is Empty (to)) (<= (/ (* (count at:(site)) (if (= (mover) 1) (mapEntry ""NoDoctrine"" 7) (if (= (mover) 2) (mapEntry ""NoDoctrine"" 7) (if (= (mover) 3) (mapEntry ""NoDoctrine"" 7) (if (= (mover) 4) (mapEntry ""NoDoctrine"" 7) 0))))) 4) (score Mover)))) copy:True (then (and {(addScore Mover (- (/ (* (count at:(last From)) (if (= (mover) 1) (mapEntry ""NoDoctrine"" 7) (if (= (mover) 2) (mapEntry ""NoDoctrine"" 7) (if (= (mover) 3) (mapEntry ""NoDoctrine"" 7) (if (= (mover) 4) (mapEntry ""NoDoctrine"" 7) 0))))) 4))) (take Control of:All by:Mover at:(last To)) (set State at:(last To) 0)})))) (forEach Site (sites Occupied by:Neutral container:1 components:{""Cruiser"" ""Submarine"" ""Battleship""}) (move (from (site)) (to (difference (sites Around (sites Occupied by:Mover component:""Dock"") Orthogonal) (union (sites ""Mountain"") (difference (sites Board) (union (sites ""ShallowWater"") (sites ""DeepWater""))))) if:(and (is Empty (to)) (<= (/ (* (count at:(site)) (if (= (mover) 1) (mapEntry ""NoDoctrine"" 7) (if (= (mover) 2) (mapEntry ""NoDoctrine"" 7) (if (= (mover) 3) (mapEntry ""NoDoctrine"" 7) (if (= (mover) 4) (mapEntry ""NoDoctrine"" 7) 0))))) 4) (score Mover)))) copy:True (then (and {(addScore Mover (- (/ (* (count at:(last From)) (if (= (mover) 1) (mapEntry ""NoDoctrine"" 7) (if (= (mover) 2) (mapEntry ""NoDoctrine"" 7) (if (= (mover) 3) (mapEntry ""NoDoctrine"" 7) (if (= (mover) 4) (mapEntry ""NoDoctrine"" 7) 0))))) 4))) (take Control of:All by:Mover at:(last To)) (set State at:(last To) 0)})))) (forEach Site (sites Occupied by:Neutral container:1 components:{""Helicopter"" ""Fighter"" ""Bomber""}) (move (from (site)) (to (sites Around (sites Occupied by:Mover component:""Airport"") Orthogonal) if:(and (is Empty (to)) (<= (/ (* (count at:(site)) (if (= (mover) 1) (mapEntry ""NoDoctrine"" 7) (if (= (mover) 2) (mapEntry ""NoDoctrine"" 7) (if (= (mover) 3) (mapEntry ""NoDoctrine"" 7) (if (= (mover) 4) (mapEntry ""NoDoctrine"" 7) 0))))) 4) (score Mover)))) copy:True (then (and {(addScore Mover (- (/ (* (count at:(last From)) (if (= (mover) 1) (mapEntry ""NoDoctrine"" 7) (if (= (mover) 2) (mapEntry ""NoDoctrine"" 7) (if (= (mover) 3) (mapEntry ""NoDoctrine"" 7) (if (= (mover) 4) (mapEntry ""NoDoctrine"" 7) 0))))) 4))) (take Control of:All by:Mover at:(last To)) (set State at:(last To) 0)})))) (forEach Site (sites Occupied by:Neutral container:1 components:{""Speeder"" ""Shooter"" ""Tank"" ""Antiair"" ""Launcher"" ""Artillery""}) (move (from (site)) (to (difference (sites Around (sites Occupied by:Mover component:""Factory"") Orthogonal) (union (sites ""Mountain"") (sites ""DeepWater""))) if:(and (is Empty (to)) (<= (/ (* (count at:(site)) (if (= (mover) 1) (mapEntry ""NoDoctrine"" 7) (if (= (mover) 2) (mapEntry ""NoDoctrine"" 7) (if (= (mover) 3) (mapEntry ""NoDoctrine"" 7) (if (= (mover) 4) (mapEntry ""NoDoctrine"" 7) 0))))) 4) (score Mover)))) copy:True (then (and {(addScore Mover (- (/ (* (count at:(last From)) (if (= (mover) 1) (mapEntry ""NoDoctrine"" 7) (if (= (mover) 2) (mapEntry ""NoDoctrine"" 7) (if (= (mover) 3) (mapEntry ""NoDoctrine"" 7) (if (= (mover) 4) (mapEntry ""NoDoctrine"" 7) 0))))) 4))) (take Control of:All by:Mover at:(last To)) (set State at:(last To) 0)}))))} (then (and {(forEach Player (if (and {(is Active Player) (> (count Active) 2) (= (where ""Base"" Player) -1)}) (forEach Site (sites Occupied by:Player) (if (is In (site) (sites Occupied by:Player components:{""Town"" ""Base"" ""Factory"" ""Dock"" ""Airport""})) (take Control of:All by:Neutral at:(site)) (remove (site)))))) (moveAgain) (and {})}))) (move Pass (then (and {(forEach Site (sites Occupied by:Mover container:""Board"") (set State at:(site) (mapEntry ""Movement"" (what at:(site))))) (set Score Mover (+ {(* (count Sites in:(sites Occupied by:Mover component:""Base"")) 20) (* (count Sites in:(sites Occupied by:Mover component:""Town"")) 10) (score Mover)})) (forEach Site (sites Occupied by:Mover components:{""Town"" ""Base"" ""Factory"" ""Dock"" ""Airport""}) (set Value at:(site) (min (mapEntry ""MaxHealth"" (what at:(site))) (+ (value Piece at:(site)) 10)))) (and {})}))))) (end (forEach NonMover if:(= (where ""Base"" Player) -1) (result Player Loss)))))","###Description -//------------------------------------------------------------------------------ General Rules: The following rules apply to all units, unless stated otherwise in their description: - All units move and measure distance orthogonally. - Units may move up to their maximum movement limit and can then attack an adjacent site. - Attacking a unit will deal damage to it (see damage calculation section). - If an attacked unit's health reaches zero, it will be removed from the battlefield. - Defending units that survive an attack, will then deal counter damage to their attacker. - Units can reinforce an adjacent unit of the same type, instead of attacking. - Both units must be owned by the same player. - Reinforcing will convert health from one unit to the other, transferring as much health as possible. - Any units that are left with zero health after reinforcing are removed. - A unit which has been reinforced cannot perform any further actions this turn. The following rules apply to all buildings: - There are five types of building: Town, Factory, Airport, Dock and Base. - Attacking a building will deal damage to it (see damage calculation section). - If an attacked building's health reaches zero, it will gain 50 health and change ownership to the player who attacked it. - Buildings that are attacked, will not deal counter damage. - Units can heal at an adjacent building that you own, instead of attacking. - Healing at a building, will convert health from the building to the unit, transferring as much health as possible. - Additional units can be purchased using gold at their corresponding production building. - To purchase a unit, drag it from your hand to an available site next to a production building that you own. - The cost of purchasing a unit is represented by its count. - Purchased units cannot move, attack or heal, on the same turn they are purchased. - Each player receives 10 gold for every Town they own and 20 gold for every Base they own, at the start of their turn. - Buildings gain 10 health at the end of the owning player's turn, up to a maximum of 100. - Grey buildings are neutral, and are not owned by any player. - If a player loses ownership of all their Bases, they lose the game. //------------------------------------------------------------------------------ Units: Human (Purchased from Towns) Soldier Move: 3 Health: 30 Cost: 30 Damage Factor: 50% Motorbike Move: 5 Health: 40 Cost: 50 Damage Factor: 50% Vehicle (Purchased from Factories) Speeder Move: 6 Health: 60 Cost: 60 Damage Factor: 40% Shooter Move: 4 Health: 60 Cost: 80 Damage Factor: 40% - Deals double damage against Humans. Tank Move: 4 Health: 80 Cost: 100 Damage Factor: 50% Anti-Aircraft Move: 4 Health: 50 Cost: 80 Damage Factor: 100% - Can only attack Aircraft. - Can attack units 1-2 spaces away. - Does not deal or receive counter damage during an attack. Missile Launcher Move: 3 Health: 50 Cost: 80 Damage Factor: 50% - Cannot attack Aircraft. - Can only attack units 2-3 spaces away. - Does not deal or receive counter damage during an attack. Artillery Move: 3 Health: 40 Cost: 100 Damage Factor: 100% - Cannot attack Aircraft. - Can only attack units 3-5 spaces away. - Does not deal or receive counter damage during an attack. - Cannot attack or heal in the same turn that it moved. Aircraft (Purchased from Airports) Helicopter Move: 4 Health: 40 Cost: 60 Damage Factor: 70% Fighter Jet Move: 6 Health: 100 Cost: 100 Damage Factor: 100% - Can only attack Aircraft. Bomber Move: 5 Health: 100 Cost: 120 Damage Factor: 80% - Cannot attack Aircraft. Boat (Purchased from Docks) Cruiser Move: 5 Health: 70 Cost: 60 Damage Factor: 50% Submarine Move: 5 Health: 100 Cost: 100 Damage Factor: 80% - Can only attack Boats. Battleship Move: 4 Health: 120 Cost: 120 Damage Factor: 50% - Cannot attack Aircraft. - Can only attack units 2-4 spaces away. - Does not deal or receive counter damage during an attack. //------------------------------------------------------------------------------ Movement Restrictions: Humans may travel across plains, forests, and shallow water. They may also move 1 space into mountains instead of their regular movement. Vehicles may travel across plains. They may also move 1 space into forests or shallow water instead of their regular movement. Aircraft may travel across all spaces. Boats may travel across shallow and deep water. Buildings cannot move (obviously). Units cannot move over enemy or neutral occupied spaces. //------------------------------------------------------------------------------ Damage Calculation: An attacking unit deals damage equal to its health, multiplied by its damage factor. For example, A submarine has a damage factor of 80%, so a submarine with 20 health will deal 16 damage when it attacks (20 x 0.8). If the defending unit is in shallow or deep water, it takes 25% more damage. If the defending unit is in a forest, it takes 25% less damage. Aircraft are unaffected by terrain when calculating damage against them. All damage values are rounded down to the nearest whole number. //------------------------------------------------------------------------------ Fog of War: (Optional) All friendly units and buildings can see tiles up to 2 spaces away. Aircraft can see tiles up to 3 spaces away. Boats can see shallow and deep water tiles up to 3 spaces away. Humans on a mountain can see tiles up to 3 spaces away. Forest and mountain tiles can only be seen if adjacent to them. Enemy units and buildings that are not visible cannot be attacked, and have their type and health hidden. //------------------------------------------------------------------------------ Army Doctrine: At the start of the game (selected via the game options) you may pick a doctrine for your army. None - No effect. Special Forces - Human units do 50% more damage, all other units do 25% less damage. Brute Strength - Direct Vehicle units (no range on their attack distance) do 50% more damage, all other units do 25% less damage. Sharpshooter - Indirect Vehicle units (range on their attack distance) do 50% more damage, all other units do 25% less damage. Ace Pilot - Aircraft units do 50% more damage, all other units do 25% less damage. Sea Dog - Boat units do 50% more damage, all other units do 25% less damage. Guerrilla Warfare - Attacks against buildings deal 50% more damage, but attacks against units deal 25% less damage. Foreign Invader - Attacks against buildings deal 50% less damage, but attacks against units deal 25% more damage. Conscription - Units cost 50% less gold, but do 50% less damage. Elite Training - Units cost 50% more gold, but do 50% more damage. Glass Cannon - Units do 50% more damage, but take 50% more damage. Hardened Resolve - Units do 50% less damage, but take 50% less damage. Preemptive Strike - Units do 50% more damage when attacking, but never deal counter damage. Retaliation - Units do 50% less damage when attacking, but deal 100% more counter damage. Lady Luck - All attack damage is randomly selected between 50% and 150% of the normal amount. //------------------------------------------------------------------------------ Scenario - First Encounter No Fog of War. Player 1 - No Doctrine. Player 2 - No Doctrine. Player 3 - No Doctrine. Player 4 - No Doctrine. - -###Ludii -(game ""Mini Wars"" (players 2) (equipment {(board (hex 5)) (regions ""ShallowWater"" (sites {""A3"" ""B3"" ""C3"" ""C1""})) (regions ""DeepWater"" (sites {""A1"" ""A2"" ""B2"" ""B1""})) (regions ""Forest"" (sites {""I9"" ""H9"" ""G9"" ""A4"" ""A5"" ""D1"" ""E1"" ""E7"" ""D2"" ""E2""})) (regions ""Mountain"" (sites {""I8"" ""H7"" ""G7"" ""F6""})) (hand Shared size:14) (piece ""Base"" Each) (piece ""Factory"" Each) (piece ""Town"" Each) (piece ""Airport"" Each) (piece ""Dock"" Each) (piece ""Soldier"" Each (or {(or (move (from (from) if:(> (state at:(from)) 1)) (to (sites Distance (step Orthogonal (to if:(is In (to) (difference (union (sites Empty) (sites Occupied by:Friend container:""Board"")) (union (sites ""DeepWater"") (sites ""Mountain"")))))) from:(from) (range 1 (- (state at:(from)) 1))) if:(is Empty (to)) (apply (set State at:(from) 1)))) (move (from (from) if:(> (state at:(from)) 1)) (to (sites Distance (step Orthogonal (to if:(is In (to) (intersection (sites Empty) (sites ""Mountain""))))) from:(from) (range 1 (- 2 1))) if:(is Empty (to)) (apply (set State at:(from) 1))))) (move Select (from (from) if:(> (state at:(from)) 0)) (to (sites Distance Orthogonal from:(from) (range 1 1)) if:(and {(if (is In (from) (sites Occupied by:Mover container:""Board"" components:{""Bomber"" ""Battleship"" ""Artillery"" ""Launcher""})) (is In (to) (union (sites Occupied by:Enemy container:""Board"" components:{""Soldier"" ""Motorbike"" ""Tank"" ""Speeder"" ""Shooter"" ""Launcher"" ""Antiair"" ""Battleship"" ""Artillery"" ""Base"" ""Town"" ""Factory"" ""Dock"" ""Airport"" ""Cruiser"" ""Submarine""}) (sites Occupied by:Neutral container:""Board""))) (is In (to) (union (sites Occupied by:Enemy container:""Board"") (sites Occupied by:Neutral container:""Board"")))) (if (is In (from) (sites Occupied by:Mover container:""Board"" components:{""Antiair"" ""Fighter""})) (is In (to) (sites Occupied by:Enemy container:""Board"" components:{""Fighter"" ""Helicopter"" ""Bomber""})) (is In (to) (union (sites Occupied by:Enemy container:""Board"") (sites Occupied by:Neutral container:""Board"")))) (if (is In (from) (sites Occupied by:Mover container:""Board"" components:{""Submarine""})) (is In (to) (sites Occupied by:Enemy container:""Board"" components:{""Submarine"" ""Battleship"" ""Cruiser""})) (is In (to) (union (sites Occupied by:Enemy container:""Board"") (sites Occupied by:Neutral container:""Board""))))})) (then (do (and (set Value at:(last To) (max 0 (- (value Piece at:(last To)) (/ (* (if (is In (last To) (sites Occupied by:All container:""Board"" components:{""Fighter"" ""Bomber"" ""Helicopter""})) (max (/ (* (* (value Piece at:(last From)) 4) (mapEntry ""DamageMultiplier"" (what at:(last From)))) 100) 1) (if (and (is In (last To) (sites Occupied by:All container:""Board"" components:{""Soldier"" ""Motorbike""})) (is In (last From) (sites Occupied by:All component:""Shooter""))) (if (is In (last To) (sites ""Forest"")) (max (/ (* (* (value Piece at:(last From)) 6) (mapEntry ""DamageMultiplier"" (what at:(last From)))) 100) 1) (if (is In (last To) (union (sites ""ShallowWater"") (sites ""DeepWater""))) (max (/ (* (* (value Piece at:(last From)) 10) (mapEntry ""DamageMultiplier"" (what at:(last From)))) 100) 1) (max (/ (* (* (value Piece at:(last From)) 8) (mapEntry ""DamageMultiplier"" (what at:(last From)))) 100) 1))) (if (is In (last To) (sites ""Forest"")) (max (/ (* (* (value Piece at:(last From)) 3) (mapEntry ""DamageMultiplier"" (what at:(last From)))) 100) 1) (if (is In (last To) (union (sites ""ShallowWater"") (sites ""DeepWater""))) (max (/ (* (* (value Piece at:(last From)) 5) (mapEntry ""DamageMultiplier"" (what at:(last From)))) 100) 1) (max (/ (* (* (value Piece at:(last From)) 4) (mapEntry ""DamageMultiplier"" (what at:(last From)))) 100) 1))))) (* {(if (is In (last From) (sites Occupied by:All container:""Board"" components:{""Soldier"" ""Motorbike""})) (if (= (who at:(last From)) 1) (mapEntry ""NoDoctrine"" 1) (if (= (who at:(last From)) 2) (mapEntry ""NoDoctrine"" 1) (if (= (who at:(last From)) 3) (mapEntry ""NoDoctrine"" 1) (if (= (who at:(last From)) 4) (mapEntry ""NoDoctrine"" 1) 0)))) (if (is In (last From) (sites Occupied by:All container:""Board"" components:{""Tank"" ""Speeder"" ""Shooter""})) (if (= (who at:(last From)) 1) (mapEntry ""NoDoctrine"" 2) (if (= (who at:(last From)) 2) (mapEntry ""NoDoctrine"" 2) (if (= (who at:(last From)) 3) (mapEntry ""NoDoctrine"" 2) (if (= (who at:(last From)) 4) (mapEntry ""NoDoctrine"" 2) 0)))) (if (is In (last From) (sites Occupied by:All container:""Board"" components:{""Launcher"" ""Antiair"" ""Artillery""})) (if (= (who at:(last From)) 1) (mapEntry ""NoDoctrine"" 3) (if (= (who at:(last From)) 2) (mapEntry ""NoDoctrine"" 3) (if (= (who at:(last From)) 3) (mapEntry ""NoDoctrine"" 3) (if (= (who at:(last From)) 4) (mapEntry ""NoDoctrine"" 3) 0)))) (if (is In (last From) (sites Occupied by:All container:""Board"" components:{""Fighter"" ""Bomber"" ""Helicopter""})) (if (= (who at:(last From)) 1) (mapEntry ""NoDoctrine"" 4) (if (= (who at:(last From)) 2) (mapEntry ""NoDoctrine"" 4) (if (= (who at:(last From)) 3) (mapEntry ""NoDoctrine"" 4) (if (= (who at:(last From)) 4) (mapEntry ""NoDoctrine"" 4) 0)))) (if (is In (last From) (sites Occupied by:All container:""Board"" components:{""Submarine"" ""Cruiser"" ""Battleship""})) (if (= (who at:(last From)) 1) (mapEntry ""NoDoctrine"" 5) (if (= (who at:(last From)) 2) (mapEntry ""NoDoctrine"" 5) (if (= (who at:(last From)) 3) (mapEntry ""NoDoctrine"" 5) (if (= (who at:(last From)) 4) (mapEntry ""NoDoctrine"" 5) 0)))) 4))))) (if (and (= 8 (state at:(last To))) (!= (mover) (who at:(last To)))) (if (= (who at:(last From)) 1) (mapEntry ""NoDoctrine"" 6) (if (= (who at:(last From)) 2) (mapEntry ""NoDoctrine"" 6) (if (= (who at:(last From)) 3) (mapEntry ""NoDoctrine"" 6) (if (= (who at:(last From)) 4) (mapEntry ""NoDoctrine"" 6) 0)))) 5) (if (> (who at:(last To)) 0) (if (= (who at:(last To)) 1) (mapEntry ""NoDoctrine"" 8) (if (= (who at:(last To)) 2) (mapEntry ""NoDoctrine"" 8) (if (= (who at:(last To)) 3) (mapEntry ""NoDoctrine"" 8) (if (= (who at:(last To)) 4) (mapEntry ""NoDoctrine"" 8) 0)))) 4) (if False (if (= (who at:(last From)) 1) (mapEntry ""NoDoctrine"" 10) (if (= (who at:(last From)) 2) (mapEntry ""NoDoctrine"" 10) (if (= (who at:(last From)) 3) (mapEntry ""NoDoctrine"" 10) (if (= (who at:(last From)) 4) (mapEntry ""NoDoctrine"" 10) 0)))) (if (= (who at:(last From)) 1) (mapEntry ""NoDoctrine"" 9) (if (= (who at:(last From)) 2) (mapEntry ""NoDoctrine"" 9) (if (= (who at:(last From)) 3) (mapEntry ""NoDoctrine"" 9) (if (= (who at:(last From)) 4) (mapEntry ""NoDoctrine"" 9) 0))))) (value Random (range (if (= (who at:(last From)) 1) (mapEntry ""NoDoctrine"" 11) (if (= (who at:(last From)) 2) (mapEntry ""NoDoctrine"" 11) (if (= (who at:(last From)) 3) (mapEntry ""NoDoctrine"" 11) (if (= (who at:(last From)) 4) (mapEntry ""NoDoctrine"" 11) 0)))) (if (= (who at:(last From)) 1) (mapEntry ""NoDoctrine"" 12) (if (= (who at:(last From)) 2) (mapEntry ""NoDoctrine"" 12) (if (= (who at:(last From)) 3) (mapEntry ""NoDoctrine"" 12) (if (= (who at:(last From)) 4) (mapEntry ""NoDoctrine"" 12) 0))))))})) 128000)))) (set State at:(last From) 0)) next:(if (and (= 8 (state at:(last To))) (!= (mover) (who at:(last To)))) (if (= (value Piece at:(last To)) 0) (and {(take Control of:All by:Mover at:(last To)) (set Value at:(last To) 50)}) (set Value at:(last To) (value Piece at:(last To)))) (if (= (value Piece at:(last To)) 0) (remove (last To)) (if (and {(= 0 (count Sites in:(intersection (sites {(last To) (last From)}) (sites Occupied by:All components:{""Launcher"" ""Artillery"" ""Battleship"" ""Antiair""})))) (if (is In (last To) (sites Occupied by:Enemy components:{""Bomber"" ""Battleship"" ""Artillery"" ""Launcher""})) (is In (last From) (union (sites Occupied by:Mover components:{""Soldier"" ""Motorbike"" ""Tank"" ""Speeder"" ""Shooter"" ""Launcher"" ""Antiair"" ""Battleship"" ""Artillery"" ""Base"" ""Town"" ""Factory"" ""Dock"" ""Airport"" ""Cruiser"" ""Submarine""}) (sites Occupied by:Neutral container:""Board""))) (is In (last From) (union (sites Occupied by:Mover) (sites Occupied by:Neutral container:""Board"")))) (if (is In (last To) (sites Occupied by:Enemy components:{""Antiair"" ""Fighter""})) (is In (last From) (sites Occupied by:Mover components:{""Fighter"" ""Helicopter"" ""Bomber""})) (is In (last From) (union (sites Occupied by:Mover) (sites Occupied by:Neutral container:""Board"")))) (if (is In (last To) (sites Occupied by:Enemy components:{""Submarine""})) (is In (last From) (sites Occupied by:Mover components:{""Submarine"" ""Battleship"" ""Cruiser""})) (is In (last From) (union (sites Occupied by:Mover) (sites Occupied by:Neutral container:""Board""))))}) (if (<= (- (value Piece at:(last From)) (/ (* (if (is In (last From) (sites Occupied by:All container:""Board"" components:{""Fighter"" ""Bomber"" ""Helicopter""})) (max (/ (* (* (value Piece at:(last To)) 4) (mapEntry ""DamageMultiplier"" (what at:(last To)))) 100) 1) (if (and (is In (last From) (sites Occupied by:All container:""Board"" components:{""Soldier"" ""Motorbike""})) (is In (last To) (sites Occupied by:All component:""Shooter""))) (if (is In (last From) (sites ""Forest"")) (max (/ (* (* (value Piece at:(last To)) 6) (mapEntry ""DamageMultiplier"" (what at:(last To)))) 100) 1) (if (is In (last From) (union (sites ""ShallowWater"") (sites ""DeepWater""))) (max (/ (* (* (value Piece at:(last To)) 10) (mapEntry ""DamageMultiplier"" (what at:(last To)))) 100) 1) (max (/ (* (* (value Piece at:(last To)) 8) (mapEntry ""DamageMultiplier"" (what at:(last To)))) 100) 1))) (if (is In (last From) (sites ""Forest"")) (max (/ (* (* (value Piece at:(last To)) 3) (mapEntry ""DamageMultiplier"" (what at:(last To)))) 100) 1) (if (is In (last From) (union (sites ""ShallowWater"") (sites ""DeepWater""))) (max (/ (* (* (value Piece at:(last To)) 5) (mapEntry ""DamageMultiplier"" (what at:(last To)))) 100) 1) (max (/ (* (* (value Piece at:(last To)) 4) (mapEntry ""DamageMultiplier"" (what at:(last To)))) 100) 1))))) (* {(if (is In (last To) (sites Occupied by:All container:""Board"" components:{""Soldier"" ""Motorbike""})) (if (= (who at:(last To)) 1) (mapEntry ""NoDoctrine"" 1) (if (= (who at:(last To)) 2) (mapEntry ""NoDoctrine"" 1) (if (= (who at:(last To)) 3) (mapEntry ""NoDoctrine"" 1) (if (= (who at:(last To)) 4) (mapEntry ""NoDoctrine"" 1) 0)))) (if (is In (last To) (sites Occupied by:All container:""Board"" components:{""Tank"" ""Speeder"" ""Shooter""})) (if (= (who at:(last To)) 1) (mapEntry ""NoDoctrine"" 2) (if (= (who at:(last To)) 2) (mapEntry ""NoDoctrine"" 2) (if (= (who at:(last To)) 3) (mapEntry ""NoDoctrine"" 2) (if (= (who at:(last To)) 4) (mapEntry ""NoDoctrine"" 2) 0)))) (if (is In (last To) (sites Occupied by:All container:""Board"" components:{""Launcher"" ""Antiair"" ""Artillery""})) (if (= (who at:(last To)) 1) (mapEntry ""NoDoctrine"" 3) (if (= (who at:(last To)) 2) (mapEntry ""NoDoctrine"" 3) (if (= (who at:(last To)) 3) (mapEntry ""NoDoctrine"" 3) (if (= (who at:(last To)) 4) (mapEntry ""NoDoctrine"" 3) 0)))) (if (is In (last To) (sites Occupied by:All container:""Board"" components:{""Fighter"" ""Bomber"" ""Helicopter""})) (if (= (who at:(last To)) 1) (mapEntry ""NoDoctrine"" 4) (if (= (who at:(last To)) 2) (mapEntry ""NoDoctrine"" 4) (if (= (who at:(last To)) 3) (mapEntry ""NoDoctrine"" 4) (if (= (who at:(last To)) 4) (mapEntry ""NoDoctrine"" 4) 0)))) (if (is In (last To) (sites Occupied by:All container:""Board"" components:{""Submarine"" ""Cruiser"" ""Battleship""})) (if (= (who at:(last To)) 1) (mapEntry ""NoDoctrine"" 5) (if (= (who at:(last To)) 2) (mapEntry ""NoDoctrine"" 5) (if (= (who at:(last To)) 3) (mapEntry ""NoDoctrine"" 5) (if (= (who at:(last To)) 4) (mapEntry ""NoDoctrine"" 5) 0)))) 4))))) (if (and (= 8 (state at:(last From))) (!= (mover) (who at:(last From)))) (if (= (who at:(last To)) 1) (mapEntry ""NoDoctrine"" 6) (if (= (who at:(last To)) 2) (mapEntry ""NoDoctrine"" 6) (if (= (who at:(last To)) 3) (mapEntry ""NoDoctrine"" 6) (if (= (who at:(last To)) 4) (mapEntry ""NoDoctrine"" 6) 0)))) 5) (if (> (who at:(last From)) 0) (if (= (who at:(last From)) 1) (mapEntry ""NoDoctrine"" 8) (if (= (who at:(last From)) 2) (mapEntry ""NoDoctrine"" 8) (if (= (who at:(last From)) 3) (mapEntry ""NoDoctrine"" 8) (if (= (who at:(last From)) 4) (mapEntry ""NoDoctrine"" 8) 0)))) 4) (if True (if (= (who at:(last To)) 1) (mapEntry ""NoDoctrine"" 10) (if (= (who at:(last To)) 2) (mapEntry ""NoDoctrine"" 10) (if (= (who at:(last To)) 3) (mapEntry ""NoDoctrine"" 10) (if (= (who at:(last To)) 4) (mapEntry ""NoDoctrine"" 10) 0)))) (if (= (who at:(last To)) 1) (mapEntry ""NoDoctrine"" 9) (if (= (who at:(last To)) 2) (mapEntry ""NoDoctrine"" 9) (if (= (who at:(last To)) 3) (mapEntry ""NoDoctrine"" 9) (if (= (who at:(last To)) 4) (mapEntry ""NoDoctrine"" 9) 0))))) (value Random (range (if (= (who at:(last To)) 1) (mapEntry ""NoDoctrine"" 11) (if (= (who at:(last To)) 2) (mapEntry ""NoDoctrine"" 11) (if (= (who at:(last To)) 3) (mapEntry ""NoDoctrine"" 11) (if (= (who at:(last To)) 4) (mapEntry ""NoDoctrine"" 11) 0)))) (if (= (who at:(last To)) 1) (mapEntry ""NoDoctrine"" 12) (if (= (who at:(last To)) 2) (mapEntry ""NoDoctrine"" 12) (if (= (who at:(last To)) 3) (mapEntry ""NoDoctrine"" 12) (if (= (who at:(last To)) 4) (mapEntry ""NoDoctrine"" 12) 0))))))})) 128000)) 0) (remove (last From)) (set Value at:(last From) (- (value Piece at:(last From)) (/ (* (if (is In (last From) (sites Occupied by:All container:""Board"" components:{""Fighter"" ""Bomber"" ""Helicopter""})) (max (/ (* (* (value Piece at:(last To)) 4) (mapEntry ""DamageMultiplier"" (what at:(last To)))) 100) 1) (if (and (is In (last From) (sites Occupied by:All container:""Board"" components:{""Soldier"" ""Motorbike""})) (is In (last To) (sites Occupied by:All component:""Shooter""))) (if (is In (last From) (sites ""Forest"")) (max (/ (* (* (value Piece at:(last To)) 6) (mapEntry ""DamageMultiplier"" (what at:(last To)))) 100) 1) (if (is In (last From) (union (sites ""ShallowWater"") (sites ""DeepWater""))) (max (/ (* (* (value Piece at:(last To)) 10) (mapEntry ""DamageMultiplier"" (what at:(last To)))) 100) 1) (max (/ (* (* (value Piece at:(last To)) 8) (mapEntry ""DamageMultiplier"" (what at:(last To)))) 100) 1))) (if (is In (last From) (sites ""Forest"")) (max (/ (* (* (value Piece at:(last To)) 3) (mapEntry ""DamageMultiplier"" (what at:(last To)))) 100) 1) (if (is In (last From) (union (sites ""ShallowWater"") (sites ""DeepWater""))) (max (/ (* (* (value Piece at:(last To)) 5) (mapEntry ""DamageMultiplier"" (what at:(last To)))) 100) 1) (max (/ (* (* (value Piece at:(last To)) 4) (mapEntry ""DamageMultiplier"" (what at:(last To)))) 100) 1))))) (* {(if (is In (last To) (sites Occupied by:All container:""Board"" components:{""Soldier"" ""Motorbike""})) (if (= (who at:(last To)) 1) (mapEntry ""NoDoctrine"" 1) (if (= (who at:(last To)) 2) (mapEntry ""NoDoctrine"" 1) (if (= (who at:(last To)) 3) (mapEntry ""NoDoctrine"" 1) (if (= (who at:(last To)) 4) (mapEntry ""NoDoctrine"" 1) 0)))) (if (is In (last To) (sites Occupied by:All container:""Board"" components:{""Tank"" ""Speeder"" ""Shooter""})) (if (= (who at:(last To)) 1) (mapEntry ""NoDoctrine"" 2) (if (= (who at:(last To)) 2) (mapEntry ""NoDoctrine"" 2) (if (= (who at:(last To)) 3) (mapEntry ""NoDoctrine"" 2) (if (= (who at:(last To)) 4) (mapEntry ""NoDoctrine"" 2) 0)))) (if (is In (last To) (sites Occupied by:All container:""Board"" components:{""Launcher"" ""Antiair"" ""Artillery""})) (if (= (who at:(last To)) 1) (mapEntry ""NoDoctrine"" 3) (if (= (who at:(last To)) 2) (mapEntry ""NoDoctrine"" 3) (if (= (who at:(last To)) 3) (mapEntry ""NoDoctrine"" 3) (if (= (who at:(last To)) 4) (mapEntry ""NoDoctrine"" 3) 0)))) (if (is In (last To) (sites Occupied by:All container:""Board"" components:{""Fighter"" ""Bomber"" ""Helicopter""})) (if (= (who at:(last To)) 1) (mapEntry ""NoDoctrine"" 4) (if (= (who at:(last To)) 2) (mapEntry ""NoDoctrine"" 4) (if (= (who at:(last To)) 3) (mapEntry ""NoDoctrine"" 4) (if (= (who at:(last To)) 4) (mapEntry ""NoDoctrine"" 4) 0)))) (if (is In (last To) (sites Occupied by:All container:""Board"" components:{""Submarine"" ""Cruiser"" ""Battleship""})) (if (= (who at:(last To)) 1) (mapEntry ""NoDoctrine"" 5) (if (= (who at:(last To)) 2) (mapEntry ""NoDoctrine"" 5) (if (= (who at:(last To)) 3) (mapEntry ""NoDoctrine"" 5) (if (= (who at:(last To)) 4) (mapEntry ""NoDoctrine"" 5) 0)))) 4))))) (if (and (= 8 (state at:(last From))) (!= (mover) (who at:(last From)))) (if (= (who at:(last To)) 1) (mapEntry ""NoDoctrine"" 6) (if (= (who at:(last To)) 2) (mapEntry ""NoDoctrine"" 6) (if (= (who at:(last To)) 3) (mapEntry ""NoDoctrine"" 6) (if (= (who at:(last To)) 4) (mapEntry ""NoDoctrine"" 6) 0)))) 5) (if (> (who at:(last From)) 0) (if (= (who at:(last From)) 1) (mapEntry ""NoDoctrine"" 8) (if (= (who at:(last From)) 2) (mapEntry ""NoDoctrine"" 8) (if (= (who at:(last From)) 3) (mapEntry ""NoDoctrine"" 8) (if (= (who at:(last From)) 4) (mapEntry ""NoDoctrine"" 8) 0)))) 4) (if True (if (= (who at:(last To)) 1) (mapEntry ""NoDoctrine"" 10) (if (= (who at:(last To)) 2) (mapEntry ""NoDoctrine"" 10) (if (= (who at:(last To)) 3) (mapEntry ""NoDoctrine"" 10) (if (= (who at:(last To)) 4) (mapEntry ""NoDoctrine"" 10) 0)))) (if (= (who at:(last To)) 1) (mapEntry ""NoDoctrine"" 9) (if (= (who at:(last To)) 2) (mapEntry ""NoDoctrine"" 9) (if (= (who at:(last To)) 3) (mapEntry ""NoDoctrine"" 9) (if (= (who at:(last To)) 4) (mapEntry ""NoDoctrine"" 9) 0))))) (value Random (range (if (= (who at:(last To)) 1) (mapEntry ""NoDoctrine"" 11) (if (= (who at:(last To)) 2) (mapEntry ""NoDoctrine"" 11) (if (= (who at:(last To)) 3) (mapEntry ""NoDoctrine"" 11) (if (= (who at:(last To)) 4) (mapEntry ""NoDoctrine"" 11) 0)))) (if (= (who at:(last To)) 1) (mapEntry ""NoDoctrine"" 12) (if (= (who at:(last To)) 2) (mapEntry ""NoDoctrine"" 12) (if (= (who at:(last To)) 3) (mapEntry ""NoDoctrine"" 12) (if (= (who at:(last To)) 4) (mapEntry ""NoDoctrine"" 12) 0))))))})) 128000)))) (set Value at:(last From) (value Piece at:(last From))))))))) (move Select (from (from) if:(and (> (state at:(from)) 0) (< (value Piece at:(from)) (mapEntry ""MaxHealth"" (what at:(from)))))) (to (sites Around (from) Orthogonal if:(is In (to) (sites Occupied by:Mover container:""Board"" components:{""Town"" ""Dock"" ""Base"" ""Factory"" ""Airport""})))) (then (and {(set Value at:(last From) (min (mapEntry ""MaxHealth"" (what at:(last From))) (- (+ (value Piece at:(last From)) (value Piece at:(last To))) 1))) (set Value at:(last To) (max (- (value Piece at:(last To)) (- (mapEntry ""MaxHealth"" (what at:(last From))) (value Piece at:(last From)))) 1)) (set State at:(last From) 0)}))) (move Select (from (from) if:(> (state at:(from)) 0)) (to (sites Around (from) Orthogonal if:(and (= (what at:(from)) (what at:(to))) (< (value Piece at:(to)) (mapEntry ""MaxHealth"" (what at:(to))))))) (then (and {(if (<= (+ (value Piece at:(last To)) (value Piece at:(last From))) (mapEntry ""MaxHealth"" (what at:(last From)))) (and (set Value at:(last To) (min (mapEntry ""MaxHealth"" (what at:(last From))) (+ (value Piece at:(last From)) (value Piece at:(last To))))) (remove (last From))) (and (set Value at:(last To) (min (mapEntry ""MaxHealth"" (what at:(last From))) (- (+ (value Piece at:(last From)) (value Piece at:(last To))) 1))) (set Value at:(last From) (max (- (value Piece at:(last To)) (- (mapEntry ""MaxHealth"" (what at:(last From))) (value Piece at:(last From)))) 1)))) (set State at:(last From) 0) (set State at:(last To) 0)})))})) (piece ""Motorbike"" Each (or {(or (move (from (from) if:(> (state at:(from)) 1)) (to (sites Distance (step Orthogonal (to if:(is In (to) (difference (union (sites Empty) (sites Occupied by:Friend container:""Board"")) (union (sites ""DeepWater"") (sites ""Mountain"")))))) from:(from) (range 1 (- (state at:(from)) 1))) if:(is Empty (to)) (apply (set State at:(from) 1)))) (move (from (from) if:(> (state at:(from)) 1)) (to (sites Distance (step Orthogonal (to if:(is In (to) (intersection (sites Empty) (sites ""Mountain""))))) from:(from) (range 1 (- 2 1))) if:(is Empty (to)) (apply (set State at:(from) 1))))) (move Select (from (from) if:(> (state at:(from)) 0)) (to (sites Distance Orthogonal from:(from) (range 1 1)) if:(and {(if (is In (from) (sites Occupied by:Mover container:""Board"" components:{""Bomber"" ""Battleship"" ""Artillery"" ""Launcher""})) (is In (to) (union (sites Occupied by:Enemy container:""Board"" components:{""Soldier"" ""Motorbike"" ""Tank"" ""Speeder"" ""Shooter"" ""Launcher"" ""Antiair"" ""Battleship"" ""Artillery"" ""Base"" ""Town"" ""Factory"" ""Dock"" ""Airport"" ""Cruiser"" ""Submarine""}) (sites Occupied by:Neutral container:""Board""))) (is In (to) (union (sites Occupied by:Enemy container:""Board"") (sites Occupied by:Neutral container:""Board"")))) (if (is In (from) (sites Occupied by:Mover container:""Board"" components:{""Antiair"" ""Fighter""})) (is In (to) (sites Occupied by:Enemy container:""Board"" components:{""Fighter"" ""Helicopter"" ""Bomber""})) (is In (to) (union (sites Occupied by:Enemy container:""Board"") (sites Occupied by:Neutral container:""Board"")))) (if (is In (from) (sites Occupied by:Mover container:""Board"" components:{""Submarine""})) (is In (to) (sites Occupied by:Enemy container:""Board"" components:{""Submarine"" ""Battleship"" ""Cruiser""})) (is In (to) (union (sites Occupied by:Enemy container:""Board"") (sites Occupied by:Neutral container:""Board""))))})) (then (do (and (set Value at:(last To) (max 0 (- (value Piece at:(last To)) (/ (* (if (is In (last To) (sites Occupied by:All container:""Board"" components:{""Fighter"" ""Bomber"" ""Helicopter""})) (max (/ (* (* (value Piece at:(last From)) 4) (mapEntry ""DamageMultiplier"" (what at:(last From)))) 100) 1) (if (and (is In (last To) (sites Occupied by:All container:""Board"" components:{""Soldier"" ""Motorbike""})) (is In (last From) (sites Occupied by:All component:""Shooter""))) (if (is In (last To) (sites ""Forest"")) (max (/ (* (* (value Piece at:(last From)) 6) (mapEntry ""DamageMultiplier"" (what at:(last From)))) 100) 1) (if (is In (last To) (union (sites ""ShallowWater"") (sites ""DeepWater""))) (max (/ (* (* (value Piece at:(last From)) 10) (mapEntry ""DamageMultiplier"" (what at:(last From)))) 100) 1) (max (/ (* (* (value Piece at:(last From)) 8) (mapEntry ""DamageMultiplier"" (what at:(last From)))) 100) 1))) (if (is In (last To) (sites ""Forest"")) (max (/ (* (* (value Piece at:(last From)) 3) (mapEntry ""DamageMultiplier"" (what at:(last From)))) 100) 1) (if (is In (last To) (union (sites ""ShallowWater"") (sites ""DeepWater""))) (max (/ (* (* (value Piece at:(last From)) 5) (mapEntry ""DamageMultiplier"" (what at:(last From)))) 100) 1) (max (/ (* (* (value Piece at:(last From)) 4) (mapEntry ""DamageMultiplier"" (what at:(last From)))) 100) 1))))) (* {(if (is In (last From) (sites Occupied by:All container:""Board"" components:{""Soldier"" ""Motorbike""})) (if (= (who at:(last From)) 1) (mapEntry ""NoDoctrine"" 1) (if (= (who at:(last From)) 2) (mapEntry ""NoDoctrine"" 1) (if (= (who at:(last From)) 3) (mapEntry ""NoDoctrine"" 1) (if (= (who at:(last From)) 4) (mapEntry ""NoDoctrine"" 1) 0)))) (if (is In (last From) (sites Occupied by:All container:""Board"" components:{""Tank"" ""Speeder"" ""Shooter""})) (if (= (who at:(last From)) 1) (mapEntry ""NoDoctrine"" 2) (if (= (who at:(last From)) 2) (mapEntry ""NoDoctrine"" 2) (if (= (who at:(last From)) 3) (mapEntry ""NoDoctrine"" 2) (if (= (who at:(last From)) 4) (mapEntry ""NoDoctrine"" 2) 0)))) (if (is In (last From) (sites Occupied by:All container:""Board"" components:{""Launcher"" ""Antiair"" ""Artillery""})) (if (= (who at:(last From)) 1) (mapEntry ""NoDoctrine"" 3) (if (= (who at:(last From)) 2) (mapEntry ""NoDoctrine"" 3) (if (= (who at:(last From)) 3) (mapEntry ""NoDoctrine"" 3) (if (= (who at:(last From)) 4) (mapEntry ""NoDoctrine"" 3) 0)))) (if (is In (last From) (sites Occupied by:All container:""Board"" components:{""Fighter"" ""Bomber"" ""Helicopter""})) (if (= (who at:(last From)) 1) (mapEntry ""NoDoctrine"" 4) (if (= (who at:(last From)) 2) (mapEntry ""NoDoctrine"" 4) (if (= (who at:(last From)) 3) (mapEntry ""NoDoctrine"" 4) (if (= (who at:(last From)) 4) (mapEntry ""NoDoctrine"" 4) 0)))) (if (is In (last From) (sites Occupied by:All container:""Board"" components:{""Submarine"" ""Cruiser"" ""Battleship""})) (if (= (who at:(last From)) 1) (mapEntry ""NoDoctrine"" 5) (if (= (who at:(last From)) 2) (mapEntry ""NoDoctrine"" 5) (if (= (who at:(last From)) 3) (mapEntry ""NoDoctrine"" 5) (if (= (who at:(last From)) 4) (mapEntry ""NoDoctrine"" 5) 0)))) 4))))) (if (and (= 8 (state at:(last To))) (!= (mover) (who at:(last To)))) (if (= (who at:(last From)) 1) (mapEntry ""NoDoctrine"" 6) (if (= (who at:(last From)) 2) (mapEntry ""NoDoctrine"" 6) (if (= (who at:(last From)) 3) (mapEntry ""NoDoctrine"" 6) (if (= (who at:(last From)) 4) (mapEntry ""NoDoctrine"" 6) 0)))) 5) (if (> (who at:(last To)) 0) (if (= (who at:(last To)) 1) (mapEntry ""NoDoctrine"" 8) (if (= (who at:(last To)) 2) (mapEntry ""NoDoctrine"" 8) (if (= (who at:(last To)) 3) (mapEntry ""NoDoctrine"" 8) (if (= (who at:(last To)) 4) (mapEntry ""NoDoctrine"" 8) 0)))) 4) (if False (if (= (who at:(last From)) 1) (mapEntry ""NoDoctrine"" 10) (if (= (who at:(last From)) 2) (mapEntry ""NoDoctrine"" 10) (if (= (who at:(last From)) 3) (mapEntry ""NoDoctrine"" 10) (if (= (who at:(last From)) 4) (mapEntry ""NoDoctrine"" 10) 0)))) (if (= (who at:(last From)) 1) (mapEntry ""NoDoctrine"" 9) (if (= (who at:(last From)) 2) (mapEntry ""NoDoctrine"" 9) (if (= (who at:(last From)) 3) (mapEntry ""NoDoctrine"" 9) (if (= (who at:(last From)) 4) (mapEntry ""NoDoctrine"" 9) 0))))) (value Random (range (if (= (who at:(last From)) 1) (mapEntry ""NoDoctrine"" 11) (if (= (who at:(last From)) 2) (mapEntry ""NoDoctrine"" 11) (if (= (who at:(last From)) 3) (mapEntry ""NoDoctrine"" 11) (if (= (who at:(last From)) 4) (mapEntry ""NoDoctrine"" 11) 0)))) (if (= (who at:(last From)) 1) (mapEntry ""NoDoctrine"" 12) (if (= (who at:(last From)) 2) (mapEntry ""NoDoctrine"" 12) (if (= (who at:(last From)) 3) (mapEntry ""NoDoctrine"" 12) (if (= (who at:(last From)) 4) (mapEntry ""NoDoctrine"" 12) 0))))))})) 128000)))) (set State at:(last From) 0)) next:(if (and (= 8 (state at:(last To))) (!= (mover) (who at:(last To)))) (if (= (value Piece at:(last To)) 0) (and {(take Control of:All by:Mover at:(last To)) (set Value at:(last To) 50)}) (set Value at:(last To) (value Piece at:(last To)))) (if (= (value Piece at:(last To)) 0) (remove (last To)) (if (and {(= 0 (count Sites in:(intersection (sites {(last To) (last From)}) (sites Occupied by:All components:{""Launcher"" ""Artillery"" ""Battleship"" ""Antiair""})))) (if (is In (last To) (sites Occupied by:Enemy components:{""Bomber"" ""Battleship"" ""Artillery"" ""Launcher""})) (is In (last From) (union (sites Occupied by:Mover components:{""Soldier"" ""Motorbike"" ""Tank"" ""Speeder"" ""Shooter"" ""Launcher"" ""Antiair"" ""Battleship"" ""Artillery"" ""Base"" ""Town"" ""Factory"" ""Dock"" ""Airport"" ""Cruiser"" ""Submarine""}) (sites Occupied by:Neutral container:""Board""))) (is In (last From) (union (sites Occupied by:Mover) (sites Occupied by:Neutral container:""Board"")))) (if (is In (last To) (sites Occupied by:Enemy components:{""Antiair"" ""Fighter""})) (is In (last From) (sites Occupied by:Mover components:{""Fighter"" ""Helicopter"" ""Bomber""})) (is In (last From) (union (sites Occupied by:Mover) (sites Occupied by:Neutral container:""Board"")))) (if (is In (last To) (sites Occupied by:Enemy components:{""Submarine""})) (is In (last From) (sites Occupied by:Mover components:{""Submarine"" ""Battleship"" ""Cruiser""})) (is In (last From) (union (sites Occupied by:Mover) (sites Occupied by:Neutral container:""Board""))))}) (if (<= (- (value Piece at:(last From)) (/ (* (if (is In (last From) (sites Occupied by:All container:""Board"" components:{""Fighter"" ""Bomber"" ""Helicopter""})) (max (/ (* (* (value Piece at:(last To)) 4) (mapEntry ""DamageMultiplier"" (what at:(last To)))) 100) 1) (if (and (is In (last From) (sites Occupied by:All container:""Board"" components:{""Soldier"" ""Motorbike""})) (is In (last To) (sites Occupied by:All component:""Shooter""))) (if (is In (last From) (sites ""Forest"")) (max (/ (* (* (value Piece at:(last To)) 6) (mapEntry ""DamageMultiplier"" (what at:(last To)))) 100) 1) (if (is In (last From) (union (sites ""ShallowWater"") (sites ""DeepWater""))) (max (/ (* (* (value Piece at:(last To)) 10) (mapEntry ""DamageMultiplier"" (what at:(last To)))) 100) 1) (max (/ (* (* (value Piece at:(last To)) 8) (mapEntry ""DamageMultiplier"" (what at:(last To)))) 100) 1))) (if (is In (last From) (sites ""Forest"")) (max (/ (* (* (value Piece at:(last To)) 3) (mapEntry ""DamageMultiplier"" (what at:(last To)))) 100) 1) (if (is In (last From) (union (sites ""ShallowWater"") (sites ""DeepWater""))) (max (/ (* (* (value Piece at:(last To)) 5) (mapEntry ""DamageMultiplier"" (what at:(last To)))) 100) 1) (max (/ (* (* (value Piece at:(last To)) 4) (mapEntry ""DamageMultiplier"" (what at:(last To)))) 100) 1))))) (* {(if (is In (last To) (sites Occupied by:All container:""Board"" components:{""Soldier"" ""Motorbike""})) (if (= (who at:(last To)) 1) (mapEntry ""NoDoctrine"" 1) (if (= (who at:(last To)) 2) (mapEntry ""NoDoctrine"" 1) (if (= (who at:(last To)) 3) (mapEntry ""NoDoctrine"" 1) (if (= (who at:(last To)) 4) (mapEntry ""NoDoctrine"" 1) 0)))) (if (is In (last To) (sites Occupied by:All container:""Board"" components:{""Tank"" ""Speeder"" ""Shooter""})) (if (= (who at:(last To)) 1) (mapEntry ""NoDoctrine"" 2) (if (= (who at:(last To)) 2) (mapEntry ""NoDoctrine"" 2) (if (= (who at:(last To)) 3) (mapEntry ""NoDoctrine"" 2) (if (= (who at:(last To)) 4) (mapEntry ""NoDoctrine"" 2) 0)))) (if (is In (last To) (sites Occupied by:All container:""Board"" components:{""Launcher"" ""Antiair"" ""Artillery""})) (if (= (who at:(last To)) 1) (mapEntry ""NoDoctrine"" 3) (if (= (who at:(last To)) 2) (mapEntry ""NoDoctrine"" 3) (if (= (who at:(last To)) 3) (mapEntry ""NoDoctrine"" 3) (if (= (who at:(last To)) 4) (mapEntry ""NoDoctrine"" 3) 0)))) (if (is In (last To) (sites Occupied by:All container:""Board"" components:{""Fighter"" ""Bomber"" ""Helicopter""})) (if (= (who at:(last To)) 1) (mapEntry ""NoDoctrine"" 4) (if (= (who at:(last To)) 2) (mapEntry ""NoDoctrine"" 4) (if (= (who at:(last To)) 3) (mapEntry ""NoDoctrine"" 4) (if (= (who at:(last To)) 4) (mapEntry ""NoDoctrine"" 4) 0)))) (if (is In (last To) (sites Occupied by:All container:""Board"" components:{""Submarine"" ""Cruiser"" ""Battleship""})) (if (= (who at:(last To)) 1) (mapEntry ""NoDoctrine"" 5) (if (= (who at:(last To)) 2) (mapEntry ""NoDoctrine"" 5) (if (= (who at:(last To)) 3) (mapEntry ""NoDoctrine"" 5) (if (= (who at:(last To)) 4) (mapEntry ""NoDoctrine"" 5) 0)))) 4))))) (if (and (= 8 (state at:(last From))) (!= (mover) (who at:(last From)))) (if (= (who at:(last To)) 1) (mapEntry ""NoDoctrine"" 6) (if (= (who at:(last To)) 2) (mapEntry ""NoDoctrine"" 6) (if (= (who at:(last To)) 3) (mapEntry ""NoDoctrine"" 6) (if (= (who at:(last To)) 4) (mapEntry ""NoDoctrine"" 6) 0)))) 5) (if (> (who at:(last From)) 0) (if (= (who at:(last From)) 1) (mapEntry ""NoDoctrine"" 8) (if (= (who at:(last From)) 2) (mapEntry ""NoDoctrine"" 8) (if (= (who at:(last From)) 3) (mapEntry ""NoDoctrine"" 8) (if (= (who at:(last From)) 4) (mapEntry ""NoDoctrine"" 8) 0)))) 4) (if True (if (= (who at:(last To)) 1) (mapEntry ""NoDoctrine"" 10) (if (= (who at:(last To)) 2) (mapEntry ""NoDoctrine"" 10) (if (= (who at:(last To)) 3) (mapEntry ""NoDoctrine"" 10) (if (= (who at:(last To)) 4) (mapEntry ""NoDoctrine"" 10) 0)))) (if (= (who at:(last To)) 1) (mapEntry ""NoDoctrine"" 9) (if (= (who at:(last To)) 2) (mapEntry ""NoDoctrine"" 9) (if (= (who at:(last To)) 3) (mapEntry ""NoDoctrine"" 9) (if (= (who at:(last To)) 4) (mapEntry ""NoDoctrine"" 9) 0))))) (value Random (range (if (= (who at:(last To)) 1) (mapEntry ""NoDoctrine"" 11) (if (= (who at:(last To)) 2) (mapEntry ""NoDoctrine"" 11) (if (= (who at:(last To)) 3) (mapEntry ""NoDoctrine"" 11) (if (= (who at:(last To)) 4) (mapEntry ""NoDoctrine"" 11) 0)))) (if (= (who at:(last To)) 1) (mapEntry ""NoDoctrine"" 12) (if (= (who at:(last To)) 2) (mapEntry ""NoDoctrine"" 12) (if (= (who at:(last To)) 3) (mapEntry ""NoDoctrine"" 12) (if (= (who at:(last To)) 4) (mapEntry ""NoDoctrine"" 12) 0))))))})) 128000)) 0) (remove (last From)) (set Value at:(last From) (- (value Piece at:(last From)) (/ (* (if (is In (last From) (sites Occupied by:All container:""Board"" components:{""Fighter"" ""Bomber"" ""Helicopter""})) (max (/ (* (* (value Piece at:(last To)) 4) (mapEntry ""DamageMultiplier"" (what at:(last To)))) 100) 1) (if (and (is In (last From) (sites Occupied by:All container:""Board"" components:{""Soldier"" ""Motorbike""})) (is In (last To) (sites Occupied by:All component:""Shooter""))) (if (is In (last From) (sites ""Forest"")) (max (/ (* (* (value Piece at:(last To)) 6) (mapEntry ""DamageMultiplier"" (what at:(last To)))) 100) 1) (if (is In (last From) (union (sites ""ShallowWater"") (sites ""DeepWater""))) (max (/ (* (* (value Piece at:(last To)) 10) (mapEntry ""DamageMultiplier"" (what at:(last To)))) 100) 1) (max (/ (* (* (value Piece at:(last To)) 8) (mapEntry ""DamageMultiplier"" (what at:(last To)))) 100) 1))) (if (is In (last From) (sites ""Forest"")) (max (/ (* (* (value Piece at:(last To)) 3) (mapEntry ""DamageMultiplier"" (what at:(last To)))) 100) 1) (if (is In (last From) (union (sites ""ShallowWater"") (sites ""DeepWater""))) (max (/ (* (* (value Piece at:(last To)) 5) (mapEntry ""DamageMultiplier"" (what at:(last To)))) 100) 1) (max (/ (* (* (value Piece at:(last To)) 4) (mapEntry ""DamageMultiplier"" (what at:(last To)))) 100) 1))))) (* {(if (is In (last To) (sites Occupied by:All container:""Board"" components:{""Soldier"" ""Motorbike""})) (if (= (who at:(last To)) 1) (mapEntry ""NoDoctrine"" 1) (if (= (who at:(last To)) 2) (mapEntry ""NoDoctrine"" 1) (if (= (who at:(last To)) 3) (mapEntry ""NoDoctrine"" 1) (if (= (who at:(last To)) 4) (mapEntry ""NoDoctrine"" 1) 0)))) (if (is In (last To) (sites Occupied by:All container:""Board"" components:{""Tank"" ""Speeder"" ""Shooter""})) (if (= (who at:(last To)) 1) (mapEntry ""NoDoctrine"" 2) (if (= (who at:(last To)) 2) (mapEntry ""NoDoctrine"" 2) (if (= (who at:(last To)) 3) (mapEntry ""NoDoctrine"" 2) (if (= (who at:(last To)) 4) (mapEntry ""NoDoctrine"" 2) 0)))) (if (is In (last To) (sites Occupied by:All container:""Board"" components:{""Launcher"" ""Antiair"" ""Artillery""})) (if (= (who at:(last To)) 1) (mapEntry ""NoDoctrine"" 3) (if (= (who at:(last To)) 2) (mapEntry ""NoDoctrine"" 3) (if (= (who at:(last To)) 3) (mapEntry ""NoDoctrine"" 3) (if (= (who at:(last To)) 4) (mapEntry ""NoDoctrine"" 3) 0)))) (if (is In (last To) (sites Occupied by:All container:""Board"" components:{""Fighter"" ""Bomber"" ""Helicopter""})) (if (= (who at:(last To)) 1) (mapEntry ""NoDoctrine"" 4) (if (= (who at:(last To)) 2) (mapEntry ""NoDoctrine"" 4) (if (= (who at:(last To)) 3) (mapEntry ""NoDoctrine"" 4) (if (= (who at:(last To)) 4) (mapEntry ""NoDoctrine"" 4) 0)))) (if (is In (last To) (sites Occupied by:All container:""Board"" components:{""Submarine"" ""Cruiser"" ""Battleship""})) (if (= (who at:(last To)) 1) (mapEntry ""NoDoctrine"" 5) (if (= (who at:(last To)) 2) (mapEntry ""NoDoctrine"" 5) (if (= (who at:(last To)) 3) (mapEntry ""NoDoctrine"" 5) (if (= (who at:(last To)) 4) (mapEntry ""NoDoctrine"" 5) 0)))) 4))))) (if (and (= 8 (state at:(last From))) (!= (mover) (who at:(last From)))) (if (= (who at:(last To)) 1) (mapEntry ""NoDoctrine"" 6) (if (= (who at:(last To)) 2) (mapEntry ""NoDoctrine"" 6) (if (= (who at:(last To)) 3) (mapEntry ""NoDoctrine"" 6) (if (= (who at:(last To)) 4) (mapEntry ""NoDoctrine"" 6) 0)))) 5) (if (> (who at:(last From)) 0) (if (= (who at:(last From)) 1) (mapEntry ""NoDoctrine"" 8) (if (= (who at:(last From)) 2) (mapEntry ""NoDoctrine"" 8) (if (= (who at:(last From)) 3) (mapEntry ""NoDoctrine"" 8) (if (= (who at:(last From)) 4) (mapEntry ""NoDoctrine"" 8) 0)))) 4) (if True (if (= (who at:(last To)) 1) (mapEntry ""NoDoctrine"" 10) (if (= (who at:(last To)) 2) (mapEntry ""NoDoctrine"" 10) (if (= (who at:(last To)) 3) (mapEntry ""NoDoctrine"" 10) (if (= (who at:(last To)) 4) (mapEntry ""NoDoctrine"" 10) 0)))) (if (= (who at:(last To)) 1) (mapEntry ""NoDoctrine"" 9) (if (= (who at:(last To)) 2) (mapEntry ""NoDoctrine"" 9) (if (= (who at:(last To)) 3) (mapEntry ""NoDoctrine"" 9) (if (= (who at:(last To)) 4) (mapEntry ""NoDoctrine"" 9) 0))))) (value Random (range (if (= (who at:(last To)) 1) (mapEntry ""NoDoctrine"" 11) (if (= (who at:(last To)) 2) (mapEntry ""NoDoctrine"" 11) (if (= (who at:(last To)) 3) (mapEntry ""NoDoctrine"" 11) (if (= (who at:(last To)) 4) (mapEntry ""NoDoctrine"" 11) 0)))) (if (= (who at:(last To)) 1) (mapEntry ""NoDoctrine"" 12) (if (= (who at:(last To)) 2) (mapEntry ""NoDoctrine"" 12) (if (= (who at:(last To)) 3) (mapEntry ""NoDoctrine"" 12) (if (= (who at:(last To)) 4) (mapEntry ""NoDoctrine"" 12) 0))))))})) 128000)))) (set Value at:(last From) (value Piece at:(last From))))))))) (move Select (from (from) if:(and (> (state at:(from)) 0) (< (value Piece at:(from)) (mapEntry ""MaxHealth"" (what at:(from)))))) (to (sites Around (from) Orthogonal if:(is In (to) (sites Occupied by:Mover container:""Board"" components:{""Town"" ""Dock"" ""Base"" ""Factory"" ""Airport""})))) (then (and {(set Value at:(last From) (min (mapEntry ""MaxHealth"" (what at:(last From))) (- (+ (value Piece at:(last From)) (value Piece at:(last To))) 1))) (set Value at:(last To) (max (- (value Piece at:(last To)) (- (mapEntry ""MaxHealth"" (what at:(last From))) (value Piece at:(last From)))) 1)) (set State at:(last From) 0)}))) (move Select (from (from) if:(> (state at:(from)) 0)) (to (sites Around (from) Orthogonal if:(and (= (what at:(from)) (what at:(to))) (< (value Piece at:(to)) (mapEntry ""MaxHealth"" (what at:(to))))))) (then (and {(if (<= (+ (value Piece at:(last To)) (value Piece at:(last From))) (mapEntry ""MaxHealth"" (what at:(last From)))) (and (set Value at:(last To) (min (mapEntry ""MaxHealth"" (what at:(last From))) (+ (value Piece at:(last From)) (value Piece at:(last To))))) (remove (last From))) (and (set Value at:(last To) (min (mapEntry ""MaxHealth"" (what at:(last From))) (- (+ (value Piece at:(last From)) (value Piece at:(last To))) 1))) (set Value at:(last From) (max (- (value Piece at:(last To)) (- (mapEntry ""MaxHealth"" (what at:(last From))) (value Piece at:(last From)))) 1)))) (set State at:(last From) 0) (set State at:(last To) 0)})))})) (piece ""Speeder"" Each (or {(or (move (from (from) if:(> (state at:(from)) 1)) (to (sites Distance (step Orthogonal (to if:(is In (to) (difference (union (sites Empty) (sites Occupied by:Friend container:""Board"")) (union (union (sites ""Mountain"") (sites ""DeepWater"")) (union (sites ""Forest"") (sites ""ShallowWater""))))))) from:(from) (range 1 (- (state at:(from)) 1))) if:(is Empty (to)) (apply (set State at:(from) 1)))) (move (from (from) if:(> (state at:(from)) 1)) (to (sites Distance (step Orthogonal (to if:(is In (to) (intersection (sites Empty) (union (sites ""Forest"") (sites ""ShallowWater"")))))) from:(from) (range 1 (- 2 1))) if:(is Empty (to)) (apply (set State at:(from) 1))))) (move Select (from (from) if:(> (state at:(from)) 0)) (to (sites Distance Orthogonal from:(from) (range 1 1)) if:(and {(if (is In (from) (sites Occupied by:Mover container:""Board"" components:{""Bomber"" ""Battleship"" ""Artillery"" ""Launcher""})) (is In (to) (union (sites Occupied by:Enemy container:""Board"" components:{""Soldier"" ""Motorbike"" ""Tank"" ""Speeder"" ""Shooter"" ""Launcher"" ""Antiair"" ""Battleship"" ""Artillery"" ""Base"" ""Town"" ""Factory"" ""Dock"" ""Airport"" ""Cruiser"" ""Submarine""}) (sites Occupied by:Neutral container:""Board""))) (is In (to) (union (sites Occupied by:Enemy container:""Board"") (sites Occupied by:Neutral container:""Board"")))) (if (is In (from) (sites Occupied by:Mover container:""Board"" components:{""Antiair"" ""Fighter""})) (is In (to) (sites Occupied by:Enemy container:""Board"" components:{""Fighter"" ""Helicopter"" ""Bomber""})) (is In (to) (union (sites Occupied by:Enemy container:""Board"") (sites Occupied by:Neutral container:""Board"")))) (if (is In (from) (sites Occupied by:Mover container:""Board"" components:{""Submarine""})) (is In (to) (sites Occupied by:Enemy container:""Board"" components:{""Submarine"" ""Battleship"" ""Cruiser""})) (is In (to) (union (sites Occupied by:Enemy container:""Board"") (sites Occupied by:Neutral container:""Board""))))})) (then (do (and (set Value at:(last To) (max 0 (- (value Piece at:(last To)) (/ (* (if (is In (last To) (sites Occupied by:All container:""Board"" components:{""Fighter"" ""Bomber"" ""Helicopter""})) (max (/ (* (* (value Piece at:(last From)) 4) (mapEntry ""DamageMultiplier"" (what at:(last From)))) 100) 1) (if (and (is In (last To) (sites Occupied by:All container:""Board"" components:{""Soldier"" ""Motorbike""})) (is In (last From) (sites Occupied by:All component:""Shooter""))) (if (is In (last To) (sites ""Forest"")) (max (/ (* (* (value Piece at:(last From)) 6) (mapEntry ""DamageMultiplier"" (what at:(last From)))) 100) 1) (if (is In (last To) (union (sites ""ShallowWater"") (sites ""DeepWater""))) (max (/ (* (* (value Piece at:(last From)) 10) (mapEntry ""DamageMultiplier"" (what at:(last From)))) 100) 1) (max (/ (* (* (value Piece at:(last From)) 8) (mapEntry ""DamageMultiplier"" (what at:(last From)))) 100) 1))) (if (is In (last To) (sites ""Forest"")) (max (/ (* (* (value Piece at:(last From)) 3) (mapEntry ""DamageMultiplier"" (what at:(last From)))) 100) 1) (if (is In (last To) (union (sites ""ShallowWater"") (sites ""DeepWater""))) (max (/ (* (* (value Piece at:(last From)) 5) (mapEntry ""DamageMultiplier"" (what at:(last From)))) 100) 1) (max (/ (* (* (value Piece at:(last From)) 4) (mapEntry ""DamageMultiplier"" (what at:(last From)))) 100) 1))))) (* {(if (is In (last From) (sites Occupied by:All container:""Board"" components:{""Soldier"" ""Motorbike""})) (if (= (who at:(last From)) 1) (mapEntry ""NoDoctrine"" 1) (if (= (who at:(last From)) 2) (mapEntry ""NoDoctrine"" 1) (if (= (who at:(last From)) 3) (mapEntry ""NoDoctrine"" 1) (if (= (who at:(last From)) 4) (mapEntry ""NoDoctrine"" 1) 0)))) (if (is In (last From) (sites Occupied by:All container:""Board"" components:{""Tank"" ""Speeder"" ""Shooter""})) (if (= (who at:(last From)) 1) (mapEntry ""NoDoctrine"" 2) (if (= (who at:(last From)) 2) (mapEntry ""NoDoctrine"" 2) (if (= (who at:(last From)) 3) (mapEntry ""NoDoctrine"" 2) (if (= (who at:(last From)) 4) (mapEntry ""NoDoctrine"" 2) 0)))) (if (is In (last From) (sites Occupied by:All container:""Board"" components:{""Launcher"" ""Antiair"" ""Artillery""})) (if (= (who at:(last From)) 1) (mapEntry ""NoDoctrine"" 3) (if (= (who at:(last From)) 2) (mapEntry ""NoDoctrine"" 3) (if (= (who at:(last From)) 3) (mapEntry ""NoDoctrine"" 3) (if (= (who at:(last From)) 4) (mapEntry ""NoDoctrine"" 3) 0)))) (if (is In (last From) (sites Occupied by:All container:""Board"" components:{""Fighter"" ""Bomber"" ""Helicopter""})) (if (= (who at:(last From)) 1) (mapEntry ""NoDoctrine"" 4) (if (= (who at:(last From)) 2) (mapEntry ""NoDoctrine"" 4) (if (= (who at:(last From)) 3) (mapEntry ""NoDoctrine"" 4) (if (= (who at:(last From)) 4) (mapEntry ""NoDoctrine"" 4) 0)))) (if (is In (last From) (sites Occupied by:All container:""Board"" components:{""Submarine"" ""Cruiser"" ""Battleship""})) (if (= (who at:(last From)) 1) (mapEntry ""NoDoctrine"" 5) (if (= (who at:(last From)) 2) (mapEntry ""NoDoctrine"" 5) (if (= (who at:(last From)) 3) (mapEntry ""NoDoctrine"" 5) (if (= (who at:(last From)) 4) (mapEntry ""NoDoctrine"" 5) 0)))) 4))))) (if (and (= 8 (state at:(last To))) (!= (mover) (who at:(last To)))) (if (= (who at:(last From)) 1) (mapEntry ""NoDoctrine"" 6) (if (= (who at:(last From)) 2) (mapEntry ""NoDoctrine"" 6) (if (= (who at:(last From)) 3) (mapEntry ""NoDoctrine"" 6) (if (= (who at:(last From)) 4) (mapEntry ""NoDoctrine"" 6) 0)))) 5) (if (> (who at:(last To)) 0) (if (= (who at:(last To)) 1) (mapEntry ""NoDoctrine"" 8) (if (= (who at:(last To)) 2) (mapEntry ""NoDoctrine"" 8) (if (= (who at:(last To)) 3) (mapEntry ""NoDoctrine"" 8) (if (= (who at:(last To)) 4) (mapEntry ""NoDoctrine"" 8) 0)))) 4) (if False (if (= (who at:(last From)) 1) (mapEntry ""NoDoctrine"" 10) (if (= (who at:(last From)) 2) (mapEntry ""NoDoctrine"" 10) (if (= (who at:(last From)) 3) (mapEntry ""NoDoctrine"" 10) (if (= (who at:(last From)) 4) (mapEntry ""NoDoctrine"" 10) 0)))) (if (= (who at:(last From)) 1) (mapEntry ""NoDoctrine"" 9) (if (= (who at:(last From)) 2) (mapEntry ""NoDoctrine"" 9) (if (= (who at:(last From)) 3) (mapEntry ""NoDoctrine"" 9) (if (= (who at:(last From)) 4) (mapEntry ""NoDoctrine"" 9) 0))))) (value Random (range (if (= (who at:(last From)) 1) (mapEntry ""NoDoctrine"" 11) (if (= (who at:(last From)) 2) (mapEntry ""NoDoctrine"" 11) (if (= (who at:(last From)) 3) (mapEntry ""NoDoctrine"" 11) (if (= (who at:(last From)) 4) (mapEntry ""NoDoctrine"" 11) 0)))) (if (= (who at:(last From)) 1) (mapEntry ""NoDoctrine"" 12) (if (= (who at:(last From)) 2) (mapEntry ""NoDoctrine"" 12) (if (= (who at:(last From)) 3) (mapEntry ""NoDoctrine"" 12) (if (= (who at:(last From)) 4) (mapEntry ""NoDoctrine"" 12) 0))))))})) 128000)))) (set State at:(last From) 0)) next:(if (and (= 8 (state at:(last To))) (!= (mover) (who at:(last To)))) (if (= (value Piece at:(last To)) 0) (and {(take Control of:All by:Mover at:(last To)) (set Value at:(last To) 50)}) (set Value at:(last To) (value Piece at:(last To)))) (if (= (value Piece at:(last To)) 0) (remove (last To)) (if (and {(= 0 (count Sites in:(intersection (sites {(last To) (last From)}) (sites Occupied by:All components:{""Launcher"" ""Artillery"" ""Battleship"" ""Antiair""})))) (if (is In (last To) (sites Occupied by:Enemy components:{""Bomber"" ""Battleship"" ""Artillery"" ""Launcher""})) (is In (last From) (union (sites Occupied by:Mover components:{""Soldier"" ""Motorbike"" ""Tank"" ""Speeder"" ""Shooter"" ""Launcher"" ""Antiair"" ""Battleship"" ""Artillery"" ""Base"" ""Town"" ""Factory"" ""Dock"" ""Airport"" ""Cruiser"" ""Submarine""}) (sites Occupied by:Neutral container:""Board""))) (is In (last From) (union (sites Occupied by:Mover) (sites Occupied by:Neutral container:""Board"")))) (if (is In (last To) (sites Occupied by:Enemy components:{""Antiair"" ""Fighter""})) (is In (last From) (sites Occupied by:Mover components:{""Fighter"" ""Helicopter"" ""Bomber""})) (is In (last From) (union (sites Occupied by:Mover) (sites Occupied by:Neutral container:""Board"")))) (if (is In (last To) (sites Occupied by:Enemy components:{""Submarine""})) (is In (last From) (sites Occupied by:Mover components:{""Submarine"" ""Battleship"" ""Cruiser""})) (is In (last From) (union (sites Occupied by:Mover) (sites Occupied by:Neutral container:""Board""))))}) (if (<= (- (value Piece at:(last From)) (/ (* (if (is In (last From) (sites Occupied by:All container:""Board"" components:{""Fighter"" ""Bomber"" ""Helicopter""})) (max (/ (* (* (value Piece at:(last To)) 4) (mapEntry ""DamageMultiplier"" (what at:(last To)))) 100) 1) (if (and (is In (last From) (sites Occupied by:All container:""Board"" components:{""Soldier"" ""Motorbike""})) (is In (last To) (sites Occupied by:All component:""Shooter""))) (if (is In (last From) (sites ""Forest"")) (max (/ (* (* (value Piece at:(last To)) 6) (mapEntry ""DamageMultiplier"" (what at:(last To)))) 100) 1) (if (is In (last From) (union (sites ""ShallowWater"") (sites ""DeepWater""))) (max (/ (* (* (value Piece at:(last To)) 10) (mapEntry ""DamageMultiplier"" (what at:(last To)))) 100) 1) (max (/ (* (* (value Piece at:(last To)) 8) (mapEntry ""DamageMultiplier"" (what at:(last To)))) 100) 1))) (if (is In (last From) (sites ""Forest"")) (max (/ (* (* (value Piece at:(last To)) 3) (mapEntry ""DamageMultiplier"" (what at:(last To)))) 100) 1) (if (is In (last From) (union (sites ""ShallowWater"") (sites ""DeepWater""))) (max (/ (* (* (value Piece at:(last To)) 5) (mapEntry ""DamageMultiplier"" (what at:(last To)))) 100) 1) (max (/ (* (* (value Piece at:(last To)) 4) (mapEntry ""DamageMultiplier"" (what at:(last To)))) 100) 1))))) (* {(if (is In (last To) (sites Occupied by:All container:""Board"" components:{""Soldier"" ""Motorbike""})) (if (= (who at:(last To)) 1) (mapEntry ""NoDoctrine"" 1) (if (= (who at:(last To)) 2) (mapEntry ""NoDoctrine"" 1) (if (= (who at:(last To)) 3) (mapEntry ""NoDoctrine"" 1) (if (= (who at:(last To)) 4) (mapEntry ""NoDoctrine"" 1) 0)))) (if (is In (last To) (sites Occupied by:All container:""Board"" components:{""Tank"" ""Speeder"" ""Shooter""})) (if (= (who at:(last To)) 1) (mapEntry ""NoDoctrine"" 2) (if (= (who at:(last To)) 2) (mapEntry ""NoDoctrine"" 2) (if (= (who at:(last To)) 3) (mapEntry ""NoDoctrine"" 2) (if (= (who at:(last To)) 4) (mapEntry ""NoDoctrine"" 2) 0)))) (if (is In (last To) (sites Occupied by:All container:""Board"" components:{""Launcher"" ""Antiair"" ""Artillery""})) (if (= (who at:(last To)) 1) (mapEntry ""NoDoctrine"" 3) (if (= (who at:(last To)) 2) (mapEntry ""NoDoctrine"" 3) (if (= (who at:(last To)) 3) (mapEntry ""NoDoctrine"" 3) (if (= (who at:(last To)) 4) (mapEntry ""NoDoctrine"" 3) 0)))) (if (is In (last To) (sites Occupied by:All container:""Board"" components:{""Fighter"" ""Bomber"" ""Helicopter""})) (if (= (who at:(last To)) 1) (mapEntry ""NoDoctrine"" 4) (if (= (who at:(last To)) 2) (mapEntry ""NoDoctrine"" 4) (if (= (who at:(last To)) 3) (mapEntry ""NoDoctrine"" 4) (if (= (who at:(last To)) 4) (mapEntry ""NoDoctrine"" 4) 0)))) (if (is In (last To) (sites Occupied by:All container:""Board"" components:{""Submarine"" ""Cruiser"" ""Battleship""})) (if (= (who at:(last To)) 1) (mapEntry ""NoDoctrine"" 5) (if (= (who at:(last To)) 2) (mapEntry ""NoDoctrine"" 5) (if (= (who at:(last To)) 3) (mapEntry ""NoDoctrine"" 5) (if (= (who at:(last To)) 4) (mapEntry ""NoDoctrine"" 5) 0)))) 4))))) (if (and (= 8 (state at:(last From))) (!= (mover) (who at:(last From)))) (if (= (who at:(last To)) 1) (mapEntry ""NoDoctrine"" 6) (if (= (who at:(last To)) 2) (mapEntry ""NoDoctrine"" 6) (if (= (who at:(last To)) 3) (mapEntry ""NoDoctrine"" 6) (if (= (who at:(last To)) 4) (mapEntry ""NoDoctrine"" 6) 0)))) 5) (if (> (who at:(last From)) 0) (if (= (who at:(last From)) 1) (mapEntry ""NoDoctrine"" 8) (if (= (who at:(last From)) 2) (mapEntry ""NoDoctrine"" 8) (if (= (who at:(last From)) 3) (mapEntry ""NoDoctrine"" 8) (if (= (who at:(last From)) 4) (mapEntry ""NoDoctrine"" 8) 0)))) 4) (if True (if (= (who at:(last To)) 1) (mapEntry ""NoDoctrine"" 10) (if (= (who at:(last To)) 2) (mapEntry ""NoDoctrine"" 10) (if (= (who at:(last To)) 3) (mapEntry ""NoDoctrine"" 10) (if (= (who at:(last To)) 4) (mapEntry ""NoDoctrine"" 10) 0)))) (if (= (who at:(last To)) 1) (mapEntry ""NoDoctrine"" 9) (if (= (who at:(last To)) 2) (mapEntry ""NoDoctrine"" 9) (if (= (who at:(last To)) 3) (mapEntry ""NoDoctrine"" 9) (if (= (who at:(last To)) 4) (mapEntry ""NoDoctrine"" 9) 0))))) (value Random (range (if (= (who at:(last To)) 1) (mapEntry ""NoDoctrine"" 11) (if (= (who at:(last To)) 2) (mapEntry ""NoDoctrine"" 11) (if (= (who at:(last To)) 3) (mapEntry ""NoDoctrine"" 11) (if (= (who at:(last To)) 4) (mapEntry ""NoDoctrine"" 11) 0)))) (if (= (who at:(last To)) 1) (mapEntry ""NoDoctrine"" 12) (if (= (who at:(last To)) 2) (mapEntry ""NoDoctrine"" 12) (if (= (who at:(last To)) 3) (mapEntry ""NoDoctrine"" 12) (if (= (who at:(last To)) 4) (mapEntry ""NoDoctrine"" 12) 0))))))})) 128000)) 0) (remove (last From)) (set Value at:(last From) (- (value Piece at:(last From)) (/ (* (if (is In (last From) (sites Occupied by:All container:""Board"" components:{""Fighter"" ""Bomber"" ""Helicopter""})) (max (/ (* (* (value Piece at:(last To)) 4) (mapEntry ""DamageMultiplier"" (what at:(last To)))) 100) 1) (if (and (is In (last From) (sites Occupied by:All container:""Board"" components:{""Soldier"" ""Motorbike""})) (is In (last To) (sites Occupied by:All component:""Shooter""))) (if (is In (last From) (sites ""Forest"")) (max (/ (* (* (value Piece at:(last To)) 6) (mapEntry ""DamageMultiplier"" (what at:(last To)))) 100) 1) (if (is In (last From) (union (sites ""ShallowWater"") (sites ""DeepWater""))) (max (/ (* (* (value Piece at:(last To)) 10) (mapEntry ""DamageMultiplier"" (what at:(last To)))) 100) 1) (max (/ (* (* (value Piece at:(last To)) 8) (mapEntry ""DamageMultiplier"" (what at:(last To)))) 100) 1))) (if (is In (last From) (sites ""Forest"")) (max (/ (* (* (value Piece at:(last To)) 3) (mapEntry ""DamageMultiplier"" (what at:(last To)))) 100) 1) (if (is In (last From) (union (sites ""ShallowWater"") (sites ""DeepWater""))) (max (/ (* (* (value Piece at:(last To)) 5) (mapEntry ""DamageMultiplier"" (what at:(last To)))) 100) 1) (max (/ (* (* (value Piece at:(last To)) 4) (mapEntry ""DamageMultiplier"" (what at:(last To)))) 100) 1))))) (* {(if (is In (last To) (sites Occupied by:All container:""Board"" components:{""Soldier"" ""Motorbike""})) (if (= (who at:(last To)) 1) (mapEntry ""NoDoctrine"" 1) (if (= (who at:(last To)) 2) (mapEntry ""NoDoctrine"" 1) (if (= (who at:(last To)) 3) (mapEntry ""NoDoctrine"" 1) (if (= (who at:(last To)) 4) (mapEntry ""NoDoctrine"" 1) 0)))) (if (is In (last To) (sites Occupied by:All container:""Board"" components:{""Tank"" ""Speeder"" ""Shooter""})) (if (= (who at:(last To)) 1) (mapEntry ""NoDoctrine"" 2) (if (= (who at:(last To)) 2) (mapEntry ""NoDoctrine"" 2) (if (= (who at:(last To)) 3) (mapEntry ""NoDoctrine"" 2) (if (= (who at:(last To)) 4) (mapEntry ""NoDoctrine"" 2) 0)))) (if (is In (last To) (sites Occupied by:All container:""Board"" components:{""Launcher"" ""Antiair"" ""Artillery""})) (if (= (who at:(last To)) 1) (mapEntry ""NoDoctrine"" 3) (if (= (who at:(last To)) 2) (mapEntry ""NoDoctrine"" 3) (if (= (who at:(last To)) 3) (mapEntry ""NoDoctrine"" 3) (if (= (who at:(last To)) 4) (mapEntry ""NoDoctrine"" 3) 0)))) (if (is In (last To) (sites Occupied by:All container:""Board"" components:{""Fighter"" ""Bomber"" ""Helicopter""})) (if (= (who at:(last To)) 1) (mapEntry ""NoDoctrine"" 4) (if (= (who at:(last To)) 2) (mapEntry ""NoDoctrine"" 4) (if (= (who at:(last To)) 3) (mapEntry ""NoDoctrine"" 4) (if (= (who at:(last To)) 4) (mapEntry ""NoDoctrine"" 4) 0)))) (if (is In (last To) (sites Occupied by:All container:""Board"" components:{""Submarine"" ""Cruiser"" ""Battleship""})) (if (= (who at:(last To)) 1) (mapEntry ""NoDoctrine"" 5) (if (= (who at:(last To)) 2) (mapEntry ""NoDoctrine"" 5) (if (= (who at:(last To)) 3) (mapEntry ""NoDoctrine"" 5) (if (= (who at:(last To)) 4) (mapEntry ""NoDoctrine"" 5) 0)))) 4))))) (if (and (= 8 (state at:(last From))) (!= (mover) (who at:(last From)))) (if (= (who at:(last To)) 1) (mapEntry ""NoDoctrine"" 6) (if (= (who at:(last To)) 2) (mapEntry ""NoDoctrine"" 6) (if (= (who at:(last To)) 3) (mapEntry ""NoDoctrine"" 6) (if (= (who at:(last To)) 4) (mapEntry ""NoDoctrine"" 6) 0)))) 5) (if (> (who at:(last From)) 0) (if (= (who at:(last From)) 1) (mapEntry ""NoDoctrine"" 8) (if (= (who at:(last From)) 2) (mapEntry ""NoDoctrine"" 8) (if (= (who at:(last From)) 3) (mapEntry ""NoDoctrine"" 8) (if (= (who at:(last From)) 4) (mapEntry ""NoDoctrine"" 8) 0)))) 4) (if True (if (= (who at:(last To)) 1) (mapEntry ""NoDoctrine"" 10) (if (= (who at:(last To)) 2) (mapEntry ""NoDoctrine"" 10) (if (= (who at:(last To)) 3) (mapEntry ""NoDoctrine"" 10) (if (= (who at:(last To)) 4) (mapEntry ""NoDoctrine"" 10) 0)))) (if (= (who at:(last To)) 1) (mapEntry ""NoDoctrine"" 9) (if (= (who at:(last To)) 2) (mapEntry ""NoDoctrine"" 9) (if (= (who at:(last To)) 3) (mapEntry ""NoDoctrine"" 9) (if (= (who at:(last To)) 4) (mapEntry ""NoDoctrine"" 9) 0))))) (value Random (range (if (= (who at:(last To)) 1) (mapEntry ""NoDoctrine"" 11) (if (= (who at:(last To)) 2) (mapEntry ""NoDoctrine"" 11) (if (= (who at:(last To)) 3) (mapEntry ""NoDoctrine"" 11) (if (= (who at:(last To)) 4) (mapEntry ""NoDoctrine"" 11) 0)))) (if (= (who at:(last To)) 1) (mapEntry ""NoDoctrine"" 12) (if (= (who at:(last To)) 2) (mapEntry ""NoDoctrine"" 12) (if (= (who at:(last To)) 3) (mapEntry ""NoDoctrine"" 12) (if (= (who at:(last To)) 4) (mapEntry ""NoDoctrine"" 12) 0))))))})) 128000)))) (set Value at:(last From) (value Piece at:(last From))))))))) (move Select (from (from) if:(and (> (state at:(from)) 0) (< (value Piece at:(from)) (mapEntry ""MaxHealth"" (what at:(from)))))) (to (sites Around (from) Orthogonal if:(is In (to) (sites Occupied by:Mover container:""Board"" components:{""Town"" ""Dock"" ""Base"" ""Factory"" ""Airport""})))) (then (and {(set Value at:(last From) (min (mapEntry ""MaxHealth"" (what at:(last From))) (- (+ (value Piece at:(last From)) (value Piece at:(last To))) 1))) (set Value at:(last To) (max (- (value Piece at:(last To)) (- (mapEntry ""MaxHealth"" (what at:(last From))) (value Piece at:(last From)))) 1)) (set State at:(last From) 0)}))) (move Select (from (from) if:(> (state at:(from)) 0)) (to (sites Around (from) Orthogonal if:(and (= (what at:(from)) (what at:(to))) (< (value Piece at:(to)) (mapEntry ""MaxHealth"" (what at:(to))))))) (then (and {(if (<= (+ (value Piece at:(last To)) (value Piece at:(last From))) (mapEntry ""MaxHealth"" (what at:(last From)))) (and (set Value at:(last To) (min (mapEntry ""MaxHealth"" (what at:(last From))) (+ (value Piece at:(last From)) (value Piece at:(last To))))) (remove (last From))) (and (set Value at:(last To) (min (mapEntry ""MaxHealth"" (what at:(last From))) (- (+ (value Piece at:(last From)) (value Piece at:(last To))) 1))) (set Value at:(last From) (max (- (value Piece at:(last To)) (- (mapEntry ""MaxHealth"" (what at:(last From))) (value Piece at:(last From)))) 1)))) (set State at:(last From) 0) (set State at:(last To) 0)})))})) (piece ""Shooter"" Each (or {(or (move (from (from) if:(> (state at:(from)) 1)) (to (sites Distance (step Orthogonal (to if:(is In (to) (difference (union (sites Empty) (sites Occupied by:Friend container:""Board"")) (union (union (sites ""Mountain"") (sites ""DeepWater"")) (union (sites ""Forest"") (sites ""ShallowWater""))))))) from:(from) (range 1 (- (state at:(from)) 1))) if:(is Empty (to)) (apply (set State at:(from) 1)))) (move (from (from) if:(> (state at:(from)) 1)) (to (sites Distance (step Orthogonal (to if:(is In (to) (intersection (sites Empty) (union (sites ""Forest"") (sites ""ShallowWater"")))))) from:(from) (range 1 (- 2 1))) if:(is Empty (to)) (apply (set State at:(from) 1))))) (move Select (from (from) if:(> (state at:(from)) 0)) (to (sites Distance Orthogonal from:(from) (range 1 1)) if:(and {(if (is In (from) (sites Occupied by:Mover container:""Board"" components:{""Bomber"" ""Battleship"" ""Artillery"" ""Launcher""})) (is In (to) (union (sites Occupied by:Enemy container:""Board"" components:{""Soldier"" ""Motorbike"" ""Tank"" ""Speeder"" ""Shooter"" ""Launcher"" ""Antiair"" ""Battleship"" ""Artillery"" ""Base"" ""Town"" ""Factory"" ""Dock"" ""Airport"" ""Cruiser"" ""Submarine""}) (sites Occupied by:Neutral container:""Board""))) (is In (to) (union (sites Occupied by:Enemy container:""Board"") (sites Occupied by:Neutral container:""Board"")))) (if (is In (from) (sites Occupied by:Mover container:""Board"" components:{""Antiair"" ""Fighter""})) (is In (to) (sites Occupied by:Enemy container:""Board"" components:{""Fighter"" ""Helicopter"" ""Bomber""})) (is In (to) (union (sites Occupied by:Enemy container:""Board"") (sites Occupied by:Neutral container:""Board"")))) (if (is In (from) (sites Occupied by:Mover container:""Board"" components:{""Submarine""})) (is In (to) (sites Occupied by:Enemy container:""Board"" components:{""Submarine"" ""Battleship"" ""Cruiser""})) (is In (to) (union (sites Occupied by:Enemy container:""Board"") (sites Occupied by:Neutral container:""Board""))))})) (then (do (and (set Value at:(last To) (max 0 (- (value Piece at:(last To)) (/ (* (if (is In (last To) (sites Occupied by:All container:""Board"" components:{""Fighter"" ""Bomber"" ""Helicopter""})) (max (/ (* (* (value Piece at:(last From)) 4) (mapEntry ""DamageMultiplier"" (what at:(last From)))) 100) 1) (if (and (is In (last To) (sites Occupied by:All container:""Board"" components:{""Soldier"" ""Motorbike""})) (is In (last From) (sites Occupied by:All component:""Shooter""))) (if (is In (last To) (sites ""Forest"")) (max (/ (* (* (value Piece at:(last From)) 6) (mapEntry ""DamageMultiplier"" (what at:(last From)))) 100) 1) (if (is In (last To) (union (sites ""ShallowWater"") (sites ""DeepWater""))) (max (/ (* (* (value Piece at:(last From)) 10) (mapEntry ""DamageMultiplier"" (what at:(last From)))) 100) 1) (max (/ (* (* (value Piece at:(last From)) 8) (mapEntry ""DamageMultiplier"" (what at:(last From)))) 100) 1))) (if (is In (last To) (sites ""Forest"")) (max (/ (* (* (value Piece at:(last From)) 3) (mapEntry ""DamageMultiplier"" (what at:(last From)))) 100) 1) (if (is In (last To) (union (sites ""ShallowWater"") (sites ""DeepWater""))) (max (/ (* (* (value Piece at:(last From)) 5) (mapEntry ""DamageMultiplier"" (what at:(last From)))) 100) 1) (max (/ (* (* (value Piece at:(last From)) 4) (mapEntry ""DamageMultiplier"" (what at:(last From)))) 100) 1))))) (* {(if (is In (last From) (sites Occupied by:All container:""Board"" components:{""Soldier"" ""Motorbike""})) (if (= (who at:(last From)) 1) (mapEntry ""NoDoctrine"" 1) (if (= (who at:(last From)) 2) (mapEntry ""NoDoctrine"" 1) (if (= (who at:(last From)) 3) (mapEntry ""NoDoctrine"" 1) (if (= (who at:(last From)) 4) (mapEntry ""NoDoctrine"" 1) 0)))) (if (is In (last From) (sites Occupied by:All container:""Board"" components:{""Tank"" ""Speeder"" ""Shooter""})) (if (= (who at:(last From)) 1) (mapEntry ""NoDoctrine"" 2) (if (= (who at:(last From)) 2) (mapEntry ""NoDoctrine"" 2) (if (= (who at:(last From)) 3) (mapEntry ""NoDoctrine"" 2) (if (= (who at:(last From)) 4) (mapEntry ""NoDoctrine"" 2) 0)))) (if (is In (last From) (sites Occupied by:All container:""Board"" components:{""Launcher"" ""Antiair"" ""Artillery""})) (if (= (who at:(last From)) 1) (mapEntry ""NoDoctrine"" 3) (if (= (who at:(last From)) 2) (mapEntry ""NoDoctrine"" 3) (if (= (who at:(last From)) 3) (mapEntry ""NoDoctrine"" 3) (if (= (who at:(last From)) 4) (mapEntry ""NoDoctrine"" 3) 0)))) (if (is In (last From) (sites Occupied by:All container:""Board"" components:{""Fighter"" ""Bomber"" ""Helicopter""})) (if (= (who at:(last From)) 1) (mapEntry ""NoDoctrine"" 4) (if (= (who at:(last From)) 2) (mapEntry ""NoDoctrine"" 4) (if (= (who at:(last From)) 3) (mapEntry ""NoDoctrine"" 4) (if (= (who at:(last From)) 4) (mapEntry ""NoDoctrine"" 4) 0)))) (if (is In (last From) (sites Occupied by:All container:""Board"" components:{""Submarine"" ""Cruiser"" ""Battleship""})) (if (= (who at:(last From)) 1) (mapEntry ""NoDoctrine"" 5) (if (= (who at:(last From)) 2) (mapEntry ""NoDoctrine"" 5) (if (= (who at:(last From)) 3) (mapEntry ""NoDoctrine"" 5) (if (= (who at:(last From)) 4) (mapEntry ""NoDoctrine"" 5) 0)))) 4))))) (if (and (= 8 (state at:(last To))) (!= (mover) (who at:(last To)))) (if (= (who at:(last From)) 1) (mapEntry ""NoDoctrine"" 6) (if (= (who at:(last From)) 2) (mapEntry ""NoDoctrine"" 6) (if (= (who at:(last From)) 3) (mapEntry ""NoDoctrine"" 6) (if (= (who at:(last From)) 4) (mapEntry ""NoDoctrine"" 6) 0)))) 5) (if (> (who at:(last To)) 0) (if (= (who at:(last To)) 1) (mapEntry ""NoDoctrine"" 8) (if (= (who at:(last To)) 2) (mapEntry ""NoDoctrine"" 8) (if (= (who at:(last To)) 3) (mapEntry ""NoDoctrine"" 8) (if (= (who at:(last To)) 4) (mapEntry ""NoDoctrine"" 8) 0)))) 4) (if False (if (= (who at:(last From)) 1) (mapEntry ""NoDoctrine"" 10) (if (= (who at:(last From)) 2) (mapEntry ""NoDoctrine"" 10) (if (= (who at:(last From)) 3) (mapEntry ""NoDoctrine"" 10) (if (= (who at:(last From)) 4) (mapEntry ""NoDoctrine"" 10) 0)))) (if (= (who at:(last From)) 1) (mapEntry ""NoDoctrine"" 9) (if (= (who at:(last From)) 2) (mapEntry ""NoDoctrine"" 9) (if (= (who at:(last From)) 3) (mapEntry ""NoDoctrine"" 9) (if (= (who at:(last From)) 4) (mapEntry ""NoDoctrine"" 9) 0))))) (value Random (range (if (= (who at:(last From)) 1) (mapEntry ""NoDoctrine"" 11) (if (= (who at:(last From)) 2) (mapEntry ""NoDoctrine"" 11) (if (= (who at:(last From)) 3) (mapEntry ""NoDoctrine"" 11) (if (= (who at:(last From)) 4) (mapEntry ""NoDoctrine"" 11) 0)))) (if (= (who at:(last From)) 1) (mapEntry ""NoDoctrine"" 12) (if (= (who at:(last From)) 2) (mapEntry ""NoDoctrine"" 12) (if (= (who at:(last From)) 3) (mapEntry ""NoDoctrine"" 12) (if (= (who at:(last From)) 4) (mapEntry ""NoDoctrine"" 12) 0))))))})) 128000)))) (set State at:(last From) 0)) next:(if (and (= 8 (state at:(last To))) (!= (mover) (who at:(last To)))) (if (= (value Piece at:(last To)) 0) (and {(take Control of:All by:Mover at:(last To)) (set Value at:(last To) 50)}) (set Value at:(last To) (value Piece at:(last To)))) (if (= (value Piece at:(last To)) 0) (remove (last To)) (if (and {(= 0 (count Sites in:(intersection (sites {(last To) (last From)}) (sites Occupied by:All components:{""Launcher"" ""Artillery"" ""Battleship"" ""Antiair""})))) (if (is In (last To) (sites Occupied by:Enemy components:{""Bomber"" ""Battleship"" ""Artillery"" ""Launcher""})) (is In (last From) (union (sites Occupied by:Mover components:{""Soldier"" ""Motorbike"" ""Tank"" ""Speeder"" ""Shooter"" ""Launcher"" ""Antiair"" ""Battleship"" ""Artillery"" ""Base"" ""Town"" ""Factory"" ""Dock"" ""Airport"" ""Cruiser"" ""Submarine""}) (sites Occupied by:Neutral container:""Board""))) (is In (last From) (union (sites Occupied by:Mover) (sites Occupied by:Neutral container:""Board"")))) (if (is In (last To) (sites Occupied by:Enemy components:{""Antiair"" ""Fighter""})) (is In (last From) (sites Occupied by:Mover components:{""Fighter"" ""Helicopter"" ""Bomber""})) (is In (last From) (union (sites Occupied by:Mover) (sites Occupied by:Neutral container:""Board"")))) (if (is In (last To) (sites Occupied by:Enemy components:{""Submarine""})) (is In (last From) (sites Occupied by:Mover components:{""Submarine"" ""Battleship"" ""Cruiser""})) (is In (last From) (union (sites Occupied by:Mover) (sites Occupied by:Neutral container:""Board""))))}) (if (<= (- (value Piece at:(last From)) (/ (* (if (is In (last From) (sites Occupied by:All container:""Board"" components:{""Fighter"" ""Bomber"" ""Helicopter""})) (max (/ (* (* (value Piece at:(last To)) 4) (mapEntry ""DamageMultiplier"" (what at:(last To)))) 100) 1) (if (and (is In (last From) (sites Occupied by:All container:""Board"" components:{""Soldier"" ""Motorbike""})) (is In (last To) (sites Occupied by:All component:""Shooter""))) (if (is In (last From) (sites ""Forest"")) (max (/ (* (* (value Piece at:(last To)) 6) (mapEntry ""DamageMultiplier"" (what at:(last To)))) 100) 1) (if (is In (last From) (union (sites ""ShallowWater"") (sites ""DeepWater""))) (max (/ (* (* (value Piece at:(last To)) 10) (mapEntry ""DamageMultiplier"" (what at:(last To)))) 100) 1) (max (/ (* (* (value Piece at:(last To)) 8) (mapEntry ""DamageMultiplier"" (what at:(last To)))) 100) 1))) (if (is In (last From) (sites ""Forest"")) (max (/ (* (* (value Piece at:(last To)) 3) (mapEntry ""DamageMultiplier"" (what at:(last To)))) 100) 1) (if (is In (last From) (union (sites ""ShallowWater"") (sites ""DeepWater""))) (max (/ (* (* (value Piece at:(last To)) 5) (mapEntry ""DamageMultiplier"" (what at:(last To)))) 100) 1) (max (/ (* (* (value Piece at:(last To)) 4) (mapEntry ""DamageMultiplier"" (what at:(last To)))) 100) 1))))) (* {(if (is In (last To) (sites Occupied by:All container:""Board"" components:{""Soldier"" ""Motorbike""})) (if (= (who at:(last To)) 1) (mapEntry ""NoDoctrine"" 1) (if (= (who at:(last To)) 2) (mapEntry ""NoDoctrine"" 1) (if (= (who at:(last To)) 3) (mapEntry ""NoDoctrine"" 1) (if (= (who at:(last To)) 4) (mapEntry ""NoDoctrine"" 1) 0)))) (if (is In (last To) (sites Occupied by:All container:""Board"" components:{""Tank"" ""Speeder"" ""Shooter""})) (if (= (who at:(last To)) 1) (mapEntry ""NoDoctrine"" 2) (if (= (who at:(last To)) 2) (mapEntry ""NoDoctrine"" 2) (if (= (who at:(last To)) 3) (mapEntry ""NoDoctrine"" 2) (if (= (who at:(last To)) 4) (mapEntry ""NoDoctrine"" 2) 0)))) (if (is In (last To) (sites Occupied by:All container:""Board"" components:{""Launcher"" ""Antiair"" ""Artillery""})) (if (= (who at:(last To)) 1) (mapEntry ""NoDoctrine"" 3) (if (= (who at:(last To)) 2) (mapEntry ""NoDoctrine"" 3) (if (= (who at:(last To)) 3) (mapEntry ""NoDoctrine"" 3) (if (= (who at:(last To)) 4) (mapEntry ""NoDoctrine"" 3) 0)))) (if (is In (last To) (sites Occupied by:All container:""Board"" components:{""Fighter"" ""Bomber"" ""Helicopter""})) (if (= (who at:(last To)) 1) (mapEntry ""NoDoctrine"" 4) (if (= (who at:(last To)) 2) (mapEntry ""NoDoctrine"" 4) (if (= (who at:(last To)) 3) (mapEntry ""NoDoctrine"" 4) (if (= (who at:(last To)) 4) (mapEntry ""NoDoctrine"" 4) 0)))) (if (is In (last To) (sites Occupied by:All container:""Board"" components:{""Submarine"" ""Cruiser"" ""Battleship""})) (if (= (who at:(last To)) 1) (mapEntry ""NoDoctrine"" 5) (if (= (who at:(last To)) 2) (mapEntry ""NoDoctrine"" 5) (if (= (who at:(last To)) 3) (mapEntry ""NoDoctrine"" 5) (if (= (who at:(last To)) 4) (mapEntry ""NoDoctrine"" 5) 0)))) 4))))) (if (and (= 8 (state at:(last From))) (!= (mover) (who at:(last From)))) (if (= (who at:(last To)) 1) (mapEntry ""NoDoctrine"" 6) (if (= (who at:(last To)) 2) (mapEntry ""NoDoctrine"" 6) (if (= (who at:(last To)) 3) (mapEntry ""NoDoctrine"" 6) (if (= (who at:(last To)) 4) (mapEntry ""NoDoctrine"" 6) 0)))) 5) (if (> (who at:(last From)) 0) (if (= (who at:(last From)) 1) (mapEntry ""NoDoctrine"" 8) (if (= (who at:(last From)) 2) (mapEntry ""NoDoctrine"" 8) (if (= (who at:(last From)) 3) (mapEntry ""NoDoctrine"" 8) (if (= (who at:(last From)) 4) (mapEntry ""NoDoctrine"" 8) 0)))) 4) (if True (if (= (who at:(last To)) 1) (mapEntry ""NoDoctrine"" 10) (if (= (who at:(last To)) 2) (mapEntry ""NoDoctrine"" 10) (if (= (who at:(last To)) 3) (mapEntry ""NoDoctrine"" 10) (if (= (who at:(last To)) 4) (mapEntry ""NoDoctrine"" 10) 0)))) (if (= (who at:(last To)) 1) (mapEntry ""NoDoctrine"" 9) (if (= (who at:(last To)) 2) (mapEntry ""NoDoctrine"" 9) (if (= (who at:(last To)) 3) (mapEntry ""NoDoctrine"" 9) (if (= (who at:(last To)) 4) (mapEntry ""NoDoctrine"" 9) 0))))) (value Random (range (if (= (who at:(last To)) 1) (mapEntry ""NoDoctrine"" 11) (if (= (who at:(last To)) 2) (mapEntry ""NoDoctrine"" 11) (if (= (who at:(last To)) 3) (mapEntry ""NoDoctrine"" 11) (if (= (who at:(last To)) 4) (mapEntry ""NoDoctrine"" 11) 0)))) (if (= (who at:(last To)) 1) (mapEntry ""NoDoctrine"" 12) (if (= (who at:(last To)) 2) (mapEntry ""NoDoctrine"" 12) (if (= (who at:(last To)) 3) (mapEntry ""NoDoctrine"" 12) (if (= (who at:(last To)) 4) (mapEntry ""NoDoctrine"" 12) 0))))))})) 128000)) 0) (remove (last From)) (set Value at:(last From) (- (value Piece at:(last From)) (/ (* (if (is In (last From) (sites Occupied by:All container:""Board"" components:{""Fighter"" ""Bomber"" ""Helicopter""})) (max (/ (* (* (value Piece at:(last To)) 4) (mapEntry ""DamageMultiplier"" (what at:(last To)))) 100) 1) (if (and (is In (last From) (sites Occupied by:All container:""Board"" components:{""Soldier"" ""Motorbike""})) (is In (last To) (sites Occupied by:All component:""Shooter""))) (if (is In (last From) (sites ""Forest"")) (max (/ (* (* (value Piece at:(last To)) 6) (mapEntry ""DamageMultiplier"" (what at:(last To)))) 100) 1) (if (is In (last From) (union (sites ""ShallowWater"") (sites ""DeepWater""))) (max (/ (* (* (value Piece at:(last To)) 10) (mapEntry ""DamageMultiplier"" (what at:(last To)))) 100) 1) (max (/ (* (* (value Piece at:(last To)) 8) (mapEntry ""DamageMultiplier"" (what at:(last To)))) 100) 1))) (if (is In (last From) (sites ""Forest"")) (max (/ (* (* (value Piece at:(last To)) 3) (mapEntry ""DamageMultiplier"" (what at:(last To)))) 100) 1) (if (is In (last From) (union (sites ""ShallowWater"") (sites ""DeepWater""))) (max (/ (* (* (value Piece at:(last To)) 5) (mapEntry ""DamageMultiplier"" (what at:(last To)))) 100) 1) (max (/ (* (* (value Piece at:(last To)) 4) (mapEntry ""DamageMultiplier"" (what at:(last To)))) 100) 1))))) (* {(if (is In (last To) (sites Occupied by:All container:""Board"" components:{""Soldier"" ""Motorbike""})) (if (= (who at:(last To)) 1) (mapEntry ""NoDoctrine"" 1) (if (= (who at:(last To)) 2) (mapEntry ""NoDoctrine"" 1) (if (= (who at:(last To)) 3) (mapEntry ""NoDoctrine"" 1) (if (= (who at:(last To)) 4) (mapEntry ""NoDoctrine"" 1) 0)))) (if (is In (last To) (sites Occupied by:All container:""Board"" components:{""Tank"" ""Speeder"" ""Shooter""})) (if (= (who at:(last To)) 1) (mapEntry ""NoDoctrine"" 2) (if (= (who at:(last To)) 2) (mapEntry ""NoDoctrine"" 2) (if (= (who at:(last To)) 3) (mapEntry ""NoDoctrine"" 2) (if (= (who at:(last To)) 4) (mapEntry ""NoDoctrine"" 2) 0)))) (if (is In (last To) (sites Occupied by:All container:""Board"" components:{""Launcher"" ""Antiair"" ""Artillery""})) (if (= (who at:(last To)) 1) (mapEntry ""NoDoctrine"" 3) (if (= (who at:(last To)) 2) (mapEntry ""NoDoctrine"" 3) (if (= (who at:(last To)) 3) (mapEntry ""NoDoctrine"" 3) (if (= (who at:(last To)) 4) (mapEntry ""NoDoctrine"" 3) 0)))) (if (is In (last To) (sites Occupied by:All container:""Board"" components:{""Fighter"" ""Bomber"" ""Helicopter""})) (if (= (who at:(last To)) 1) (mapEntry ""NoDoctrine"" 4) (if (= (who at:(last To)) 2) (mapEntry ""NoDoctrine"" 4) (if (= (who at:(last To)) 3) (mapEntry ""NoDoctrine"" 4) (if (= (who at:(last To)) 4) (mapEntry ""NoDoctrine"" 4) 0)))) (if (is In (last To) (sites Occupied by:All container:""Board"" components:{""Submarine"" ""Cruiser"" ""Battleship""})) (if (= (who at:(last To)) 1) (mapEntry ""NoDoctrine"" 5) (if (= (who at:(last To)) 2) (mapEntry ""NoDoctrine"" 5) (if (= (who at:(last To)) 3) (mapEntry ""NoDoctrine"" 5) (if (= (who at:(last To)) 4) (mapEntry ""NoDoctrine"" 5) 0)))) 4))))) (if (and (= 8 (state at:(last From))) (!= (mover) (who at:(last From)))) (if (= (who at:(last To)) 1) (mapEntry ""NoDoctrine"" 6) (if (= (who at:(last To)) 2) (mapEntry ""NoDoctrine"" 6) (if (= (who at:(last To)) 3) (mapEntry ""NoDoctrine"" 6) (if (= (who at:(last To)) 4) (mapEntry ""NoDoctrine"" 6) 0)))) 5) (if (> (who at:(last From)) 0) (if (= (who at:(last From)) 1) (mapEntry ""NoDoctrine"" 8) (if (= (who at:(last From)) 2) (mapEntry ""NoDoctrine"" 8) (if (= (who at:(last From)) 3) (mapEntry ""NoDoctrine"" 8) (if (= (who at:(last From)) 4) (mapEntry ""NoDoctrine"" 8) 0)))) 4) (if True (if (= (who at:(last To)) 1) (mapEntry ""NoDoctrine"" 10) (if (= (who at:(last To)) 2) (mapEntry ""NoDoctrine"" 10) (if (= (who at:(last To)) 3) (mapEntry ""NoDoctrine"" 10) (if (= (who at:(last To)) 4) (mapEntry ""NoDoctrine"" 10) 0)))) (if (= (who at:(last To)) 1) (mapEntry ""NoDoctrine"" 9) (if (= (who at:(last To)) 2) (mapEntry ""NoDoctrine"" 9) (if (= (who at:(last To)) 3) (mapEntry ""NoDoctrine"" 9) (if (= (who at:(last To)) 4) (mapEntry ""NoDoctrine"" 9) 0))))) (value Random (range (if (= (who at:(last To)) 1) (mapEntry ""NoDoctrine"" 11) (if (= (who at:(last To)) 2) (mapEntry ""NoDoctrine"" 11) (if (= (who at:(last To)) 3) (mapEntry ""NoDoctrine"" 11) (if (= (who at:(last To)) 4) (mapEntry ""NoDoctrine"" 11) 0)))) (if (= (who at:(last To)) 1) (mapEntry ""NoDoctrine"" 12) (if (= (who at:(last To)) 2) (mapEntry ""NoDoctrine"" 12) (if (= (who at:(last To)) 3) (mapEntry ""NoDoctrine"" 12) (if (= (who at:(last To)) 4) (mapEntry ""NoDoctrine"" 12) 0))))))})) 128000)))) (set Value at:(last From) (value Piece at:(last From))))))))) (move Select (from (from) if:(and (> (state at:(from)) 0) (< (value Piece at:(from)) (mapEntry ""MaxHealth"" (what at:(from)))))) (to (sites Around (from) Orthogonal if:(is In (to) (sites Occupied by:Mover container:""Board"" components:{""Town"" ""Dock"" ""Base"" ""Factory"" ""Airport""})))) (then (and {(set Value at:(last From) (min (mapEntry ""MaxHealth"" (what at:(last From))) (- (+ (value Piece at:(last From)) (value Piece at:(last To))) 1))) (set Value at:(last To) (max (- (value Piece at:(last To)) (- (mapEntry ""MaxHealth"" (what at:(last From))) (value Piece at:(last From)))) 1)) (set State at:(last From) 0)}))) (move Select (from (from) if:(> (state at:(from)) 0)) (to (sites Around (from) Orthogonal if:(and (= (what at:(from)) (what at:(to))) (< (value Piece at:(to)) (mapEntry ""MaxHealth"" (what at:(to))))))) (then (and {(if (<= (+ (value Piece at:(last To)) (value Piece at:(last From))) (mapEntry ""MaxHealth"" (what at:(last From)))) (and (set Value at:(last To) (min (mapEntry ""MaxHealth"" (what at:(last From))) (+ (value Piece at:(last From)) (value Piece at:(last To))))) (remove (last From))) (and (set Value at:(last To) (min (mapEntry ""MaxHealth"" (what at:(last From))) (- (+ (value Piece at:(last From)) (value Piece at:(last To))) 1))) (set Value at:(last From) (max (- (value Piece at:(last To)) (- (mapEntry ""MaxHealth"" (what at:(last From))) (value Piece at:(last From)))) 1)))) (set State at:(last From) 0) (set State at:(last To) 0)})))})) (piece ""Tank"" Each (or {(or (move (from (from) if:(> (state at:(from)) 1)) (to (sites Distance (step Orthogonal (to if:(is In (to) (difference (union (sites Empty) (sites Occupied by:Friend container:""Board"")) (union (union (sites ""Mountain"") (sites ""DeepWater"")) (union (sites ""Forest"") (sites ""ShallowWater""))))))) from:(from) (range 1 (- (state at:(from)) 1))) if:(is Empty (to)) (apply (set State at:(from) 1)))) (move (from (from) if:(> (state at:(from)) 1)) (to (sites Distance (step Orthogonal (to if:(is In (to) (intersection (sites Empty) (union (sites ""Forest"") (sites ""ShallowWater"")))))) from:(from) (range 1 (- 2 1))) if:(is Empty (to)) (apply (set State at:(from) 1))))) (move Select (from (from) if:(> (state at:(from)) 0)) (to (sites Distance Orthogonal from:(from) (range 1 1)) if:(and {(if (is In (from) (sites Occupied by:Mover container:""Board"" components:{""Bomber"" ""Battleship"" ""Artillery"" ""Launcher""})) (is In (to) (union (sites Occupied by:Enemy container:""Board"" components:{""Soldier"" ""Motorbike"" ""Tank"" ""Speeder"" ""Shooter"" ""Launcher"" ""Antiair"" ""Battleship"" ""Artillery"" ""Base"" ""Town"" ""Factory"" ""Dock"" ""Airport"" ""Cruiser"" ""Submarine""}) (sites Occupied by:Neutral container:""Board""))) (is In (to) (union (sites Occupied by:Enemy container:""Board"") (sites Occupied by:Neutral container:""Board"")))) (if (is In (from) (sites Occupied by:Mover container:""Board"" components:{""Antiair"" ""Fighter""})) (is In (to) (sites Occupied by:Enemy container:""Board"" components:{""Fighter"" ""Helicopter"" ""Bomber""})) (is In (to) (union (sites Occupied by:Enemy container:""Board"") (sites Occupied by:Neutral container:""Board"")))) (if (is In (from) (sites Occupied by:Mover container:""Board"" components:{""Submarine""})) (is In (to) (sites Occupied by:Enemy container:""Board"" components:{""Submarine"" ""Battleship"" ""Cruiser""})) (is In (to) (union (sites Occupied by:Enemy container:""Board"") (sites Occupied by:Neutral container:""Board""))))})) (then (do (and (set Value at:(last To) (max 0 (- (value Piece at:(last To)) (/ (* (if (is In (last To) (sites Occupied by:All container:""Board"" components:{""Fighter"" ""Bomber"" ""Helicopter""})) (max (/ (* (* (value Piece at:(last From)) 4) (mapEntry ""DamageMultiplier"" (what at:(last From)))) 100) 1) (if (and (is In (last To) (sites Occupied by:All container:""Board"" components:{""Soldier"" ""Motorbike""})) (is In (last From) (sites Occupied by:All component:""Shooter""))) (if (is In (last To) (sites ""Forest"")) (max (/ (* (* (value Piece at:(last From)) 6) (mapEntry ""DamageMultiplier"" (what at:(last From)))) 100) 1) (if (is In (last To) (union (sites ""ShallowWater"") (sites ""DeepWater""))) (max (/ (* (* (value Piece at:(last From)) 10) (mapEntry ""DamageMultiplier"" (what at:(last From)))) 100) 1) (max (/ (* (* (value Piece at:(last From)) 8) (mapEntry ""DamageMultiplier"" (what at:(last From)))) 100) 1))) (if (is In (last To) (sites ""Forest"")) (max (/ (* (* (value Piece at:(last From)) 3) (mapEntry ""DamageMultiplier"" (what at:(last From)))) 100) 1) (if (is In (last To) (union (sites ""ShallowWater"") (sites ""DeepWater""))) (max (/ (* (* (value Piece at:(last From)) 5) (mapEntry ""DamageMultiplier"" (what at:(last From)))) 100) 1) (max (/ (* (* (value Piece at:(last From)) 4) (mapEntry ""DamageMultiplier"" (what at:(last From)))) 100) 1))))) (* {(if (is In (last From) (sites Occupied by:All container:""Board"" components:{""Soldier"" ""Motorbike""})) (if (= (who at:(last From)) 1) (mapEntry ""NoDoctrine"" 1) (if (= (who at:(last From)) 2) (mapEntry ""NoDoctrine"" 1) (if (= (who at:(last From)) 3) (mapEntry ""NoDoctrine"" 1) (if (= (who at:(last From)) 4) (mapEntry ""NoDoctrine"" 1) 0)))) (if (is In (last From) (sites Occupied by:All container:""Board"" components:{""Tank"" ""Speeder"" ""Shooter""})) (if (= (who at:(last From)) 1) (mapEntry ""NoDoctrine"" 2) (if (= (who at:(last From)) 2) (mapEntry ""NoDoctrine"" 2) (if (= (who at:(last From)) 3) (mapEntry ""NoDoctrine"" 2) (if (= (who at:(last From)) 4) (mapEntry ""NoDoctrine"" 2) 0)))) (if (is In (last From) (sites Occupied by:All container:""Board"" components:{""Launcher"" ""Antiair"" ""Artillery""})) (if (= (who at:(last From)) 1) (mapEntry ""NoDoctrine"" 3) (if (= (who at:(last From)) 2) (mapEntry ""NoDoctrine"" 3) (if (= (who at:(last From)) 3) (mapEntry ""NoDoctrine"" 3) (if (= (who at:(last From)) 4) (mapEntry ""NoDoctrine"" 3) 0)))) (if (is In (last From) (sites Occupied by:All container:""Board"" components:{""Fighter"" ""Bomber"" ""Helicopter""})) (if (= (who at:(last From)) 1) (mapEntry ""NoDoctrine"" 4) (if (= (who at:(last From)) 2) (mapEntry ""NoDoctrine"" 4) (if (= (who at:(last From)) 3) (mapEntry ""NoDoctrine"" 4) (if (= (who at:(last From)) 4) (mapEntry ""NoDoctrine"" 4) 0)))) (if (is In (last From) (sites Occupied by:All container:""Board"" components:{""Submarine"" ""Cruiser"" ""Battleship""})) (if (= (who at:(last From)) 1) (mapEntry ""NoDoctrine"" 5) (if (= (who at:(last From)) 2) (mapEntry ""NoDoctrine"" 5) (if (= (who at:(last From)) 3) (mapEntry ""NoDoctrine"" 5) (if (= (who at:(last From)) 4) (mapEntry ""NoDoctrine"" 5) 0)))) 4))))) (if (and (= 8 (state at:(last To))) (!= (mover) (who at:(last To)))) (if (= (who at:(last From)) 1) (mapEntry ""NoDoctrine"" 6) (if (= (who at:(last From)) 2) (mapEntry ""NoDoctrine"" 6) (if (= (who at:(last From)) 3) (mapEntry ""NoDoctrine"" 6) (if (= (who at:(last From)) 4) (mapEntry ""NoDoctrine"" 6) 0)))) 5) (if (> (who at:(last To)) 0) (if (= (who at:(last To)) 1) (mapEntry ""NoDoctrine"" 8) (if (= (who at:(last To)) 2) (mapEntry ""NoDoctrine"" 8) (if (= (who at:(last To)) 3) (mapEntry ""NoDoctrine"" 8) (if (= (who at:(last To)) 4) (mapEntry ""NoDoctrine"" 8) 0)))) 4) (if False (if (= (who at:(last From)) 1) (mapEntry ""NoDoctrine"" 10) (if (= (who at:(last From)) 2) (mapEntry ""NoDoctrine"" 10) (if (= (who at:(last From)) 3) (mapEntry ""NoDoctrine"" 10) (if (= (who at:(last From)) 4) (mapEntry ""NoDoctrine"" 10) 0)))) (if (= (who at:(last From)) 1) (mapEntry ""NoDoctrine"" 9) (if (= (who at:(last From)) 2) (mapEntry ""NoDoctrine"" 9) (if (= (who at:(last From)) 3) (mapEntry ""NoDoctrine"" 9) (if (= (who at:(last From)) 4) (mapEntry ""NoDoctrine"" 9) 0))))) (value Random (range (if (= (who at:(last From)) 1) (mapEntry ""NoDoctrine"" 11) (if (= (who at:(last From)) 2) (mapEntry ""NoDoctrine"" 11) (if (= (who at:(last From)) 3) (mapEntry ""NoDoctrine"" 11) (if (= (who at:(last From)) 4) (mapEntry ""NoDoctrine"" 11) 0)))) (if (= (who at:(last From)) 1) (mapEntry ""NoDoctrine"" 12) (if (= (who at:(last From)) 2) (mapEntry ""NoDoctrine"" 12) (if (= (who at:(last From)) 3) (mapEntry ""NoDoctrine"" 12) (if (= (who at:(last From)) 4) (mapEntry ""NoDoctrine"" 12) 0))))))})) 128000)))) (set State at:(last From) 0)) next:(if (and (= 8 (state at:(last To))) (!= (mover) (who at:(last To)))) (if (= (value Piece at:(last To)) 0) (and {(take Control of:All by:Mover at:(last To)) (set Value at:(last To) 50)}) (set Value at:(last To) (value Piece at:(last To)))) (if (= (value Piece at:(last To)) 0) (remove (last To)) (if (and {(= 0 (count Sites in:(intersection (sites {(last To) (last From)}) (sites Occupied by:All components:{""Launcher"" ""Artillery"" ""Battleship"" ""Antiair""})))) (if (is In (last To) (sites Occupied by:Enemy components:{""Bomber"" ""Battleship"" ""Artillery"" ""Launcher""})) (is In (last From) (union (sites Occupied by:Mover components:{""Soldier"" ""Motorbike"" ""Tank"" ""Speeder"" ""Shooter"" ""Launcher"" ""Antiair"" ""Battleship"" ""Artillery"" ""Base"" ""Town"" ""Factory"" ""Dock"" ""Airport"" ""Cruiser"" ""Submarine""}) (sites Occupied by:Neutral container:""Board""))) (is In (last From) (union (sites Occupied by:Mover) (sites Occupied by:Neutral container:""Board"")))) (if (is In (last To) (sites Occupied by:Enemy components:{""Antiair"" ""Fighter""})) (is In (last From) (sites Occupied by:Mover components:{""Fighter"" ""Helicopter"" ""Bomber""})) (is In (last From) (union (sites Occupied by:Mover) (sites Occupied by:Neutral container:""Board"")))) (if (is In (last To) (sites Occupied by:Enemy components:{""Submarine""})) (is In (last From) (sites Occupied by:Mover components:{""Submarine"" ""Battleship"" ""Cruiser""})) (is In (last From) (union (sites Occupied by:Mover) (sites Occupied by:Neutral container:""Board""))))}) (if (<= (- (value Piece at:(last From)) (/ (* (if (is In (last From) (sites Occupied by:All container:""Board"" components:{""Fighter"" ""Bomber"" ""Helicopter""})) (max (/ (* (* (value Piece at:(last To)) 4) (mapEntry ""DamageMultiplier"" (what at:(last To)))) 100) 1) (if (and (is In (last From) (sites Occupied by:All container:""Board"" components:{""Soldier"" ""Motorbike""})) (is In (last To) (sites Occupied by:All component:""Shooter""))) (if (is In (last From) (sites ""Forest"")) (max (/ (* (* (value Piece at:(last To)) 6) (mapEntry ""DamageMultiplier"" (what at:(last To)))) 100) 1) (if (is In (last From) (union (sites ""ShallowWater"") (sites ""DeepWater""))) (max (/ (* (* (value Piece at:(last To)) 10) (mapEntry ""DamageMultiplier"" (what at:(last To)))) 100) 1) (max (/ (* (* (value Piece at:(last To)) 8) (mapEntry ""DamageMultiplier"" (what at:(last To)))) 100) 1))) (if (is In (last From) (sites ""Forest"")) (max (/ (* (* (value Piece at:(last To)) 3) (mapEntry ""DamageMultiplier"" (what at:(last To)))) 100) 1) (if (is In (last From) (union (sites ""ShallowWater"") (sites ""DeepWater""))) (max (/ (* (* (value Piece at:(last To)) 5) (mapEntry ""DamageMultiplier"" (what at:(last To)))) 100) 1) (max (/ (* (* (value Piece at:(last To)) 4) (mapEntry ""DamageMultiplier"" (what at:(last To)))) 100) 1))))) (* {(if (is In (last To) (sites Occupied by:All container:""Board"" components:{""Soldier"" ""Motorbike""})) (if (= (who at:(last To)) 1) (mapEntry ""NoDoctrine"" 1) (if (= (who at:(last To)) 2) (mapEntry ""NoDoctrine"" 1) (if (= (who at:(last To)) 3) (mapEntry ""NoDoctrine"" 1) (if (= (who at:(last To)) 4) (mapEntry ""NoDoctrine"" 1) 0)))) (if (is In (last To) (sites Occupied by:All container:""Board"" components:{""Tank"" ""Speeder"" ""Shooter""})) (if (= (who at:(last To)) 1) (mapEntry ""NoDoctrine"" 2) (if (= (who at:(last To)) 2) (mapEntry ""NoDoctrine"" 2) (if (= (who at:(last To)) 3) (mapEntry ""NoDoctrine"" 2) (if (= (who at:(last To)) 4) (mapEntry ""NoDoctrine"" 2) 0)))) (if (is In (last To) (sites Occupied by:All container:""Board"" components:{""Launcher"" ""Antiair"" ""Artillery""})) (if (= (who at:(last To)) 1) (mapEntry ""NoDoctrine"" 3) (if (= (who at:(last To)) 2) (mapEntry ""NoDoctrine"" 3) (if (= (who at:(last To)) 3) (mapEntry ""NoDoctrine"" 3) (if (= (who at:(last To)) 4) (mapEntry ""NoDoctrine"" 3) 0)))) (if (is In (last To) (sites Occupied by:All container:""Board"" components:{""Fighter"" ""Bomber"" ""Helicopter""})) (if (= (who at:(last To)) 1) (mapEntry ""NoDoctrine"" 4) (if (= (who at:(last To)) 2) (mapEntry ""NoDoctrine"" 4) (if (= (who at:(last To)) 3) (mapEntry ""NoDoctrine"" 4) (if (= (who at:(last To)) 4) (mapEntry ""NoDoctrine"" 4) 0)))) (if (is In (last To) (sites Occupied by:All container:""Board"" components:{""Submarine"" ""Cruiser"" ""Battleship""})) (if (= (who at:(last To)) 1) (mapEntry ""NoDoctrine"" 5) (if (= (who at:(last To)) 2) (mapEntry ""NoDoctrine"" 5) (if (= (who at:(last To)) 3) (mapEntry ""NoDoctrine"" 5) (if (= (who at:(last To)) 4) (mapEntry ""NoDoctrine"" 5) 0)))) 4))))) (if (and (= 8 (state at:(last From))) (!= (mover) (who at:(last From)))) (if (= (who at:(last To)) 1) (mapEntry ""NoDoctrine"" 6) (if (= (who at:(last To)) 2) (mapEntry ""NoDoctrine"" 6) (if (= (who at:(last To)) 3) (mapEntry ""NoDoctrine"" 6) (if (= (who at:(last To)) 4) (mapEntry ""NoDoctrine"" 6) 0)))) 5) (if (> (who at:(last From)) 0) (if (= (who at:(last From)) 1) (mapEntry ""NoDoctrine"" 8) (if (= (who at:(last From)) 2) (mapEntry ""NoDoctrine"" 8) (if (= (who at:(last From)) 3) (mapEntry ""NoDoctrine"" 8) (if (= (who at:(last From)) 4) (mapEntry ""NoDoctrine"" 8) 0)))) 4) (if True (if (= (who at:(last To)) 1) (mapEntry ""NoDoctrine"" 10) (if (= (who at:(last To)) 2) (mapEntry ""NoDoctrine"" 10) (if (= (who at:(last To)) 3) (mapEntry ""NoDoctrine"" 10) (if (= (who at:(last To)) 4) (mapEntry ""NoDoctrine"" 10) 0)))) (if (= (who at:(last To)) 1) (mapEntry ""NoDoctrine"" 9) (if (= (who at:(last To)) 2) (mapEntry ""NoDoctrine"" 9) (if (= (who at:(last To)) 3) (mapEntry ""NoDoctrine"" 9) (if (= (who at:(last To)) 4) (mapEntry ""NoDoctrine"" 9) 0))))) (value Random (range (if (= (who at:(last To)) 1) (mapEntry ""NoDoctrine"" 11) (if (= (who at:(last To)) 2) (mapEntry ""NoDoctrine"" 11) (if (= (who at:(last To)) 3) (mapEntry ""NoDoctrine"" 11) (if (= (who at:(last To)) 4) (mapEntry ""NoDoctrine"" 11) 0)))) (if (= (who at:(last To)) 1) (mapEntry ""NoDoctrine"" 12) (if (= (who at:(last To)) 2) (mapEntry ""NoDoctrine"" 12) (if (= (who at:(last To)) 3) (mapEntry ""NoDoctrine"" 12) (if (= (who at:(last To)) 4) (mapEntry ""NoDoctrine"" 12) 0))))))})) 128000)) 0) (remove (last From)) (set Value at:(last From) (- (value Piece at:(last From)) (/ (* (if (is In (last From) (sites Occupied by:All container:""Board"" components:{""Fighter"" ""Bomber"" ""Helicopter""})) (max (/ (* (* (value Piece at:(last To)) 4) (mapEntry ""DamageMultiplier"" (what at:(last To)))) 100) 1) (if (and (is In (last From) (sites Occupied by:All container:""Board"" components:{""Soldier"" ""Motorbike""})) (is In (last To) (sites Occupied by:All component:""Shooter""))) (if (is In (last From) (sites ""Forest"")) (max (/ (* (* (value Piece at:(last To)) 6) (mapEntry ""DamageMultiplier"" (what at:(last To)))) 100) 1) (if (is In (last From) (union (sites ""ShallowWater"") (sites ""DeepWater""))) (max (/ (* (* (value Piece at:(last To)) 10) (mapEntry ""DamageMultiplier"" (what at:(last To)))) 100) 1) (max (/ (* (* (value Piece at:(last To)) 8) (mapEntry ""DamageMultiplier"" (what at:(last To)))) 100) 1))) (if (is In (last From) (sites ""Forest"")) (max (/ (* (* (value Piece at:(last To)) 3) (mapEntry ""DamageMultiplier"" (what at:(last To)))) 100) 1) (if (is In (last From) (union (sites ""ShallowWater"") (sites ""DeepWater""))) (max (/ (* (* (value Piece at:(last To)) 5) (mapEntry ""DamageMultiplier"" (what at:(last To)))) 100) 1) (max (/ (* (* (value Piece at:(last To)) 4) (mapEntry ""DamageMultiplier"" (what at:(last To)))) 100) 1))))) (* {(if (is In (last To) (sites Occupied by:All container:""Board"" components:{""Soldier"" ""Motorbike""})) (if (= (who at:(last To)) 1) (mapEntry ""NoDoctrine"" 1) (if (= (who at:(last To)) 2) (mapEntry ""NoDoctrine"" 1) (if (= (who at:(last To)) 3) (mapEntry ""NoDoctrine"" 1) (if (= (who at:(last To)) 4) (mapEntry ""NoDoctrine"" 1) 0)))) (if (is In (last To) (sites Occupied by:All container:""Board"" components:{""Tank"" ""Speeder"" ""Shooter""})) (if (= (who at:(last To)) 1) (mapEntry ""NoDoctrine"" 2) (if (= (who at:(last To)) 2) (mapEntry ""NoDoctrine"" 2) (if (= (who at:(last To)) 3) (mapEntry ""NoDoctrine"" 2) (if (= (who at:(last To)) 4) (mapEntry ""NoDoctrine"" 2) 0)))) (if (is In (last To) (sites Occupied by:All container:""Board"" components:{""Launcher"" ""Antiair"" ""Artillery""})) (if (= (who at:(last To)) 1) (mapEntry ""NoDoctrine"" 3) (if (= (who at:(last To)) 2) (mapEntry ""NoDoctrine"" 3) (if (= (who at:(last To)) 3) (mapEntry ""NoDoctrine"" 3) (if (= (who at:(last To)) 4) (mapEntry ""NoDoctrine"" 3) 0)))) (if (is In (last To) (sites Occupied by:All container:""Board"" components:{""Fighter"" ""Bomber"" ""Helicopter""})) (if (= (who at:(last To)) 1) (mapEntry ""NoDoctrine"" 4) (if (= (who at:(last To)) 2) (mapEntry ""NoDoctrine"" 4) (if (= (who at:(last To)) 3) (mapEntry ""NoDoctrine"" 4) (if (= (who at:(last To)) 4) (mapEntry ""NoDoctrine"" 4) 0)))) (if (is In (last To) (sites Occupied by:All container:""Board"" components:{""Submarine"" ""Cruiser"" ""Battleship""})) (if (= (who at:(last To)) 1) (mapEntry ""NoDoctrine"" 5) (if (= (who at:(last To)) 2) (mapEntry ""NoDoctrine"" 5) (if (= (who at:(last To)) 3) (mapEntry ""NoDoctrine"" 5) (if (= (who at:(last To)) 4) (mapEntry ""NoDoctrine"" 5) 0)))) 4))))) (if (and (= 8 (state at:(last From))) (!= (mover) (who at:(last From)))) (if (= (who at:(last To)) 1) (mapEntry ""NoDoctrine"" 6) (if (= (who at:(last To)) 2) (mapEntry ""NoDoctrine"" 6) (if (= (who at:(last To)) 3) (mapEntry ""NoDoctrine"" 6) (if (= (who at:(last To)) 4) (mapEntry ""NoDoctrine"" 6) 0)))) 5) (if (> (who at:(last From)) 0) (if (= (who at:(last From)) 1) (mapEntry ""NoDoctrine"" 8) (if (= (who at:(last From)) 2) (mapEntry ""NoDoctrine"" 8) (if (= (who at:(last From)) 3) (mapEntry ""NoDoctrine"" 8) (if (= (who at:(last From)) 4) (mapEntry ""NoDoctrine"" 8) 0)))) 4) (if True (if (= (who at:(last To)) 1) (mapEntry ""NoDoctrine"" 10) (if (= (who at:(last To)) 2) (mapEntry ""NoDoctrine"" 10) (if (= (who at:(last To)) 3) (mapEntry ""NoDoctrine"" 10) (if (= (who at:(last To)) 4) (mapEntry ""NoDoctrine"" 10) 0)))) (if (= (who at:(last To)) 1) (mapEntry ""NoDoctrine"" 9) (if (= (who at:(last To)) 2) (mapEntry ""NoDoctrine"" 9) (if (= (who at:(last To)) 3) (mapEntry ""NoDoctrine"" 9) (if (= (who at:(last To)) 4) (mapEntry ""NoDoctrine"" 9) 0))))) (value Random (range (if (= (who at:(last To)) 1) (mapEntry ""NoDoctrine"" 11) (if (= (who at:(last To)) 2) (mapEntry ""NoDoctrine"" 11) (if (= (who at:(last To)) 3) (mapEntry ""NoDoctrine"" 11) (if (= (who at:(last To)) 4) (mapEntry ""NoDoctrine"" 11) 0)))) (if (= (who at:(last To)) 1) (mapEntry ""NoDoctrine"" 12) (if (= (who at:(last To)) 2) (mapEntry ""NoDoctrine"" 12) (if (= (who at:(last To)) 3) (mapEntry ""NoDoctrine"" 12) (if (= (who at:(last To)) 4) (mapEntry ""NoDoctrine"" 12) 0))))))})) 128000)))) (set Value at:(last From) (value Piece at:(last From))))))))) (move Select (from (from) if:(and (> (state at:(from)) 0) (< (value Piece at:(from)) (mapEntry ""MaxHealth"" (what at:(from)))))) (to (sites Around (from) Orthogonal if:(is In (to) (sites Occupied by:Mover container:""Board"" components:{""Town"" ""Dock"" ""Base"" ""Factory"" ""Airport""})))) (then (and {(set Value at:(last From) (min (mapEntry ""MaxHealth"" (what at:(last From))) (- (+ (value Piece at:(last From)) (value Piece at:(last To))) 1))) (set Value at:(last To) (max (- (value Piece at:(last To)) (- (mapEntry ""MaxHealth"" (what at:(last From))) (value Piece at:(last From)))) 1)) (set State at:(last From) 0)}))) (move Select (from (from) if:(> (state at:(from)) 0)) (to (sites Around (from) Orthogonal if:(and (= (what at:(from)) (what at:(to))) (< (value Piece at:(to)) (mapEntry ""MaxHealth"" (what at:(to))))))) (then (and {(if (<= (+ (value Piece at:(last To)) (value Piece at:(last From))) (mapEntry ""MaxHealth"" (what at:(last From)))) (and (set Value at:(last To) (min (mapEntry ""MaxHealth"" (what at:(last From))) (+ (value Piece at:(last From)) (value Piece at:(last To))))) (remove (last From))) (and (set Value at:(last To) (min (mapEntry ""MaxHealth"" (what at:(last From))) (- (+ (value Piece at:(last From)) (value Piece at:(last To))) 1))) (set Value at:(last From) (max (- (value Piece at:(last To)) (- (mapEntry ""MaxHealth"" (what at:(last From))) (value Piece at:(last From)))) 1)))) (set State at:(last From) 0) (set State at:(last To) 0)})))})) (piece ""Antiair"" Each (or {(or (move (from (from) if:(> (state at:(from)) 1)) (to (sites Distance (step Orthogonal (to if:(is In (to) (difference (union (sites Empty) (sites Occupied by:Friend container:""Board"")) (union (union (sites ""Mountain"") (sites ""DeepWater"")) (union (sites ""Forest"") (sites ""ShallowWater""))))))) from:(from) (range 1 (- (state at:(from)) 1))) if:(is Empty (to)) (apply (set State at:(from) 1)))) (move (from (from) if:(> (state at:(from)) 1)) (to (sites Distance (step Orthogonal (to if:(is In (to) (intersection (sites Empty) (union (sites ""Forest"") (sites ""ShallowWater"")))))) from:(from) (range 1 (- 2 1))) if:(is Empty (to)) (apply (set State at:(from) 1))))) (move Select (from (from) if:(> (state at:(from)) 0)) (to (sites Distance Orthogonal from:(from) (range 1 2)) if:(and {(if (is In (from) (sites Occupied by:Mover container:""Board"" components:{""Bomber"" ""Battleship"" ""Artillery"" ""Launcher""})) (is In (to) (union (sites Occupied by:Enemy container:""Board"" components:{""Soldier"" ""Motorbike"" ""Tank"" ""Speeder"" ""Shooter"" ""Launcher"" ""Antiair"" ""Battleship"" ""Artillery"" ""Base"" ""Town"" ""Factory"" ""Dock"" ""Airport"" ""Cruiser"" ""Submarine""}) (sites Occupied by:Neutral container:""Board""))) (is In (to) (union (sites Occupied by:Enemy container:""Board"") (sites Occupied by:Neutral container:""Board"")))) (if (is In (from) (sites Occupied by:Mover container:""Board"" components:{""Antiair"" ""Fighter""})) (is In (to) (sites Occupied by:Enemy container:""Board"" components:{""Fighter"" ""Helicopter"" ""Bomber""})) (is In (to) (union (sites Occupied by:Enemy container:""Board"") (sites Occupied by:Neutral container:""Board"")))) (if (is In (from) (sites Occupied by:Mover container:""Board"" components:{""Submarine""})) (is In (to) (sites Occupied by:Enemy container:""Board"" components:{""Submarine"" ""Battleship"" ""Cruiser""})) (is In (to) (union (sites Occupied by:Enemy container:""Board"") (sites Occupied by:Neutral container:""Board""))))})) (then (do (and (set Value at:(last To) (max 0 (- (value Piece at:(last To)) (/ (* (if (is In (last To) (sites Occupied by:All container:""Board"" components:{""Fighter"" ""Bomber"" ""Helicopter""})) (max (/ (* (* (value Piece at:(last From)) 4) (mapEntry ""DamageMultiplier"" (what at:(last From)))) 100) 1) (if (and (is In (last To) (sites Occupied by:All container:""Board"" components:{""Soldier"" ""Motorbike""})) (is In (last From) (sites Occupied by:All component:""Shooter""))) (if (is In (last To) (sites ""Forest"")) (max (/ (* (* (value Piece at:(last From)) 6) (mapEntry ""DamageMultiplier"" (what at:(last From)))) 100) 1) (if (is In (last To) (union (sites ""ShallowWater"") (sites ""DeepWater""))) (max (/ (* (* (value Piece at:(last From)) 10) (mapEntry ""DamageMultiplier"" (what at:(last From)))) 100) 1) (max (/ (* (* (value Piece at:(last From)) 8) (mapEntry ""DamageMultiplier"" (what at:(last From)))) 100) 1))) (if (is In (last To) (sites ""Forest"")) (max (/ (* (* (value Piece at:(last From)) 3) (mapEntry ""DamageMultiplier"" (what at:(last From)))) 100) 1) (if (is In (last To) (union (sites ""ShallowWater"") (sites ""DeepWater""))) (max (/ (* (* (value Piece at:(last From)) 5) (mapEntry ""DamageMultiplier"" (what at:(last From)))) 100) 1) (max (/ (* (* (value Piece at:(last From)) 4) (mapEntry ""DamageMultiplier"" (what at:(last From)))) 100) 1))))) (* {(if (is In (last From) (sites Occupied by:All container:""Board"" components:{""Soldier"" ""Motorbike""})) (if (= (who at:(last From)) 1) (mapEntry ""NoDoctrine"" 1) (if (= (who at:(last From)) 2) (mapEntry ""NoDoctrine"" 1) (if (= (who at:(last From)) 3) (mapEntry ""NoDoctrine"" 1) (if (= (who at:(last From)) 4) (mapEntry ""NoDoctrine"" 1) 0)))) (if (is In (last From) (sites Occupied by:All container:""Board"" components:{""Tank"" ""Speeder"" ""Shooter""})) (if (= (who at:(last From)) 1) (mapEntry ""NoDoctrine"" 2) (if (= (who at:(last From)) 2) (mapEntry ""NoDoctrine"" 2) (if (= (who at:(last From)) 3) (mapEntry ""NoDoctrine"" 2) (if (= (who at:(last From)) 4) (mapEntry ""NoDoctrine"" 2) 0)))) (if (is In (last From) (sites Occupied by:All container:""Board"" components:{""Launcher"" ""Antiair"" ""Artillery""})) (if (= (who at:(last From)) 1) (mapEntry ""NoDoctrine"" 3) (if (= (who at:(last From)) 2) (mapEntry ""NoDoctrine"" 3) (if (= (who at:(last From)) 3) (mapEntry ""NoDoctrine"" 3) (if (= (who at:(last From)) 4) (mapEntry ""NoDoctrine"" 3) 0)))) (if (is In (last From) (sites Occupied by:All container:""Board"" components:{""Fighter"" ""Bomber"" ""Helicopter""})) (if (= (who at:(last From)) 1) (mapEntry ""NoDoctrine"" 4) (if (= (who at:(last From)) 2) (mapEntry ""NoDoctrine"" 4) (if (= (who at:(last From)) 3) (mapEntry ""NoDoctrine"" 4) (if (= (who at:(last From)) 4) (mapEntry ""NoDoctrine"" 4) 0)))) (if (is In (last From) (sites Occupied by:All container:""Board"" components:{""Submarine"" ""Cruiser"" ""Battleship""})) (if (= (who at:(last From)) 1) (mapEntry ""NoDoctrine"" 5) (if (= (who at:(last From)) 2) (mapEntry ""NoDoctrine"" 5) (if (= (who at:(last From)) 3) (mapEntry ""NoDoctrine"" 5) (if (= (who at:(last From)) 4) (mapEntry ""NoDoctrine"" 5) 0)))) 4))))) (if (and (= 8 (state at:(last To))) (!= (mover) (who at:(last To)))) (if (= (who at:(last From)) 1) (mapEntry ""NoDoctrine"" 6) (if (= (who at:(last From)) 2) (mapEntry ""NoDoctrine"" 6) (if (= (who at:(last From)) 3) (mapEntry ""NoDoctrine"" 6) (if (= (who at:(last From)) 4) (mapEntry ""NoDoctrine"" 6) 0)))) 5) (if (> (who at:(last To)) 0) (if (= (who at:(last To)) 1) (mapEntry ""NoDoctrine"" 8) (if (= (who at:(last To)) 2) (mapEntry ""NoDoctrine"" 8) (if (= (who at:(last To)) 3) (mapEntry ""NoDoctrine"" 8) (if (= (who at:(last To)) 4) (mapEntry ""NoDoctrine"" 8) 0)))) 4) (if False (if (= (who at:(last From)) 1) (mapEntry ""NoDoctrine"" 10) (if (= (who at:(last From)) 2) (mapEntry ""NoDoctrine"" 10) (if (= (who at:(last From)) 3) (mapEntry ""NoDoctrine"" 10) (if (= (who at:(last From)) 4) (mapEntry ""NoDoctrine"" 10) 0)))) (if (= (who at:(last From)) 1) (mapEntry ""NoDoctrine"" 9) (if (= (who at:(last From)) 2) (mapEntry ""NoDoctrine"" 9) (if (= (who at:(last From)) 3) (mapEntry ""NoDoctrine"" 9) (if (= (who at:(last From)) 4) (mapEntry ""NoDoctrine"" 9) 0))))) (value Random (range (if (= (who at:(last From)) 1) (mapEntry ""NoDoctrine"" 11) (if (= (who at:(last From)) 2) (mapEntry ""NoDoctrine"" 11) (if (= (who at:(last From)) 3) (mapEntry ""NoDoctrine"" 11) (if (= (who at:(last From)) 4) (mapEntry ""NoDoctrine"" 11) 0)))) (if (= (who at:(last From)) 1) (mapEntry ""NoDoctrine"" 12) (if (= (who at:(last From)) 2) (mapEntry ""NoDoctrine"" 12) (if (= (who at:(last From)) 3) (mapEntry ""NoDoctrine"" 12) (if (= (who at:(last From)) 4) (mapEntry ""NoDoctrine"" 12) 0))))))})) 128000)))) (set State at:(last From) 0)) next:(if (and (= 8 (state at:(last To))) (!= (mover) (who at:(last To)))) (if (= (value Piece at:(last To)) 0) (and {(take Control of:All by:Mover at:(last To)) (set Value at:(last To) 50)}) (set Value at:(last To) (value Piece at:(last To)))) (if (= (value Piece at:(last To)) 0) (remove (last To)) (if (and {(= 0 (count Sites in:(intersection (sites {(last To) (last From)}) (sites Occupied by:All components:{""Launcher"" ""Artillery"" ""Battleship"" ""Antiair""})))) (if (is In (last To) (sites Occupied by:Enemy components:{""Bomber"" ""Battleship"" ""Artillery"" ""Launcher""})) (is In (last From) (union (sites Occupied by:Mover components:{""Soldier"" ""Motorbike"" ""Tank"" ""Speeder"" ""Shooter"" ""Launcher"" ""Antiair"" ""Battleship"" ""Artillery"" ""Base"" ""Town"" ""Factory"" ""Dock"" ""Airport"" ""Cruiser"" ""Submarine""}) (sites Occupied by:Neutral container:""Board""))) (is In (last From) (union (sites Occupied by:Mover) (sites Occupied by:Neutral container:""Board"")))) (if (is In (last To) (sites Occupied by:Enemy components:{""Antiair"" ""Fighter""})) (is In (last From) (sites Occupied by:Mover components:{""Fighter"" ""Helicopter"" ""Bomber""})) (is In (last From) (union (sites Occupied by:Mover) (sites Occupied by:Neutral container:""Board"")))) (if (is In (last To) (sites Occupied by:Enemy components:{""Submarine""})) (is In (last From) (sites Occupied by:Mover components:{""Submarine"" ""Battleship"" ""Cruiser""})) (is In (last From) (union (sites Occupied by:Mover) (sites Occupied by:Neutral container:""Board""))))}) (if (<= (- (value Piece at:(last From)) (/ (* (if (is In (last From) (sites Occupied by:All container:""Board"" components:{""Fighter"" ""Bomber"" ""Helicopter""})) (max (/ (* (* (value Piece at:(last To)) 4) (mapEntry ""DamageMultiplier"" (what at:(last To)))) 100) 1) (if (and (is In (last From) (sites Occupied by:All container:""Board"" components:{""Soldier"" ""Motorbike""})) (is In (last To) (sites Occupied by:All component:""Shooter""))) (if (is In (last From) (sites ""Forest"")) (max (/ (* (* (value Piece at:(last To)) 6) (mapEntry ""DamageMultiplier"" (what at:(last To)))) 100) 1) (if (is In (last From) (union (sites ""ShallowWater"") (sites ""DeepWater""))) (max (/ (* (* (value Piece at:(last To)) 10) (mapEntry ""DamageMultiplier"" (what at:(last To)))) 100) 1) (max (/ (* (* (value Piece at:(last To)) 8) (mapEntry ""DamageMultiplier"" (what at:(last To)))) 100) 1))) (if (is In (last From) (sites ""Forest"")) (max (/ (* (* (value Piece at:(last To)) 3) (mapEntry ""DamageMultiplier"" (what at:(last To)))) 100) 1) (if (is In (last From) (union (sites ""ShallowWater"") (sites ""DeepWater""))) (max (/ (* (* (value Piece at:(last To)) 5) (mapEntry ""DamageMultiplier"" (what at:(last To)))) 100) 1) (max (/ (* (* (value Piece at:(last To)) 4) (mapEntry ""DamageMultiplier"" (what at:(last To)))) 100) 1))))) (* {(if (is In (last To) (sites Occupied by:All container:""Board"" components:{""Soldier"" ""Motorbike""})) (if (= (who at:(last To)) 1) (mapEntry ""NoDoctrine"" 1) (if (= (who at:(last To)) 2) (mapEntry ""NoDoctrine"" 1) (if (= (who at:(last To)) 3) (mapEntry ""NoDoctrine"" 1) (if (= (who at:(last To)) 4) (mapEntry ""NoDoctrine"" 1) 0)))) (if (is In (last To) (sites Occupied by:All container:""Board"" components:{""Tank"" ""Speeder"" ""Shooter""})) (if (= (who at:(last To)) 1) (mapEntry ""NoDoctrine"" 2) (if (= (who at:(last To)) 2) (mapEntry ""NoDoctrine"" 2) (if (= (who at:(last To)) 3) (mapEntry ""NoDoctrine"" 2) (if (= (who at:(last To)) 4) (mapEntry ""NoDoctrine"" 2) 0)))) (if (is In (last To) (sites Occupied by:All container:""Board"" components:{""Launcher"" ""Antiair"" ""Artillery""})) (if (= (who at:(last To)) 1) (mapEntry ""NoDoctrine"" 3) (if (= (who at:(last To)) 2) (mapEntry ""NoDoctrine"" 3) (if (= (who at:(last To)) 3) (mapEntry ""NoDoctrine"" 3) (if (= (who at:(last To)) 4) (mapEntry ""NoDoctrine"" 3) 0)))) (if (is In (last To) (sites Occupied by:All container:""Board"" components:{""Fighter"" ""Bomber"" ""Helicopter""})) (if (= (who at:(last To)) 1) (mapEntry ""NoDoctrine"" 4) (if (= (who at:(last To)) 2) (mapEntry ""NoDoctrine"" 4) (if (= (who at:(last To)) 3) (mapEntry ""NoDoctrine"" 4) (if (= (who at:(last To)) 4) (mapEntry ""NoDoctrine"" 4) 0)))) (if (is In (last To) (sites Occupied by:All container:""Board"" components:{""Submarine"" ""Cruiser"" ""Battleship""})) (if (= (who at:(last To)) 1) (mapEntry ""NoDoctrine"" 5) (if (= (who at:(last To)) 2) (mapEntry ""NoDoctrine"" 5) (if (= (who at:(last To)) 3) (mapEntry ""NoDoctrine"" 5) (if (= (who at:(last To)) 4) (mapEntry ""NoDoctrine"" 5) 0)))) 4))))) (if (and (= 8 (state at:(last From))) (!= (mover) (who at:(last From)))) (if (= (who at:(last To)) 1) (mapEntry ""NoDoctrine"" 6) (if (= (who at:(last To)) 2) (mapEntry ""NoDoctrine"" 6) (if (= (who at:(last To)) 3) (mapEntry ""NoDoctrine"" 6) (if (= (who at:(last To)) 4) (mapEntry ""NoDoctrine"" 6) 0)))) 5) (if (> (who at:(last From)) 0) (if (= (who at:(last From)) 1) (mapEntry ""NoDoctrine"" 8) (if (= (who at:(last From)) 2) (mapEntry ""NoDoctrine"" 8) (if (= (who at:(last From)) 3) (mapEntry ""NoDoctrine"" 8) (if (= (who at:(last From)) 4) (mapEntry ""NoDoctrine"" 8) 0)))) 4) (if True (if (= (who at:(last To)) 1) (mapEntry ""NoDoctrine"" 10) (if (= (who at:(last To)) 2) (mapEntry ""NoDoctrine"" 10) (if (= (who at:(last To)) 3) (mapEntry ""NoDoctrine"" 10) (if (= (who at:(last To)) 4) (mapEntry ""NoDoctrine"" 10) 0)))) (if (= (who at:(last To)) 1) (mapEntry ""NoDoctrine"" 9) (if (= (who at:(last To)) 2) (mapEntry ""NoDoctrine"" 9) (if (= (who at:(last To)) 3) (mapEntry ""NoDoctrine"" 9) (if (= (who at:(last To)) 4) (mapEntry ""NoDoctrine"" 9) 0))))) (value Random (range (if (= (who at:(last To)) 1) (mapEntry ""NoDoctrine"" 11) (if (= (who at:(last To)) 2) (mapEntry ""NoDoctrine"" 11) (if (= (who at:(last To)) 3) (mapEntry ""NoDoctrine"" 11) (if (= (who at:(last To)) 4) (mapEntry ""NoDoctrine"" 11) 0)))) (if (= (who at:(last To)) 1) (mapEntry ""NoDoctrine"" 12) (if (= (who at:(last To)) 2) (mapEntry ""NoDoctrine"" 12) (if (= (who at:(last To)) 3) (mapEntry ""NoDoctrine"" 12) (if (= (who at:(last To)) 4) (mapEntry ""NoDoctrine"" 12) 0))))))})) 128000)) 0) (remove (last From)) (set Value at:(last From) (- (value Piece at:(last From)) (/ (* (if (is In (last From) (sites Occupied by:All container:""Board"" components:{""Fighter"" ""Bomber"" ""Helicopter""})) (max (/ (* (* (value Piece at:(last To)) 4) (mapEntry ""DamageMultiplier"" (what at:(last To)))) 100) 1) (if (and (is In (last From) (sites Occupied by:All container:""Board"" components:{""Soldier"" ""Motorbike""})) (is In (last To) (sites Occupied by:All component:""Shooter""))) (if (is In (last From) (sites ""Forest"")) (max (/ (* (* (value Piece at:(last To)) 6) (mapEntry ""DamageMultiplier"" (what at:(last To)))) 100) 1) (if (is In (last From) (union (sites ""ShallowWater"") (sites ""DeepWater""))) (max (/ (* (* (value Piece at:(last To)) 10) (mapEntry ""DamageMultiplier"" (what at:(last To)))) 100) 1) (max (/ (* (* (value Piece at:(last To)) 8) (mapEntry ""DamageMultiplier"" (what at:(last To)))) 100) 1))) (if (is In (last From) (sites ""Forest"")) (max (/ (* (* (value Piece at:(last To)) 3) (mapEntry ""DamageMultiplier"" (what at:(last To)))) 100) 1) (if (is In (last From) (union (sites ""ShallowWater"") (sites ""DeepWater""))) (max (/ (* (* (value Piece at:(last To)) 5) (mapEntry ""DamageMultiplier"" (what at:(last To)))) 100) 1) (max (/ (* (* (value Piece at:(last To)) 4) (mapEntry ""DamageMultiplier"" (what at:(last To)))) 100) 1))))) (* {(if (is In (last To) (sites Occupied by:All container:""Board"" components:{""Soldier"" ""Motorbike""})) (if (= (who at:(last To)) 1) (mapEntry ""NoDoctrine"" 1) (if (= (who at:(last To)) 2) (mapEntry ""NoDoctrine"" 1) (if (= (who at:(last To)) 3) (mapEntry ""NoDoctrine"" 1) (if (= (who at:(last To)) 4) (mapEntry ""NoDoctrine"" 1) 0)))) (if (is In (last To) (sites Occupied by:All container:""Board"" components:{""Tank"" ""Speeder"" ""Shooter""})) (if (= (who at:(last To)) 1) (mapEntry ""NoDoctrine"" 2) (if (= (who at:(last To)) 2) (mapEntry ""NoDoctrine"" 2) (if (= (who at:(last To)) 3) (mapEntry ""NoDoctrine"" 2) (if (= (who at:(last To)) 4) (mapEntry ""NoDoctrine"" 2) 0)))) (if (is In (last To) (sites Occupied by:All container:""Board"" components:{""Launcher"" ""Antiair"" ""Artillery""})) (if (= (who at:(last To)) 1) (mapEntry ""NoDoctrine"" 3) (if (= (who at:(last To)) 2) (mapEntry ""NoDoctrine"" 3) (if (= (who at:(last To)) 3) (mapEntry ""NoDoctrine"" 3) (if (= (who at:(last To)) 4) (mapEntry ""NoDoctrine"" 3) 0)))) (if (is In (last To) (sites Occupied by:All container:""Board"" components:{""Fighter"" ""Bomber"" ""Helicopter""})) (if (= (who at:(last To)) 1) (mapEntry ""NoDoctrine"" 4) (if (= (who at:(last To)) 2) (mapEntry ""NoDoctrine"" 4) (if (= (who at:(last To)) 3) (mapEntry ""NoDoctrine"" 4) (if (= (who at:(last To)) 4) (mapEntry ""NoDoctrine"" 4) 0)))) (if (is In (last To) (sites Occupied by:All container:""Board"" components:{""Submarine"" ""Cruiser"" ""Battleship""})) (if (= (who at:(last To)) 1) (mapEntry ""NoDoctrine"" 5) (if (= (who at:(last To)) 2) (mapEntry ""NoDoctrine"" 5) (if (= (who at:(last To)) 3) (mapEntry ""NoDoctrine"" 5) (if (= (who at:(last To)) 4) (mapEntry ""NoDoctrine"" 5) 0)))) 4))))) (if (and (= 8 (state at:(last From))) (!= (mover) (who at:(last From)))) (if (= (who at:(last To)) 1) (mapEntry ""NoDoctrine"" 6) (if (= (who at:(last To)) 2) (mapEntry ""NoDoctrine"" 6) (if (= (who at:(last To)) 3) (mapEntry ""NoDoctrine"" 6) (if (= (who at:(last To)) 4) (mapEntry ""NoDoctrine"" 6) 0)))) 5) (if (> (who at:(last From)) 0) (if (= (who at:(last From)) 1) (mapEntry ""NoDoctrine"" 8) (if (= (who at:(last From)) 2) (mapEntry ""NoDoctrine"" 8) (if (= (who at:(last From)) 3) (mapEntry ""NoDoctrine"" 8) (if (= (who at:(last From)) 4) (mapEntry ""NoDoctrine"" 8) 0)))) 4) (if True (if (= (who at:(last To)) 1) (mapEntry ""NoDoctrine"" 10) (if (= (who at:(last To)) 2) (mapEntry ""NoDoctrine"" 10) (if (= (who at:(last To)) 3) (mapEntry ""NoDoctrine"" 10) (if (= (who at:(last To)) 4) (mapEntry ""NoDoctrine"" 10) 0)))) (if (= (who at:(last To)) 1) (mapEntry ""NoDoctrine"" 9) (if (= (who at:(last To)) 2) (mapEntry ""NoDoctrine"" 9) (if (= (who at:(last To)) 3) (mapEntry ""NoDoctrine"" 9) (if (= (who at:(last To)) 4) (mapEntry ""NoDoctrine"" 9) 0))))) (value Random (range (if (= (who at:(last To)) 1) (mapEntry ""NoDoctrine"" 11) (if (= (who at:(last To)) 2) (mapEntry ""NoDoctrine"" 11) (if (= (who at:(last To)) 3) (mapEntry ""NoDoctrine"" 11) (if (= (who at:(last To)) 4) (mapEntry ""NoDoctrine"" 11) 0)))) (if (= (who at:(last To)) 1) (mapEntry ""NoDoctrine"" 12) (if (= (who at:(last To)) 2) (mapEntry ""NoDoctrine"" 12) (if (= (who at:(last To)) 3) (mapEntry ""NoDoctrine"" 12) (if (= (who at:(last To)) 4) (mapEntry ""NoDoctrine"" 12) 0))))))})) 128000)))) (set Value at:(last From) (value Piece at:(last From))))))))) (move Select (from (from) if:(and (> (state at:(from)) 0) (< (value Piece at:(from)) (mapEntry ""MaxHealth"" (what at:(from)))))) (to (sites Around (from) Orthogonal if:(is In (to) (sites Occupied by:Mover container:""Board"" components:{""Town"" ""Dock"" ""Base"" ""Factory"" ""Airport""})))) (then (and {(set Value at:(last From) (min (mapEntry ""MaxHealth"" (what at:(last From))) (- (+ (value Piece at:(last From)) (value Piece at:(last To))) 1))) (set Value at:(last To) (max (- (value Piece at:(last To)) (- (mapEntry ""MaxHealth"" (what at:(last From))) (value Piece at:(last From)))) 1)) (set State at:(last From) 0)}))) (move Select (from (from) if:(> (state at:(from)) 0)) (to (sites Around (from) Orthogonal if:(and (= (what at:(from)) (what at:(to))) (< (value Piece at:(to)) (mapEntry ""MaxHealth"" (what at:(to))))))) (then (and {(if (<= (+ (value Piece at:(last To)) (value Piece at:(last From))) (mapEntry ""MaxHealth"" (what at:(last From)))) (and (set Value at:(last To) (min (mapEntry ""MaxHealth"" (what at:(last From))) (+ (value Piece at:(last From)) (value Piece at:(last To))))) (remove (last From))) (and (set Value at:(last To) (min (mapEntry ""MaxHealth"" (what at:(last From))) (- (+ (value Piece at:(last From)) (value Piece at:(last To))) 1))) (set Value at:(last From) (max (- (value Piece at:(last To)) (- (mapEntry ""MaxHealth"" (what at:(last From))) (value Piece at:(last From)))) 1)))) (set State at:(last From) 0) (set State at:(last To) 0)})))})) (piece ""Launcher"" Each (or {(or (move (from (from) if:(> (state at:(from)) 1)) (to (sites Distance (step Orthogonal (to if:(is In (to) (difference (union (sites Empty) (sites Occupied by:Friend container:""Board"")) (union (union (sites ""Mountain"") (sites ""DeepWater"")) (union (sites ""Forest"") (sites ""ShallowWater""))))))) from:(from) (range 1 (- (state at:(from)) 1))) if:(is Empty (to)) (apply (set State at:(from) 1)))) (move (from (from) if:(> (state at:(from)) 1)) (to (sites Distance (step Orthogonal (to if:(is In (to) (intersection (sites Empty) (union (sites ""Forest"") (sites ""ShallowWater"")))))) from:(from) (range 1 (- 2 1))) if:(is Empty (to)) (apply (set State at:(from) 1))))) (move Select (from (from) if:(> (state at:(from)) 0)) (to (sites Distance Orthogonal from:(from) (range 2 3)) if:(and {(if (is In (from) (sites Occupied by:Mover container:""Board"" components:{""Bomber"" ""Battleship"" ""Artillery"" ""Launcher""})) (is In (to) (union (sites Occupied by:Enemy container:""Board"" components:{""Soldier"" ""Motorbike"" ""Tank"" ""Speeder"" ""Shooter"" ""Launcher"" ""Antiair"" ""Battleship"" ""Artillery"" ""Base"" ""Town"" ""Factory"" ""Dock"" ""Airport"" ""Cruiser"" ""Submarine""}) (sites Occupied by:Neutral container:""Board""))) (is In (to) (union (sites Occupied by:Enemy container:""Board"") (sites Occupied by:Neutral container:""Board"")))) (if (is In (from) (sites Occupied by:Mover container:""Board"" components:{""Antiair"" ""Fighter""})) (is In (to) (sites Occupied by:Enemy container:""Board"" components:{""Fighter"" ""Helicopter"" ""Bomber""})) (is In (to) (union (sites Occupied by:Enemy container:""Board"") (sites Occupied by:Neutral container:""Board"")))) (if (is In (from) (sites Occupied by:Mover container:""Board"" components:{""Submarine""})) (is In (to) (sites Occupied by:Enemy container:""Board"" components:{""Submarine"" ""Battleship"" ""Cruiser""})) (is In (to) (union (sites Occupied by:Enemy container:""Board"") (sites Occupied by:Neutral container:""Board""))))})) (then (do (and (set Value at:(last To) (max 0 (- (value Piece at:(last To)) (/ (* (if (is In (last To) (sites Occupied by:All container:""Board"" components:{""Fighter"" ""Bomber"" ""Helicopter""})) (max (/ (* (* (value Piece at:(last From)) 4) (mapEntry ""DamageMultiplier"" (what at:(last From)))) 100) 1) (if (and (is In (last To) (sites Occupied by:All container:""Board"" components:{""Soldier"" ""Motorbike""})) (is In (last From) (sites Occupied by:All component:""Shooter""))) (if (is In (last To) (sites ""Forest"")) (max (/ (* (* (value Piece at:(last From)) 6) (mapEntry ""DamageMultiplier"" (what at:(last From)))) 100) 1) (if (is In (last To) (union (sites ""ShallowWater"") (sites ""DeepWater""))) (max (/ (* (* (value Piece at:(last From)) 10) (mapEntry ""DamageMultiplier"" (what at:(last From)))) 100) 1) (max (/ (* (* (value Piece at:(last From)) 8) (mapEntry ""DamageMultiplier"" (what at:(last From)))) 100) 1))) (if (is In (last To) (sites ""Forest"")) (max (/ (* (* (value Piece at:(last From)) 3) (mapEntry ""DamageMultiplier"" (what at:(last From)))) 100) 1) (if (is In (last To) (union (sites ""ShallowWater"") (sites ""DeepWater""))) (max (/ (* (* (value Piece at:(last From)) 5) (mapEntry ""DamageMultiplier"" (what at:(last From)))) 100) 1) (max (/ (* (* (value Piece at:(last From)) 4) (mapEntry ""DamageMultiplier"" (what at:(last From)))) 100) 1))))) (* {(if (is In (last From) (sites Occupied by:All container:""Board"" components:{""Soldier"" ""Motorbike""})) (if (= (who at:(last From)) 1) (mapEntry ""NoDoctrine"" 1) (if (= (who at:(last From)) 2) (mapEntry ""NoDoctrine"" 1) (if (= (who at:(last From)) 3) (mapEntry ""NoDoctrine"" 1) (if (= (who at:(last From)) 4) (mapEntry ""NoDoctrine"" 1) 0)))) (if (is In (last From) (sites Occupied by:All container:""Board"" components:{""Tank"" ""Speeder"" ""Shooter""})) (if (= (who at:(last From)) 1) (mapEntry ""NoDoctrine"" 2) (if (= (who at:(last From)) 2) (mapEntry ""NoDoctrine"" 2) (if (= (who at:(last From)) 3) (mapEntry ""NoDoctrine"" 2) (if (= (who at:(last From)) 4) (mapEntry ""NoDoctrine"" 2) 0)))) (if (is In (last From) (sites Occupied by:All container:""Board"" components:{""Launcher"" ""Antiair"" ""Artillery""})) (if (= (who at:(last From)) 1) (mapEntry ""NoDoctrine"" 3) (if (= (who at:(last From)) 2) (mapEntry ""NoDoctrine"" 3) (if (= (who at:(last From)) 3) (mapEntry ""NoDoctrine"" 3) (if (= (who at:(last From)) 4) (mapEntry ""NoDoctrine"" 3) 0)))) (if (is In (last From) (sites Occupied by:All container:""Board"" components:{""Fighter"" ""Bomber"" ""Helicopter""})) (if (= (who at:(last From)) 1) (mapEntry ""NoDoctrine"" 4) (if (= (who at:(last From)) 2) (mapEntry ""NoDoctrine"" 4) (if (= (who at:(last From)) 3) (mapEntry ""NoDoctrine"" 4) (if (= (who at:(last From)) 4) (mapEntry ""NoDoctrine"" 4) 0)))) (if (is In (last From) (sites Occupied by:All container:""Board"" components:{""Submarine"" ""Cruiser"" ""Battleship""})) (if (= (who at:(last From)) 1) (mapEntry ""NoDoctrine"" 5) (if (= (who at:(last From)) 2) (mapEntry ""NoDoctrine"" 5) (if (= (who at:(last From)) 3) (mapEntry ""NoDoctrine"" 5) (if (= (who at:(last From)) 4) (mapEntry ""NoDoctrine"" 5) 0)))) 4))))) (if (and (= 8 (state at:(last To))) (!= (mover) (who at:(last To)))) (if (= (who at:(last From)) 1) (mapEntry ""NoDoctrine"" 6) (if (= (who at:(last From)) 2) (mapEntry ""NoDoctrine"" 6) (if (= (who at:(last From)) 3) (mapEntry ""NoDoctrine"" 6) (if (= (who at:(last From)) 4) (mapEntry ""NoDoctrine"" 6) 0)))) 5) (if (> (who at:(last To)) 0) (if (= (who at:(last To)) 1) (mapEntry ""NoDoctrine"" 8) (if (= (who at:(last To)) 2) (mapEntry ""NoDoctrine"" 8) (if (= (who at:(last To)) 3) (mapEntry ""NoDoctrine"" 8) (if (= (who at:(last To)) 4) (mapEntry ""NoDoctrine"" 8) 0)))) 4) (if False (if (= (who at:(last From)) 1) (mapEntry ""NoDoctrine"" 10) (if (= (who at:(last From)) 2) (mapEntry ""NoDoctrine"" 10) (if (= (who at:(last From)) 3) (mapEntry ""NoDoctrine"" 10) (if (= (who at:(last From)) 4) (mapEntry ""NoDoctrine"" 10) 0)))) (if (= (who at:(last From)) 1) (mapEntry ""NoDoctrine"" 9) (if (= (who at:(last From)) 2) (mapEntry ""NoDoctrine"" 9) (if (= (who at:(last From)) 3) (mapEntry ""NoDoctrine"" 9) (if (= (who at:(last From)) 4) (mapEntry ""NoDoctrine"" 9) 0))))) (value Random (range (if (= (who at:(last From)) 1) (mapEntry ""NoDoctrine"" 11) (if (= (who at:(last From)) 2) (mapEntry ""NoDoctrine"" 11) (if (= (who at:(last From)) 3) (mapEntry ""NoDoctrine"" 11) (if (= (who at:(last From)) 4) (mapEntry ""NoDoctrine"" 11) 0)))) (if (= (who at:(last From)) 1) (mapEntry ""NoDoctrine"" 12) (if (= (who at:(last From)) 2) (mapEntry ""NoDoctrine"" 12) (if (= (who at:(last From)) 3) (mapEntry ""NoDoctrine"" 12) (if (= (who at:(last From)) 4) (mapEntry ""NoDoctrine"" 12) 0))))))})) 128000)))) (set State at:(last From) 0)) next:(if (and (= 8 (state at:(last To))) (!= (mover) (who at:(last To)))) (if (= (value Piece at:(last To)) 0) (and {(take Control of:All by:Mover at:(last To)) (set Value at:(last To) 50)}) (set Value at:(last To) (value Piece at:(last To)))) (if (= (value Piece at:(last To)) 0) (remove (last To)) (if (and {(= 0 (count Sites in:(intersection (sites {(last To) (last From)}) (sites Occupied by:All components:{""Launcher"" ""Artillery"" ""Battleship"" ""Antiair""})))) (if (is In (last To) (sites Occupied by:Enemy components:{""Bomber"" ""Battleship"" ""Artillery"" ""Launcher""})) (is In (last From) (union (sites Occupied by:Mover components:{""Soldier"" ""Motorbike"" ""Tank"" ""Speeder"" ""Shooter"" ""Launcher"" ""Antiair"" ""Battleship"" ""Artillery"" ""Base"" ""Town"" ""Factory"" ""Dock"" ""Airport"" ""Cruiser"" ""Submarine""}) (sites Occupied by:Neutral container:""Board""))) (is In (last From) (union (sites Occupied by:Mover) (sites Occupied by:Neutral container:""Board"")))) (if (is In (last To) (sites Occupied by:Enemy components:{""Antiair"" ""Fighter""})) (is In (last From) (sites Occupied by:Mover components:{""Fighter"" ""Helicopter"" ""Bomber""})) (is In (last From) (union (sites Occupied by:Mover) (sites Occupied by:Neutral container:""Board"")))) (if (is In (last To) (sites Occupied by:Enemy components:{""Submarine""})) (is In (last From) (sites Occupied by:Mover components:{""Submarine"" ""Battleship"" ""Cruiser""})) (is In (last From) (union (sites Occupied by:Mover) (sites Occupied by:Neutral container:""Board""))))}) (if (<= (- (value Piece at:(last From)) (/ (* (if (is In (last From) (sites Occupied by:All container:""Board"" components:{""Fighter"" ""Bomber"" ""Helicopter""})) (max (/ (* (* (value Piece at:(last To)) 4) (mapEntry ""DamageMultiplier"" (what at:(last To)))) 100) 1) (if (and (is In (last From) (sites Occupied by:All container:""Board"" components:{""Soldier"" ""Motorbike""})) (is In (last To) (sites Occupied by:All component:""Shooter""))) (if (is In (last From) (sites ""Forest"")) (max (/ (* (* (value Piece at:(last To)) 6) (mapEntry ""DamageMultiplier"" (what at:(last To)))) 100) 1) (if (is In (last From) (union (sites ""ShallowWater"") (sites ""DeepWater""))) (max (/ (* (* (value Piece at:(last To)) 10) (mapEntry ""DamageMultiplier"" (what at:(last To)))) 100) 1) (max (/ (* (* (value Piece at:(last To)) 8) (mapEntry ""DamageMultiplier"" (what at:(last To)))) 100) 1))) (if (is In (last From) (sites ""Forest"")) (max (/ (* (* (value Piece at:(last To)) 3) (mapEntry ""DamageMultiplier"" (what at:(last To)))) 100) 1) (if (is In (last From) (union (sites ""ShallowWater"") (sites ""DeepWater""))) (max (/ (* (* (value Piece at:(last To)) 5) (mapEntry ""DamageMultiplier"" (what at:(last To)))) 100) 1) (max (/ (* (* (value Piece at:(last To)) 4) (mapEntry ""DamageMultiplier"" (what at:(last To)))) 100) 1))))) (* {(if (is In (last To) (sites Occupied by:All container:""Board"" components:{""Soldier"" ""Motorbike""})) (if (= (who at:(last To)) 1) (mapEntry ""NoDoctrine"" 1) (if (= (who at:(last To)) 2) (mapEntry ""NoDoctrine"" 1) (if (= (who at:(last To)) 3) (mapEntry ""NoDoctrine"" 1) (if (= (who at:(last To)) 4) (mapEntry ""NoDoctrine"" 1) 0)))) (if (is In (last To) (sites Occupied by:All container:""Board"" components:{""Tank"" ""Speeder"" ""Shooter""})) (if (= (who at:(last To)) 1) (mapEntry ""NoDoctrine"" 2) (if (= (who at:(last To)) 2) (mapEntry ""NoDoctrine"" 2) (if (= (who at:(last To)) 3) (mapEntry ""NoDoctrine"" 2) (if (= (who at:(last To)) 4) (mapEntry ""NoDoctrine"" 2) 0)))) (if (is In (last To) (sites Occupied by:All container:""Board"" components:{""Launcher"" ""Antiair"" ""Artillery""})) (if (= (who at:(last To)) 1) (mapEntry ""NoDoctrine"" 3) (if (= (who at:(last To)) 2) (mapEntry ""NoDoctrine"" 3) (if (= (who at:(last To)) 3) (mapEntry ""NoDoctrine"" 3) (if (= (who at:(last To)) 4) (mapEntry ""NoDoctrine"" 3) 0)))) (if (is In (last To) (sites Occupied by:All container:""Board"" components:{""Fighter"" ""Bomber"" ""Helicopter""})) (if (= (who at:(last To)) 1) (mapEntry ""NoDoctrine"" 4) (if (= (who at:(last To)) 2) (mapEntry ""NoDoctrine"" 4) (if (= (who at:(last To)) 3) (mapEntry ""NoDoctrine"" 4) (if (= (who at:(last To)) 4) (mapEntry ""NoDoctrine"" 4) 0)))) (if (is In (last To) (sites Occupied by:All container:""Board"" components:{""Submarine"" ""Cruiser"" ""Battleship""})) (if (= (who at:(last To)) 1) (mapEntry ""NoDoctrine"" 5) (if (= (who at:(last To)) 2) (mapEntry ""NoDoctrine"" 5) (if (= (who at:(last To)) 3) (mapEntry ""NoDoctrine"" 5) (if (= (who at:(last To)) 4) (mapEntry ""NoDoctrine"" 5) 0)))) 4))))) (if (and (= 8 (state at:(last From))) (!= (mover) (who at:(last From)))) (if (= (who at:(last To)) 1) (mapEntry ""NoDoctrine"" 6) (if (= (who at:(last To)) 2) (mapEntry ""NoDoctrine"" 6) (if (= (who at:(last To)) 3) (mapEntry ""NoDoctrine"" 6) (if (= (who at:(last To)) 4) (mapEntry ""NoDoctrine"" 6) 0)))) 5) (if (> (who at:(last From)) 0) (if (= (who at:(last From)) 1) (mapEntry ""NoDoctrine"" 8) (if (= (who at:(last From)) 2) (mapEntry ""NoDoctrine"" 8) (if (= (who at:(last From)) 3) (mapEntry ""NoDoctrine"" 8) (if (= (who at:(last From)) 4) (mapEntry ""NoDoctrine"" 8) 0)))) 4) (if True (if (= (who at:(last To)) 1) (mapEntry ""NoDoctrine"" 10) (if (= (who at:(last To)) 2) (mapEntry ""NoDoctrine"" 10) (if (= (who at:(last To)) 3) (mapEntry ""NoDoctrine"" 10) (if (= (who at:(last To)) 4) (mapEntry ""NoDoctrine"" 10) 0)))) (if (= (who at:(last To)) 1) (mapEntry ""NoDoctrine"" 9) (if (= (who at:(last To)) 2) (mapEntry ""NoDoctrine"" 9) (if (= (who at:(last To)) 3) (mapEntry ""NoDoctrine"" 9) (if (= (who at:(last To)) 4) (mapEntry ""NoDoctrine"" 9) 0))))) (value Random (range (if (= (who at:(last To)) 1) (mapEntry ""NoDoctrine"" 11) (if (= (who at:(last To)) 2) (mapEntry ""NoDoctrine"" 11) (if (= (who at:(last To)) 3) (mapEntry ""NoDoctrine"" 11) (if (= (who at:(last To)) 4) (mapEntry ""NoDoctrine"" 11) 0)))) (if (= (who at:(last To)) 1) (mapEntry ""NoDoctrine"" 12) (if (= (who at:(last To)) 2) (mapEntry ""NoDoctrine"" 12) (if (= (who at:(last To)) 3) (mapEntry ""NoDoctrine"" 12) (if (= (who at:(last To)) 4) (mapEntry ""NoDoctrine"" 12) 0))))))})) 128000)) 0) (remove (last From)) (set Value at:(last From) (- (value Piece at:(last From)) (/ (* (if (is In (last From) (sites Occupied by:All container:""Board"" components:{""Fighter"" ""Bomber"" ""Helicopter""})) (max (/ (* (* (value Piece at:(last To)) 4) (mapEntry ""DamageMultiplier"" (what at:(last To)))) 100) 1) (if (and (is In (last From) (sites Occupied by:All container:""Board"" components:{""Soldier"" ""Motorbike""})) (is In (last To) (sites Occupied by:All component:""Shooter""))) (if (is In (last From) (sites ""Forest"")) (max (/ (* (* (value Piece at:(last To)) 6) (mapEntry ""DamageMultiplier"" (what at:(last To)))) 100) 1) (if (is In (last From) (union (sites ""ShallowWater"") (sites ""DeepWater""))) (max (/ (* (* (value Piece at:(last To)) 10) (mapEntry ""DamageMultiplier"" (what at:(last To)))) 100) 1) (max (/ (* (* (value Piece at:(last To)) 8) (mapEntry ""DamageMultiplier"" (what at:(last To)))) 100) 1))) (if (is In (last From) (sites ""Forest"")) (max (/ (* (* (value Piece at:(last To)) 3) (mapEntry ""DamageMultiplier"" (what at:(last To)))) 100) 1) (if (is In (last From) (union (sites ""ShallowWater"") (sites ""DeepWater""))) (max (/ (* (* (value Piece at:(last To)) 5) (mapEntry ""DamageMultiplier"" (what at:(last To)))) 100) 1) (max (/ (* (* (value Piece at:(last To)) 4) (mapEntry ""DamageMultiplier"" (what at:(last To)))) 100) 1))))) (* {(if (is In (last To) (sites Occupied by:All container:""Board"" components:{""Soldier"" ""Motorbike""})) (if (= (who at:(last To)) 1) (mapEntry ""NoDoctrine"" 1) (if (= (who at:(last To)) 2) (mapEntry ""NoDoctrine"" 1) (if (= (who at:(last To)) 3) (mapEntry ""NoDoctrine"" 1) (if (= (who at:(last To)) 4) (mapEntry ""NoDoctrine"" 1) 0)))) (if (is In (last To) (sites Occupied by:All container:""Board"" components:{""Tank"" ""Speeder"" ""Shooter""})) (if (= (who at:(last To)) 1) (mapEntry ""NoDoctrine"" 2) (if (= (who at:(last To)) 2) (mapEntry ""NoDoctrine"" 2) (if (= (who at:(last To)) 3) (mapEntry ""NoDoctrine"" 2) (if (= (who at:(last To)) 4) (mapEntry ""NoDoctrine"" 2) 0)))) (if (is In (last To) (sites Occupied by:All container:""Board"" components:{""Launcher"" ""Antiair"" ""Artillery""})) (if (= (who at:(last To)) 1) (mapEntry ""NoDoctrine"" 3) (if (= (who at:(last To)) 2) (mapEntry ""NoDoctrine"" 3) (if (= (who at:(last To)) 3) (mapEntry ""NoDoctrine"" 3) (if (= (who at:(last To)) 4) (mapEntry ""NoDoctrine"" 3) 0)))) (if (is In (last To) (sites Occupied by:All container:""Board"" components:{""Fighter"" ""Bomber"" ""Helicopter""})) (if (= (who at:(last To)) 1) (mapEntry ""NoDoctrine"" 4) (if (= (who at:(last To)) 2) (mapEntry ""NoDoctrine"" 4) (if (= (who at:(last To)) 3) (mapEntry ""NoDoctrine"" 4) (if (= (who at:(last To)) 4) (mapEntry ""NoDoctrine"" 4) 0)))) (if (is In (last To) (sites Occupied by:All container:""Board"" components:{""Submarine"" ""Cruiser"" ""Battleship""})) (if (= (who at:(last To)) 1) (mapEntry ""NoDoctrine"" 5) (if (= (who at:(last To)) 2) (mapEntry ""NoDoctrine"" 5) (if (= (who at:(last To)) 3) (mapEntry ""NoDoctrine"" 5) (if (= (who at:(last To)) 4) (mapEntry ""NoDoctrine"" 5) 0)))) 4))))) (if (and (= 8 (state at:(last From))) (!= (mover) (who at:(last From)))) (if (= (who at:(last To)) 1) (mapEntry ""NoDoctrine"" 6) (if (= (who at:(last To)) 2) (mapEntry ""NoDoctrine"" 6) (if (= (who at:(last To)) 3) (mapEntry ""NoDoctrine"" 6) (if (= (who at:(last To)) 4) (mapEntry ""NoDoctrine"" 6) 0)))) 5) (if (> (who at:(last From)) 0) (if (= (who at:(last From)) 1) (mapEntry ""NoDoctrine"" 8) (if (= (who at:(last From)) 2) (mapEntry ""NoDoctrine"" 8) (if (= (who at:(last From)) 3) (mapEntry ""NoDoctrine"" 8) (if (= (who at:(last From)) 4) (mapEntry ""NoDoctrine"" 8) 0)))) 4) (if True (if (= (who at:(last To)) 1) (mapEntry ""NoDoctrine"" 10) (if (= (who at:(last To)) 2) (mapEntry ""NoDoctrine"" 10) (if (= (who at:(last To)) 3) (mapEntry ""NoDoctrine"" 10) (if (= (who at:(last To)) 4) (mapEntry ""NoDoctrine"" 10) 0)))) (if (= (who at:(last To)) 1) (mapEntry ""NoDoctrine"" 9) (if (= (who at:(last To)) 2) (mapEntry ""NoDoctrine"" 9) (if (= (who at:(last To)) 3) (mapEntry ""NoDoctrine"" 9) (if (= (who at:(last To)) 4) (mapEntry ""NoDoctrine"" 9) 0))))) (value Random (range (if (= (who at:(last To)) 1) (mapEntry ""NoDoctrine"" 11) (if (= (who at:(last To)) 2) (mapEntry ""NoDoctrine"" 11) (if (= (who at:(last To)) 3) (mapEntry ""NoDoctrine"" 11) (if (= (who at:(last To)) 4) (mapEntry ""NoDoctrine"" 11) 0)))) (if (= (who at:(last To)) 1) (mapEntry ""NoDoctrine"" 12) (if (= (who at:(last To)) 2) (mapEntry ""NoDoctrine"" 12) (if (= (who at:(last To)) 3) (mapEntry ""NoDoctrine"" 12) (if (= (who at:(last To)) 4) (mapEntry ""NoDoctrine"" 12) 0))))))})) 128000)))) (set Value at:(last From) (value Piece at:(last From))))))))) (move Select (from (from) if:(and (> (state at:(from)) 0) (< (value Piece at:(from)) (mapEntry ""MaxHealth"" (what at:(from)))))) (to (sites Around (from) Orthogonal if:(is In (to) (sites Occupied by:Mover container:""Board"" components:{""Town"" ""Dock"" ""Base"" ""Factory"" ""Airport""})))) (then (and {(set Value at:(last From) (min (mapEntry ""MaxHealth"" (what at:(last From))) (- (+ (value Piece at:(last From)) (value Piece at:(last To))) 1))) (set Value at:(last To) (max (- (value Piece at:(last To)) (- (mapEntry ""MaxHealth"" (what at:(last From))) (value Piece at:(last From)))) 1)) (set State at:(last From) 0)}))) (move Select (from (from) if:(> (state at:(from)) 0)) (to (sites Around (from) Orthogonal if:(and (= (what at:(from)) (what at:(to))) (< (value Piece at:(to)) (mapEntry ""MaxHealth"" (what at:(to))))))) (then (and {(if (<= (+ (value Piece at:(last To)) (value Piece at:(last From))) (mapEntry ""MaxHealth"" (what at:(last From)))) (and (set Value at:(last To) (min (mapEntry ""MaxHealth"" (what at:(last From))) (+ (value Piece at:(last From)) (value Piece at:(last To))))) (remove (last From))) (and (set Value at:(last To) (min (mapEntry ""MaxHealth"" (what at:(last From))) (- (+ (value Piece at:(last From)) (value Piece at:(last To))) 1))) (set Value at:(last From) (max (- (value Piece at:(last To)) (- (mapEntry ""MaxHealth"" (what at:(last From))) (value Piece at:(last From)))) 1)))) (set State at:(last From) 0) (set State at:(last To) 0)})))})) (piece ""Artillery"" Each (or {(or (move (from (from) if:(> (state at:(from)) 1)) (to (sites Distance (step Orthogonal (to if:(is In (to) (difference (union (sites Empty) (sites Occupied by:Friend container:""Board"")) (union (union (sites ""Mountain"") (sites ""DeepWater"")) (union (sites ""Forest"") (sites ""ShallowWater""))))))) from:(from) (range 1 (- (state at:(from)) 1))) if:(is Empty (to)) (apply (set State at:(from) 0)))) (move (from (from) if:(> (state at:(from)) 1)) (to (sites Distance (step Orthogonal (to if:(is In (to) (intersection (sites Empty) (union (sites ""Forest"") (sites ""ShallowWater"")))))) from:(from) (range 1 (- 2 1))) if:(is Empty (to)) (apply (set State at:(from) 0))))) (move Select (from (from) if:(> (state at:(from)) 0)) (to (sites Distance Orthogonal from:(from) (range 3 5)) if:(and {(if (is In (from) (sites Occupied by:Mover container:""Board"" components:{""Bomber"" ""Battleship"" ""Artillery"" ""Launcher""})) (is In (to) (union (sites Occupied by:Enemy container:""Board"" components:{""Soldier"" ""Motorbike"" ""Tank"" ""Speeder"" ""Shooter"" ""Launcher"" ""Antiair"" ""Battleship"" ""Artillery"" ""Base"" ""Town"" ""Factory"" ""Dock"" ""Airport"" ""Cruiser"" ""Submarine""}) (sites Occupied by:Neutral container:""Board""))) (is In (to) (union (sites Occupied by:Enemy container:""Board"") (sites Occupied by:Neutral container:""Board"")))) (if (is In (from) (sites Occupied by:Mover container:""Board"" components:{""Antiair"" ""Fighter""})) (is In (to) (sites Occupied by:Enemy container:""Board"" components:{""Fighter"" ""Helicopter"" ""Bomber""})) (is In (to) (union (sites Occupied by:Enemy container:""Board"") (sites Occupied by:Neutral container:""Board"")))) (if (is In (from) (sites Occupied by:Mover container:""Board"" components:{""Submarine""})) (is In (to) (sites Occupied by:Enemy container:""Board"" components:{""Submarine"" ""Battleship"" ""Cruiser""})) (is In (to) (union (sites Occupied by:Enemy container:""Board"") (sites Occupied by:Neutral container:""Board""))))})) (then (do (and (set Value at:(last To) (max 0 (- (value Piece at:(last To)) (/ (* (if (is In (last To) (sites Occupied by:All container:""Board"" components:{""Fighter"" ""Bomber"" ""Helicopter""})) (max (/ (* (* (value Piece at:(last From)) 4) (mapEntry ""DamageMultiplier"" (what at:(last From)))) 100) 1) (if (and (is In (last To) (sites Occupied by:All container:""Board"" components:{""Soldier"" ""Motorbike""})) (is In (last From) (sites Occupied by:All component:""Shooter""))) (if (is In (last To) (sites ""Forest"")) (max (/ (* (* (value Piece at:(last From)) 6) (mapEntry ""DamageMultiplier"" (what at:(last From)))) 100) 1) (if (is In (last To) (union (sites ""ShallowWater"") (sites ""DeepWater""))) (max (/ (* (* (value Piece at:(last From)) 10) (mapEntry ""DamageMultiplier"" (what at:(last From)))) 100) 1) (max (/ (* (* (value Piece at:(last From)) 8) (mapEntry ""DamageMultiplier"" (what at:(last From)))) 100) 1))) (if (is In (last To) (sites ""Forest"")) (max (/ (* (* (value Piece at:(last From)) 3) (mapEntry ""DamageMultiplier"" (what at:(last From)))) 100) 1) (if (is In (last To) (union (sites ""ShallowWater"") (sites ""DeepWater""))) (max (/ (* (* (value Piece at:(last From)) 5) (mapEntry ""DamageMultiplier"" (what at:(last From)))) 100) 1) (max (/ (* (* (value Piece at:(last From)) 4) (mapEntry ""DamageMultiplier"" (what at:(last From)))) 100) 1))))) (* {(if (is In (last From) (sites Occupied by:All container:""Board"" components:{""Soldier"" ""Motorbike""})) (if (= (who at:(last From)) 1) (mapEntry ""NoDoctrine"" 1) (if (= (who at:(last From)) 2) (mapEntry ""NoDoctrine"" 1) (if (= (who at:(last From)) 3) (mapEntry ""NoDoctrine"" 1) (if (= (who at:(last From)) 4) (mapEntry ""NoDoctrine"" 1) 0)))) (if (is In (last From) (sites Occupied by:All container:""Board"" components:{""Tank"" ""Speeder"" ""Shooter""})) (if (= (who at:(last From)) 1) (mapEntry ""NoDoctrine"" 2) (if (= (who at:(last From)) 2) (mapEntry ""NoDoctrine"" 2) (if (= (who at:(last From)) 3) (mapEntry ""NoDoctrine"" 2) (if (= (who at:(last From)) 4) (mapEntry ""NoDoctrine"" 2) 0)))) (if (is In (last From) (sites Occupied by:All container:""Board"" components:{""Launcher"" ""Antiair"" ""Artillery""})) (if (= (who at:(last From)) 1) (mapEntry ""NoDoctrine"" 3) (if (= (who at:(last From)) 2) (mapEntry ""NoDoctrine"" 3) (if (= (who at:(last From)) 3) (mapEntry ""NoDoctrine"" 3) (if (= (who at:(last From)) 4) (mapEntry ""NoDoctrine"" 3) 0)))) (if (is In (last From) (sites Occupied by:All container:""Board"" components:{""Fighter"" ""Bomber"" ""Helicopter""})) (if (= (who at:(last From)) 1) (mapEntry ""NoDoctrine"" 4) (if (= (who at:(last From)) 2) (mapEntry ""NoDoctrine"" 4) (if (= (who at:(last From)) 3) (mapEntry ""NoDoctrine"" 4) (if (= (who at:(last From)) 4) (mapEntry ""NoDoctrine"" 4) 0)))) (if (is In (last From) (sites Occupied by:All container:""Board"" components:{""Submarine"" ""Cruiser"" ""Battleship""})) (if (= (who at:(last From)) 1) (mapEntry ""NoDoctrine"" 5) (if (= (who at:(last From)) 2) (mapEntry ""NoDoctrine"" 5) (if (= (who at:(last From)) 3) (mapEntry ""NoDoctrine"" 5) (if (= (who at:(last From)) 4) (mapEntry ""NoDoctrine"" 5) 0)))) 4))))) (if (and (= 8 (state at:(last To))) (!= (mover) (who at:(last To)))) (if (= (who at:(last From)) 1) (mapEntry ""NoDoctrine"" 6) (if (= (who at:(last From)) 2) (mapEntry ""NoDoctrine"" 6) (if (= (who at:(last From)) 3) (mapEntry ""NoDoctrine"" 6) (if (= (who at:(last From)) 4) (mapEntry ""NoDoctrine"" 6) 0)))) 5) (if (> (who at:(last To)) 0) (if (= (who at:(last To)) 1) (mapEntry ""NoDoctrine"" 8) (if (= (who at:(last To)) 2) (mapEntry ""NoDoctrine"" 8) (if (= (who at:(last To)) 3) (mapEntry ""NoDoctrine"" 8) (if (= (who at:(last To)) 4) (mapEntry ""NoDoctrine"" 8) 0)))) 4) (if False (if (= (who at:(last From)) 1) (mapEntry ""NoDoctrine"" 10) (if (= (who at:(last From)) 2) (mapEntry ""NoDoctrine"" 10) (if (= (who at:(last From)) 3) (mapEntry ""NoDoctrine"" 10) (if (= (who at:(last From)) 4) (mapEntry ""NoDoctrine"" 10) 0)))) (if (= (who at:(last From)) 1) (mapEntry ""NoDoctrine"" 9) (if (= (who at:(last From)) 2) (mapEntry ""NoDoctrine"" 9) (if (= (who at:(last From)) 3) (mapEntry ""NoDoctrine"" 9) (if (= (who at:(last From)) 4) (mapEntry ""NoDoctrine"" 9) 0))))) (value Random (range (if (= (who at:(last From)) 1) (mapEntry ""NoDoctrine"" 11) (if (= (who at:(last From)) 2) (mapEntry ""NoDoctrine"" 11) (if (= (who at:(last From)) 3) (mapEntry ""NoDoctrine"" 11) (if (= (who at:(last From)) 4) (mapEntry ""NoDoctrine"" 11) 0)))) (if (= (who at:(last From)) 1) (mapEntry ""NoDoctrine"" 12) (if (= (who at:(last From)) 2) (mapEntry ""NoDoctrine"" 12) (if (= (who at:(last From)) 3) (mapEntry ""NoDoctrine"" 12) (if (= (who at:(last From)) 4) (mapEntry ""NoDoctrine"" 12) 0))))))})) 128000)))) (set State at:(last From) 0)) next:(if (and (= 8 (state at:(last To))) (!= (mover) (who at:(last To)))) (if (= (value Piece at:(last To)) 0) (and {(take Control of:All by:Mover at:(last To)) (set Value at:(last To) 50)}) (set Value at:(last To) (value Piece at:(last To)))) (if (= (value Piece at:(last To)) 0) (remove (last To)) (if (and {(= 0 (count Sites in:(intersection (sites {(last To) (last From)}) (sites Occupied by:All components:{""Launcher"" ""Artillery"" ""Battleship"" ""Antiair""})))) (if (is In (last To) (sites Occupied by:Enemy components:{""Bomber"" ""Battleship"" ""Artillery"" ""Launcher""})) (is In (last From) (union (sites Occupied by:Mover components:{""Soldier"" ""Motorbike"" ""Tank"" ""Speeder"" ""Shooter"" ""Launcher"" ""Antiair"" ""Battleship"" ""Artillery"" ""Base"" ""Town"" ""Factory"" ""Dock"" ""Airport"" ""Cruiser"" ""Submarine""}) (sites Occupied by:Neutral container:""Board""))) (is In (last From) (union (sites Occupied by:Mover) (sites Occupied by:Neutral container:""Board"")))) (if (is In (last To) (sites Occupied by:Enemy components:{""Antiair"" ""Fighter""})) (is In (last From) (sites Occupied by:Mover components:{""Fighter"" ""Helicopter"" ""Bomber""})) (is In (last From) (union (sites Occupied by:Mover) (sites Occupied by:Neutral container:""Board"")))) (if (is In (last To) (sites Occupied by:Enemy components:{""Submarine""})) (is In (last From) (sites Occupied by:Mover components:{""Submarine"" ""Battleship"" ""Cruiser""})) (is In (last From) (union (sites Occupied by:Mover) (sites Occupied by:Neutral container:""Board""))))}) (if (<= (- (value Piece at:(last From)) (/ (* (if (is In (last From) (sites Occupied by:All container:""Board"" components:{""Fighter"" ""Bomber"" ""Helicopter""})) (max (/ (* (* (value Piece at:(last To)) 4) (mapEntry ""DamageMultiplier"" (what at:(last To)))) 100) 1) (if (and (is In (last From) (sites Occupied by:All container:""Board"" components:{""Soldier"" ""Motorbike""})) (is In (last To) (sites Occupied by:All component:""Shooter""))) (if (is In (last From) (sites ""Forest"")) (max (/ (* (* (value Piece at:(last To)) 6) (mapEntry ""DamageMultiplier"" (what at:(last To)))) 100) 1) (if (is In (last From) (union (sites ""ShallowWater"") (sites ""DeepWater""))) (max (/ (* (* (value Piece at:(last To)) 10) (mapEntry ""DamageMultiplier"" (what at:(last To)))) 100) 1) (max (/ (* (* (value Piece at:(last To)) 8) (mapEntry ""DamageMultiplier"" (what at:(last To)))) 100) 1))) (if (is In (last From) (sites ""Forest"")) (max (/ (* (* (value Piece at:(last To)) 3) (mapEntry ""DamageMultiplier"" (what at:(last To)))) 100) 1) (if (is In (last From) (union (sites ""ShallowWater"") (sites ""DeepWater""))) (max (/ (* (* (value Piece at:(last To)) 5) (mapEntry ""DamageMultiplier"" (what at:(last To)))) 100) 1) (max (/ (* (* (value Piece at:(last To)) 4) (mapEntry ""DamageMultiplier"" (what at:(last To)))) 100) 1))))) (* {(if (is In (last To) (sites Occupied by:All container:""Board"" components:{""Soldier"" ""Motorbike""})) (if (= (who at:(last To)) 1) (mapEntry ""NoDoctrine"" 1) (if (= (who at:(last To)) 2) (mapEntry ""NoDoctrine"" 1) (if (= (who at:(last To)) 3) (mapEntry ""NoDoctrine"" 1) (if (= (who at:(last To)) 4) (mapEntry ""NoDoctrine"" 1) 0)))) (if (is In (last To) (sites Occupied by:All container:""Board"" components:{""Tank"" ""Speeder"" ""Shooter""})) (if (= (who at:(last To)) 1) (mapEntry ""NoDoctrine"" 2) (if (= (who at:(last To)) 2) (mapEntry ""NoDoctrine"" 2) (if (= (who at:(last To)) 3) (mapEntry ""NoDoctrine"" 2) (if (= (who at:(last To)) 4) (mapEntry ""NoDoctrine"" 2) 0)))) (if (is In (last To) (sites Occupied by:All container:""Board"" components:{""Launcher"" ""Antiair"" ""Artillery""})) (if (= (who at:(last To)) 1) (mapEntry ""NoDoctrine"" 3) (if (= (who at:(last To)) 2) (mapEntry ""NoDoctrine"" 3) (if (= (who at:(last To)) 3) (mapEntry ""NoDoctrine"" 3) (if (= (who at:(last To)) 4) (mapEntry ""NoDoctrine"" 3) 0)))) (if (is In (last To) (sites Occupied by:All container:""Board"" components:{""Fighter"" ""Bomber"" ""Helicopter""})) (if (= (who at:(last To)) 1) (mapEntry ""NoDoctrine"" 4) (if (= (who at:(last To)) 2) (mapEntry ""NoDoctrine"" 4) (if (= (who at:(last To)) 3) (mapEntry ""NoDoctrine"" 4) (if (= (who at:(last To)) 4) (mapEntry ""NoDoctrine"" 4) 0)))) (if (is In (last To) (sites Occupied by:All container:""Board"" components:{""Submarine"" ""Cruiser"" ""Battleship""})) (if (= (who at:(last To)) 1) (mapEntry ""NoDoctrine"" 5) (if (= (who at:(last To)) 2) (mapEntry ""NoDoctrine"" 5) (if (= (who at:(last To)) 3) (mapEntry ""NoDoctrine"" 5) (if (= (who at:(last To)) 4) (mapEntry ""NoDoctrine"" 5) 0)))) 4))))) (if (and (= 8 (state at:(last From))) (!= (mover) (who at:(last From)))) (if (= (who at:(last To)) 1) (mapEntry ""NoDoctrine"" 6) (if (= (who at:(last To)) 2) (mapEntry ""NoDoctrine"" 6) (if (= (who at:(last To)) 3) (mapEntry ""NoDoctrine"" 6) (if (= (who at:(last To)) 4) (mapEntry ""NoDoctrine"" 6) 0)))) 5) (if (> (who at:(last From)) 0) (if (= (who at:(last From)) 1) (mapEntry ""NoDoctrine"" 8) (if (= (who at:(last From)) 2) (mapEntry ""NoDoctrine"" 8) (if (= (who at:(last From)) 3) (mapEntry ""NoDoctrine"" 8) (if (= (who at:(last From)) 4) (mapEntry ""NoDoctrine"" 8) 0)))) 4) (if True (if (= (who at:(last To)) 1) (mapEntry ""NoDoctrine"" 10) (if (= (who at:(last To)) 2) (mapEntry ""NoDoctrine"" 10) (if (= (who at:(last To)) 3) (mapEntry ""NoDoctrine"" 10) (if (= (who at:(last To)) 4) (mapEntry ""NoDoctrine"" 10) 0)))) (if (= (who at:(last To)) 1) (mapEntry ""NoDoctrine"" 9) (if (= (who at:(last To)) 2) (mapEntry ""NoDoctrine"" 9) (if (= (who at:(last To)) 3) (mapEntry ""NoDoctrine"" 9) (if (= (who at:(last To)) 4) (mapEntry ""NoDoctrine"" 9) 0))))) (value Random (range (if (= (who at:(last To)) 1) (mapEntry ""NoDoctrine"" 11) (if (= (who at:(last To)) 2) (mapEntry ""NoDoctrine"" 11) (if (= (who at:(last To)) 3) (mapEntry ""NoDoctrine"" 11) (if (= (who at:(last To)) 4) (mapEntry ""NoDoctrine"" 11) 0)))) (if (= (who at:(last To)) 1) (mapEntry ""NoDoctrine"" 12) (if (= (who at:(last To)) 2) (mapEntry ""NoDoctrine"" 12) (if (= (who at:(last To)) 3) (mapEntry ""NoDoctrine"" 12) (if (= (who at:(last To)) 4) (mapEntry ""NoDoctrine"" 12) 0))))))})) 128000)) 0) (remove (last From)) (set Value at:(last From) (- (value Piece at:(last From)) (/ (* (if (is In (last From) (sites Occupied by:All container:""Board"" components:{""Fighter"" ""Bomber"" ""Helicopter""})) (max (/ (* (* (value Piece at:(last To)) 4) (mapEntry ""DamageMultiplier"" (what at:(last To)))) 100) 1) (if (and (is In (last From) (sites Occupied by:All container:""Board"" components:{""Soldier"" ""Motorbike""})) (is In (last To) (sites Occupied by:All component:""Shooter""))) (if (is In (last From) (sites ""Forest"")) (max (/ (* (* (value Piece at:(last To)) 6) (mapEntry ""DamageMultiplier"" (what at:(last To)))) 100) 1) (if (is In (last From) (union (sites ""ShallowWater"") (sites ""DeepWater""))) (max (/ (* (* (value Piece at:(last To)) 10) (mapEntry ""DamageMultiplier"" (what at:(last To)))) 100) 1) (max (/ (* (* (value Piece at:(last To)) 8) (mapEntry ""DamageMultiplier"" (what at:(last To)))) 100) 1))) (if (is In (last From) (sites ""Forest"")) (max (/ (* (* (value Piece at:(last To)) 3) (mapEntry ""DamageMultiplier"" (what at:(last To)))) 100) 1) (if (is In (last From) (union (sites ""ShallowWater"") (sites ""DeepWater""))) (max (/ (* (* (value Piece at:(last To)) 5) (mapEntry ""DamageMultiplier"" (what at:(last To)))) 100) 1) (max (/ (* (* (value Piece at:(last To)) 4) (mapEntry ""DamageMultiplier"" (what at:(last To)))) 100) 1))))) (* {(if (is In (last To) (sites Occupied by:All container:""Board"" components:{""Soldier"" ""Motorbike""})) (if (= (who at:(last To)) 1) (mapEntry ""NoDoctrine"" 1) (if (= (who at:(last To)) 2) (mapEntry ""NoDoctrine"" 1) (if (= (who at:(last To)) 3) (mapEntry ""NoDoctrine"" 1) (if (= (who at:(last To)) 4) (mapEntry ""NoDoctrine"" 1) 0)))) (if (is In (last To) (sites Occupied by:All container:""Board"" components:{""Tank"" ""Speeder"" ""Shooter""})) (if (= (who at:(last To)) 1) (mapEntry ""NoDoctrine"" 2) (if (= (who at:(last To)) 2) (mapEntry ""NoDoctrine"" 2) (if (= (who at:(last To)) 3) (mapEntry ""NoDoctrine"" 2) (if (= (who at:(last To)) 4) (mapEntry ""NoDoctrine"" 2) 0)))) (if (is In (last To) (sites Occupied by:All container:""Board"" components:{""Launcher"" ""Antiair"" ""Artillery""})) (if (= (who at:(last To)) 1) (mapEntry ""NoDoctrine"" 3) (if (= (who at:(last To)) 2) (mapEntry ""NoDoctrine"" 3) (if (= (who at:(last To)) 3) (mapEntry ""NoDoctrine"" 3) (if (= (who at:(last To)) 4) (mapEntry ""NoDoctrine"" 3) 0)))) (if (is In (last To) (sites Occupied by:All container:""Board"" components:{""Fighter"" ""Bomber"" ""Helicopter""})) (if (= (who at:(last To)) 1) (mapEntry ""NoDoctrine"" 4) (if (= (who at:(last To)) 2) (mapEntry ""NoDoctrine"" 4) (if (= (who at:(last To)) 3) (mapEntry ""NoDoctrine"" 4) (if (= (who at:(last To)) 4) (mapEntry ""NoDoctrine"" 4) 0)))) (if (is In (last To) (sites Occupied by:All container:""Board"" components:{""Submarine"" ""Cruiser"" ""Battleship""})) (if (= (who at:(last To)) 1) (mapEntry ""NoDoctrine"" 5) (if (= (who at:(last To)) 2) (mapEntry ""NoDoctrine"" 5) (if (= (who at:(last To)) 3) (mapEntry ""NoDoctrine"" 5) (if (= (who at:(last To)) 4) (mapEntry ""NoDoctrine"" 5) 0)))) 4))))) (if (and (= 8 (state at:(last From))) (!= (mover) (who at:(last From)))) (if (= (who at:(last To)) 1) (mapEntry ""NoDoctrine"" 6) (if (= (who at:(last To)) 2) (mapEntry ""NoDoctrine"" 6) (if (= (who at:(last To)) 3) (mapEntry ""NoDoctrine"" 6) (if (= (who at:(last To)) 4) (mapEntry ""NoDoctrine"" 6) 0)))) 5) (if (> (who at:(last From)) 0) (if (= (who at:(last From)) 1) (mapEntry ""NoDoctrine"" 8) (if (= (who at:(last From)) 2) (mapEntry ""NoDoctrine"" 8) (if (= (who at:(last From)) 3) (mapEntry ""NoDoctrine"" 8) (if (= (who at:(last From)) 4) (mapEntry ""NoDoctrine"" 8) 0)))) 4) (if True (if (= (who at:(last To)) 1) (mapEntry ""NoDoctrine"" 10) (if (= (who at:(last To)) 2) (mapEntry ""NoDoctrine"" 10) (if (= (who at:(last To)) 3) (mapEntry ""NoDoctrine"" 10) (if (= (who at:(last To)) 4) (mapEntry ""NoDoctrine"" 10) 0)))) (if (= (who at:(last To)) 1) (mapEntry ""NoDoctrine"" 9) (if (= (who at:(last To)) 2) (mapEntry ""NoDoctrine"" 9) (if (= (who at:(last To)) 3) (mapEntry ""NoDoctrine"" 9) (if (= (who at:(last To)) 4) (mapEntry ""NoDoctrine"" 9) 0))))) (value Random (range (if (= (who at:(last To)) 1) (mapEntry ""NoDoctrine"" 11) (if (= (who at:(last To)) 2) (mapEntry ""NoDoctrine"" 11) (if (= (who at:(last To)) 3) (mapEntry ""NoDoctrine"" 11) (if (= (who at:(last To)) 4) (mapEntry ""NoDoctrine"" 11) 0)))) (if (= (who at:(last To)) 1) (mapEntry ""NoDoctrine"" 12) (if (= (who at:(last To)) 2) (mapEntry ""NoDoctrine"" 12) (if (= (who at:(last To)) 3) (mapEntry ""NoDoctrine"" 12) (if (= (who at:(last To)) 4) (mapEntry ""NoDoctrine"" 12) 0))))))})) 128000)))) (set Value at:(last From) (value Piece at:(last From))))))))) (move Select (from (from) if:(and (> (state at:(from)) 0) (< (value Piece at:(from)) (mapEntry ""MaxHealth"" (what at:(from)))))) (to (sites Around (from) Orthogonal if:(is In (to) (sites Occupied by:Mover container:""Board"" components:{""Town"" ""Dock"" ""Base"" ""Factory"" ""Airport""})))) (then (and {(set Value at:(last From) (min (mapEntry ""MaxHealth"" (what at:(last From))) (- (+ (value Piece at:(last From)) (value Piece at:(last To))) 1))) (set Value at:(last To) (max (- (value Piece at:(last To)) (- (mapEntry ""MaxHealth"" (what at:(last From))) (value Piece at:(last From)))) 1)) (set State at:(last From) 0)}))) (move Select (from (from) if:(> (state at:(from)) 0)) (to (sites Around (from) Orthogonal if:(and (= (what at:(from)) (what at:(to))) (< (value Piece at:(to)) (mapEntry ""MaxHealth"" (what at:(to))))))) (then (and {(if (<= (+ (value Piece at:(last To)) (value Piece at:(last From))) (mapEntry ""MaxHealth"" (what at:(last From)))) (and (set Value at:(last To) (min (mapEntry ""MaxHealth"" (what at:(last From))) (+ (value Piece at:(last From)) (value Piece at:(last To))))) (remove (last From))) (and (set Value at:(last To) (min (mapEntry ""MaxHealth"" (what at:(last From))) (- (+ (value Piece at:(last From)) (value Piece at:(last To))) 1))) (set Value at:(last From) (max (- (value Piece at:(last To)) (- (mapEntry ""MaxHealth"" (what at:(last From))) (value Piece at:(last From)))) 1)))) (set State at:(last From) 0) (set State at:(last To) 0)})))})) (piece ""Helicopter"" Each (or {(move (from (from) if:(> (state at:(from)) 1)) (to (sites Distance (step Orthogonal (to if:(is In (to) (union (sites Empty) (sites Occupied by:Friend container:""Board""))))) from:(from) (range 1 (- (state at:(from)) 1))) if:(is Empty (to)) (apply (set State at:(from) 1)))) (move Select (from (from) if:(> (state at:(from)) 0)) (to (sites Distance Orthogonal from:(from) (range 1 1)) if:(and {(if (is In (from) (sites Occupied by:Mover container:""Board"" components:{""Bomber"" ""Battleship"" ""Artillery"" ""Launcher""})) (is In (to) (union (sites Occupied by:Enemy container:""Board"" components:{""Soldier"" ""Motorbike"" ""Tank"" ""Speeder"" ""Shooter"" ""Launcher"" ""Antiair"" ""Battleship"" ""Artillery"" ""Base"" ""Town"" ""Factory"" ""Dock"" ""Airport"" ""Cruiser"" ""Submarine""}) (sites Occupied by:Neutral container:""Board""))) (is In (to) (union (sites Occupied by:Enemy container:""Board"") (sites Occupied by:Neutral container:""Board"")))) (if (is In (from) (sites Occupied by:Mover container:""Board"" components:{""Antiair"" ""Fighter""})) (is In (to) (sites Occupied by:Enemy container:""Board"" components:{""Fighter"" ""Helicopter"" ""Bomber""})) (is In (to) (union (sites Occupied by:Enemy container:""Board"") (sites Occupied by:Neutral container:""Board"")))) (if (is In (from) (sites Occupied by:Mover container:""Board"" components:{""Submarine""})) (is In (to) (sites Occupied by:Enemy container:""Board"" components:{""Submarine"" ""Battleship"" ""Cruiser""})) (is In (to) (union (sites Occupied by:Enemy container:""Board"") (sites Occupied by:Neutral container:""Board""))))})) (then (do (and (set Value at:(last To) (max 0 (- (value Piece at:(last To)) (/ (* (if (is In (last To) (sites Occupied by:All container:""Board"" components:{""Fighter"" ""Bomber"" ""Helicopter""})) (max (/ (* (* (value Piece at:(last From)) 4) (mapEntry ""DamageMultiplier"" (what at:(last From)))) 100) 1) (if (and (is In (last To) (sites Occupied by:All container:""Board"" components:{""Soldier"" ""Motorbike""})) (is In (last From) (sites Occupied by:All component:""Shooter""))) (if (is In (last To) (sites ""Forest"")) (max (/ (* (* (value Piece at:(last From)) 6) (mapEntry ""DamageMultiplier"" (what at:(last From)))) 100) 1) (if (is In (last To) (union (sites ""ShallowWater"") (sites ""DeepWater""))) (max (/ (* (* (value Piece at:(last From)) 10) (mapEntry ""DamageMultiplier"" (what at:(last From)))) 100) 1) (max (/ (* (* (value Piece at:(last From)) 8) (mapEntry ""DamageMultiplier"" (what at:(last From)))) 100) 1))) (if (is In (last To) (sites ""Forest"")) (max (/ (* (* (value Piece at:(last From)) 3) (mapEntry ""DamageMultiplier"" (what at:(last From)))) 100) 1) (if (is In (last To) (union (sites ""ShallowWater"") (sites ""DeepWater""))) (max (/ (* (* (value Piece at:(last From)) 5) (mapEntry ""DamageMultiplier"" (what at:(last From)))) 100) 1) (max (/ (* (* (value Piece at:(last From)) 4) (mapEntry ""DamageMultiplier"" (what at:(last From)))) 100) 1))))) (* {(if (is In (last From) (sites Occupied by:All container:""Board"" components:{""Soldier"" ""Motorbike""})) (if (= (who at:(last From)) 1) (mapEntry ""NoDoctrine"" 1) (if (= (who at:(last From)) 2) (mapEntry ""NoDoctrine"" 1) (if (= (who at:(last From)) 3) (mapEntry ""NoDoctrine"" 1) (if (= (who at:(last From)) 4) (mapEntry ""NoDoctrine"" 1) 0)))) (if (is In (last From) (sites Occupied by:All container:""Board"" components:{""Tank"" ""Speeder"" ""Shooter""})) (if (= (who at:(last From)) 1) (mapEntry ""NoDoctrine"" 2) (if (= (who at:(last From)) 2) (mapEntry ""NoDoctrine"" 2) (if (= (who at:(last From)) 3) (mapEntry ""NoDoctrine"" 2) (if (= (who at:(last From)) 4) (mapEntry ""NoDoctrine"" 2) 0)))) (if (is In (last From) (sites Occupied by:All container:""Board"" components:{""Launcher"" ""Antiair"" ""Artillery""})) (if (= (who at:(last From)) 1) (mapEntry ""NoDoctrine"" 3) (if (= (who at:(last From)) 2) (mapEntry ""NoDoctrine"" 3) (if (= (who at:(last From)) 3) (mapEntry ""NoDoctrine"" 3) (if (= (who at:(last From)) 4) (mapEntry ""NoDoctrine"" 3) 0)))) (if (is In (last From) (sites Occupied by:All container:""Board"" components:{""Fighter"" ""Bomber"" ""Helicopter""})) (if (= (who at:(last From)) 1) (mapEntry ""NoDoctrine"" 4) (if (= (who at:(last From)) 2) (mapEntry ""NoDoctrine"" 4) (if (= (who at:(last From)) 3) (mapEntry ""NoDoctrine"" 4) (if (= (who at:(last From)) 4) (mapEntry ""NoDoctrine"" 4) 0)))) (if (is In (last From) (sites Occupied by:All container:""Board"" components:{""Submarine"" ""Cruiser"" ""Battleship""})) (if (= (who at:(last From)) 1) (mapEntry ""NoDoctrine"" 5) (if (= (who at:(last From)) 2) (mapEntry ""NoDoctrine"" 5) (if (= (who at:(last From)) 3) (mapEntry ""NoDoctrine"" 5) (if (= (who at:(last From)) 4) (mapEntry ""NoDoctrine"" 5) 0)))) 4))))) (if (and (= 8 (state at:(last To))) (!= (mover) (who at:(last To)))) (if (= (who at:(last From)) 1) (mapEntry ""NoDoctrine"" 6) (if (= (who at:(last From)) 2) (mapEntry ""NoDoctrine"" 6) (if (= (who at:(last From)) 3) (mapEntry ""NoDoctrine"" 6) (if (= (who at:(last From)) 4) (mapEntry ""NoDoctrine"" 6) 0)))) 5) (if (> (who at:(last To)) 0) (if (= (who at:(last To)) 1) (mapEntry ""NoDoctrine"" 8) (if (= (who at:(last To)) 2) (mapEntry ""NoDoctrine"" 8) (if (= (who at:(last To)) 3) (mapEntry ""NoDoctrine"" 8) (if (= (who at:(last To)) 4) (mapEntry ""NoDoctrine"" 8) 0)))) 4) (if False (if (= (who at:(last From)) 1) (mapEntry ""NoDoctrine"" 10) (if (= (who at:(last From)) 2) (mapEntry ""NoDoctrine"" 10) (if (= (who at:(last From)) 3) (mapEntry ""NoDoctrine"" 10) (if (= (who at:(last From)) 4) (mapEntry ""NoDoctrine"" 10) 0)))) (if (= (who at:(last From)) 1) (mapEntry ""NoDoctrine"" 9) (if (= (who at:(last From)) 2) (mapEntry ""NoDoctrine"" 9) (if (= (who at:(last From)) 3) (mapEntry ""NoDoctrine"" 9) (if (= (who at:(last From)) 4) (mapEntry ""NoDoctrine"" 9) 0))))) (value Random (range (if (= (who at:(last From)) 1) (mapEntry ""NoDoctrine"" 11) (if (= (who at:(last From)) 2) (mapEntry ""NoDoctrine"" 11) (if (= (who at:(last From)) 3) (mapEntry ""NoDoctrine"" 11) (if (= (who at:(last From)) 4) (mapEntry ""NoDoctrine"" 11) 0)))) (if (= (who at:(last From)) 1) (mapEntry ""NoDoctrine"" 12) (if (= (who at:(last From)) 2) (mapEntry ""NoDoctrine"" 12) (if (= (who at:(last From)) 3) (mapEntry ""NoDoctrine"" 12) (if (= (who at:(last From)) 4) (mapEntry ""NoDoctrine"" 12) 0))))))})) 128000)))) (set State at:(last From) 0)) next:(if (and (= 8 (state at:(last To))) (!= (mover) (who at:(last To)))) (if (= (value Piece at:(last To)) 0) (and {(take Control of:All by:Mover at:(last To)) (set Value at:(last To) 50)}) (set Value at:(last To) (value Piece at:(last To)))) (if (= (value Piece at:(last To)) 0) (remove (last To)) (if (and {(= 0 (count Sites in:(intersection (sites {(last To) (last From)}) (sites Occupied by:All components:{""Launcher"" ""Artillery"" ""Battleship"" ""Antiair""})))) (if (is In (last To) (sites Occupied by:Enemy components:{""Bomber"" ""Battleship"" ""Artillery"" ""Launcher""})) (is In (last From) (union (sites Occupied by:Mover components:{""Soldier"" ""Motorbike"" ""Tank"" ""Speeder"" ""Shooter"" ""Launcher"" ""Antiair"" ""Battleship"" ""Artillery"" ""Base"" ""Town"" ""Factory"" ""Dock"" ""Airport"" ""Cruiser"" ""Submarine""}) (sites Occupied by:Neutral container:""Board""))) (is In (last From) (union (sites Occupied by:Mover) (sites Occupied by:Neutral container:""Board"")))) (if (is In (last To) (sites Occupied by:Enemy components:{""Antiair"" ""Fighter""})) (is In (last From) (sites Occupied by:Mover components:{""Fighter"" ""Helicopter"" ""Bomber""})) (is In (last From) (union (sites Occupied by:Mover) (sites Occupied by:Neutral container:""Board"")))) (if (is In (last To) (sites Occupied by:Enemy components:{""Submarine""})) (is In (last From) (sites Occupied by:Mover components:{""Submarine"" ""Battleship"" ""Cruiser""})) (is In (last From) (union (sites Occupied by:Mover) (sites Occupied by:Neutral container:""Board""))))}) (if (<= (- (value Piece at:(last From)) (/ (* (if (is In (last From) (sites Occupied by:All container:""Board"" components:{""Fighter"" ""Bomber"" ""Helicopter""})) (max (/ (* (* (value Piece at:(last To)) 4) (mapEntry ""DamageMultiplier"" (what at:(last To)))) 100) 1) (if (and (is In (last From) (sites Occupied by:All container:""Board"" components:{""Soldier"" ""Motorbike""})) (is In (last To) (sites Occupied by:All component:""Shooter""))) (if (is In (last From) (sites ""Forest"")) (max (/ (* (* (value Piece at:(last To)) 6) (mapEntry ""DamageMultiplier"" (what at:(last To)))) 100) 1) (if (is In (last From) (union (sites ""ShallowWater"") (sites ""DeepWater""))) (max (/ (* (* (value Piece at:(last To)) 10) (mapEntry ""DamageMultiplier"" (what at:(last To)))) 100) 1) (max (/ (* (* (value Piece at:(last To)) 8) (mapEntry ""DamageMultiplier"" (what at:(last To)))) 100) 1))) (if (is In (last From) (sites ""Forest"")) (max (/ (* (* (value Piece at:(last To)) 3) (mapEntry ""DamageMultiplier"" (what at:(last To)))) 100) 1) (if (is In (last From) (union (sites ""ShallowWater"") (sites ""DeepWater""))) (max (/ (* (* (value Piece at:(last To)) 5) (mapEntry ""DamageMultiplier"" (what at:(last To)))) 100) 1) (max (/ (* (* (value Piece at:(last To)) 4) (mapEntry ""DamageMultiplier"" (what at:(last To)))) 100) 1))))) (* {(if (is In (last To) (sites Occupied by:All container:""Board"" components:{""Soldier"" ""Motorbike""})) (if (= (who at:(last To)) 1) (mapEntry ""NoDoctrine"" 1) (if (= (who at:(last To)) 2) (mapEntry ""NoDoctrine"" 1) (if (= (who at:(last To)) 3) (mapEntry ""NoDoctrine"" 1) (if (= (who at:(last To)) 4) (mapEntry ""NoDoctrine"" 1) 0)))) (if (is In (last To) (sites Occupied by:All container:""Board"" components:{""Tank"" ""Speeder"" ""Shooter""})) (if (= (who at:(last To)) 1) (mapEntry ""NoDoctrine"" 2) (if (= (who at:(last To)) 2) (mapEntry ""NoDoctrine"" 2) (if (= (who at:(last To)) 3) (mapEntry ""NoDoctrine"" 2) (if (= (who at:(last To)) 4) (mapEntry ""NoDoctrine"" 2) 0)))) (if (is In (last To) (sites Occupied by:All container:""Board"" components:{""Launcher"" ""Antiair"" ""Artillery""})) (if (= (who at:(last To)) 1) (mapEntry ""NoDoctrine"" 3) (if (= (who at:(last To)) 2) (mapEntry ""NoDoctrine"" 3) (if (= (who at:(last To)) 3) (mapEntry ""NoDoctrine"" 3) (if (= (who at:(last To)) 4) (mapEntry ""NoDoctrine"" 3) 0)))) (if (is In (last To) (sites Occupied by:All container:""Board"" components:{""Fighter"" ""Bomber"" ""Helicopter""})) (if (= (who at:(last To)) 1) (mapEntry ""NoDoctrine"" 4) (if (= (who at:(last To)) 2) (mapEntry ""NoDoctrine"" 4) (if (= (who at:(last To)) 3) (mapEntry ""NoDoctrine"" 4) (if (= (who at:(last To)) 4) (mapEntry ""NoDoctrine"" 4) 0)))) (if (is In (last To) (sites Occupied by:All container:""Board"" components:{""Submarine"" ""Cruiser"" ""Battleship""})) (if (= (who at:(last To)) 1) (mapEntry ""NoDoctrine"" 5) (if (= (who at:(last To)) 2) (mapEntry ""NoDoctrine"" 5) (if (= (who at:(last To)) 3) (mapEntry ""NoDoctrine"" 5) (if (= (who at:(last To)) 4) (mapEntry ""NoDoctrine"" 5) 0)))) 4))))) (if (and (= 8 (state at:(last From))) (!= (mover) (who at:(last From)))) (if (= (who at:(last To)) 1) (mapEntry ""NoDoctrine"" 6) (if (= (who at:(last To)) 2) (mapEntry ""NoDoctrine"" 6) (if (= (who at:(last To)) 3) (mapEntry ""NoDoctrine"" 6) (if (= (who at:(last To)) 4) (mapEntry ""NoDoctrine"" 6) 0)))) 5) (if (> (who at:(last From)) 0) (if (= (who at:(last From)) 1) (mapEntry ""NoDoctrine"" 8) (if (= (who at:(last From)) 2) (mapEntry ""NoDoctrine"" 8) (if (= (who at:(last From)) 3) (mapEntry ""NoDoctrine"" 8) (if (= (who at:(last From)) 4) (mapEntry ""NoDoctrine"" 8) 0)))) 4) (if True (if (= (who at:(last To)) 1) (mapEntry ""NoDoctrine"" 10) (if (= (who at:(last To)) 2) (mapEntry ""NoDoctrine"" 10) (if (= (who at:(last To)) 3) (mapEntry ""NoDoctrine"" 10) (if (= (who at:(last To)) 4) (mapEntry ""NoDoctrine"" 10) 0)))) (if (= (who at:(last To)) 1) (mapEntry ""NoDoctrine"" 9) (if (= (who at:(last To)) 2) (mapEntry ""NoDoctrine"" 9) (if (= (who at:(last To)) 3) (mapEntry ""NoDoctrine"" 9) (if (= (who at:(last To)) 4) (mapEntry ""NoDoctrine"" 9) 0))))) (value Random (range (if (= (who at:(last To)) 1) (mapEntry ""NoDoctrine"" 11) (if (= (who at:(last To)) 2) (mapEntry ""NoDoctrine"" 11) (if (= (who at:(last To)) 3) (mapEntry ""NoDoctrine"" 11) (if (= (who at:(last To)) 4) (mapEntry ""NoDoctrine"" 11) 0)))) (if (= (who at:(last To)) 1) (mapEntry ""NoDoctrine"" 12) (if (= (who at:(last To)) 2) (mapEntry ""NoDoctrine"" 12) (if (= (who at:(last To)) 3) (mapEntry ""NoDoctrine"" 12) (if (= (who at:(last To)) 4) (mapEntry ""NoDoctrine"" 12) 0))))))})) 128000)) 0) (remove (last From)) (set Value at:(last From) (- (value Piece at:(last From)) (/ (* (if (is In (last From) (sites Occupied by:All container:""Board"" components:{""Fighter"" ""Bomber"" ""Helicopter""})) (max (/ (* (* (value Piece at:(last To)) 4) (mapEntry ""DamageMultiplier"" (what at:(last To)))) 100) 1) (if (and (is In (last From) (sites Occupied by:All container:""Board"" components:{""Soldier"" ""Motorbike""})) (is In (last To) (sites Occupied by:All component:""Shooter""))) (if (is In (last From) (sites ""Forest"")) (max (/ (* (* (value Piece at:(last To)) 6) (mapEntry ""DamageMultiplier"" (what at:(last To)))) 100) 1) (if (is In (last From) (union (sites ""ShallowWater"") (sites ""DeepWater""))) (max (/ (* (* (value Piece at:(last To)) 10) (mapEntry ""DamageMultiplier"" (what at:(last To)))) 100) 1) (max (/ (* (* (value Piece at:(last To)) 8) (mapEntry ""DamageMultiplier"" (what at:(last To)))) 100) 1))) (if (is In (last From) (sites ""Forest"")) (max (/ (* (* (value Piece at:(last To)) 3) (mapEntry ""DamageMultiplier"" (what at:(last To)))) 100) 1) (if (is In (last From) (union (sites ""ShallowWater"") (sites ""DeepWater""))) (max (/ (* (* (value Piece at:(last To)) 5) (mapEntry ""DamageMultiplier"" (what at:(last To)))) 100) 1) (max (/ (* (* (value Piece at:(last To)) 4) (mapEntry ""DamageMultiplier"" (what at:(last To)))) 100) 1))))) (* {(if (is In (last To) (sites Occupied by:All container:""Board"" components:{""Soldier"" ""Motorbike""})) (if (= (who at:(last To)) 1) (mapEntry ""NoDoctrine"" 1) (if (= (who at:(last To)) 2) (mapEntry ""NoDoctrine"" 1) (if (= (who at:(last To)) 3) (mapEntry ""NoDoctrine"" 1) (if (= (who at:(last To)) 4) (mapEntry ""NoDoctrine"" 1) 0)))) (if (is In (last To) (sites Occupied by:All container:""Board"" components:{""Tank"" ""Speeder"" ""Shooter""})) (if (= (who at:(last To)) 1) (mapEntry ""NoDoctrine"" 2) (if (= (who at:(last To)) 2) (mapEntry ""NoDoctrine"" 2) (if (= (who at:(last To)) 3) (mapEntry ""NoDoctrine"" 2) (if (= (who at:(last To)) 4) (mapEntry ""NoDoctrine"" 2) 0)))) (if (is In (last To) (sites Occupied by:All container:""Board"" components:{""Launcher"" ""Antiair"" ""Artillery""})) (if (= (who at:(last To)) 1) (mapEntry ""NoDoctrine"" 3) (if (= (who at:(last To)) 2) (mapEntry ""NoDoctrine"" 3) (if (= (who at:(last To)) 3) (mapEntry ""NoDoctrine"" 3) (if (= (who at:(last To)) 4) (mapEntry ""NoDoctrine"" 3) 0)))) (if (is In (last To) (sites Occupied by:All container:""Board"" components:{""Fighter"" ""Bomber"" ""Helicopter""})) (if (= (who at:(last To)) 1) (mapEntry ""NoDoctrine"" 4) (if (= (who at:(last To)) 2) (mapEntry ""NoDoctrine"" 4) (if (= (who at:(last To)) 3) (mapEntry ""NoDoctrine"" 4) (if (= (who at:(last To)) 4) (mapEntry ""NoDoctrine"" 4) 0)))) (if (is In (last To) (sites Occupied by:All container:""Board"" components:{""Submarine"" ""Cruiser"" ""Battleship""})) (if (= (who at:(last To)) 1) (mapEntry ""NoDoctrine"" 5) (if (= (who at:(last To)) 2) (mapEntry ""NoDoctrine"" 5) (if (= (who at:(last To)) 3) (mapEntry ""NoDoctrine"" 5) (if (= (who at:(last To)) 4) (mapEntry ""NoDoctrine"" 5) 0)))) 4))))) (if (and (= 8 (state at:(last From))) (!= (mover) (who at:(last From)))) (if (= (who at:(last To)) 1) (mapEntry ""NoDoctrine"" 6) (if (= (who at:(last To)) 2) (mapEntry ""NoDoctrine"" 6) (if (= (who at:(last To)) 3) (mapEntry ""NoDoctrine"" 6) (if (= (who at:(last To)) 4) (mapEntry ""NoDoctrine"" 6) 0)))) 5) (if (> (who at:(last From)) 0) (if (= (who at:(last From)) 1) (mapEntry ""NoDoctrine"" 8) (if (= (who at:(last From)) 2) (mapEntry ""NoDoctrine"" 8) (if (= (who at:(last From)) 3) (mapEntry ""NoDoctrine"" 8) (if (= (who at:(last From)) 4) (mapEntry ""NoDoctrine"" 8) 0)))) 4) (if True (if (= (who at:(last To)) 1) (mapEntry ""NoDoctrine"" 10) (if (= (who at:(last To)) 2) (mapEntry ""NoDoctrine"" 10) (if (= (who at:(last To)) 3) (mapEntry ""NoDoctrine"" 10) (if (= (who at:(last To)) 4) (mapEntry ""NoDoctrine"" 10) 0)))) (if (= (who at:(last To)) 1) (mapEntry ""NoDoctrine"" 9) (if (= (who at:(last To)) 2) (mapEntry ""NoDoctrine"" 9) (if (= (who at:(last To)) 3) (mapEntry ""NoDoctrine"" 9) (if (= (who at:(last To)) 4) (mapEntry ""NoDoctrine"" 9) 0))))) (value Random (range (if (= (who at:(last To)) 1) (mapEntry ""NoDoctrine"" 11) (if (= (who at:(last To)) 2) (mapEntry ""NoDoctrine"" 11) (if (= (who at:(last To)) 3) (mapEntry ""NoDoctrine"" 11) (if (= (who at:(last To)) 4) (mapEntry ""NoDoctrine"" 11) 0)))) (if (= (who at:(last To)) 1) (mapEntry ""NoDoctrine"" 12) (if (= (who at:(last To)) 2) (mapEntry ""NoDoctrine"" 12) (if (= (who at:(last To)) 3) (mapEntry ""NoDoctrine"" 12) (if (= (who at:(last To)) 4) (mapEntry ""NoDoctrine"" 12) 0))))))})) 128000)))) (set Value at:(last From) (value Piece at:(last From))))))))) (move Select (from (from) if:(and (> (state at:(from)) 0) (< (value Piece at:(from)) (mapEntry ""MaxHealth"" (what at:(from)))))) (to (sites Around (from) Orthogonal if:(is In (to) (sites Occupied by:Mover container:""Board"" components:{""Town"" ""Dock"" ""Base"" ""Factory"" ""Airport""})))) (then (and {(set Value at:(last From) (min (mapEntry ""MaxHealth"" (what at:(last From))) (- (+ (value Piece at:(last From)) (value Piece at:(last To))) 1))) (set Value at:(last To) (max (- (value Piece at:(last To)) (- (mapEntry ""MaxHealth"" (what at:(last From))) (value Piece at:(last From)))) 1)) (set State at:(last From) 0)}))) (move Select (from (from) if:(> (state at:(from)) 0)) (to (sites Around (from) Orthogonal if:(and (= (what at:(from)) (what at:(to))) (< (value Piece at:(to)) (mapEntry ""MaxHealth"" (what at:(to))))))) (then (and {(if (<= (+ (value Piece at:(last To)) (value Piece at:(last From))) (mapEntry ""MaxHealth"" (what at:(last From)))) (and (set Value at:(last To) (min (mapEntry ""MaxHealth"" (what at:(last From))) (+ (value Piece at:(last From)) (value Piece at:(last To))))) (remove (last From))) (and (set Value at:(last To) (min (mapEntry ""MaxHealth"" (what at:(last From))) (- (+ (value Piece at:(last From)) (value Piece at:(last To))) 1))) (set Value at:(last From) (max (- (value Piece at:(last To)) (- (mapEntry ""MaxHealth"" (what at:(last From))) (value Piece at:(last From)))) 1)))) (set State at:(last From) 0) (set State at:(last To) 0)})))})) (piece ""Fighter"" Each (or {(move (from (from) if:(> (state at:(from)) 1)) (to (sites Distance (step Orthogonal (to if:(is In (to) (union (sites Empty) (sites Occupied by:Friend container:""Board""))))) from:(from) (range 1 (- (state at:(from)) 1))) if:(is Empty (to)) (apply (set State at:(from) 1)))) (move Select (from (from) if:(> (state at:(from)) 0)) (to (sites Distance Orthogonal from:(from) (range 1 1)) if:(and {(if (is In (from) (sites Occupied by:Mover container:""Board"" components:{""Bomber"" ""Battleship"" ""Artillery"" ""Launcher""})) (is In (to) (union (sites Occupied by:Enemy container:""Board"" components:{""Soldier"" ""Motorbike"" ""Tank"" ""Speeder"" ""Shooter"" ""Launcher"" ""Antiair"" ""Battleship"" ""Artillery"" ""Base"" ""Town"" ""Factory"" ""Dock"" ""Airport"" ""Cruiser"" ""Submarine""}) (sites Occupied by:Neutral container:""Board""))) (is In (to) (union (sites Occupied by:Enemy container:""Board"") (sites Occupied by:Neutral container:""Board"")))) (if (is In (from) (sites Occupied by:Mover container:""Board"" components:{""Antiair"" ""Fighter""})) (is In (to) (sites Occupied by:Enemy container:""Board"" components:{""Fighter"" ""Helicopter"" ""Bomber""})) (is In (to) (union (sites Occupied by:Enemy container:""Board"") (sites Occupied by:Neutral container:""Board"")))) (if (is In (from) (sites Occupied by:Mover container:""Board"" components:{""Submarine""})) (is In (to) (sites Occupied by:Enemy container:""Board"" components:{""Submarine"" ""Battleship"" ""Cruiser""})) (is In (to) (union (sites Occupied by:Enemy container:""Board"") (sites Occupied by:Neutral container:""Board""))))})) (then (do (and (set Value at:(last To) (max 0 (- (value Piece at:(last To)) (/ (* (if (is In (last To) (sites Occupied by:All container:""Board"" components:{""Fighter"" ""Bomber"" ""Helicopter""})) (max (/ (* (* (value Piece at:(last From)) 4) (mapEntry ""DamageMultiplier"" (what at:(last From)))) 100) 1) (if (and (is In (last To) (sites Occupied by:All container:""Board"" components:{""Soldier"" ""Motorbike""})) (is In (last From) (sites Occupied by:All component:""Shooter""))) (if (is In (last To) (sites ""Forest"")) (max (/ (* (* (value Piece at:(last From)) 6) (mapEntry ""DamageMultiplier"" (what at:(last From)))) 100) 1) (if (is In (last To) (union (sites ""ShallowWater"") (sites ""DeepWater""))) (max (/ (* (* (value Piece at:(last From)) 10) (mapEntry ""DamageMultiplier"" (what at:(last From)))) 100) 1) (max (/ (* (* (value Piece at:(last From)) 8) (mapEntry ""DamageMultiplier"" (what at:(last From)))) 100) 1))) (if (is In (last To) (sites ""Forest"")) (max (/ (* (* (value Piece at:(last From)) 3) (mapEntry ""DamageMultiplier"" (what at:(last From)))) 100) 1) (if (is In (last To) (union (sites ""ShallowWater"") (sites ""DeepWater""))) (max (/ (* (* (value Piece at:(last From)) 5) (mapEntry ""DamageMultiplier"" (what at:(last From)))) 100) 1) (max (/ (* (* (value Piece at:(last From)) 4) (mapEntry ""DamageMultiplier"" (what at:(last From)))) 100) 1))))) (* {(if (is In (last From) (sites Occupied by:All container:""Board"" components:{""Soldier"" ""Motorbike""})) (if (= (who at:(last From)) 1) (mapEntry ""NoDoctrine"" 1) (if (= (who at:(last From)) 2) (mapEntry ""NoDoctrine"" 1) (if (= (who at:(last From)) 3) (mapEntry ""NoDoctrine"" 1) (if (= (who at:(last From)) 4) (mapEntry ""NoDoctrine"" 1) 0)))) (if (is In (last From) (sites Occupied by:All container:""Board"" components:{""Tank"" ""Speeder"" ""Shooter""})) (if (= (who at:(last From)) 1) (mapEntry ""NoDoctrine"" 2) (if (= (who at:(last From)) 2) (mapEntry ""NoDoctrine"" 2) (if (= (who at:(last From)) 3) (mapEntry ""NoDoctrine"" 2) (if (= (who at:(last From)) 4) (mapEntry ""NoDoctrine"" 2) 0)))) (if (is In (last From) (sites Occupied by:All container:""Board"" components:{""Launcher"" ""Antiair"" ""Artillery""})) (if (= (who at:(last From)) 1) (mapEntry ""NoDoctrine"" 3) (if (= (who at:(last From)) 2) (mapEntry ""NoDoctrine"" 3) (if (= (who at:(last From)) 3) (mapEntry ""NoDoctrine"" 3) (if (= (who at:(last From)) 4) (mapEntry ""NoDoctrine"" 3) 0)))) (if (is In (last From) (sites Occupied by:All container:""Board"" components:{""Fighter"" ""Bomber"" ""Helicopter""})) (if (= (who at:(last From)) 1) (mapEntry ""NoDoctrine"" 4) (if (= (who at:(last From)) 2) (mapEntry ""NoDoctrine"" 4) (if (= (who at:(last From)) 3) (mapEntry ""NoDoctrine"" 4) (if (= (who at:(last From)) 4) (mapEntry ""NoDoctrine"" 4) 0)))) (if (is In (last From) (sites Occupied by:All container:""Board"" components:{""Submarine"" ""Cruiser"" ""Battleship""})) (if (= (who at:(last From)) 1) (mapEntry ""NoDoctrine"" 5) (if (= (who at:(last From)) 2) (mapEntry ""NoDoctrine"" 5) (if (= (who at:(last From)) 3) (mapEntry ""NoDoctrine"" 5) (if (= (who at:(last From)) 4) (mapEntry ""NoDoctrine"" 5) 0)))) 4))))) (if (and (= 8 (state at:(last To))) (!= (mover) (who at:(last To)))) (if (= (who at:(last From)) 1) (mapEntry ""NoDoctrine"" 6) (if (= (who at:(last From)) 2) (mapEntry ""NoDoctrine"" 6) (if (= (who at:(last From)) 3) (mapEntry ""NoDoctrine"" 6) (if (= (who at:(last From)) 4) (mapEntry ""NoDoctrine"" 6) 0)))) 5) (if (> (who at:(last To)) 0) (if (= (who at:(last To)) 1) (mapEntry ""NoDoctrine"" 8) (if (= (who at:(last To)) 2) (mapEntry ""NoDoctrine"" 8) (if (= (who at:(last To)) 3) (mapEntry ""NoDoctrine"" 8) (if (= (who at:(last To)) 4) (mapEntry ""NoDoctrine"" 8) 0)))) 4) (if False (if (= (who at:(last From)) 1) (mapEntry ""NoDoctrine"" 10) (if (= (who at:(last From)) 2) (mapEntry ""NoDoctrine"" 10) (if (= (who at:(last From)) 3) (mapEntry ""NoDoctrine"" 10) (if (= (who at:(last From)) 4) (mapEntry ""NoDoctrine"" 10) 0)))) (if (= (who at:(last From)) 1) (mapEntry ""NoDoctrine"" 9) (if (= (who at:(last From)) 2) (mapEntry ""NoDoctrine"" 9) (if (= (who at:(last From)) 3) (mapEntry ""NoDoctrine"" 9) (if (= (who at:(last From)) 4) (mapEntry ""NoDoctrine"" 9) 0))))) (value Random (range (if (= (who at:(last From)) 1) (mapEntry ""NoDoctrine"" 11) (if (= (who at:(last From)) 2) (mapEntry ""NoDoctrine"" 11) (if (= (who at:(last From)) 3) (mapEntry ""NoDoctrine"" 11) (if (= (who at:(last From)) 4) (mapEntry ""NoDoctrine"" 11) 0)))) (if (= (who at:(last From)) 1) (mapEntry ""NoDoctrine"" 12) (if (= (who at:(last From)) 2) (mapEntry ""NoDoctrine"" 12) (if (= (who at:(last From)) 3) (mapEntry ""NoDoctrine"" 12) (if (= (who at:(last From)) 4) (mapEntry ""NoDoctrine"" 12) 0))))))})) 128000)))) (set State at:(last From) 0)) next:(if (and (= 8 (state at:(last To))) (!= (mover) (who at:(last To)))) (if (= (value Piece at:(last To)) 0) (and {(take Control of:All by:Mover at:(last To)) (set Value at:(last To) 50)}) (set Value at:(last To) (value Piece at:(last To)))) (if (= (value Piece at:(last To)) 0) (remove (last To)) (if (and {(= 0 (count Sites in:(intersection (sites {(last To) (last From)}) (sites Occupied by:All components:{""Launcher"" ""Artillery"" ""Battleship"" ""Antiair""})))) (if (is In (last To) (sites Occupied by:Enemy components:{""Bomber"" ""Battleship"" ""Artillery"" ""Launcher""})) (is In (last From) (union (sites Occupied by:Mover components:{""Soldier"" ""Motorbike"" ""Tank"" ""Speeder"" ""Shooter"" ""Launcher"" ""Antiair"" ""Battleship"" ""Artillery"" ""Base"" ""Town"" ""Factory"" ""Dock"" ""Airport"" ""Cruiser"" ""Submarine""}) (sites Occupied by:Neutral container:""Board""))) (is In (last From) (union (sites Occupied by:Mover) (sites Occupied by:Neutral container:""Board"")))) (if (is In (last To) (sites Occupied by:Enemy components:{""Antiair"" ""Fighter""})) (is In (last From) (sites Occupied by:Mover components:{""Fighter"" ""Helicopter"" ""Bomber""})) (is In (last From) (union (sites Occupied by:Mover) (sites Occupied by:Neutral container:""Board"")))) (if (is In (last To) (sites Occupied by:Enemy components:{""Submarine""})) (is In (last From) (sites Occupied by:Mover components:{""Submarine"" ""Battleship"" ""Cruiser""})) (is In (last From) (union (sites Occupied by:Mover) (sites Occupied by:Neutral container:""Board""))))}) (if (<= (- (value Piece at:(last From)) (/ (* (if (is In (last From) (sites Occupied by:All container:""Board"" components:{""Fighter"" ""Bomber"" ""Helicopter""})) (max (/ (* (* (value Piece at:(last To)) 4) (mapEntry ""DamageMultiplier"" (what at:(last To)))) 100) 1) (if (and (is In (last From) (sites Occupied by:All container:""Board"" components:{""Soldier"" ""Motorbike""})) (is In (last To) (sites Occupied by:All component:""Shooter""))) (if (is In (last From) (sites ""Forest"")) (max (/ (* (* (value Piece at:(last To)) 6) (mapEntry ""DamageMultiplier"" (what at:(last To)))) 100) 1) (if (is In (last From) (union (sites ""ShallowWater"") (sites ""DeepWater""))) (max (/ (* (* (value Piece at:(last To)) 10) (mapEntry ""DamageMultiplier"" (what at:(last To)))) 100) 1) (max (/ (* (* (value Piece at:(last To)) 8) (mapEntry ""DamageMultiplier"" (what at:(last To)))) 100) 1))) (if (is In (last From) (sites ""Forest"")) (max (/ (* (* (value Piece at:(last To)) 3) (mapEntry ""DamageMultiplier"" (what at:(last To)))) 100) 1) (if (is In (last From) (union (sites ""ShallowWater"") (sites ""DeepWater""))) (max (/ (* (* (value Piece at:(last To)) 5) (mapEntry ""DamageMultiplier"" (what at:(last To)))) 100) 1) (max (/ (* (* (value Piece at:(last To)) 4) (mapEntry ""DamageMultiplier"" (what at:(last To)))) 100) 1))))) (* {(if (is In (last To) (sites Occupied by:All container:""Board"" components:{""Soldier"" ""Motorbike""})) (if (= (who at:(last To)) 1) (mapEntry ""NoDoctrine"" 1) (if (= (who at:(last To)) 2) (mapEntry ""NoDoctrine"" 1) (if (= (who at:(last To)) 3) (mapEntry ""NoDoctrine"" 1) (if (= (who at:(last To)) 4) (mapEntry ""NoDoctrine"" 1) 0)))) (if (is In (last To) (sites Occupied by:All container:""Board"" components:{""Tank"" ""Speeder"" ""Shooter""})) (if (= (who at:(last To)) 1) (mapEntry ""NoDoctrine"" 2) (if (= (who at:(last To)) 2) (mapEntry ""NoDoctrine"" 2) (if (= (who at:(last To)) 3) (mapEntry ""NoDoctrine"" 2) (if (= (who at:(last To)) 4) (mapEntry ""NoDoctrine"" 2) 0)))) (if (is In (last To) (sites Occupied by:All container:""Board"" components:{""Launcher"" ""Antiair"" ""Artillery""})) (if (= (who at:(last To)) 1) (mapEntry ""NoDoctrine"" 3) (if (= (who at:(last To)) 2) (mapEntry ""NoDoctrine"" 3) (if (= (who at:(last To)) 3) (mapEntry ""NoDoctrine"" 3) (if (= (who at:(last To)) 4) (mapEntry ""NoDoctrine"" 3) 0)))) (if (is In (last To) (sites Occupied by:All container:""Board"" components:{""Fighter"" ""Bomber"" ""Helicopter""})) (if (= (who at:(last To)) 1) (mapEntry ""NoDoctrine"" 4) (if (= (who at:(last To)) 2) (mapEntry ""NoDoctrine"" 4) (if (= (who at:(last To)) 3) (mapEntry ""NoDoctrine"" 4) (if (= (who at:(last To)) 4) (mapEntry ""NoDoctrine"" 4) 0)))) (if (is In (last To) (sites Occupied by:All container:""Board"" components:{""Submarine"" ""Cruiser"" ""Battleship""})) (if (= (who at:(last To)) 1) (mapEntry ""NoDoctrine"" 5) (if (= (who at:(last To)) 2) (mapEntry ""NoDoctrine"" 5) (if (= (who at:(last To)) 3) (mapEntry ""NoDoctrine"" 5) (if (= (who at:(last To)) 4) (mapEntry ""NoDoctrine"" 5) 0)))) 4))))) (if (and (= 8 (state at:(last From))) (!= (mover) (who at:(last From)))) (if (= (who at:(last To)) 1) (mapEntry ""NoDoctrine"" 6) (if (= (who at:(last To)) 2) (mapEntry ""NoDoctrine"" 6) (if (= (who at:(last To)) 3) (mapEntry ""NoDoctrine"" 6) (if (= (who at:(last To)) 4) (mapEntry ""NoDoctrine"" 6) 0)))) 5) (if (> (who at:(last From)) 0) (if (= (who at:(last From)) 1) (mapEntry ""NoDoctrine"" 8) (if (= (who at:(last From)) 2) (mapEntry ""NoDoctrine"" 8) (if (= (who at:(last From)) 3) (mapEntry ""NoDoctrine"" 8) (if (= (who at:(last From)) 4) (mapEntry ""NoDoctrine"" 8) 0)))) 4) (if True (if (= (who at:(last To)) 1) (mapEntry ""NoDoctrine"" 10) (if (= (who at:(last To)) 2) (mapEntry ""NoDoctrine"" 10) (if (= (who at:(last To)) 3) (mapEntry ""NoDoctrine"" 10) (if (= (who at:(last To)) 4) (mapEntry ""NoDoctrine"" 10) 0)))) (if (= (who at:(last To)) 1) (mapEntry ""NoDoctrine"" 9) (if (= (who at:(last To)) 2) (mapEntry ""NoDoctrine"" 9) (if (= (who at:(last To)) 3) (mapEntry ""NoDoctrine"" 9) (if (= (who at:(last To)) 4) (mapEntry ""NoDoctrine"" 9) 0))))) (value Random (range (if (= (who at:(last To)) 1) (mapEntry ""NoDoctrine"" 11) (if (= (who at:(last To)) 2) (mapEntry ""NoDoctrine"" 11) (if (= (who at:(last To)) 3) (mapEntry ""NoDoctrine"" 11) (if (= (who at:(last To)) 4) (mapEntry ""NoDoctrine"" 11) 0)))) (if (= (who at:(last To)) 1) (mapEntry ""NoDoctrine"" 12) (if (= (who at:(last To)) 2) (mapEntry ""NoDoctrine"" 12) (if (= (who at:(last To)) 3) (mapEntry ""NoDoctrine"" 12) (if (= (who at:(last To)) 4) (mapEntry ""NoDoctrine"" 12) 0))))))})) 128000)) 0) (remove (last From)) (set Value at:(last From) (- (value Piece at:(last From)) (/ (* (if (is In (last From) (sites Occupied by:All container:""Board"" components:{""Fighter"" ""Bomber"" ""Helicopter""})) (max (/ (* (* (value Piece at:(last To)) 4) (mapEntry ""DamageMultiplier"" (what at:(last To)))) 100) 1) (if (and (is In (last From) (sites Occupied by:All container:""Board"" components:{""Soldier"" ""Motorbike""})) (is In (last To) (sites Occupied by:All component:""Shooter""))) (if (is In (last From) (sites ""Forest"")) (max (/ (* (* (value Piece at:(last To)) 6) (mapEntry ""DamageMultiplier"" (what at:(last To)))) 100) 1) (if (is In (last From) (union (sites ""ShallowWater"") (sites ""DeepWater""))) (max (/ (* (* (value Piece at:(last To)) 10) (mapEntry ""DamageMultiplier"" (what at:(last To)))) 100) 1) (max (/ (* (* (value Piece at:(last To)) 8) (mapEntry ""DamageMultiplier"" (what at:(last To)))) 100) 1))) (if (is In (last From) (sites ""Forest"")) (max (/ (* (* (value Piece at:(last To)) 3) (mapEntry ""DamageMultiplier"" (what at:(last To)))) 100) 1) (if (is In (last From) (union (sites ""ShallowWater"") (sites ""DeepWater""))) (max (/ (* (* (value Piece at:(last To)) 5) (mapEntry ""DamageMultiplier"" (what at:(last To)))) 100) 1) (max (/ (* (* (value Piece at:(last To)) 4) (mapEntry ""DamageMultiplier"" (what at:(last To)))) 100) 1))))) (* {(if (is In (last To) (sites Occupied by:All container:""Board"" components:{""Soldier"" ""Motorbike""})) (if (= (who at:(last To)) 1) (mapEntry ""NoDoctrine"" 1) (if (= (who at:(last To)) 2) (mapEntry ""NoDoctrine"" 1) (if (= (who at:(last To)) 3) (mapEntry ""NoDoctrine"" 1) (if (= (who at:(last To)) 4) (mapEntry ""NoDoctrine"" 1) 0)))) (if (is In (last To) (sites Occupied by:All container:""Board"" components:{""Tank"" ""Speeder"" ""Shooter""})) (if (= (who at:(last To)) 1) (mapEntry ""NoDoctrine"" 2) (if (= (who at:(last To)) 2) (mapEntry ""NoDoctrine"" 2) (if (= (who at:(last To)) 3) (mapEntry ""NoDoctrine"" 2) (if (= (who at:(last To)) 4) (mapEntry ""NoDoctrine"" 2) 0)))) (if (is In (last To) (sites Occupied by:All container:""Board"" components:{""Launcher"" ""Antiair"" ""Artillery""})) (if (= (who at:(last To)) 1) (mapEntry ""NoDoctrine"" 3) (if (= (who at:(last To)) 2) (mapEntry ""NoDoctrine"" 3) (if (= (who at:(last To)) 3) (mapEntry ""NoDoctrine"" 3) (if (= (who at:(last To)) 4) (mapEntry ""NoDoctrine"" 3) 0)))) (if (is In (last To) (sites Occupied by:All container:""Board"" components:{""Fighter"" ""Bomber"" ""Helicopter""})) (if (= (who at:(last To)) 1) (mapEntry ""NoDoctrine"" 4) (if (= (who at:(last To)) 2) (mapEntry ""NoDoctrine"" 4) (if (= (who at:(last To)) 3) (mapEntry ""NoDoctrine"" 4) (if (= (who at:(last To)) 4) (mapEntry ""NoDoctrine"" 4) 0)))) (if (is In (last To) (sites Occupied by:All container:""Board"" components:{""Submarine"" ""Cruiser"" ""Battleship""})) (if (= (who at:(last To)) 1) (mapEntry ""NoDoctrine"" 5) (if (= (who at:(last To)) 2) (mapEntry ""NoDoctrine"" 5) (if (= (who at:(last To)) 3) (mapEntry ""NoDoctrine"" 5) (if (= (who at:(last To)) 4) (mapEntry ""NoDoctrine"" 5) 0)))) 4))))) (if (and (= 8 (state at:(last From))) (!= (mover) (who at:(last From)))) (if (= (who at:(last To)) 1) (mapEntry ""NoDoctrine"" 6) (if (= (who at:(last To)) 2) (mapEntry ""NoDoctrine"" 6) (if (= (who at:(last To)) 3) (mapEntry ""NoDoctrine"" 6) (if (= (who at:(last To)) 4) (mapEntry ""NoDoctrine"" 6) 0)))) 5) (if (> (who at:(last From)) 0) (if (= (who at:(last From)) 1) (mapEntry ""NoDoctrine"" 8) (if (= (who at:(last From)) 2) (mapEntry ""NoDoctrine"" 8) (if (= (who at:(last From)) 3) (mapEntry ""NoDoctrine"" 8) (if (= (who at:(last From)) 4) (mapEntry ""NoDoctrine"" 8) 0)))) 4) (if True (if (= (who at:(last To)) 1) (mapEntry ""NoDoctrine"" 10) (if (= (who at:(last To)) 2) (mapEntry ""NoDoctrine"" 10) (if (= (who at:(last To)) 3) (mapEntry ""NoDoctrine"" 10) (if (= (who at:(last To)) 4) (mapEntry ""NoDoctrine"" 10) 0)))) (if (= (who at:(last To)) 1) (mapEntry ""NoDoctrine"" 9) (if (= (who at:(last To)) 2) (mapEntry ""NoDoctrine"" 9) (if (= (who at:(last To)) 3) (mapEntry ""NoDoctrine"" 9) (if (= (who at:(last To)) 4) (mapEntry ""NoDoctrine"" 9) 0))))) (value Random (range (if (= (who at:(last To)) 1) (mapEntry ""NoDoctrine"" 11) (if (= (who at:(last To)) 2) (mapEntry ""NoDoctrine"" 11) (if (= (who at:(last To)) 3) (mapEntry ""NoDoctrine"" 11) (if (= (who at:(last To)) 4) (mapEntry ""NoDoctrine"" 11) 0)))) (if (= (who at:(last To)) 1) (mapEntry ""NoDoctrine"" 12) (if (= (who at:(last To)) 2) (mapEntry ""NoDoctrine"" 12) (if (= (who at:(last To)) 3) (mapEntry ""NoDoctrine"" 12) (if (= (who at:(last To)) 4) (mapEntry ""NoDoctrine"" 12) 0))))))})) 128000)))) (set Value at:(last From) (value Piece at:(last From))))))))) (move Select (from (from) if:(and (> (state at:(from)) 0) (< (value Piece at:(from)) (mapEntry ""MaxHealth"" (what at:(from)))))) (to (sites Around (from) Orthogonal if:(is In (to) (sites Occupied by:Mover container:""Board"" components:{""Town"" ""Dock"" ""Base"" ""Factory"" ""Airport""})))) (then (and {(set Value at:(last From) (min (mapEntry ""MaxHealth"" (what at:(last From))) (- (+ (value Piece at:(last From)) (value Piece at:(last To))) 1))) (set Value at:(last To) (max (- (value Piece at:(last To)) (- (mapEntry ""MaxHealth"" (what at:(last From))) (value Piece at:(last From)))) 1)) (set State at:(last From) 0)}))) (move Select (from (from) if:(> (state at:(from)) 0)) (to (sites Around (from) Orthogonal if:(and (= (what at:(from)) (what at:(to))) (< (value Piece at:(to)) (mapEntry ""MaxHealth"" (what at:(to))))))) (then (and {(if (<= (+ (value Piece at:(last To)) (value Piece at:(last From))) (mapEntry ""MaxHealth"" (what at:(last From)))) (and (set Value at:(last To) (min (mapEntry ""MaxHealth"" (what at:(last From))) (+ (value Piece at:(last From)) (value Piece at:(last To))))) (remove (last From))) (and (set Value at:(last To) (min (mapEntry ""MaxHealth"" (what at:(last From))) (- (+ (value Piece at:(last From)) (value Piece at:(last To))) 1))) (set Value at:(last From) (max (- (value Piece at:(last To)) (- (mapEntry ""MaxHealth"" (what at:(last From))) (value Piece at:(last From)))) 1)))) (set State at:(last From) 0) (set State at:(last To) 0)})))})) (piece ""Bomber"" Each (or {(move (from (from) if:(> (state at:(from)) 1)) (to (sites Distance (step Orthogonal (to if:(is In (to) (union (sites Empty) (sites Occupied by:Friend container:""Board""))))) from:(from) (range 1 (- (state at:(from)) 1))) if:(is Empty (to)) (apply (set State at:(from) 1)))) (move Select (from (from) if:(> (state at:(from)) 0)) (to (sites Distance Orthogonal from:(from) (range 1 1)) if:(and {(if (is In (from) (sites Occupied by:Mover container:""Board"" components:{""Bomber"" ""Battleship"" ""Artillery"" ""Launcher""})) (is In (to) (union (sites Occupied by:Enemy container:""Board"" components:{""Soldier"" ""Motorbike"" ""Tank"" ""Speeder"" ""Shooter"" ""Launcher"" ""Antiair"" ""Battleship"" ""Artillery"" ""Base"" ""Town"" ""Factory"" ""Dock"" ""Airport"" ""Cruiser"" ""Submarine""}) (sites Occupied by:Neutral container:""Board""))) (is In (to) (union (sites Occupied by:Enemy container:""Board"") (sites Occupied by:Neutral container:""Board"")))) (if (is In (from) (sites Occupied by:Mover container:""Board"" components:{""Antiair"" ""Fighter""})) (is In (to) (sites Occupied by:Enemy container:""Board"" components:{""Fighter"" ""Helicopter"" ""Bomber""})) (is In (to) (union (sites Occupied by:Enemy container:""Board"") (sites Occupied by:Neutral container:""Board"")))) (if (is In (from) (sites Occupied by:Mover container:""Board"" components:{""Submarine""})) (is In (to) (sites Occupied by:Enemy container:""Board"" components:{""Submarine"" ""Battleship"" ""Cruiser""})) (is In (to) (union (sites Occupied by:Enemy container:""Board"") (sites Occupied by:Neutral container:""Board""))))})) (then (do (and (set Value at:(last To) (max 0 (- (value Piece at:(last To)) (/ (* (if (is In (last To) (sites Occupied by:All container:""Board"" components:{""Fighter"" ""Bomber"" ""Helicopter""})) (max (/ (* (* (value Piece at:(last From)) 4) (mapEntry ""DamageMultiplier"" (what at:(last From)))) 100) 1) (if (and (is In (last To) (sites Occupied by:All container:""Board"" components:{""Soldier"" ""Motorbike""})) (is In (last From) (sites Occupied by:All component:""Shooter""))) (if (is In (last To) (sites ""Forest"")) (max (/ (* (* (value Piece at:(last From)) 6) (mapEntry ""DamageMultiplier"" (what at:(last From)))) 100) 1) (if (is In (last To) (union (sites ""ShallowWater"") (sites ""DeepWater""))) (max (/ (* (* (value Piece at:(last From)) 10) (mapEntry ""DamageMultiplier"" (what at:(last From)))) 100) 1) (max (/ (* (* (value Piece at:(last From)) 8) (mapEntry ""DamageMultiplier"" (what at:(last From)))) 100) 1))) (if (is In (last To) (sites ""Forest"")) (max (/ (* (* (value Piece at:(last From)) 3) (mapEntry ""DamageMultiplier"" (what at:(last From)))) 100) 1) (if (is In (last To) (union (sites ""ShallowWater"") (sites ""DeepWater""))) (max (/ (* (* (value Piece at:(last From)) 5) (mapEntry ""DamageMultiplier"" (what at:(last From)))) 100) 1) (max (/ (* (* (value Piece at:(last From)) 4) (mapEntry ""DamageMultiplier"" (what at:(last From)))) 100) 1))))) (* {(if (is In (last From) (sites Occupied by:All container:""Board"" components:{""Soldier"" ""Motorbike""})) (if (= (who at:(last From)) 1) (mapEntry ""NoDoctrine"" 1) (if (= (who at:(last From)) 2) (mapEntry ""NoDoctrine"" 1) (if (= (who at:(last From)) 3) (mapEntry ""NoDoctrine"" 1) (if (= (who at:(last From)) 4) (mapEntry ""NoDoctrine"" 1) 0)))) (if (is In (last From) (sites Occupied by:All container:""Board"" components:{""Tank"" ""Speeder"" ""Shooter""})) (if (= (who at:(last From)) 1) (mapEntry ""NoDoctrine"" 2) (if (= (who at:(last From)) 2) (mapEntry ""NoDoctrine"" 2) (if (= (who at:(last From)) 3) (mapEntry ""NoDoctrine"" 2) (if (= (who at:(last From)) 4) (mapEntry ""NoDoctrine"" 2) 0)))) (if (is In (last From) (sites Occupied by:All container:""Board"" components:{""Launcher"" ""Antiair"" ""Artillery""})) (if (= (who at:(last From)) 1) (mapEntry ""NoDoctrine"" 3) (if (= (who at:(last From)) 2) (mapEntry ""NoDoctrine"" 3) (if (= (who at:(last From)) 3) (mapEntry ""NoDoctrine"" 3) (if (= (who at:(last From)) 4) (mapEntry ""NoDoctrine"" 3) 0)))) (if (is In (last From) (sites Occupied by:All container:""Board"" components:{""Fighter"" ""Bomber"" ""Helicopter""})) (if (= (who at:(last From)) 1) (mapEntry ""NoDoctrine"" 4) (if (= (who at:(last From)) 2) (mapEntry ""NoDoctrine"" 4) (if (= (who at:(last From)) 3) (mapEntry ""NoDoctrine"" 4) (if (= (who at:(last From)) 4) (mapEntry ""NoDoctrine"" 4) 0)))) (if (is In (last From) (sites Occupied by:All container:""Board"" components:{""Submarine"" ""Cruiser"" ""Battleship""})) (if (= (who at:(last From)) 1) (mapEntry ""NoDoctrine"" 5) (if (= (who at:(last From)) 2) (mapEntry ""NoDoctrine"" 5) (if (= (who at:(last From)) 3) (mapEntry ""NoDoctrine"" 5) (if (= (who at:(last From)) 4) (mapEntry ""NoDoctrine"" 5) 0)))) 4))))) (if (and (= 8 (state at:(last To))) (!= (mover) (who at:(last To)))) (if (= (who at:(last From)) 1) (mapEntry ""NoDoctrine"" 6) (if (= (who at:(last From)) 2) (mapEntry ""NoDoctrine"" 6) (if (= (who at:(last From)) 3) (mapEntry ""NoDoctrine"" 6) (if (= (who at:(last From)) 4) (mapEntry ""NoDoctrine"" 6) 0)))) 5) (if (> (who at:(last To)) 0) (if (= (who at:(last To)) 1) (mapEntry ""NoDoctrine"" 8) (if (= (who at:(last To)) 2) (mapEntry ""NoDoctrine"" 8) (if (= (who at:(last To)) 3) (mapEntry ""NoDoctrine"" 8) (if (= (who at:(last To)) 4) (mapEntry ""NoDoctrine"" 8) 0)))) 4) (if False (if (= (who at:(last From)) 1) (mapEntry ""NoDoctrine"" 10) (if (= (who at:(last From)) 2) (mapEntry ""NoDoctrine"" 10) (if (= (who at:(last From)) 3) (mapEntry ""NoDoctrine"" 10) (if (= (who at:(last From)) 4) (mapEntry ""NoDoctrine"" 10) 0)))) (if (= (who at:(last From)) 1) (mapEntry ""NoDoctrine"" 9) (if (= (who at:(last From)) 2) (mapEntry ""NoDoctrine"" 9) (if (= (who at:(last From)) 3) (mapEntry ""NoDoctrine"" 9) (if (= (who at:(last From)) 4) (mapEntry ""NoDoctrine"" 9) 0))))) (value Random (range (if (= (who at:(last From)) 1) (mapEntry ""NoDoctrine"" 11) (if (= (who at:(last From)) 2) (mapEntry ""NoDoctrine"" 11) (if (= (who at:(last From)) 3) (mapEntry ""NoDoctrine"" 11) (if (= (who at:(last From)) 4) (mapEntry ""NoDoctrine"" 11) 0)))) (if (= (who at:(last From)) 1) (mapEntry ""NoDoctrine"" 12) (if (= (who at:(last From)) 2) (mapEntry ""NoDoctrine"" 12) (if (= (who at:(last From)) 3) (mapEntry ""NoDoctrine"" 12) (if (= (who at:(last From)) 4) (mapEntry ""NoDoctrine"" 12) 0))))))})) 128000)))) (set State at:(last From) 0)) next:(if (and (= 8 (state at:(last To))) (!= (mover) (who at:(last To)))) (if (= (value Piece at:(last To)) 0) (and {(take Control of:All by:Mover at:(last To)) (set Value at:(last To) 50)}) (set Value at:(last To) (value Piece at:(last To)))) (if (= (value Piece at:(last To)) 0) (remove (last To)) (if (and {(= 0 (count Sites in:(intersection (sites {(last To) (last From)}) (sites Occupied by:All components:{""Launcher"" ""Artillery"" ""Battleship"" ""Antiair""})))) (if (is In (last To) (sites Occupied by:Enemy components:{""Bomber"" ""Battleship"" ""Artillery"" ""Launcher""})) (is In (last From) (union (sites Occupied by:Mover components:{""Soldier"" ""Motorbike"" ""Tank"" ""Speeder"" ""Shooter"" ""Launcher"" ""Antiair"" ""Battleship"" ""Artillery"" ""Base"" ""Town"" ""Factory"" ""Dock"" ""Airport"" ""Cruiser"" ""Submarine""}) (sites Occupied by:Neutral container:""Board""))) (is In (last From) (union (sites Occupied by:Mover) (sites Occupied by:Neutral container:""Board"")))) (if (is In (last To) (sites Occupied by:Enemy components:{""Antiair"" ""Fighter""})) (is In (last From) (sites Occupied by:Mover components:{""Fighter"" ""Helicopter"" ""Bomber""})) (is In (last From) (union (sites Occupied by:Mover) (sites Occupied by:Neutral container:""Board"")))) (if (is In (last To) (sites Occupied by:Enemy components:{""Submarine""})) (is In (last From) (sites Occupied by:Mover components:{""Submarine"" ""Battleship"" ""Cruiser""})) (is In (last From) (union (sites Occupied by:Mover) (sites Occupied by:Neutral container:""Board""))))}) (if (<= (- (value Piece at:(last From)) (/ (* (if (is In (last From) (sites Occupied by:All container:""Board"" components:{""Fighter"" ""Bomber"" ""Helicopter""})) (max (/ (* (* (value Piece at:(last To)) 4) (mapEntry ""DamageMultiplier"" (what at:(last To)))) 100) 1) (if (and (is In (last From) (sites Occupied by:All container:""Board"" components:{""Soldier"" ""Motorbike""})) (is In (last To) (sites Occupied by:All component:""Shooter""))) (if (is In (last From) (sites ""Forest"")) (max (/ (* (* (value Piece at:(last To)) 6) (mapEntry ""DamageMultiplier"" (what at:(last To)))) 100) 1) (if (is In (last From) (union (sites ""ShallowWater"") (sites ""DeepWater""))) (max (/ (* (* (value Piece at:(last To)) 10) (mapEntry ""DamageMultiplier"" (what at:(last To)))) 100) 1) (max (/ (* (* (value Piece at:(last To)) 8) (mapEntry ""DamageMultiplier"" (what at:(last To)))) 100) 1))) (if (is In (last From) (sites ""Forest"")) (max (/ (* (* (value Piece at:(last To)) 3) (mapEntry ""DamageMultiplier"" (what at:(last To)))) 100) 1) (if (is In (last From) (union (sites ""ShallowWater"") (sites ""DeepWater""))) (max (/ (* (* (value Piece at:(last To)) 5) (mapEntry ""DamageMultiplier"" (what at:(last To)))) 100) 1) (max (/ (* (* (value Piece at:(last To)) 4) (mapEntry ""DamageMultiplier"" (what at:(last To)))) 100) 1))))) (* {(if (is In (last To) (sites Occupied by:All container:""Board"" components:{""Soldier"" ""Motorbike""})) (if (= (who at:(last To)) 1) (mapEntry ""NoDoctrine"" 1) (if (= (who at:(last To)) 2) (mapEntry ""NoDoctrine"" 1) (if (= (who at:(last To)) 3) (mapEntry ""NoDoctrine"" 1) (if (= (who at:(last To)) 4) (mapEntry ""NoDoctrine"" 1) 0)))) (if (is In (last To) (sites Occupied by:All container:""Board"" components:{""Tank"" ""Speeder"" ""Shooter""})) (if (= (who at:(last To)) 1) (mapEntry ""NoDoctrine"" 2) (if (= (who at:(last To)) 2) (mapEntry ""NoDoctrine"" 2) (if (= (who at:(last To)) 3) (mapEntry ""NoDoctrine"" 2) (if (= (who at:(last To)) 4) (mapEntry ""NoDoctrine"" 2) 0)))) (if (is In (last To) (sites Occupied by:All container:""Board"" components:{""Launcher"" ""Antiair"" ""Artillery""})) (if (= (who at:(last To)) 1) (mapEntry ""NoDoctrine"" 3) (if (= (who at:(last To)) 2) (mapEntry ""NoDoctrine"" 3) (if (= (who at:(last To)) 3) (mapEntry ""NoDoctrine"" 3) (if (= (who at:(last To)) 4) (mapEntry ""NoDoctrine"" 3) 0)))) (if (is In (last To) (sites Occupied by:All container:""Board"" components:{""Fighter"" ""Bomber"" ""Helicopter""})) (if (= (who at:(last To)) 1) (mapEntry ""NoDoctrine"" 4) (if (= (who at:(last To)) 2) (mapEntry ""NoDoctrine"" 4) (if (= (who at:(last To)) 3) (mapEntry ""NoDoctrine"" 4) (if (= (who at:(last To)) 4) (mapEntry ""NoDoctrine"" 4) 0)))) (if (is In (last To) (sites Occupied by:All container:""Board"" components:{""Submarine"" ""Cruiser"" ""Battleship""})) (if (= (who at:(last To)) 1) (mapEntry ""NoDoctrine"" 5) (if (= (who at:(last To)) 2) (mapEntry ""NoDoctrine"" 5) (if (= (who at:(last To)) 3) (mapEntry ""NoDoctrine"" 5) (if (= (who at:(last To)) 4) (mapEntry ""NoDoctrine"" 5) 0)))) 4))))) (if (and (= 8 (state at:(last From))) (!= (mover) (who at:(last From)))) (if (= (who at:(last To)) 1) (mapEntry ""NoDoctrine"" 6) (if (= (who at:(last To)) 2) (mapEntry ""NoDoctrine"" 6) (if (= (who at:(last To)) 3) (mapEntry ""NoDoctrine"" 6) (if (= (who at:(last To)) 4) (mapEntry ""NoDoctrine"" 6) 0)))) 5) (if (> (who at:(last From)) 0) (if (= (who at:(last From)) 1) (mapEntry ""NoDoctrine"" 8) (if (= (who at:(last From)) 2) (mapEntry ""NoDoctrine"" 8) (if (= (who at:(last From)) 3) (mapEntry ""NoDoctrine"" 8) (if (= (who at:(last From)) 4) (mapEntry ""NoDoctrine"" 8) 0)))) 4) (if True (if (= (who at:(last To)) 1) (mapEntry ""NoDoctrine"" 10) (if (= (who at:(last To)) 2) (mapEntry ""NoDoctrine"" 10) (if (= (who at:(last To)) 3) (mapEntry ""NoDoctrine"" 10) (if (= (who at:(last To)) 4) (mapEntry ""NoDoctrine"" 10) 0)))) (if (= (who at:(last To)) 1) (mapEntry ""NoDoctrine"" 9) (if (= (who at:(last To)) 2) (mapEntry ""NoDoctrine"" 9) (if (= (who at:(last To)) 3) (mapEntry ""NoDoctrine"" 9) (if (= (who at:(last To)) 4) (mapEntry ""NoDoctrine"" 9) 0))))) (value Random (range (if (= (who at:(last To)) 1) (mapEntry ""NoDoctrine"" 11) (if (= (who at:(last To)) 2) (mapEntry ""NoDoctrine"" 11) (if (= (who at:(last To)) 3) (mapEntry ""NoDoctrine"" 11) (if (= (who at:(last To)) 4) (mapEntry ""NoDoctrine"" 11) 0)))) (if (= (who at:(last To)) 1) (mapEntry ""NoDoctrine"" 12) (if (= (who at:(last To)) 2) (mapEntry ""NoDoctrine"" 12) (if (= (who at:(last To)) 3) (mapEntry ""NoDoctrine"" 12) (if (= (who at:(last To)) 4) (mapEntry ""NoDoctrine"" 12) 0))))))})) 128000)) 0) (remove (last From)) (set Value at:(last From) (- (value Piece at:(last From)) (/ (* (if (is In (last From) (sites Occupied by:All container:""Board"" components:{""Fighter"" ""Bomber"" ""Helicopter""})) (max (/ (* (* (value Piece at:(last To)) 4) (mapEntry ""DamageMultiplier"" (what at:(last To)))) 100) 1) (if (and (is In (last From) (sites Occupied by:All container:""Board"" components:{""Soldier"" ""Motorbike""})) (is In (last To) (sites Occupied by:All component:""Shooter""))) (if (is In (last From) (sites ""Forest"")) (max (/ (* (* (value Piece at:(last To)) 6) (mapEntry ""DamageMultiplier"" (what at:(last To)))) 100) 1) (if (is In (last From) (union (sites ""ShallowWater"") (sites ""DeepWater""))) (max (/ (* (* (value Piece at:(last To)) 10) (mapEntry ""DamageMultiplier"" (what at:(last To)))) 100) 1) (max (/ (* (* (value Piece at:(last To)) 8) (mapEntry ""DamageMultiplier"" (what at:(last To)))) 100) 1))) (if (is In (last From) (sites ""Forest"")) (max (/ (* (* (value Piece at:(last To)) 3) (mapEntry ""DamageMultiplier"" (what at:(last To)))) 100) 1) (if (is In (last From) (union (sites ""ShallowWater"") (sites ""DeepWater""))) (max (/ (* (* (value Piece at:(last To)) 5) (mapEntry ""DamageMultiplier"" (what at:(last To)))) 100) 1) (max (/ (* (* (value Piece at:(last To)) 4) (mapEntry ""DamageMultiplier"" (what at:(last To)))) 100) 1))))) (* {(if (is In (last To) (sites Occupied by:All container:""Board"" components:{""Soldier"" ""Motorbike""})) (if (= (who at:(last To)) 1) (mapEntry ""NoDoctrine"" 1) (if (= (who at:(last To)) 2) (mapEntry ""NoDoctrine"" 1) (if (= (who at:(last To)) 3) (mapEntry ""NoDoctrine"" 1) (if (= (who at:(last To)) 4) (mapEntry ""NoDoctrine"" 1) 0)))) (if (is In (last To) (sites Occupied by:All container:""Board"" components:{""Tank"" ""Speeder"" ""Shooter""})) (if (= (who at:(last To)) 1) (mapEntry ""NoDoctrine"" 2) (if (= (who at:(last To)) 2) (mapEntry ""NoDoctrine"" 2) (if (= (who at:(last To)) 3) (mapEntry ""NoDoctrine"" 2) (if (= (who at:(last To)) 4) (mapEntry ""NoDoctrine"" 2) 0)))) (if (is In (last To) (sites Occupied by:All container:""Board"" components:{""Launcher"" ""Antiair"" ""Artillery""})) (if (= (who at:(last To)) 1) (mapEntry ""NoDoctrine"" 3) (if (= (who at:(last To)) 2) (mapEntry ""NoDoctrine"" 3) (if (= (who at:(last To)) 3) (mapEntry ""NoDoctrine"" 3) (if (= (who at:(last To)) 4) (mapEntry ""NoDoctrine"" 3) 0)))) (if (is In (last To) (sites Occupied by:All container:""Board"" components:{""Fighter"" ""Bomber"" ""Helicopter""})) (if (= (who at:(last To)) 1) (mapEntry ""NoDoctrine"" 4) (if (= (who at:(last To)) 2) (mapEntry ""NoDoctrine"" 4) (if (= (who at:(last To)) 3) (mapEntry ""NoDoctrine"" 4) (if (= (who at:(last To)) 4) (mapEntry ""NoDoctrine"" 4) 0)))) (if (is In (last To) (sites Occupied by:All container:""Board"" components:{""Submarine"" ""Cruiser"" ""Battleship""})) (if (= (who at:(last To)) 1) (mapEntry ""NoDoctrine"" 5) (if (= (who at:(last To)) 2) (mapEntry ""NoDoctrine"" 5) (if (= (who at:(last To)) 3) (mapEntry ""NoDoctrine"" 5) (if (= (who at:(last To)) 4) (mapEntry ""NoDoctrine"" 5) 0)))) 4))))) (if (and (= 8 (state at:(last From))) (!= (mover) (who at:(last From)))) (if (= (who at:(last To)) 1) (mapEntry ""NoDoctrine"" 6) (if (= (who at:(last To)) 2) (mapEntry ""NoDoctrine"" 6) (if (= (who at:(last To)) 3) (mapEntry ""NoDoctrine"" 6) (if (= (who at:(last To)) 4) (mapEntry ""NoDoctrine"" 6) 0)))) 5) (if (> (who at:(last From)) 0) (if (= (who at:(last From)) 1) (mapEntry ""NoDoctrine"" 8) (if (= (who at:(last From)) 2) (mapEntry ""NoDoctrine"" 8) (if (= (who at:(last From)) 3) (mapEntry ""NoDoctrine"" 8) (if (= (who at:(last From)) 4) (mapEntry ""NoDoctrine"" 8) 0)))) 4) (if True (if (= (who at:(last To)) 1) (mapEntry ""NoDoctrine"" 10) (if (= (who at:(last To)) 2) (mapEntry ""NoDoctrine"" 10) (if (= (who at:(last To)) 3) (mapEntry ""NoDoctrine"" 10) (if (= (who at:(last To)) 4) (mapEntry ""NoDoctrine"" 10) 0)))) (if (= (who at:(last To)) 1) (mapEntry ""NoDoctrine"" 9) (if (= (who at:(last To)) 2) (mapEntry ""NoDoctrine"" 9) (if (= (who at:(last To)) 3) (mapEntry ""NoDoctrine"" 9) (if (= (who at:(last To)) 4) (mapEntry ""NoDoctrine"" 9) 0))))) (value Random (range (if (= (who at:(last To)) 1) (mapEntry ""NoDoctrine"" 11) (if (= (who at:(last To)) 2) (mapEntry ""NoDoctrine"" 11) (if (= (who at:(last To)) 3) (mapEntry ""NoDoctrine"" 11) (if (= (who at:(last To)) 4) (mapEntry ""NoDoctrine"" 11) 0)))) (if (= (who at:(last To)) 1) (mapEntry ""NoDoctrine"" 12) (if (= (who at:(last To)) 2) (mapEntry ""NoDoctrine"" 12) (if (= (who at:(last To)) 3) (mapEntry ""NoDoctrine"" 12) (if (= (who at:(last To)) 4) (mapEntry ""NoDoctrine"" 12) 0))))))})) 128000)))) (set Value at:(last From) (value Piece at:(last From))))))))) (move Select (from (from) if:(and (> (state at:(from)) 0) (< (value Piece at:(from)) (mapEntry ""MaxHealth"" (what at:(from)))))) (to (sites Around (from) Orthogonal if:(is In (to) (sites Occupied by:Mover container:""Board"" components:{""Town"" ""Dock"" ""Base"" ""Factory"" ""Airport""})))) (then (and {(set Value at:(last From) (min (mapEntry ""MaxHealth"" (what at:(last From))) (- (+ (value Piece at:(last From)) (value Piece at:(last To))) 1))) (set Value at:(last To) (max (- (value Piece at:(last To)) (- (mapEntry ""MaxHealth"" (what at:(last From))) (value Piece at:(last From)))) 1)) (set State at:(last From) 0)}))) (move Select (from (from) if:(> (state at:(from)) 0)) (to (sites Around (from) Orthogonal if:(and (= (what at:(from)) (what at:(to))) (< (value Piece at:(to)) (mapEntry ""MaxHealth"" (what at:(to))))))) (then (and {(if (<= (+ (value Piece at:(last To)) (value Piece at:(last From))) (mapEntry ""MaxHealth"" (what at:(last From)))) (and (set Value at:(last To) (min (mapEntry ""MaxHealth"" (what at:(last From))) (+ (value Piece at:(last From)) (value Piece at:(last To))))) (remove (last From))) (and (set Value at:(last To) (min (mapEntry ""MaxHealth"" (what at:(last From))) (- (+ (value Piece at:(last From)) (value Piece at:(last To))) 1))) (set Value at:(last From) (max (- (value Piece at:(last To)) (- (mapEntry ""MaxHealth"" (what at:(last From))) (value Piece at:(last From)))) 1)))) (set State at:(last From) 0) (set State at:(last To) 0)})))})) (piece ""Cruiser"" Each (or {(move (from (from) if:(> (state at:(from)) 1)) (to (sites Distance (step Orthogonal (to if:(is In (to) (difference (union (sites Empty) (sites Occupied by:Friend container:""Board"")) (union (sites ""Mountain"") (difference (sites Board) (union (sites ""ShallowWater"") (sites ""DeepWater"")))))))) from:(from) (range 1 (- (state at:(from)) 1))) if:(is Empty (to)) (apply (set State at:(from) 1)))) (move Select (from (from) if:(> (state at:(from)) 0)) (to (sites Distance Orthogonal from:(from) (range 1 1)) if:(and {(if (is In (from) (sites Occupied by:Mover container:""Board"" components:{""Bomber"" ""Battleship"" ""Artillery"" ""Launcher""})) (is In (to) (union (sites Occupied by:Enemy container:""Board"" components:{""Soldier"" ""Motorbike"" ""Tank"" ""Speeder"" ""Shooter"" ""Launcher"" ""Antiair"" ""Battleship"" ""Artillery"" ""Base"" ""Town"" ""Factory"" ""Dock"" ""Airport"" ""Cruiser"" ""Submarine""}) (sites Occupied by:Neutral container:""Board""))) (is In (to) (union (sites Occupied by:Enemy container:""Board"") (sites Occupied by:Neutral container:""Board"")))) (if (is In (from) (sites Occupied by:Mover container:""Board"" components:{""Antiair"" ""Fighter""})) (is In (to) (sites Occupied by:Enemy container:""Board"" components:{""Fighter"" ""Helicopter"" ""Bomber""})) (is In (to) (union (sites Occupied by:Enemy container:""Board"") (sites Occupied by:Neutral container:""Board"")))) (if (is In (from) (sites Occupied by:Mover container:""Board"" components:{""Submarine""})) (is In (to) (sites Occupied by:Enemy container:""Board"" components:{""Submarine"" ""Battleship"" ""Cruiser""})) (is In (to) (union (sites Occupied by:Enemy container:""Board"") (sites Occupied by:Neutral container:""Board""))))})) (then (do (and (set Value at:(last To) (max 0 (- (value Piece at:(last To)) (/ (* (if (is In (last To) (sites Occupied by:All container:""Board"" components:{""Fighter"" ""Bomber"" ""Helicopter""})) (max (/ (* (* (value Piece at:(last From)) 4) (mapEntry ""DamageMultiplier"" (what at:(last From)))) 100) 1) (if (and (is In (last To) (sites Occupied by:All container:""Board"" components:{""Soldier"" ""Motorbike""})) (is In (last From) (sites Occupied by:All component:""Shooter""))) (if (is In (last To) (sites ""Forest"")) (max (/ (* (* (value Piece at:(last From)) 6) (mapEntry ""DamageMultiplier"" (what at:(last From)))) 100) 1) (if (is In (last To) (union (sites ""ShallowWater"") (sites ""DeepWater""))) (max (/ (* (* (value Piece at:(last From)) 10) (mapEntry ""DamageMultiplier"" (what at:(last From)))) 100) 1) (max (/ (* (* (value Piece at:(last From)) 8) (mapEntry ""DamageMultiplier"" (what at:(last From)))) 100) 1))) (if (is In (last To) (sites ""Forest"")) (max (/ (* (* (value Piece at:(last From)) 3) (mapEntry ""DamageMultiplier"" (what at:(last From)))) 100) 1) (if (is In (last To) (union (sites ""ShallowWater"") (sites ""DeepWater""))) (max (/ (* (* (value Piece at:(last From)) 5) (mapEntry ""DamageMultiplier"" (what at:(last From)))) 100) 1) (max (/ (* (* (value Piece at:(last From)) 4) (mapEntry ""DamageMultiplier"" (what at:(last From)))) 100) 1))))) (* {(if (is In (last From) (sites Occupied by:All container:""Board"" components:{""Soldier"" ""Motorbike""})) (if (= (who at:(last From)) 1) (mapEntry ""NoDoctrine"" 1) (if (= (who at:(last From)) 2) (mapEntry ""NoDoctrine"" 1) (if (= (who at:(last From)) 3) (mapEntry ""NoDoctrine"" 1) (if (= (who at:(last From)) 4) (mapEntry ""NoDoctrine"" 1) 0)))) (if (is In (last From) (sites Occupied by:All container:""Board"" components:{""Tank"" ""Speeder"" ""Shooter""})) (if (= (who at:(last From)) 1) (mapEntry ""NoDoctrine"" 2) (if (= (who at:(last From)) 2) (mapEntry ""NoDoctrine"" 2) (if (= (who at:(last From)) 3) (mapEntry ""NoDoctrine"" 2) (if (= (who at:(last From)) 4) (mapEntry ""NoDoctrine"" 2) 0)))) (if (is In (last From) (sites Occupied by:All container:""Board"" components:{""Launcher"" ""Antiair"" ""Artillery""})) (if (= (who at:(last From)) 1) (mapEntry ""NoDoctrine"" 3) (if (= (who at:(last From)) 2) (mapEntry ""NoDoctrine"" 3) (if (= (who at:(last From)) 3) (mapEntry ""NoDoctrine"" 3) (if (= (who at:(last From)) 4) (mapEntry ""NoDoctrine"" 3) 0)))) (if (is In (last From) (sites Occupied by:All container:""Board"" components:{""Fighter"" ""Bomber"" ""Helicopter""})) (if (= (who at:(last From)) 1) (mapEntry ""NoDoctrine"" 4) (if (= (who at:(last From)) 2) (mapEntry ""NoDoctrine"" 4) (if (= (who at:(last From)) 3) (mapEntry ""NoDoctrine"" 4) (if (= (who at:(last From)) 4) (mapEntry ""NoDoctrine"" 4) 0)))) (if (is In (last From) (sites Occupied by:All container:""Board"" components:{""Submarine"" ""Cruiser"" ""Battleship""})) (if (= (who at:(last From)) 1) (mapEntry ""NoDoctrine"" 5) (if (= (who at:(last From)) 2) (mapEntry ""NoDoctrine"" 5) (if (= (who at:(last From)) 3) (mapEntry ""NoDoctrine"" 5) (if (= (who at:(last From)) 4) (mapEntry ""NoDoctrine"" 5) 0)))) 4))))) (if (and (= 8 (state at:(last To))) (!= (mover) (who at:(last To)))) (if (= (who at:(last From)) 1) (mapEntry ""NoDoctrine"" 6) (if (= (who at:(last From)) 2) (mapEntry ""NoDoctrine"" 6) (if (= (who at:(last From)) 3) (mapEntry ""NoDoctrine"" 6) (if (= (who at:(last From)) 4) (mapEntry ""NoDoctrine"" 6) 0)))) 5) (if (> (who at:(last To)) 0) (if (= (who at:(last To)) 1) (mapEntry ""NoDoctrine"" 8) (if (= (who at:(last To)) 2) (mapEntry ""NoDoctrine"" 8) (if (= (who at:(last To)) 3) (mapEntry ""NoDoctrine"" 8) (if (= (who at:(last To)) 4) (mapEntry ""NoDoctrine"" 8) 0)))) 4) (if False (if (= (who at:(last From)) 1) (mapEntry ""NoDoctrine"" 10) (if (= (who at:(last From)) 2) (mapEntry ""NoDoctrine"" 10) (if (= (who at:(last From)) 3) (mapEntry ""NoDoctrine"" 10) (if (= (who at:(last From)) 4) (mapEntry ""NoDoctrine"" 10) 0)))) (if (= (who at:(last From)) 1) (mapEntry ""NoDoctrine"" 9) (if (= (who at:(last From)) 2) (mapEntry ""NoDoctrine"" 9) (if (= (who at:(last From)) 3) (mapEntry ""NoDoctrine"" 9) (if (= (who at:(last From)) 4) (mapEntry ""NoDoctrine"" 9) 0))))) (value Random (range (if (= (who at:(last From)) 1) (mapEntry ""NoDoctrine"" 11) (if (= (who at:(last From)) 2) (mapEntry ""NoDoctrine"" 11) (if (= (who at:(last From)) 3) (mapEntry ""NoDoctrine"" 11) (if (= (who at:(last From)) 4) (mapEntry ""NoDoctrine"" 11) 0)))) (if (= (who at:(last From)) 1) (mapEntry ""NoDoctrine"" 12) (if (= (who at:(last From)) 2) (mapEntry ""NoDoctrine"" 12) (if (= (who at:(last From)) 3) (mapEntry ""NoDoctrine"" 12) (if (= (who at:(last From)) 4) (mapEntry ""NoDoctrine"" 12) 0))))))})) 128000)))) (set State at:(last From) 0)) next:(if (and (= 8 (state at:(last To))) (!= (mover) (who at:(last To)))) (if (= (value Piece at:(last To)) 0) (and {(take Control of:All by:Mover at:(last To)) (set Value at:(last To) 50)}) (set Value at:(last To) (value Piece at:(last To)))) (if (= (value Piece at:(last To)) 0) (remove (last To)) (if (and {(= 0 (count Sites in:(intersection (sites {(last To) (last From)}) (sites Occupied by:All components:{""Launcher"" ""Artillery"" ""Battleship"" ""Antiair""})))) (if (is In (last To) (sites Occupied by:Enemy components:{""Bomber"" ""Battleship"" ""Artillery"" ""Launcher""})) (is In (last From) (union (sites Occupied by:Mover components:{""Soldier"" ""Motorbike"" ""Tank"" ""Speeder"" ""Shooter"" ""Launcher"" ""Antiair"" ""Battleship"" ""Artillery"" ""Base"" ""Town"" ""Factory"" ""Dock"" ""Airport"" ""Cruiser"" ""Submarine""}) (sites Occupied by:Neutral container:""Board""))) (is In (last From) (union (sites Occupied by:Mover) (sites Occupied by:Neutral container:""Board"")))) (if (is In (last To) (sites Occupied by:Enemy components:{""Antiair"" ""Fighter""})) (is In (last From) (sites Occupied by:Mover components:{""Fighter"" ""Helicopter"" ""Bomber""})) (is In (last From) (union (sites Occupied by:Mover) (sites Occupied by:Neutral container:""Board"")))) (if (is In (last To) (sites Occupied by:Enemy components:{""Submarine""})) (is In (last From) (sites Occupied by:Mover components:{""Submarine"" ""Battleship"" ""Cruiser""})) (is In (last From) (union (sites Occupied by:Mover) (sites Occupied by:Neutral container:""Board""))))}) (if (<= (- (value Piece at:(last From)) (/ (* (if (is In (last From) (sites Occupied by:All container:""Board"" components:{""Fighter"" ""Bomber"" ""Helicopter""})) (max (/ (* (* (value Piece at:(last To)) 4) (mapEntry ""DamageMultiplier"" (what at:(last To)))) 100) 1) (if (and (is In (last From) (sites Occupied by:All container:""Board"" components:{""Soldier"" ""Motorbike""})) (is In (last To) (sites Occupied by:All component:""Shooter""))) (if (is In (last From) (sites ""Forest"")) (max (/ (* (* (value Piece at:(last To)) 6) (mapEntry ""DamageMultiplier"" (what at:(last To)))) 100) 1) (if (is In (last From) (union (sites ""ShallowWater"") (sites ""DeepWater""))) (max (/ (* (* (value Piece at:(last To)) 10) (mapEntry ""DamageMultiplier"" (what at:(last To)))) 100) 1) (max (/ (* (* (value Piece at:(last To)) 8) (mapEntry ""DamageMultiplier"" (what at:(last To)))) 100) 1))) (if (is In (last From) (sites ""Forest"")) (max (/ (* (* (value Piece at:(last To)) 3) (mapEntry ""DamageMultiplier"" (what at:(last To)))) 100) 1) (if (is In (last From) (union (sites ""ShallowWater"") (sites ""DeepWater""))) (max (/ (* (* (value Piece at:(last To)) 5) (mapEntry ""DamageMultiplier"" (what at:(last To)))) 100) 1) (max (/ (* (* (value Piece at:(last To)) 4) (mapEntry ""DamageMultiplier"" (what at:(last To)))) 100) 1))))) (* {(if (is In (last To) (sites Occupied by:All container:""Board"" components:{""Soldier"" ""Motorbike""})) (if (= (who at:(last To)) 1) (mapEntry ""NoDoctrine"" 1) (if (= (who at:(last To)) 2) (mapEntry ""NoDoctrine"" 1) (if (= (who at:(last To)) 3) (mapEntry ""NoDoctrine"" 1) (if (= (who at:(last To)) 4) (mapEntry ""NoDoctrine"" 1) 0)))) (if (is In (last To) (sites Occupied by:All container:""Board"" components:{""Tank"" ""Speeder"" ""Shooter""})) (if (= (who at:(last To)) 1) (mapEntry ""NoDoctrine"" 2) (if (= (who at:(last To)) 2) (mapEntry ""NoDoctrine"" 2) (if (= (who at:(last To)) 3) (mapEntry ""NoDoctrine"" 2) (if (= (who at:(last To)) 4) (mapEntry ""NoDoctrine"" 2) 0)))) (if (is In (last To) (sites Occupied by:All container:""Board"" components:{""Launcher"" ""Antiair"" ""Artillery""})) (if (= (who at:(last To)) 1) (mapEntry ""NoDoctrine"" 3) (if (= (who at:(last To)) 2) (mapEntry ""NoDoctrine"" 3) (if (= (who at:(last To)) 3) (mapEntry ""NoDoctrine"" 3) (if (= (who at:(last To)) 4) (mapEntry ""NoDoctrine"" 3) 0)))) (if (is In (last To) (sites Occupied by:All container:""Board"" components:{""Fighter"" ""Bomber"" ""Helicopter""})) (if (= (who at:(last To)) 1) (mapEntry ""NoDoctrine"" 4) (if (= (who at:(last To)) 2) (mapEntry ""NoDoctrine"" 4) (if (= (who at:(last To)) 3) (mapEntry ""NoDoctrine"" 4) (if (= (who at:(last To)) 4) (mapEntry ""NoDoctrine"" 4) 0)))) (if (is In (last To) (sites Occupied by:All container:""Board"" components:{""Submarine"" ""Cruiser"" ""Battleship""})) (if (= (who at:(last To)) 1) (mapEntry ""NoDoctrine"" 5) (if (= (who at:(last To)) 2) (mapEntry ""NoDoctrine"" 5) (if (= (who at:(last To)) 3) (mapEntry ""NoDoctrine"" 5) (if (= (who at:(last To)) 4) (mapEntry ""NoDoctrine"" 5) 0)))) 4))))) (if (and (= 8 (state at:(last From))) (!= (mover) (who at:(last From)))) (if (= (who at:(last To)) 1) (mapEntry ""NoDoctrine"" 6) (if (= (who at:(last To)) 2) (mapEntry ""NoDoctrine"" 6) (if (= (who at:(last To)) 3) (mapEntry ""NoDoctrine"" 6) (if (= (who at:(last To)) 4) (mapEntry ""NoDoctrine"" 6) 0)))) 5) (if (> (who at:(last From)) 0) (if (= (who at:(last From)) 1) (mapEntry ""NoDoctrine"" 8) (if (= (who at:(last From)) 2) (mapEntry ""NoDoctrine"" 8) (if (= (who at:(last From)) 3) (mapEntry ""NoDoctrine"" 8) (if (= (who at:(last From)) 4) (mapEntry ""NoDoctrine"" 8) 0)))) 4) (if True (if (= (who at:(last To)) 1) (mapEntry ""NoDoctrine"" 10) (if (= (who at:(last To)) 2) (mapEntry ""NoDoctrine"" 10) (if (= (who at:(last To)) 3) (mapEntry ""NoDoctrine"" 10) (if (= (who at:(last To)) 4) (mapEntry ""NoDoctrine"" 10) 0)))) (if (= (who at:(last To)) 1) (mapEntry ""NoDoctrine"" 9) (if (= (who at:(last To)) 2) (mapEntry ""NoDoctrine"" 9) (if (= (who at:(last To)) 3) (mapEntry ""NoDoctrine"" 9) (if (= (who at:(last To)) 4) (mapEntry ""NoDoctrine"" 9) 0))))) (value Random (range (if (= (who at:(last To)) 1) (mapEntry ""NoDoctrine"" 11) (if (= (who at:(last To)) 2) (mapEntry ""NoDoctrine"" 11) (if (= (who at:(last To)) 3) (mapEntry ""NoDoctrine"" 11) (if (= (who at:(last To)) 4) (mapEntry ""NoDoctrine"" 11) 0)))) (if (= (who at:(last To)) 1) (mapEntry ""NoDoctrine"" 12) (if (= (who at:(last To)) 2) (mapEntry ""NoDoctrine"" 12) (if (= (who at:(last To)) 3) (mapEntry ""NoDoctrine"" 12) (if (= (who at:(last To)) 4) (mapEntry ""NoDoctrine"" 12) 0))))))})) 128000)) 0) (remove (last From)) (set Value at:(last From) (- (value Piece at:(last From)) (/ (* (if (is In (last From) (sites Occupied by:All container:""Board"" components:{""Fighter"" ""Bomber"" ""Helicopter""})) (max (/ (* (* (value Piece at:(last To)) 4) (mapEntry ""DamageMultiplier"" (what at:(last To)))) 100) 1) (if (and (is In (last From) (sites Occupied by:All container:""Board"" components:{""Soldier"" ""Motorbike""})) (is In (last To) (sites Occupied by:All component:""Shooter""))) (if (is In (last From) (sites ""Forest"")) (max (/ (* (* (value Piece at:(last To)) 6) (mapEntry ""DamageMultiplier"" (what at:(last To)))) 100) 1) (if (is In (last From) (union (sites ""ShallowWater"") (sites ""DeepWater""))) (max (/ (* (* (value Piece at:(last To)) 10) (mapEntry ""DamageMultiplier"" (what at:(last To)))) 100) 1) (max (/ (* (* (value Piece at:(last To)) 8) (mapEntry ""DamageMultiplier"" (what at:(last To)))) 100) 1))) (if (is In (last From) (sites ""Forest"")) (max (/ (* (* (value Piece at:(last To)) 3) (mapEntry ""DamageMultiplier"" (what at:(last To)))) 100) 1) (if (is In (last From) (union (sites ""ShallowWater"") (sites ""DeepWater""))) (max (/ (* (* (value Piece at:(last To)) 5) (mapEntry ""DamageMultiplier"" (what at:(last To)))) 100) 1) (max (/ (* (* (value Piece at:(last To)) 4) (mapEntry ""DamageMultiplier"" (what at:(last To)))) 100) 1))))) (* {(if (is In (last To) (sites Occupied by:All container:""Board"" components:{""Soldier"" ""Motorbike""})) (if (= (who at:(last To)) 1) (mapEntry ""NoDoctrine"" 1) (if (= (who at:(last To)) 2) (mapEntry ""NoDoctrine"" 1) (if (= (who at:(last To)) 3) (mapEntry ""NoDoctrine"" 1) (if (= (who at:(last To)) 4) (mapEntry ""NoDoctrine"" 1) 0)))) (if (is In (last To) (sites Occupied by:All container:""Board"" components:{""Tank"" ""Speeder"" ""Shooter""})) (if (= (who at:(last To)) 1) (mapEntry ""NoDoctrine"" 2) (if (= (who at:(last To)) 2) (mapEntry ""NoDoctrine"" 2) (if (= (who at:(last To)) 3) (mapEntry ""NoDoctrine"" 2) (if (= (who at:(last To)) 4) (mapEntry ""NoDoctrine"" 2) 0)))) (if (is In (last To) (sites Occupied by:All container:""Board"" components:{""Launcher"" ""Antiair"" ""Artillery""})) (if (= (who at:(last To)) 1) (mapEntry ""NoDoctrine"" 3) (if (= (who at:(last To)) 2) (mapEntry ""NoDoctrine"" 3) (if (= (who at:(last To)) 3) (mapEntry ""NoDoctrine"" 3) (if (= (who at:(last To)) 4) (mapEntry ""NoDoctrine"" 3) 0)))) (if (is In (last To) (sites Occupied by:All container:""Board"" components:{""Fighter"" ""Bomber"" ""Helicopter""})) (if (= (who at:(last To)) 1) (mapEntry ""NoDoctrine"" 4) (if (= (who at:(last To)) 2) (mapEntry ""NoDoctrine"" 4) (if (= (who at:(last To)) 3) (mapEntry ""NoDoctrine"" 4) (if (= (who at:(last To)) 4) (mapEntry ""NoDoctrine"" 4) 0)))) (if (is In (last To) (sites Occupied by:All container:""Board"" components:{""Submarine"" ""Cruiser"" ""Battleship""})) (if (= (who at:(last To)) 1) (mapEntry ""NoDoctrine"" 5) (if (= (who at:(last To)) 2) (mapEntry ""NoDoctrine"" 5) (if (= (who at:(last To)) 3) (mapEntry ""NoDoctrine"" 5) (if (= (who at:(last To)) 4) (mapEntry ""NoDoctrine"" 5) 0)))) 4))))) (if (and (= 8 (state at:(last From))) (!= (mover) (who at:(last From)))) (if (= (who at:(last To)) 1) (mapEntry ""NoDoctrine"" 6) (if (= (who at:(last To)) 2) (mapEntry ""NoDoctrine"" 6) (if (= (who at:(last To)) 3) (mapEntry ""NoDoctrine"" 6) (if (= (who at:(last To)) 4) (mapEntry ""NoDoctrine"" 6) 0)))) 5) (if (> (who at:(last From)) 0) (if (= (who at:(last From)) 1) (mapEntry ""NoDoctrine"" 8) (if (= (who at:(last From)) 2) (mapEntry ""NoDoctrine"" 8) (if (= (who at:(last From)) 3) (mapEntry ""NoDoctrine"" 8) (if (= (who at:(last From)) 4) (mapEntry ""NoDoctrine"" 8) 0)))) 4) (if True (if (= (who at:(last To)) 1) (mapEntry ""NoDoctrine"" 10) (if (= (who at:(last To)) 2) (mapEntry ""NoDoctrine"" 10) (if (= (who at:(last To)) 3) (mapEntry ""NoDoctrine"" 10) (if (= (who at:(last To)) 4) (mapEntry ""NoDoctrine"" 10) 0)))) (if (= (who at:(last To)) 1) (mapEntry ""NoDoctrine"" 9) (if (= (who at:(last To)) 2) (mapEntry ""NoDoctrine"" 9) (if (= (who at:(last To)) 3) (mapEntry ""NoDoctrine"" 9) (if (= (who at:(last To)) 4) (mapEntry ""NoDoctrine"" 9) 0))))) (value Random (range (if (= (who at:(last To)) 1) (mapEntry ""NoDoctrine"" 11) (if (= (who at:(last To)) 2) (mapEntry ""NoDoctrine"" 11) (if (= (who at:(last To)) 3) (mapEntry ""NoDoctrine"" 11) (if (= (who at:(last To)) 4) (mapEntry ""NoDoctrine"" 11) 0)))) (if (= (who at:(last To)) 1) (mapEntry ""NoDoctrine"" 12) (if (= (who at:(last To)) 2) (mapEntry ""NoDoctrine"" 12) (if (= (who at:(last To)) 3) (mapEntry ""NoDoctrine"" 12) (if (= (who at:(last To)) 4) (mapEntry ""NoDoctrine"" 12) 0))))))})) 128000)))) (set Value at:(last From) (value Piece at:(last From))))))))) (move Select (from (from) if:(and (> (state at:(from)) 0) (< (value Piece at:(from)) (mapEntry ""MaxHealth"" (what at:(from)))))) (to (sites Around (from) Orthogonal if:(is In (to) (sites Occupied by:Mover container:""Board"" components:{""Town"" ""Dock"" ""Base"" ""Factory"" ""Airport""})))) (then (and {(set Value at:(last From) (min (mapEntry ""MaxHealth"" (what at:(last From))) (- (+ (value Piece at:(last From)) (value Piece at:(last To))) 1))) (set Value at:(last To) (max (- (value Piece at:(last To)) (- (mapEntry ""MaxHealth"" (what at:(last From))) (value Piece at:(last From)))) 1)) (set State at:(last From) 0)}))) (move Select (from (from) if:(> (state at:(from)) 0)) (to (sites Around (from) Orthogonal if:(and (= (what at:(from)) (what at:(to))) (< (value Piece at:(to)) (mapEntry ""MaxHealth"" (what at:(to))))))) (then (and {(if (<= (+ (value Piece at:(last To)) (value Piece at:(last From))) (mapEntry ""MaxHealth"" (what at:(last From)))) (and (set Value at:(last To) (min (mapEntry ""MaxHealth"" (what at:(last From))) (+ (value Piece at:(last From)) (value Piece at:(last To))))) (remove (last From))) (and (set Value at:(last To) (min (mapEntry ""MaxHealth"" (what at:(last From))) (- (+ (value Piece at:(last From)) (value Piece at:(last To))) 1))) (set Value at:(last From) (max (- (value Piece at:(last To)) (- (mapEntry ""MaxHealth"" (what at:(last From))) (value Piece at:(last From)))) 1)))) (set State at:(last From) 0) (set State at:(last To) 0)})))})) (piece ""Submarine"" Each (or {(move (from (from) if:(> (state at:(from)) 1)) (to (sites Distance (step Orthogonal (to if:(is In (to) (difference (union (sites Empty) (sites Occupied by:Friend container:""Board"")) (union (sites ""Mountain"") (difference (sites Board) (union (sites ""ShallowWater"") (sites ""DeepWater"")))))))) from:(from) (range 1 (- (state at:(from)) 1))) if:(is Empty (to)) (apply (set State at:(from) 1)))) (move Select (from (from) if:(> (state at:(from)) 0)) (to (sites Distance Orthogonal from:(from) (range 1 1)) if:(and {(if (is In (from) (sites Occupied by:Mover container:""Board"" components:{""Bomber"" ""Battleship"" ""Artillery"" ""Launcher""})) (is In (to) (union (sites Occupied by:Enemy container:""Board"" components:{""Soldier"" ""Motorbike"" ""Tank"" ""Speeder"" ""Shooter"" ""Launcher"" ""Antiair"" ""Battleship"" ""Artillery"" ""Base"" ""Town"" ""Factory"" ""Dock"" ""Airport"" ""Cruiser"" ""Submarine""}) (sites Occupied by:Neutral container:""Board""))) (is In (to) (union (sites Occupied by:Enemy container:""Board"") (sites Occupied by:Neutral container:""Board"")))) (if (is In (from) (sites Occupied by:Mover container:""Board"" components:{""Antiair"" ""Fighter""})) (is In (to) (sites Occupied by:Enemy container:""Board"" components:{""Fighter"" ""Helicopter"" ""Bomber""})) (is In (to) (union (sites Occupied by:Enemy container:""Board"") (sites Occupied by:Neutral container:""Board"")))) (if (is In (from) (sites Occupied by:Mover container:""Board"" components:{""Submarine""})) (is In (to) (sites Occupied by:Enemy container:""Board"" components:{""Submarine"" ""Battleship"" ""Cruiser""})) (is In (to) (union (sites Occupied by:Enemy container:""Board"") (sites Occupied by:Neutral container:""Board""))))})) (then (do (and (set Value at:(last To) (max 0 (- (value Piece at:(last To)) (/ (* (if (is In (last To) (sites Occupied by:All container:""Board"" components:{""Fighter"" ""Bomber"" ""Helicopter""})) (max (/ (* (* (value Piece at:(last From)) 4) (mapEntry ""DamageMultiplier"" (what at:(last From)))) 100) 1) (if (and (is In (last To) (sites Occupied by:All container:""Board"" components:{""Soldier"" ""Motorbike""})) (is In (last From) (sites Occupied by:All component:""Shooter""))) (if (is In (last To) (sites ""Forest"")) (max (/ (* (* (value Piece at:(last From)) 6) (mapEntry ""DamageMultiplier"" (what at:(last From)))) 100) 1) (if (is In (last To) (union (sites ""ShallowWater"") (sites ""DeepWater""))) (max (/ (* (* (value Piece at:(last From)) 10) (mapEntry ""DamageMultiplier"" (what at:(last From)))) 100) 1) (max (/ (* (* (value Piece at:(last From)) 8) (mapEntry ""DamageMultiplier"" (what at:(last From)))) 100) 1))) (if (is In (last To) (sites ""Forest"")) (max (/ (* (* (value Piece at:(last From)) 3) (mapEntry ""DamageMultiplier"" (what at:(last From)))) 100) 1) (if (is In (last To) (union (sites ""ShallowWater"") (sites ""DeepWater""))) (max (/ (* (* (value Piece at:(last From)) 5) (mapEntry ""DamageMultiplier"" (what at:(last From)))) 100) 1) (max (/ (* (* (value Piece at:(last From)) 4) (mapEntry ""DamageMultiplier"" (what at:(last From)))) 100) 1))))) (* {(if (is In (last From) (sites Occupied by:All container:""Board"" components:{""Soldier"" ""Motorbike""})) (if (= (who at:(last From)) 1) (mapEntry ""NoDoctrine"" 1) (if (= (who at:(last From)) 2) (mapEntry ""NoDoctrine"" 1) (if (= (who at:(last From)) 3) (mapEntry ""NoDoctrine"" 1) (if (= (who at:(last From)) 4) (mapEntry ""NoDoctrine"" 1) 0)))) (if (is In (last From) (sites Occupied by:All container:""Board"" components:{""Tank"" ""Speeder"" ""Shooter""})) (if (= (who at:(last From)) 1) (mapEntry ""NoDoctrine"" 2) (if (= (who at:(last From)) 2) (mapEntry ""NoDoctrine"" 2) (if (= (who at:(last From)) 3) (mapEntry ""NoDoctrine"" 2) (if (= (who at:(last From)) 4) (mapEntry ""NoDoctrine"" 2) 0)))) (if (is In (last From) (sites Occupied by:All container:""Board"" components:{""Launcher"" ""Antiair"" ""Artillery""})) (if (= (who at:(last From)) 1) (mapEntry ""NoDoctrine"" 3) (if (= (who at:(last From)) 2) (mapEntry ""NoDoctrine"" 3) (if (= (who at:(last From)) 3) (mapEntry ""NoDoctrine"" 3) (if (= (who at:(last From)) 4) (mapEntry ""NoDoctrine"" 3) 0)))) (if (is In (last From) (sites Occupied by:All container:""Board"" components:{""Fighter"" ""Bomber"" ""Helicopter""})) (if (= (who at:(last From)) 1) (mapEntry ""NoDoctrine"" 4) (if (= (who at:(last From)) 2) (mapEntry ""NoDoctrine"" 4) (if (= (who at:(last From)) 3) (mapEntry ""NoDoctrine"" 4) (if (= (who at:(last From)) 4) (mapEntry ""NoDoctrine"" 4) 0)))) (if (is In (last From) (sites Occupied by:All container:""Board"" components:{""Submarine"" ""Cruiser"" ""Battleship""})) (if (= (who at:(last From)) 1) (mapEntry ""NoDoctrine"" 5) (if (= (who at:(last From)) 2) (mapEntry ""NoDoctrine"" 5) (if (= (who at:(last From)) 3) (mapEntry ""NoDoctrine"" 5) (if (= (who at:(last From)) 4) (mapEntry ""NoDoctrine"" 5) 0)))) 4))))) (if (and (= 8 (state at:(last To))) (!= (mover) (who at:(last To)))) (if (= (who at:(last From)) 1) (mapEntry ""NoDoctrine"" 6) (if (= (who at:(last From)) 2) (mapEntry ""NoDoctrine"" 6) (if (= (who at:(last From)) 3) (mapEntry ""NoDoctrine"" 6) (if (= (who at:(last From)) 4) (mapEntry ""NoDoctrine"" 6) 0)))) 5) (if (> (who at:(last To)) 0) (if (= (who at:(last To)) 1) (mapEntry ""NoDoctrine"" 8) (if (= (who at:(last To)) 2) (mapEntry ""NoDoctrine"" 8) (if (= (who at:(last To)) 3) (mapEntry ""NoDoctrine"" 8) (if (= (who at:(last To)) 4) (mapEntry ""NoDoctrine"" 8) 0)))) 4) (if False (if (= (who at:(last From)) 1) (mapEntry ""NoDoctrine"" 10) (if (= (who at:(last From)) 2) (mapEntry ""NoDoctrine"" 10) (if (= (who at:(last From)) 3) (mapEntry ""NoDoctrine"" 10) (if (= (who at:(last From)) 4) (mapEntry ""NoDoctrine"" 10) 0)))) (if (= (who at:(last From)) 1) (mapEntry ""NoDoctrine"" 9) (if (= (who at:(last From)) 2) (mapEntry ""NoDoctrine"" 9) (if (= (who at:(last From)) 3) (mapEntry ""NoDoctrine"" 9) (if (= (who at:(last From)) 4) (mapEntry ""NoDoctrine"" 9) 0))))) (value Random (range (if (= (who at:(last From)) 1) (mapEntry ""NoDoctrine"" 11) (if (= (who at:(last From)) 2) (mapEntry ""NoDoctrine"" 11) (if (= (who at:(last From)) 3) (mapEntry ""NoDoctrine"" 11) (if (= (who at:(last From)) 4) (mapEntry ""NoDoctrine"" 11) 0)))) (if (= (who at:(last From)) 1) (mapEntry ""NoDoctrine"" 12) (if (= (who at:(last From)) 2) (mapEntry ""NoDoctrine"" 12) (if (= (who at:(last From)) 3) (mapEntry ""NoDoctrine"" 12) (if (= (who at:(last From)) 4) (mapEntry ""NoDoctrine"" 12) 0))))))})) 128000)))) (set State at:(last From) 0)) next:(if (and (= 8 (state at:(last To))) (!= (mover) (who at:(last To)))) (if (= (value Piece at:(last To)) 0) (and {(take Control of:All by:Mover at:(last To)) (set Value at:(last To) 50)}) (set Value at:(last To) (value Piece at:(last To)))) (if (= (value Piece at:(last To)) 0) (remove (last To)) (if (and {(= 0 (count Sites in:(intersection (sites {(last To) (last From)}) (sites Occupied by:All components:{""Launcher"" ""Artillery"" ""Battleship"" ""Antiair""})))) (if (is In (last To) (sites Occupied by:Enemy components:{""Bomber"" ""Battleship"" ""Artillery"" ""Launcher""})) (is In (last From) (union (sites Occupied by:Mover components:{""Soldier"" ""Motorbike"" ""Tank"" ""Speeder"" ""Shooter"" ""Launcher"" ""Antiair"" ""Battleship"" ""Artillery"" ""Base"" ""Town"" ""Factory"" ""Dock"" ""Airport"" ""Cruiser"" ""Submarine""}) (sites Occupied by:Neutral container:""Board""))) (is In (last From) (union (sites Occupied by:Mover) (sites Occupied by:Neutral container:""Board"")))) (if (is In (last To) (sites Occupied by:Enemy components:{""Antiair"" ""Fighter""})) (is In (last From) (sites Occupied by:Mover components:{""Fighter"" ""Helicopter"" ""Bomber""})) (is In (last From) (union (sites Occupied by:Mover) (sites Occupied by:Neutral container:""Board"")))) (if (is In (last To) (sites Occupied by:Enemy components:{""Submarine""})) (is In (last From) (sites Occupied by:Mover components:{""Submarine"" ""Battleship"" ""Cruiser""})) (is In (last From) (union (sites Occupied by:Mover) (sites Occupied by:Neutral container:""Board""))))}) (if (<= (- (value Piece at:(last From)) (/ (* (if (is In (last From) (sites Occupied by:All container:""Board"" components:{""Fighter"" ""Bomber"" ""Helicopter""})) (max (/ (* (* (value Piece at:(last To)) 4) (mapEntry ""DamageMultiplier"" (what at:(last To)))) 100) 1) (if (and (is In (last From) (sites Occupied by:All container:""Board"" components:{""Soldier"" ""Motorbike""})) (is In (last To) (sites Occupied by:All component:""Shooter""))) (if (is In (last From) (sites ""Forest"")) (max (/ (* (* (value Piece at:(last To)) 6) (mapEntry ""DamageMultiplier"" (what at:(last To)))) 100) 1) (if (is In (last From) (union (sites ""ShallowWater"") (sites ""DeepWater""))) (max (/ (* (* (value Piece at:(last To)) 10) (mapEntry ""DamageMultiplier"" (what at:(last To)))) 100) 1) (max (/ (* (* (value Piece at:(last To)) 8) (mapEntry ""DamageMultiplier"" (what at:(last To)))) 100) 1))) (if (is In (last From) (sites ""Forest"")) (max (/ (* (* (value Piece at:(last To)) 3) (mapEntry ""DamageMultiplier"" (what at:(last To)))) 100) 1) (if (is In (last From) (union (sites ""ShallowWater"") (sites ""DeepWater""))) (max (/ (* (* (value Piece at:(last To)) 5) (mapEntry ""DamageMultiplier"" (what at:(last To)))) 100) 1) (max (/ (* (* (value Piece at:(last To)) 4) (mapEntry ""DamageMultiplier"" (what at:(last To)))) 100) 1))))) (* {(if (is In (last To) (sites Occupied by:All container:""Board"" components:{""Soldier"" ""Motorbike""})) (if (= (who at:(last To)) 1) (mapEntry ""NoDoctrine"" 1) (if (= (who at:(last To)) 2) (mapEntry ""NoDoctrine"" 1) (if (= (who at:(last To)) 3) (mapEntry ""NoDoctrine"" 1) (if (= (who at:(last To)) 4) (mapEntry ""NoDoctrine"" 1) 0)))) (if (is In (last To) (sites Occupied by:All container:""Board"" components:{""Tank"" ""Speeder"" ""Shooter""})) (if (= (who at:(last To)) 1) (mapEntry ""NoDoctrine"" 2) (if (= (who at:(last To)) 2) (mapEntry ""NoDoctrine"" 2) (if (= (who at:(last To)) 3) (mapEntry ""NoDoctrine"" 2) (if (= (who at:(last To)) 4) (mapEntry ""NoDoctrine"" 2) 0)))) (if (is In (last To) (sites Occupied by:All container:""Board"" components:{""Launcher"" ""Antiair"" ""Artillery""})) (if (= (who at:(last To)) 1) (mapEntry ""NoDoctrine"" 3) (if (= (who at:(last To)) 2) (mapEntry ""NoDoctrine"" 3) (if (= (who at:(last To)) 3) (mapEntry ""NoDoctrine"" 3) (if (= (who at:(last To)) 4) (mapEntry ""NoDoctrine"" 3) 0)))) (if (is In (last To) (sites Occupied by:All container:""Board"" components:{""Fighter"" ""Bomber"" ""Helicopter""})) (if (= (who at:(last To)) 1) (mapEntry ""NoDoctrine"" 4) (if (= (who at:(last To)) 2) (mapEntry ""NoDoctrine"" 4) (if (= (who at:(last To)) 3) (mapEntry ""NoDoctrine"" 4) (if (= (who at:(last To)) 4) (mapEntry ""NoDoctrine"" 4) 0)))) (if (is In (last To) (sites Occupied by:All container:""Board"" components:{""Submarine"" ""Cruiser"" ""Battleship""})) (if (= (who at:(last To)) 1) (mapEntry ""NoDoctrine"" 5) (if (= (who at:(last To)) 2) (mapEntry ""NoDoctrine"" 5) (if (= (who at:(last To)) 3) (mapEntry ""NoDoctrine"" 5) (if (= (who at:(last To)) 4) (mapEntry ""NoDoctrine"" 5) 0)))) 4))))) (if (and (= 8 (state at:(last From))) (!= (mover) (who at:(last From)))) (if (= (who at:(last To)) 1) (mapEntry ""NoDoctrine"" 6) (if (= (who at:(last To)) 2) (mapEntry ""NoDoctrine"" 6) (if (= (who at:(last To)) 3) (mapEntry ""NoDoctrine"" 6) (if (= (who at:(last To)) 4) (mapEntry ""NoDoctrine"" 6) 0)))) 5) (if (> (who at:(last From)) 0) (if (= (who at:(last From)) 1) (mapEntry ""NoDoctrine"" 8) (if (= (who at:(last From)) 2) (mapEntry ""NoDoctrine"" 8) (if (= (who at:(last From)) 3) (mapEntry ""NoDoctrine"" 8) (if (= (who at:(last From)) 4) (mapEntry ""NoDoctrine"" 8) 0)))) 4) (if True (if (= (who at:(last To)) 1) (mapEntry ""NoDoctrine"" 10) (if (= (who at:(last To)) 2) (mapEntry ""NoDoctrine"" 10) (if (= (who at:(last To)) 3) (mapEntry ""NoDoctrine"" 10) (if (= (who at:(last To)) 4) (mapEntry ""NoDoctrine"" 10) 0)))) (if (= (who at:(last To)) 1) (mapEntry ""NoDoctrine"" 9) (if (= (who at:(last To)) 2) (mapEntry ""NoDoctrine"" 9) (if (= (who at:(last To)) 3) (mapEntry ""NoDoctrine"" 9) (if (= (who at:(last To)) 4) (mapEntry ""NoDoctrine"" 9) 0))))) (value Random (range (if (= (who at:(last To)) 1) (mapEntry ""NoDoctrine"" 11) (if (= (who at:(last To)) 2) (mapEntry ""NoDoctrine"" 11) (if (= (who at:(last To)) 3) (mapEntry ""NoDoctrine"" 11) (if (= (who at:(last To)) 4) (mapEntry ""NoDoctrine"" 11) 0)))) (if (= (who at:(last To)) 1) (mapEntry ""NoDoctrine"" 12) (if (= (who at:(last To)) 2) (mapEntry ""NoDoctrine"" 12) (if (= (who at:(last To)) 3) (mapEntry ""NoDoctrine"" 12) (if (= (who at:(last To)) 4) (mapEntry ""NoDoctrine"" 12) 0))))))})) 128000)) 0) (remove (last From)) (set Value at:(last From) (- (value Piece at:(last From)) (/ (* (if (is In (last From) (sites Occupied by:All container:""Board"" components:{""Fighter"" ""Bomber"" ""Helicopter""})) (max (/ (* (* (value Piece at:(last To)) 4) (mapEntry ""DamageMultiplier"" (what at:(last To)))) 100) 1) (if (and (is In (last From) (sites Occupied by:All container:""Board"" components:{""Soldier"" ""Motorbike""})) (is In (last To) (sites Occupied by:All component:""Shooter""))) (if (is In (last From) (sites ""Forest"")) (max (/ (* (* (value Piece at:(last To)) 6) (mapEntry ""DamageMultiplier"" (what at:(last To)))) 100) 1) (if (is In (last From) (union (sites ""ShallowWater"") (sites ""DeepWater""))) (max (/ (* (* (value Piece at:(last To)) 10) (mapEntry ""DamageMultiplier"" (what at:(last To)))) 100) 1) (max (/ (* (* (value Piece at:(last To)) 8) (mapEntry ""DamageMultiplier"" (what at:(last To)))) 100) 1))) (if (is In (last From) (sites ""Forest"")) (max (/ (* (* (value Piece at:(last To)) 3) (mapEntry ""DamageMultiplier"" (what at:(last To)))) 100) 1) (if (is In (last From) (union (sites ""ShallowWater"") (sites ""DeepWater""))) (max (/ (* (* (value Piece at:(last To)) 5) (mapEntry ""DamageMultiplier"" (what at:(last To)))) 100) 1) (max (/ (* (* (value Piece at:(last To)) 4) (mapEntry ""DamageMultiplier"" (what at:(last To)))) 100) 1))))) (* {(if (is In (last To) (sites Occupied by:All container:""Board"" components:{""Soldier"" ""Motorbike""})) (if (= (who at:(last To)) 1) (mapEntry ""NoDoctrine"" 1) (if (= (who at:(last To)) 2) (mapEntry ""NoDoctrine"" 1) (if (= (who at:(last To)) 3) (mapEntry ""NoDoctrine"" 1) (if (= (who at:(last To)) 4) (mapEntry ""NoDoctrine"" 1) 0)))) (if (is In (last To) (sites Occupied by:All container:""Board"" components:{""Tank"" ""Speeder"" ""Shooter""})) (if (= (who at:(last To)) 1) (mapEntry ""NoDoctrine"" 2) (if (= (who at:(last To)) 2) (mapEntry ""NoDoctrine"" 2) (if (= (who at:(last To)) 3) (mapEntry ""NoDoctrine"" 2) (if (= (who at:(last To)) 4) (mapEntry ""NoDoctrine"" 2) 0)))) (if (is In (last To) (sites Occupied by:All container:""Board"" components:{""Launcher"" ""Antiair"" ""Artillery""})) (if (= (who at:(last To)) 1) (mapEntry ""NoDoctrine"" 3) (if (= (who at:(last To)) 2) (mapEntry ""NoDoctrine"" 3) (if (= (who at:(last To)) 3) (mapEntry ""NoDoctrine"" 3) (if (= (who at:(last To)) 4) (mapEntry ""NoDoctrine"" 3) 0)))) (if (is In (last To) (sites Occupied by:All container:""Board"" components:{""Fighter"" ""Bomber"" ""Helicopter""})) (if (= (who at:(last To)) 1) (mapEntry ""NoDoctrine"" 4) (if (= (who at:(last To)) 2) (mapEntry ""NoDoctrine"" 4) (if (= (who at:(last To)) 3) (mapEntry ""NoDoctrine"" 4) (if (= (who at:(last To)) 4) (mapEntry ""NoDoctrine"" 4) 0)))) (if (is In (last To) (sites Occupied by:All container:""Board"" components:{""Submarine"" ""Cruiser"" ""Battleship""})) (if (= (who at:(last To)) 1) (mapEntry ""NoDoctrine"" 5) (if (= (who at:(last To)) 2) (mapEntry ""NoDoctrine"" 5) (if (= (who at:(last To)) 3) (mapEntry ""NoDoctrine"" 5) (if (= (who at:(last To)) 4) (mapEntry ""NoDoctrine"" 5) 0)))) 4))))) (if (and (= 8 (state at:(last From))) (!= (mover) (who at:(last From)))) (if (= (who at:(last To)) 1) (mapEntry ""NoDoctrine"" 6) (if (= (who at:(last To)) 2) (mapEntry ""NoDoctrine"" 6) (if (= (who at:(last To)) 3) (mapEntry ""NoDoctrine"" 6) (if (= (who at:(last To)) 4) (mapEntry ""NoDoctrine"" 6) 0)))) 5) (if (> (who at:(last From)) 0) (if (= (who at:(last From)) 1) (mapEntry ""NoDoctrine"" 8) (if (= (who at:(last From)) 2) (mapEntry ""NoDoctrine"" 8) (if (= (who at:(last From)) 3) (mapEntry ""NoDoctrine"" 8) (if (= (who at:(last From)) 4) (mapEntry ""NoDoctrine"" 8) 0)))) 4) (if True (if (= (who at:(last To)) 1) (mapEntry ""NoDoctrine"" 10) (if (= (who at:(last To)) 2) (mapEntry ""NoDoctrine"" 10) (if (= (who at:(last To)) 3) (mapEntry ""NoDoctrine"" 10) (if (= (who at:(last To)) 4) (mapEntry ""NoDoctrine"" 10) 0)))) (if (= (who at:(last To)) 1) (mapEntry ""NoDoctrine"" 9) (if (= (who at:(last To)) 2) (mapEntry ""NoDoctrine"" 9) (if (= (who at:(last To)) 3) (mapEntry ""NoDoctrine"" 9) (if (= (who at:(last To)) 4) (mapEntry ""NoDoctrine"" 9) 0))))) (value Random (range (if (= (who at:(last To)) 1) (mapEntry ""NoDoctrine"" 11) (if (= (who at:(last To)) 2) (mapEntry ""NoDoctrine"" 11) (if (= (who at:(last To)) 3) (mapEntry ""NoDoctrine"" 11) (if (= (who at:(last To)) 4) (mapEntry ""NoDoctrine"" 11) 0)))) (if (= (who at:(last To)) 1) (mapEntry ""NoDoctrine"" 12) (if (= (who at:(last To)) 2) (mapEntry ""NoDoctrine"" 12) (if (= (who at:(last To)) 3) (mapEntry ""NoDoctrine"" 12) (if (= (who at:(last To)) 4) (mapEntry ""NoDoctrine"" 12) 0))))))})) 128000)))) (set Value at:(last From) (value Piece at:(last From))))))))) (move Select (from (from) if:(and (> (state at:(from)) 0) (< (value Piece at:(from)) (mapEntry ""MaxHealth"" (what at:(from)))))) (to (sites Around (from) Orthogonal if:(is In (to) (sites Occupied by:Mover container:""Board"" components:{""Town"" ""Dock"" ""Base"" ""Factory"" ""Airport""})))) (then (and {(set Value at:(last From) (min (mapEntry ""MaxHealth"" (what at:(last From))) (- (+ (value Piece at:(last From)) (value Piece at:(last To))) 1))) (set Value at:(last To) (max (- (value Piece at:(last To)) (- (mapEntry ""MaxHealth"" (what at:(last From))) (value Piece at:(last From)))) 1)) (set State at:(last From) 0)}))) (move Select (from (from) if:(> (state at:(from)) 0)) (to (sites Around (from) Orthogonal if:(and (= (what at:(from)) (what at:(to))) (< (value Piece at:(to)) (mapEntry ""MaxHealth"" (what at:(to))))))) (then (and {(if (<= (+ (value Piece at:(last To)) (value Piece at:(last From))) (mapEntry ""MaxHealth"" (what at:(last From)))) (and (set Value at:(last To) (min (mapEntry ""MaxHealth"" (what at:(last From))) (+ (value Piece at:(last From)) (value Piece at:(last To))))) (remove (last From))) (and (set Value at:(last To) (min (mapEntry ""MaxHealth"" (what at:(last From))) (- (+ (value Piece at:(last From)) (value Piece at:(last To))) 1))) (set Value at:(last From) (max (- (value Piece at:(last To)) (- (mapEntry ""MaxHealth"" (what at:(last From))) (value Piece at:(last From)))) 1)))) (set State at:(last From) 0) (set State at:(last To) 0)})))})) (piece ""Battleship"" Each (or {(move (from (from) if:(> (state at:(from)) 1)) (to (sites Distance (step Orthogonal (to if:(is In (to) (difference (union (sites Empty) (sites Occupied by:Friend container:""Board"")) (union (sites ""Mountain"") (difference (sites Board) (union (sites ""ShallowWater"") (sites ""DeepWater"")))))))) from:(from) (range 1 (- (state at:(from)) 1))) if:(is Empty (to)) (apply (set State at:(from) 1)))) (move Select (from (from) if:(> (state at:(from)) 0)) (to (sites Distance Orthogonal from:(from) (range 2 4)) if:(and {(if (is In (from) (sites Occupied by:Mover container:""Board"" components:{""Bomber"" ""Battleship"" ""Artillery"" ""Launcher""})) (is In (to) (union (sites Occupied by:Enemy container:""Board"" components:{""Soldier"" ""Motorbike"" ""Tank"" ""Speeder"" ""Shooter"" ""Launcher"" ""Antiair"" ""Battleship"" ""Artillery"" ""Base"" ""Town"" ""Factory"" ""Dock"" ""Airport"" ""Cruiser"" ""Submarine""}) (sites Occupied by:Neutral container:""Board""))) (is In (to) (union (sites Occupied by:Enemy container:""Board"") (sites Occupied by:Neutral container:""Board"")))) (if (is In (from) (sites Occupied by:Mover container:""Board"" components:{""Antiair"" ""Fighter""})) (is In (to) (sites Occupied by:Enemy container:""Board"" components:{""Fighter"" ""Helicopter"" ""Bomber""})) (is In (to) (union (sites Occupied by:Enemy container:""Board"") (sites Occupied by:Neutral container:""Board"")))) (if (is In (from) (sites Occupied by:Mover container:""Board"" components:{""Submarine""})) (is In (to) (sites Occupied by:Enemy container:""Board"" components:{""Submarine"" ""Battleship"" ""Cruiser""})) (is In (to) (union (sites Occupied by:Enemy container:""Board"") (sites Occupied by:Neutral container:""Board""))))})) (then (do (and (set Value at:(last To) (max 0 (- (value Piece at:(last To)) (/ (* (if (is In (last To) (sites Occupied by:All container:""Board"" components:{""Fighter"" ""Bomber"" ""Helicopter""})) (max (/ (* (* (value Piece at:(last From)) 4) (mapEntry ""DamageMultiplier"" (what at:(last From)))) 100) 1) (if (and (is In (last To) (sites Occupied by:All container:""Board"" components:{""Soldier"" ""Motorbike""})) (is In (last From) (sites Occupied by:All component:""Shooter""))) (if (is In (last To) (sites ""Forest"")) (max (/ (* (* (value Piece at:(last From)) 6) (mapEntry ""DamageMultiplier"" (what at:(last From)))) 100) 1) (if (is In (last To) (union (sites ""ShallowWater"") (sites ""DeepWater""))) (max (/ (* (* (value Piece at:(last From)) 10) (mapEntry ""DamageMultiplier"" (what at:(last From)))) 100) 1) (max (/ (* (* (value Piece at:(last From)) 8) (mapEntry ""DamageMultiplier"" (what at:(last From)))) 100) 1))) (if (is In (last To) (sites ""Forest"")) (max (/ (* (* (value Piece at:(last From)) 3) (mapEntry ""DamageMultiplier"" (what at:(last From)))) 100) 1) (if (is In (last To) (union (sites ""ShallowWater"") (sites ""DeepWater""))) (max (/ (* (* (value Piece at:(last From)) 5) (mapEntry ""DamageMultiplier"" (what at:(last From)))) 100) 1) (max (/ (* (* (value Piece at:(last From)) 4) (mapEntry ""DamageMultiplier"" (what at:(last From)))) 100) 1))))) (* {(if (is In (last From) (sites Occupied by:All container:""Board"" components:{""Soldier"" ""Motorbike""})) (if (= (who at:(last From)) 1) (mapEntry ""NoDoctrine"" 1) (if (= (who at:(last From)) 2) (mapEntry ""NoDoctrine"" 1) (if (= (who at:(last From)) 3) (mapEntry ""NoDoctrine"" 1) (if (= (who at:(last From)) 4) (mapEntry ""NoDoctrine"" 1) 0)))) (if (is In (last From) (sites Occupied by:All container:""Board"" components:{""Tank"" ""Speeder"" ""Shooter""})) (if (= (who at:(last From)) 1) (mapEntry ""NoDoctrine"" 2) (if (= (who at:(last From)) 2) (mapEntry ""NoDoctrine"" 2) (if (= (who at:(last From)) 3) (mapEntry ""NoDoctrine"" 2) (if (= (who at:(last From)) 4) (mapEntry ""NoDoctrine"" 2) 0)))) (if (is In (last From) (sites Occupied by:All container:""Board"" components:{""Launcher"" ""Antiair"" ""Artillery""})) (if (= (who at:(last From)) 1) (mapEntry ""NoDoctrine"" 3) (if (= (who at:(last From)) 2) (mapEntry ""NoDoctrine"" 3) (if (= (who at:(last From)) 3) (mapEntry ""NoDoctrine"" 3) (if (= (who at:(last From)) 4) (mapEntry ""NoDoctrine"" 3) 0)))) (if (is In (last From) (sites Occupied by:All container:""Board"" components:{""Fighter"" ""Bomber"" ""Helicopter""})) (if (= (who at:(last From)) 1) (mapEntry ""NoDoctrine"" 4) (if (= (who at:(last From)) 2) (mapEntry ""NoDoctrine"" 4) (if (= (who at:(last From)) 3) (mapEntry ""NoDoctrine"" 4) (if (= (who at:(last From)) 4) (mapEntry ""NoDoctrine"" 4) 0)))) (if (is In (last From) (sites Occupied by:All container:""Board"" components:{""Submarine"" ""Cruiser"" ""Battleship""})) (if (= (who at:(last From)) 1) (mapEntry ""NoDoctrine"" 5) (if (= (who at:(last From)) 2) (mapEntry ""NoDoctrine"" 5) (if (= (who at:(last From)) 3) (mapEntry ""NoDoctrine"" 5) (if (= (who at:(last From)) 4) (mapEntry ""NoDoctrine"" 5) 0)))) 4))))) (if (and (= 8 (state at:(last To))) (!= (mover) (who at:(last To)))) (if (= (who at:(last From)) 1) (mapEntry ""NoDoctrine"" 6) (if (= (who at:(last From)) 2) (mapEntry ""NoDoctrine"" 6) (if (= (who at:(last From)) 3) (mapEntry ""NoDoctrine"" 6) (if (= (who at:(last From)) 4) (mapEntry ""NoDoctrine"" 6) 0)))) 5) (if (> (who at:(last To)) 0) (if (= (who at:(last To)) 1) (mapEntry ""NoDoctrine"" 8) (if (= (who at:(last To)) 2) (mapEntry ""NoDoctrine"" 8) (if (= (who at:(last To)) 3) (mapEntry ""NoDoctrine"" 8) (if (= (who at:(last To)) 4) (mapEntry ""NoDoctrine"" 8) 0)))) 4) (if False (if (= (who at:(last From)) 1) (mapEntry ""NoDoctrine"" 10) (if (= (who at:(last From)) 2) (mapEntry ""NoDoctrine"" 10) (if (= (who at:(last From)) 3) (mapEntry ""NoDoctrine"" 10) (if (= (who at:(last From)) 4) (mapEntry ""NoDoctrine"" 10) 0)))) (if (= (who at:(last From)) 1) (mapEntry ""NoDoctrine"" 9) (if (= (who at:(last From)) 2) (mapEntry ""NoDoctrine"" 9) (if (= (who at:(last From)) 3) (mapEntry ""NoDoctrine"" 9) (if (= (who at:(last From)) 4) (mapEntry ""NoDoctrine"" 9) 0))))) (value Random (range (if (= (who at:(last From)) 1) (mapEntry ""NoDoctrine"" 11) (if (= (who at:(last From)) 2) (mapEntry ""NoDoctrine"" 11) (if (= (who at:(last From)) 3) (mapEntry ""NoDoctrine"" 11) (if (= (who at:(last From)) 4) (mapEntry ""NoDoctrine"" 11) 0)))) (if (= (who at:(last From)) 1) (mapEntry ""NoDoctrine"" 12) (if (= (who at:(last From)) 2) (mapEntry ""NoDoctrine"" 12) (if (= (who at:(last From)) 3) (mapEntry ""NoDoctrine"" 12) (if (= (who at:(last From)) 4) (mapEntry ""NoDoctrine"" 12) 0))))))})) 128000)))) (set State at:(last From) 0)) next:(if (and (= 8 (state at:(last To))) (!= (mover) (who at:(last To)))) (if (= (value Piece at:(last To)) 0) (and {(take Control of:All by:Mover at:(last To)) (set Value at:(last To) 50)}) (set Value at:(last To) (value Piece at:(last To)))) (if (= (value Piece at:(last To)) 0) (remove (last To)) (if (and {(= 0 (count Sites in:(intersection (sites {(last To) (last From)}) (sites Occupied by:All components:{""Launcher"" ""Artillery"" ""Battleship"" ""Antiair""})))) (if (is In (last To) (sites Occupied by:Enemy components:{""Bomber"" ""Battleship"" ""Artillery"" ""Launcher""})) (is In (last From) (union (sites Occupied by:Mover components:{""Soldier"" ""Motorbike"" ""Tank"" ""Speeder"" ""Shooter"" ""Launcher"" ""Antiair"" ""Battleship"" ""Artillery"" ""Base"" ""Town"" ""Factory"" ""Dock"" ""Airport"" ""Cruiser"" ""Submarine""}) (sites Occupied by:Neutral container:""Board""))) (is In (last From) (union (sites Occupied by:Mover) (sites Occupied by:Neutral container:""Board"")))) (if (is In (last To) (sites Occupied by:Enemy components:{""Antiair"" ""Fighter""})) (is In (last From) (sites Occupied by:Mover components:{""Fighter"" ""Helicopter"" ""Bomber""})) (is In (last From) (union (sites Occupied by:Mover) (sites Occupied by:Neutral container:""Board"")))) (if (is In (last To) (sites Occupied by:Enemy components:{""Submarine""})) (is In (last From) (sites Occupied by:Mover components:{""Submarine"" ""Battleship"" ""Cruiser""})) (is In (last From) (union (sites Occupied by:Mover) (sites Occupied by:Neutral container:""Board""))))}) (if (<= (- (value Piece at:(last From)) (/ (* (if (is In (last From) (sites Occupied by:All container:""Board"" components:{""Fighter"" ""Bomber"" ""Helicopter""})) (max (/ (* (* (value Piece at:(last To)) 4) (mapEntry ""DamageMultiplier"" (what at:(last To)))) 100) 1) (if (and (is In (last From) (sites Occupied by:All container:""Board"" components:{""Soldier"" ""Motorbike""})) (is In (last To) (sites Occupied by:All component:""Shooter""))) (if (is In (last From) (sites ""Forest"")) (max (/ (* (* (value Piece at:(last To)) 6) (mapEntry ""DamageMultiplier"" (what at:(last To)))) 100) 1) (if (is In (last From) (union (sites ""ShallowWater"") (sites ""DeepWater""))) (max (/ (* (* (value Piece at:(last To)) 10) (mapEntry ""DamageMultiplier"" (what at:(last To)))) 100) 1) (max (/ (* (* (value Piece at:(last To)) 8) (mapEntry ""DamageMultiplier"" (what at:(last To)))) 100) 1))) (if (is In (last From) (sites ""Forest"")) (max (/ (* (* (value Piece at:(last To)) 3) (mapEntry ""DamageMultiplier"" (what at:(last To)))) 100) 1) (if (is In (last From) (union (sites ""ShallowWater"") (sites ""DeepWater""))) (max (/ (* (* (value Piece at:(last To)) 5) (mapEntry ""DamageMultiplier"" (what at:(last To)))) 100) 1) (max (/ (* (* (value Piece at:(last To)) 4) (mapEntry ""DamageMultiplier"" (what at:(last To)))) 100) 1))))) (* {(if (is In (last To) (sites Occupied by:All container:""Board"" components:{""Soldier"" ""Motorbike""})) (if (= (who at:(last To)) 1) (mapEntry ""NoDoctrine"" 1) (if (= (who at:(last To)) 2) (mapEntry ""NoDoctrine"" 1) (if (= (who at:(last To)) 3) (mapEntry ""NoDoctrine"" 1) (if (= (who at:(last To)) 4) (mapEntry ""NoDoctrine"" 1) 0)))) (if (is In (last To) (sites Occupied by:All container:""Board"" components:{""Tank"" ""Speeder"" ""Shooter""})) (if (= (who at:(last To)) 1) (mapEntry ""NoDoctrine"" 2) (if (= (who at:(last To)) 2) (mapEntry ""NoDoctrine"" 2) (if (= (who at:(last To)) 3) (mapEntry ""NoDoctrine"" 2) (if (= (who at:(last To)) 4) (mapEntry ""NoDoctrine"" 2) 0)))) (if (is In (last To) (sites Occupied by:All container:""Board"" components:{""Launcher"" ""Antiair"" ""Artillery""})) (if (= (who at:(last To)) 1) (mapEntry ""NoDoctrine"" 3) (if (= (who at:(last To)) 2) (mapEntry ""NoDoctrine"" 3) (if (= (who at:(last To)) 3) (mapEntry ""NoDoctrine"" 3) (if (= (who at:(last To)) 4) (mapEntry ""NoDoctrine"" 3) 0)))) (if (is In (last To) (sites Occupied by:All container:""Board"" components:{""Fighter"" ""Bomber"" ""Helicopter""})) (if (= (who at:(last To)) 1) (mapEntry ""NoDoctrine"" 4) (if (= (who at:(last To)) 2) (mapEntry ""NoDoctrine"" 4) (if (= (who at:(last To)) 3) (mapEntry ""NoDoctrine"" 4) (if (= (who at:(last To)) 4) (mapEntry ""NoDoctrine"" 4) 0)))) (if (is In (last To) (sites Occupied by:All container:""Board"" components:{""Submarine"" ""Cruiser"" ""Battleship""})) (if (= (who at:(last To)) 1) (mapEntry ""NoDoctrine"" 5) (if (= (who at:(last To)) 2) (mapEntry ""NoDoctrine"" 5) (if (= (who at:(last To)) 3) (mapEntry ""NoDoctrine"" 5) (if (= (who at:(last To)) 4) (mapEntry ""NoDoctrine"" 5) 0)))) 4))))) (if (and (= 8 (state at:(last From))) (!= (mover) (who at:(last From)))) (if (= (who at:(last To)) 1) (mapEntry ""NoDoctrine"" 6) (if (= (who at:(last To)) 2) (mapEntry ""NoDoctrine"" 6) (if (= (who at:(last To)) 3) (mapEntry ""NoDoctrine"" 6) (if (= (who at:(last To)) 4) (mapEntry ""NoDoctrine"" 6) 0)))) 5) (if (> (who at:(last From)) 0) (if (= (who at:(last From)) 1) (mapEntry ""NoDoctrine"" 8) (if (= (who at:(last From)) 2) (mapEntry ""NoDoctrine"" 8) (if (= (who at:(last From)) 3) (mapEntry ""NoDoctrine"" 8) (if (= (who at:(last From)) 4) (mapEntry ""NoDoctrine"" 8) 0)))) 4) (if True (if (= (who at:(last To)) 1) (mapEntry ""NoDoctrine"" 10) (if (= (who at:(last To)) 2) (mapEntry ""NoDoctrine"" 10) (if (= (who at:(last To)) 3) (mapEntry ""NoDoctrine"" 10) (if (= (who at:(last To)) 4) (mapEntry ""NoDoctrine"" 10) 0)))) (if (= (who at:(last To)) 1) (mapEntry ""NoDoctrine"" 9) (if (= (who at:(last To)) 2) (mapEntry ""NoDoctrine"" 9) (if (= (who at:(last To)) 3) (mapEntry ""NoDoctrine"" 9) (if (= (who at:(last To)) 4) (mapEntry ""NoDoctrine"" 9) 0))))) (value Random (range (if (= (who at:(last To)) 1) (mapEntry ""NoDoctrine"" 11) (if (= (who at:(last To)) 2) (mapEntry ""NoDoctrine"" 11) (if (= (who at:(last To)) 3) (mapEntry ""NoDoctrine"" 11) (if (= (who at:(last To)) 4) (mapEntry ""NoDoctrine"" 11) 0)))) (if (= (who at:(last To)) 1) (mapEntry ""NoDoctrine"" 12) (if (= (who at:(last To)) 2) (mapEntry ""NoDoctrine"" 12) (if (= (who at:(last To)) 3) (mapEntry ""NoDoctrine"" 12) (if (= (who at:(last To)) 4) (mapEntry ""NoDoctrine"" 12) 0))))))})) 128000)) 0) (remove (last From)) (set Value at:(last From) (- (value Piece at:(last From)) (/ (* (if (is In (last From) (sites Occupied by:All container:""Board"" components:{""Fighter"" ""Bomber"" ""Helicopter""})) (max (/ (* (* (value Piece at:(last To)) 4) (mapEntry ""DamageMultiplier"" (what at:(last To)))) 100) 1) (if (and (is In (last From) (sites Occupied by:All container:""Board"" components:{""Soldier"" ""Motorbike""})) (is In (last To) (sites Occupied by:All component:""Shooter""))) (if (is In (last From) (sites ""Forest"")) (max (/ (* (* (value Piece at:(last To)) 6) (mapEntry ""DamageMultiplier"" (what at:(last To)))) 100) 1) (if (is In (last From) (union (sites ""ShallowWater"") (sites ""DeepWater""))) (max (/ (* (* (value Piece at:(last To)) 10) (mapEntry ""DamageMultiplier"" (what at:(last To)))) 100) 1) (max (/ (* (* (value Piece at:(last To)) 8) (mapEntry ""DamageMultiplier"" (what at:(last To)))) 100) 1))) (if (is In (last From) (sites ""Forest"")) (max (/ (* (* (value Piece at:(last To)) 3) (mapEntry ""DamageMultiplier"" (what at:(last To)))) 100) 1) (if (is In (last From) (union (sites ""ShallowWater"") (sites ""DeepWater""))) (max (/ (* (* (value Piece at:(last To)) 5) (mapEntry ""DamageMultiplier"" (what at:(last To)))) 100) 1) (max (/ (* (* (value Piece at:(last To)) 4) (mapEntry ""DamageMultiplier"" (what at:(last To)))) 100) 1))))) (* {(if (is In (last To) (sites Occupied by:All container:""Board"" components:{""Soldier"" ""Motorbike""})) (if (= (who at:(last To)) 1) (mapEntry ""NoDoctrine"" 1) (if (= (who at:(last To)) 2) (mapEntry ""NoDoctrine"" 1) (if (= (who at:(last To)) 3) (mapEntry ""NoDoctrine"" 1) (if (= (who at:(last To)) 4) (mapEntry ""NoDoctrine"" 1) 0)))) (if (is In (last To) (sites Occupied by:All container:""Board"" components:{""Tank"" ""Speeder"" ""Shooter""})) (if (= (who at:(last To)) 1) (mapEntry ""NoDoctrine"" 2) (if (= (who at:(last To)) 2) (mapEntry ""NoDoctrine"" 2) (if (= (who at:(last To)) 3) (mapEntry ""NoDoctrine"" 2) (if (= (who at:(last To)) 4) (mapEntry ""NoDoctrine"" 2) 0)))) (if (is In (last To) (sites Occupied by:All container:""Board"" components:{""Launcher"" ""Antiair"" ""Artillery""})) (if (= (who at:(last To)) 1) (mapEntry ""NoDoctrine"" 3) (if (= (who at:(last To)) 2) (mapEntry ""NoDoctrine"" 3) (if (= (who at:(last To)) 3) (mapEntry ""NoDoctrine"" 3) (if (= (who at:(last To)) 4) (mapEntry ""NoDoctrine"" 3) 0)))) (if (is In (last To) (sites Occupied by:All container:""Board"" components:{""Fighter"" ""Bomber"" ""Helicopter""})) (if (= (who at:(last To)) 1) (mapEntry ""NoDoctrine"" 4) (if (= (who at:(last To)) 2) (mapEntry ""NoDoctrine"" 4) (if (= (who at:(last To)) 3) (mapEntry ""NoDoctrine"" 4) (if (= (who at:(last To)) 4) (mapEntry ""NoDoctrine"" 4) 0)))) (if (is In (last To) (sites Occupied by:All container:""Board"" components:{""Submarine"" ""Cruiser"" ""Battleship""})) (if (= (who at:(last To)) 1) (mapEntry ""NoDoctrine"" 5) (if (= (who at:(last To)) 2) (mapEntry ""NoDoctrine"" 5) (if (= (who at:(last To)) 3) (mapEntry ""NoDoctrine"" 5) (if (= (who at:(last To)) 4) (mapEntry ""NoDoctrine"" 5) 0)))) 4))))) (if (and (= 8 (state at:(last From))) (!= (mover) (who at:(last From)))) (if (= (who at:(last To)) 1) (mapEntry ""NoDoctrine"" 6) (if (= (who at:(last To)) 2) (mapEntry ""NoDoctrine"" 6) (if (= (who at:(last To)) 3) (mapEntry ""NoDoctrine"" 6) (if (= (who at:(last To)) 4) (mapEntry ""NoDoctrine"" 6) 0)))) 5) (if (> (who at:(last From)) 0) (if (= (who at:(last From)) 1) (mapEntry ""NoDoctrine"" 8) (if (= (who at:(last From)) 2) (mapEntry ""NoDoctrine"" 8) (if (= (who at:(last From)) 3) (mapEntry ""NoDoctrine"" 8) (if (= (who at:(last From)) 4) (mapEntry ""NoDoctrine"" 8) 0)))) 4) (if True (if (= (who at:(last To)) 1) (mapEntry ""NoDoctrine"" 10) (if (= (who at:(last To)) 2) (mapEntry ""NoDoctrine"" 10) (if (= (who at:(last To)) 3) (mapEntry ""NoDoctrine"" 10) (if (= (who at:(last To)) 4) (mapEntry ""NoDoctrine"" 10) 0)))) (if (= (who at:(last To)) 1) (mapEntry ""NoDoctrine"" 9) (if (= (who at:(last To)) 2) (mapEntry ""NoDoctrine"" 9) (if (= (who at:(last To)) 3) (mapEntry ""NoDoctrine"" 9) (if (= (who at:(last To)) 4) (mapEntry ""NoDoctrine"" 9) 0))))) (value Random (range (if (= (who at:(last To)) 1) (mapEntry ""NoDoctrine"" 11) (if (= (who at:(last To)) 2) (mapEntry ""NoDoctrine"" 11) (if (= (who at:(last To)) 3) (mapEntry ""NoDoctrine"" 11) (if (= (who at:(last To)) 4) (mapEntry ""NoDoctrine"" 11) 0)))) (if (= (who at:(last To)) 1) (mapEntry ""NoDoctrine"" 12) (if (= (who at:(last To)) 2) (mapEntry ""NoDoctrine"" 12) (if (= (who at:(last To)) 3) (mapEntry ""NoDoctrine"" 12) (if (= (who at:(last To)) 4) (mapEntry ""NoDoctrine"" 12) 0))))))})) 128000)))) (set Value at:(last From) (value Piece at:(last From))))))))) (move Select (from (from) if:(and (> (state at:(from)) 0) (< (value Piece at:(from)) (mapEntry ""MaxHealth"" (what at:(from)))))) (to (sites Around (from) Orthogonal if:(is In (to) (sites Occupied by:Mover container:""Board"" components:{""Town"" ""Dock"" ""Base"" ""Factory"" ""Airport""})))) (then (and {(set Value at:(last From) (min (mapEntry ""MaxHealth"" (what at:(last From))) (- (+ (value Piece at:(last From)) (value Piece at:(last To))) 1))) (set Value at:(last To) (max (- (value Piece at:(last To)) (- (mapEntry ""MaxHealth"" (what at:(last From))) (value Piece at:(last From)))) 1)) (set State at:(last From) 0)}))) (move Select (from (from) if:(> (state at:(from)) 0)) (to (sites Around (from) Orthogonal if:(and (= (what at:(from)) (what at:(to))) (< (value Piece at:(to)) (mapEntry ""MaxHealth"" (what at:(to))))))) (then (and {(if (<= (+ (value Piece at:(last To)) (value Piece at:(last From))) (mapEntry ""MaxHealth"" (what at:(last From)))) (and (set Value at:(last To) (min (mapEntry ""MaxHealth"" (what at:(last From))) (+ (value Piece at:(last From)) (value Piece at:(last To))))) (remove (last From))) (and (set Value at:(last To) (min (mapEntry ""MaxHealth"" (what at:(last From))) (- (+ (value Piece at:(last From)) (value Piece at:(last To))) 1))) (set Value at:(last From) (max (- (value Piece at:(last To)) (- (mapEntry ""MaxHealth"" (what at:(last From))) (value Piece at:(last From)))) 1)))) (set State at:(last From) 0) (set State at:(last To) 0)})))})) (piece ""Base"" Neutral) (piece ""Factory"" Neutral) (piece ""Town"" Neutral) (piece ""Airport"" Neutral) (piece ""Dock"" Neutral) (piece ""Soldier"" Neutral) (piece ""Motorbike"" Neutral) (piece ""Speeder"" Neutral) (piece ""Shooter"" Neutral) (piece ""Tank"" Neutral) (piece ""Antiair"" Neutral) (piece ""Launcher"" Neutral) (piece ""Artillery"" Neutral) (piece ""Helicopter"" Neutral) (piece ""Fighter"" Neutral) (piece ""Bomber"" Neutral) (piece ""Cruiser"" Neutral) (piece ""Submarine"" Neutral) (piece ""Battleship"" Neutral) (map ""Movement"" {(pair 1 8) (pair 2 8) (pair 3 8) (pair 4 8) (pair 5 8) (pair 6 8) (pair 7 8) (pair 8 8) (pair 9 8) (pair 10 8) (pair 11 4) (pair 12 4) (pair 13 6) (pair 14 6) (pair 15 7) (pair 16 7) (pair 17 5) (pair 18 5) (pair 19 5) (pair 20 5) (pair 21 5) (pair 22 5) (pair 23 4) (pair 24 4) (pair 25 4) (pair 26 4) (pair 27 5) (pair 28 5) (pair 29 7) (pair 30 7) (pair 31 6) (pair 32 6) (pair 33 6) (pair 34 6) (pair 35 6) (pair 36 6) (pair 37 5) (pair 38 5) (pair 39 8) (pair 40 8) (pair 41 8) (pair 42 8) (pair 43 8)}) (map ""MaxHealth"" {(pair 1 100) (pair 2 100) (pair 3 100) (pair 4 100) (pair 5 100) (pair 6 100) (pair 7 100) (pair 8 100) (pair 9 100) (pair 10 100) (pair 11 30) (pair 12 30) (pair 13 40) (pair 14 40) (pair 15 60) (pair 16 60) (pair 17 60) (pair 18 60) (pair 19 80) (pair 20 80) (pair 21 50) (pair 22 50) (pair 23 50) (pair 24 50) (pair 25 40) (pair 26 40) (pair 27 40) (pair 28 40) (pair 29 100) (pair 30 100) (pair 31 100) (pair 32 100) (pair 33 70) (pair 34 70) (pair 35 100) (pair 36 100) (pair 37 120) (pair 38 120) (pair 39 100) (pair 40 100) (pair 41 100) (pair 42 100) (pair 43 100)}) (map ""DamageMultiplier"" {(pair 1 0) (pair 2 0) (pair 3 0) (pair 4 0) (pair 5 0) (pair 6 0) (pair 7 0) (pair 8 0) (pair 9 0) (pair 10 0) (pair 11 50) (pair 12 50) (pair 13 50) (pair 14 50) (pair 15 40) (pair 16 40) (pair 17 40) (pair 18 40) (pair 19 50) (pair 20 50) (pair 21 100) (pair 22 100) (pair 23 50) (pair 24 50) (pair 25 100) (pair 26 100) (pair 27 70) (pair 28 70) (pair 29 100) (pair 30 100) (pair 31 80) (pair 32 80) (pair 33 50) (pair 34 50) (pair 35 80) (pair 36 80) (pair 37 50) (pair 38 50) (pair 39 0) (pair 40 0) (pair 41 0) (pair 42 0) (pair 43 0)}) (map ""NoDoctrine"" {(pair 1 4) (pair 2 4) (pair 3 4) (pair 4 4) (pair 5 4) (pair 6 5) (pair 7 4) (pair 8 4) (pair 9 4) (pair 10 4) (pair 11 100) (pair 12 100)}) (map ""SpecialForces"" {(pair 1 6) (pair 2 3) (pair 3 3) (pair 4 3) (pair 5 3) (pair 6 5) (pair 7 4) (pair 8 4) (pair 9 4) (pair 10 4) (pair 11 100) (pair 12 100)}) (map ""BruteStrength"" {(pair 1 3) (pair 2 6) (pair 3 3) (pair 4 3) (pair 5 3) (pair 6 5) (pair 7 4) (pair 8 4) (pair 9 4) (pair 10 4) (pair 11 100) (pair 12 100)}) (map ""Sharpshooter"" {(pair 1 3) (pair 2 3) (pair 3 6) (pair 4 3) (pair 5 3) (pair 6 5) (pair 7 4) (pair 8 4) (pair 9 4) (pair 10 4) (pair 11 100) (pair 12 100)}) (map ""AcePilot"" {(pair 1 3) (pair 2 3) (pair 3 3) (pair 4 6) (pair 5 3) (pair 6 5) (pair 7 4) (pair 8 4) (pair 9 4) (pair 10 4) (pair 11 100) (pair 12 100)}) (map ""SeaDog"" {(pair 1 3) (pair 2 3) (pair 3 3) (pair 4 3) (pair 5 6) (pair 6 5) (pair 7 4) (pair 8 4) (pair 9 4) (pair 10 4) (pair 11 100) (pair 12 100)}) (map ""GuerrillaWarfare"" {(pair 1 3) (pair 2 3) (pair 3 3) (pair 4 3) (pair 5 3) (pair 6 10) (pair 7 4) (pair 8 4) (pair 9 4) (pair 10 4) (pair 11 100) (pair 12 100)}) (map ""ForeignInvader"" {(pair 1 5) (pair 2 5) (pair 3 5) (pair 4 5) (pair 5 5) (pair 6 2) (pair 7 4) (pair 8 4) (pair 9 4) (pair 10 4) (pair 11 100) (pair 12 100)}) (map ""Conscription"" {(pair 1 2) (pair 2 2) (pair 3 2) (pair 4 2) (pair 5 2) (pair 6 5) (pair 7 2) (pair 8 4) (pair 9 4) (pair 10 4) (pair 11 100) (pair 12 100)}) (map ""EliteTraining"" {(pair 1 6) (pair 2 6) (pair 3 6) (pair 4 6) (pair 5 6) (pair 6 5) (pair 7 6) (pair 8 4) (pair 9 4) (pair 10 4) (pair 11 100) (pair 12 100)}) (map ""GlassCannon"" {(pair 1 6) (pair 2 6) (pair 3 6) (pair 4 6) (pair 5 6) (pair 6 5) (pair 7 4) (pair 8 6) (pair 9 4) (pair 10 4) (pair 11 100) (pair 12 100)}) (map ""HardenedResolve"" {(pair 1 2) (pair 2 2) (pair 3 2) (pair 4 2) (pair 5 2) (pair 6 5) (pair 7 4) (pair 8 2) (pair 9 4) (pair 10 4) (pair 11 100) (pair 12 100)}) (map ""PreemptiveStrike"" {(pair 1 4) (pair 2 4) (pair 3 4) (pair 4 4) (pair 5 4) (pair 6 5) (pair 7 4) (pair 8 4) (pair 9 6) (pair 10 0) (pair 11 100) (pair 12 100)}) (map ""Retaliation"" {(pair 1 4) (pair 2 4) (pair 3 4) (pair 4 4) (pair 5 4) (pair 6 5) (pair 7 4) (pair 8 4) (pair 9 2) (pair 10 8) (pair 11 100) (pair 12 100)}) (map ""LadyLuck"" {(pair 1 4) (pair 2 4) (pair 3 4) (pair 4 4) (pair 5 4) (pair 6 5) (pair 7 4) (pair 8 4) (pair 9 4) (pair 10 4) (pair 11 50) (pair 12 150)})}) (rules (meta (passEnd NoEnd)) (start {(place ""Base1"" (sites {""C7""}) state:8 value:100) (place ""Base2"" (sites {""G3""}) state:8 value:100) (place ""Airport0"" (sites {""H8""}) state:8 value:100) (place ""Dock0"" (sites {""C2""}) state:8 value:100) (place ""Town2"" (sites {""I5"" ""I6""}) state:8 value:100) (place ""Town1"" (sites {""E9"" ""F9""}) state:8 value:100) (place ""Factory0"" (sites {""C5"" ""F4""}) state:8 value:100) (set Team 1 {P1}) (set Team 2 {P2}) (set Score Each 100) (place ""Soldier0"" (handSite Shared 0) count:30 state:1 value:30) (place ""Motorbike0"" (handSite Shared 1) count:50 state:1 value:40) (place ""Speeder0"" (handSite Shared 2) count:60 state:1 value:60) (place ""Shooter0"" (handSite Shared 3) count:80 state:1 value:60) (place ""Tank0"" (handSite Shared 4) count:100 state:1 value:80) (place ""Antiair0"" (handSite Shared 5) count:80 state:1 value:50) (place ""Launcher0"" (handSite Shared 6) count:80 state:1 value:50) (place ""Artillery0"" (handSite Shared 7) count:100 state:1 value:40) (place ""Helicopter0"" (handSite Shared 8) count:60 state:1 value:40) (place ""Fighter0"" (handSite Shared 9) count:100 state:1 value:100) (place ""Bomber0"" (handSite Shared 10) count:120 state:1 value:100) (place ""Cruiser0"" (handSite Shared 11) count:60 state:1 value:70) (place ""Submarine0"" (handSite Shared 12) count:100 state:1 value:100) (place ""Battleship0"" (handSite Shared 13) count:120 state:1 value:120)}) (play (or (or {(forEach Piece) (forEach Site (sites Occupied by:Neutral container:1 components:{""Soldier"" ""Motorbike""}) (move (from (site)) (to (difference (sites Around (sites Occupied by:Mover component:""Town"") Orthogonal) (sites ""DeepWater"")) if:(and (is Empty (to)) (<= (/ (* (count at:(site)) (if (= (mover) 1) (mapEntry ""NoDoctrine"" 7) (if (= (mover) 2) (mapEntry ""NoDoctrine"" 7) (if (= (mover) 3) (mapEntry ""NoDoctrine"" 7) (if (= (mover) 4) (mapEntry ""NoDoctrine"" 7) 0))))) 4) (score Mover)))) copy:True (then (and {(addScore Mover (- (/ (* (count at:(last From)) (if (= (mover) 1) (mapEntry ""NoDoctrine"" 7) (if (= (mover) 2) (mapEntry ""NoDoctrine"" 7) (if (= (mover) 3) (mapEntry ""NoDoctrine"" 7) (if (= (mover) 4) (mapEntry ""NoDoctrine"" 7) 0))))) 4))) (take Control of:All by:Mover at:(last To)) (set State at:(last To) 0)})))) (forEach Site (sites Occupied by:Neutral container:1 components:{""Cruiser"" ""Submarine"" ""Battleship""}) (move (from (site)) (to (difference (sites Around (sites Occupied by:Mover component:""Dock"") Orthogonal) (union (sites ""Mountain"") (difference (sites Board) (union (sites ""ShallowWater"") (sites ""DeepWater""))))) if:(and (is Empty (to)) (<= (/ (* (count at:(site)) (if (= (mover) 1) (mapEntry ""NoDoctrine"" 7) (if (= (mover) 2) (mapEntry ""NoDoctrine"" 7) (if (= (mover) 3) (mapEntry ""NoDoctrine"" 7) (if (= (mover) 4) (mapEntry ""NoDoctrine"" 7) 0))))) 4) (score Mover)))) copy:True (then (and {(addScore Mover (- (/ (* (count at:(last From)) (if (= (mover) 1) (mapEntry ""NoDoctrine"" 7) (if (= (mover) 2) (mapEntry ""NoDoctrine"" 7) (if (= (mover) 3) (mapEntry ""NoDoctrine"" 7) (if (= (mover) 4) (mapEntry ""NoDoctrine"" 7) 0))))) 4))) (take Control of:All by:Mover at:(last To)) (set State at:(last To) 0)})))) (forEach Site (sites Occupied by:Neutral container:1 components:{""Helicopter"" ""Fighter"" ""Bomber""}) (move (from (site)) (to (sites Around (sites Occupied by:Mover component:""Airport"") Orthogonal) if:(and (is Empty (to)) (<= (/ (* (count at:(site)) (if (= (mover) 1) (mapEntry ""NoDoctrine"" 7) (if (= (mover) 2) (mapEntry ""NoDoctrine"" 7) (if (= (mover) 3) (mapEntry ""NoDoctrine"" 7) (if (= (mover) 4) (mapEntry ""NoDoctrine"" 7) 0))))) 4) (score Mover)))) copy:True (then (and {(addScore Mover (- (/ (* (count at:(last From)) (if (= (mover) 1) (mapEntry ""NoDoctrine"" 7) (if (= (mover) 2) (mapEntry ""NoDoctrine"" 7) (if (= (mover) 3) (mapEntry ""NoDoctrine"" 7) (if (= (mover) 4) (mapEntry ""NoDoctrine"" 7) 0))))) 4))) (take Control of:All by:Mover at:(last To)) (set State at:(last To) 0)})))) (forEach Site (sites Occupied by:Neutral container:1 components:{""Speeder"" ""Shooter"" ""Tank"" ""Antiair"" ""Launcher"" ""Artillery""}) (move (from (site)) (to (difference (sites Around (sites Occupied by:Mover component:""Factory"") Orthogonal) (union (sites ""Mountain"") (sites ""DeepWater""))) if:(and (is Empty (to)) (<= (/ (* (count at:(site)) (if (= (mover) 1) (mapEntry ""NoDoctrine"" 7) (if (= (mover) 2) (mapEntry ""NoDoctrine"" 7) (if (= (mover) 3) (mapEntry ""NoDoctrine"" 7) (if (= (mover) 4) (mapEntry ""NoDoctrine"" 7) 0))))) 4) (score Mover)))) copy:True (then (and {(addScore Mover (- (/ (* (count at:(last From)) (if (= (mover) 1) (mapEntry ""NoDoctrine"" 7) (if (= (mover) 2) (mapEntry ""NoDoctrine"" 7) (if (= (mover) 3) (mapEntry ""NoDoctrine"" 7) (if (= (mover) 4) (mapEntry ""NoDoctrine"" 7) 0))))) 4))) (take Control of:All by:Mover at:(last To)) (set State at:(last To) 0)}))))} (then (and {(forEach Player (if (and {(is Active Player) (> (count Active) 2) (= (where ""Base"" Player) -1)}) (forEach Site (sites Occupied by:Player) (if (is In (site) (sites Occupied by:Player components:{""Town"" ""Base"" ""Factory"" ""Dock"" ""Airport""})) (take Control of:All by:Neutral at:(site)) (remove (site)))))) (moveAgain) (and {})}))) (move Pass (then (and {(forEach Site (sites Occupied by:Mover container:""Board"") (set State at:(site) (mapEntry ""Movement"" (what at:(site))))) (set Score Mover (+ {(* (count Sites in:(sites Occupied by:Mover component:""Base"")) 20) (* (count Sites in:(sites Occupied by:Mover component:""Town"")) 10) (score Mover)})) (forEach Site (sites Occupied by:Mover components:{""Town"" ""Base"" ""Factory"" ""Dock"" ""Airport""}) (set Value at:(site) (min (mapEntry ""MaxHealth"" (what at:(site))) (+ (value Piece at:(site)) 10)))) (and {})}))))) (end (forEach NonMover if:(= (where ""Base"" Player) -1) (result Player Loss)))))" "The two players take turns moving stacks of their own color (including singletons - stacks of height one), one stack per turn. Players will always have a move available and must make one. OBJECT OF THE GAME: Kill the enemy queen, or deprive your opponent of moves. The pie rule is used in Monkey Queen. Each player will always have exactly one queen monkey on the board which is a stack of two or more checkers all of the player's own color. Additionally, each player may have one or more baby monkeys on the board which are singletons of his own color. CAPTURING QUEEN MOVES - A monkey queen captures exactly like a Chess queen. Slide the entire stack in any direction (horizontally, vertically or diagonally) along a straight sequence of unoccupied squares terminated by an enemy occupied square, and capture the enemy queen or baby by replacement. NOTE: A queen may not give birth to its own baby and kill an enemy baby in the same move. NOTE: A queen of height two may not make a non-capturing move. NON-CAPTURING QUEEN MOVES - When not capturing, a queen moves any distance in any one direction, exactly like a Chess queen, except it leaves its bottom checker behind on the originating square, reducing the stack height by one. The queen monkey has thus given birth to a baby monkey. CAPTURING BABY MOVES - A monkey baby, like a monkey queen, captures exactly like a Chess queen. Slide the baby (singleton) in any direction along a straight sequence of unoccupied squares terminated by an enemy occupied square, and capture the enemy queen or baby by replacement. NON-CAPTURING BABY MOVES - When not capturing, a baby must move toward the enemy queen in the following sense: The straight line distance between your baby and the enemy queen must be shortened by your move. NOTE: There's no requirement to make a kill in Monkey Queen.","(game ""Monkey Queen"" (players 2) (equipment {(board (square 12)) (piece ""Marker"" (or {(move Slide (to if:(is Enemy (who at:(to))) (apply if:(is Enemy (who at:(to))) (remove (to) count:(size Stack at:(to))))) stack:True (then (if (< 1 (size Stack at:(last To))) (set Value Mover (last To))))) (if (< 2 (size Stack at:(from))) (move Slide stack:True (then (and (fromTo (from (last To) level:0) (to (last From))) (set Value Mover (last To)))))) (if (= 1 (size Stack at:(from))) (move Slide (between if:(and (< (count Steps (to) (value Player Next)) (count Steps (from) (value Player Next))) (is Empty (between))))))}))}) (rules (meta (swap)) (start {(place Stack ""Marker1"" 6 count:20) (place Stack ""Marker2"" 137 count:20)}) (play (forEach Piece top:True)) (end (if (or (all Sites (sites Occupied by:Next) if:(= 1 (size Stack at:(site)))) (no Moves Next)) (result Mover Win)))))","###Description The two players take turns moving stacks of their own color (including singletons - stacks of height one), one stack per turn. Players will always have a move available and must make one. OBJECT OF THE GAME: Kill the enemy queen, or deprive your opponent of moves. The pie rule is used in Monkey Queen. Each player will always have exactly one queen monkey on the board which is a stack of two or more checkers all of the player's own color. Additionally, each player may have one or more baby monkeys on the board which are singletons of his own color. CAPTURING QUEEN MOVES - A monkey queen captures exactly like a Chess queen. Slide the entire stack in any direction (horizontally, vertically or diagonally) along a straight sequence of unoccupied squares terminated by an enemy occupied square, and capture the enemy queen or baby by replacement. NOTE: A queen may not give birth to its own baby and kill an enemy baby in the same move. NOTE: A queen of height two may not make a non-capturing move. NON-CAPTURING QUEEN MOVES - When not capturing, a queen moves any distance in any one direction, exactly like a Chess queen, except it leaves its bottom checker behind on the originating square, reducing the stack height by one. The queen monkey has thus given birth to a baby monkey. CAPTURING BABY MOVES - A monkey baby, like a monkey queen, captures exactly like a Chess queen. Slide the baby (singleton) in any direction along a straight sequence of unoccupied squares terminated by an enemy occupied square, and capture the enemy queen or baby by replacement. NON-CAPTURING BABY MOVES - When not capturing, a baby must move toward the enemy queen in the following sense: The straight line distance between your baby and the enemy queen must be shortened by your move. NOTE: There's no requirement to make a kill in Monkey Queen. @@ -5129,11 +4954,6 @@ The goal is to capture the enemy Commander, or reduce the opponent army to a sin ###Ludii (game ""Ploy"" (players 2) (equipment {(board (square 9) use:Vertex) (piece ""Commander"" Each (or (move Step (directions {FR FL BL BR} of:All) (to if:(not (is Friend (who at:(to)))) (apply (remove (to))))) (move Set Rotation))) (piece ""Shield"" Each (or (move Step (directions Forward of:All) (to if:(not (is Friend (who at:(to)))) (apply (remove (to)))) (then (moveAgain))) (move Set Rotation))) (piece ""LanceW"" Each (or (move Slide (directions Forwards of:All) (between (max 3)) (to if:(is Enemy (who at:(to))) (apply (remove (to))))) (move Set Rotation))) (piece ""LanceY"" Each (or (move Slide (directions {FR FL Backward} of:All) (between (max 3)) (to if:(is Enemy (who at:(to))) (apply (remove (to))))) (move Set Rotation))) (piece ""LanceT"" Each (or (move Slide (directions {Forward Rightward Leftward} of:All) (between (max 3)) (to if:(is Enemy (who at:(to))) (apply (remove (to))))) (move Set Rotation))) (piece ""ProbeI"" Each (or (move Slide (directions {Forward Backward} of:All) (between (max 2)) (to if:(is Enemy (who at:(to))) (apply (remove (to))))) (move Set Rotation))) (piece ""ProbeMinV"" Each (or (move Slide (directions {Forward FR} of:All) (between (max 2)) (to if:(is Enemy (who at:(to))) (apply (remove (to))))) (move Set Rotation))) (piece ""ProbeBigV"" Each (or (move Slide (directions {FR FL} of:All) (between (max 2)) (to if:(is Enemy (who at:(to))) (apply (remove (to))))) (move Set Rotation)))}) (rules (start {(place ""Commander1"" coord:""E1"" rotation:0) (place ""Shield1"" {""D3"" ""E3"" ""F3""} rotation:0) (place ""ProbeI1"" coord:""E2"" rotation:0) (place ""ProbeBigV1"" {""D2"" ""F2""} rotation:0) (place ""ProbeMinV1"" coord:""C2"" rotation:0) (place ""ProbeMinV1"" coord:""G2"" rotation:7) (place ""LanceW1"" {""D1"" ""F1""} rotation:0) (place ""LanceY1"" {""C1"" ""G1""} rotation:0) (place ""LanceT1"" {""B1"" ""H1""} rotation:0) (place ""Commander2"" coord:""E9"" rotation:4) (place ""Shield2"" {""D7"" ""E7"" ""F7""} rotation:4) (place ""ProbeI2"" coord:""E8"" rotation:4) (place ""ProbeBigV2"" {""D8"" ""F8""} rotation:4) (place ""ProbeMinV2"" coord:""C8"" rotation:3) (place ""ProbeMinV2"" coord:""G8"" rotation:4) (place ""LanceW2"" {""D9"" ""F9""} rotation:4) (place ""LanceY2"" {""C9"" ""G9""} rotation:4) (place ""LanceT2"" {""B9"" ""H9""} rotation:4)}) (play (if (is Prev Mover) (or (move Set Rotation (to (last To))) (move Pass)) (forEach Piece))) (end (if (or (= (where ""Commander"" Next) -1) (= (count Pieces Next) 1)) (result Mover Win)))))" -"8x16 board. Two players, one black, one white. Each player has three types of pieces: Circles, triangle, squares, and one pyramid made up of multiple pieces stacked. Circles move one space orthogonally. Triangles move two spaces diagonally. Squares move three spaces orthogonally. Pyramids may move in any of the directions allowed by one of its constituent pieces. Each piece has a number. For white—circles: 2, 4, 6, 8, 4, 16, 36, 64; triangles: 6, 20 , 42, 72, 9, 25, 49, 81; squares: 15, 45, 153, 25, 81, 169, 289; pyramid (91) from the base: square 36, square 25, triangle 16, triangle 9, circle 4, circle 1. For black—circles: 3, 5, 7, 9, 9, 25, 49, 81; triangles: 12, 30, 56, 90, 16, 36, 64, 100; squares: 28, 66, 120, 49, 121, 225, 361; pyramid (190): from the base: square 64, square 49, triangle 36, triangle 25, circle 16. Pieces capture other pieces by mathematical allowances based on the numbers on the pieces. There are nine scenarios in which pieces can be taken when a piece moves to a space occupied by an opponent's piece. Multiplication with distance: If the value of the piece to be taken equals the value of the piece making the capture multiplied by the distance between the two pieces; Division by distance: If the value of the piece to be taken equals the value of the piece making the capture divided by the distance between the pieces. Addition: When two pieces can both move to the space of an opponent's piece, if the sum of the two pieces equals the value of the opponent's piece, it is captured and the player chooses which piece to move to that space. Subtraction: When two pieces can both move to the space of an opponent's piece, if the difference between the value of these pieces equals the value of the opponent's piece, it is taken, and the player chooses which piece to move to the space. Multiplication: When two pieces can both move to the space of an opponent's piece, if the product of the values of the two pieces equals the value of the opponent's piece, it is taken and the player chooses which piece to move to the space. Division: When two pieces can both move to the space of an opponent's piece, if the quotient of the values of the two pieces equals the value of the opponent's piece, it is taken and the player chooses which piece to move to the space. Encirclement: If pieces are positioned such that there is no possible move or capture for the opponent's piece, the opponent's piece is taken. Pyramid capture: A pyramid can be captured by capturing its constituent pieces one-by-one according to the above methods; by encircling it so it cannot move, or by obtaining the sum of the constituent pieces or of its base pieces according to the above rules; A pyramid captures as a single one of its component pieces according to the above rules (the direction of the move is independent of the value chosen), or by using the sum of its pieces according to the above rules. The goal of the game is to capture the opponent's pyramid and to create an alignment on the opponent's half of the board forming a mathematical progression. The progression may be arithmetic (a sequence where the difference between the values is constant), geometric (where each value after the first is determined by multiplying the previous value by a fixed number), or harmonic (1/a, 1/a+d, 1/a+2d, 1/a+3d). The pieces in the progression must be in a straight orthogonal or diagonal line or in a chevron shape, and must be equally spaced.","(game ""Rithmomachia"" (players 2) (equipment {(board (rectangle 16 8)) (piece ""Square"" Each (move Slide Orthogonal (between (exact 3) if:(is Empty (between))) (to if:(and (is Enemy (who at:(to))) (or {(= (value Piece at:(to) level:0) (* (value Piece at:(from) level:(level)) (count Steps (from) (to)))) (= (value Piece at:(to) level:0) (/ (value Piece at:(from) level:(level)) (count Steps (from) (to)))) (!= 0 (count Sites in:(forEach (sites Occupied by:Mover) if:(and {(!= (from) (site)) (is In (to) (sites To (forEach Level (site) FromBottom (if (= (what at:(site) level:(level)) (id ""Disc"" Mover)) (step (from (site) level:(level)) Orthogonal (to if:(not (is Friend (who at:(to)))))) (if (= (what at:(site) level:(level)) (id ""Triangle"" Mover)) (slide (from (site) level:(level)) Diagonal (between (exact 2) if:(is Empty (between))) (to if:(is Enemy (who at:(to))))) (if (= (what at:(site) level:(level)) (id ""Square"" Mover)) (slide (from (site) level:(level)) Orthogonal (between (exact 3) if:(is Empty (between))) (to if:(is Enemy (who at:(to))))))))))) (= (value Piece at:(to) level:0) (+ (value Piece at:(from) level:(level)) (value Piece at:(site))))})))) (!= 0 (count Sites in:(forEach (sites Occupied by:Mover) if:(and {(!= (from) (site)) (is In (to) (sites To (forEach Level (site) FromBottom (if (= (what at:(site) level:(level)) (id ""Disc"" Mover)) (step (from (site) level:(level)) Orthogonal (to if:(not (is Friend (who at:(to)))))) (if (= (what at:(site) level:(level)) (id ""Triangle"" Mover)) (slide (from (site) level:(level)) Diagonal (between (exact 2) if:(is Empty (between))) (to if:(is Enemy (who at:(to))))) (if (= (what at:(site) level:(level)) (id ""Square"" Mover)) (slide (from (site) level:(level)) Orthogonal (between (exact 3) if:(is Empty (between))) (to if:(is Enemy (who at:(to))))))))))) (= (value Piece at:(to) level:0) (abs (- (value Piece at:(from) level:(level)) (value Piece at:(site)))))})))) (!= 0 (count Sites in:(forEach (sites Occupied by:Mover) if:(and {(!= (from) (site)) (is In (to) (sites To (forEach Level (site) FromBottom (if (= (what at:(site) level:(level)) (id ""Disc"" Mover)) (step (from (site) level:(level)) Orthogonal (to if:(not (is Friend (who at:(to)))))) (if (= (what at:(site) level:(level)) (id ""Triangle"" Mover)) (slide (from (site) level:(level)) Diagonal (between (exact 2) if:(is Empty (between))) (to if:(is Enemy (who at:(to))))) (if (= (what at:(site) level:(level)) (id ""Square"" Mover)) (slide (from (site) level:(level)) Orthogonal (between (exact 3) if:(is Empty (between))) (to if:(is Enemy (who at:(to))))))))))) (= (value Piece at:(to) level:0) (* (value Piece at:(from) level:(level)) (value Piece at:(site))))})))) (!= 0 (count Sites in:(forEach (sites Occupied by:Mover) if:(and {(!= (from) (site)) (is In (to) (sites To (forEach Level (site) FromBottom (if (= (what at:(site) level:(level)) (id ""Disc"" Mover)) (step (from (site) level:(level)) Orthogonal (to if:(not (is Friend (who at:(to)))))) (if (= (what at:(site) level:(level)) (id ""Triangle"" Mover)) (slide (from (site) level:(level)) Diagonal (between (exact 2) if:(is Empty (between))) (to if:(is Enemy (who at:(to))))) (if (= (what at:(site) level:(level)) (id ""Square"" Mover)) (slide (from (site) level:(level)) Orthogonal (between (exact 3) if:(is Empty (between))) (to if:(is Enemy (who at:(to))))))))))) (or (and (!= 0 (value Piece at:(site))) (= (value Piece at:(to)) (/ (value Piece at:(from) level:(level)) (value Piece at:(site))))) (and (!= 0 (value Piece at:(from))) (= (value Piece at:(to)) (/ (value Piece at:(site) level:(level)) (value Piece at:(from))))))}))))})) (apply (if (is Enemy (who at:(to))) (forEach Level (to) FromTop (remove (to) level:(level)))))) stack:True)) (piece ""Triangle"" Each (move Slide Diagonal (between (exact 2) if:(is Empty (between))) (to if:(and (is Enemy (who at:(to))) (or {(= (value Piece at:(to) level:0) (* (value Piece at:(from) level:(level)) (count Steps (from) (to)))) (= (value Piece at:(to) level:0) (/ (value Piece at:(from) level:(level)) (count Steps (from) (to)))) (!= 0 (count Sites in:(forEach (sites Occupied by:Mover) if:(and {(!= (from) (site)) (is In (to) (sites To (forEach Level (site) FromBottom (if (= (what at:(site) level:(level)) (id ""Disc"" Mover)) (step (from (site) level:(level)) Orthogonal (to if:(not (is Friend (who at:(to)))))) (if (= (what at:(site) level:(level)) (id ""Triangle"" Mover)) (slide (from (site) level:(level)) Diagonal (between (exact 2) if:(is Empty (between))) (to if:(is Enemy (who at:(to))))) (if (= (what at:(site) level:(level)) (id ""Square"" Mover)) (slide (from (site) level:(level)) Orthogonal (between (exact 3) if:(is Empty (between))) (to if:(is Enemy (who at:(to))))))))))) (= (value Piece at:(to) level:0) (+ (value Piece at:(from) level:(level)) (value Piece at:(site))))})))) (!= 0 (count Sites in:(forEach (sites Occupied by:Mover) if:(and {(!= (from) (site)) (is In (to) (sites To (forEach Level (site) FromBottom (if (= (what at:(site) level:(level)) (id ""Disc"" Mover)) (step (from (site) level:(level)) Orthogonal (to if:(not (is Friend (who at:(to)))))) (if (= (what at:(site) level:(level)) (id ""Triangle"" Mover)) (slide (from (site) level:(level)) Diagonal (between (exact 2) if:(is Empty (between))) (to if:(is Enemy (who at:(to))))) (if (= (what at:(site) level:(level)) (id ""Square"" Mover)) (slide (from (site) level:(level)) Orthogonal (between (exact 3) if:(is Empty (between))) (to if:(is Enemy (who at:(to))))))))))) (= (value Piece at:(to) level:0) (abs (- (value Piece at:(from) level:(level)) (value Piece at:(site)))))})))) (!= 0 (count Sites in:(forEach (sites Occupied by:Mover) if:(and {(!= (from) (site)) (is In (to) (sites To (forEach Level (site) FromBottom (if (= (what at:(site) level:(level)) (id ""Disc"" Mover)) (step (from (site) level:(level)) Orthogonal (to if:(not (is Friend (who at:(to)))))) (if (= (what at:(site) level:(level)) (id ""Triangle"" Mover)) (slide (from (site) level:(level)) Diagonal (between (exact 2) if:(is Empty (between))) (to if:(is Enemy (who at:(to))))) (if (= (what at:(site) level:(level)) (id ""Square"" Mover)) (slide (from (site) level:(level)) Orthogonal (between (exact 3) if:(is Empty (between))) (to if:(is Enemy (who at:(to))))))))))) (= (value Piece at:(to) level:0) (* (value Piece at:(from) level:(level)) (value Piece at:(site))))})))) (!= 0 (count Sites in:(forEach (sites Occupied by:Mover) if:(and {(!= (from) (site)) (is In (to) (sites To (forEach Level (site) FromBottom (if (= (what at:(site) level:(level)) (id ""Disc"" Mover)) (step (from (site) level:(level)) Orthogonal (to if:(not (is Friend (who at:(to)))))) (if (= (what at:(site) level:(level)) (id ""Triangle"" Mover)) (slide (from (site) level:(level)) Diagonal (between (exact 2) if:(is Empty (between))) (to if:(is Enemy (who at:(to))))) (if (= (what at:(site) level:(level)) (id ""Square"" Mover)) (slide (from (site) level:(level)) Orthogonal (between (exact 3) if:(is Empty (between))) (to if:(is Enemy (who at:(to))))))))))) (or (and (!= 0 (value Piece at:(site))) (= (value Piece at:(to)) (/ (value Piece at:(from) level:(level)) (value Piece at:(site))))) (and (!= 0 (value Piece at:(from))) (= (value Piece at:(to)) (/ (value Piece at:(site) level:(level)) (value Piece at:(from))))))}))))})) (apply (if (is Enemy (who at:(to))) (forEach Level (to) FromTop (remove (to) level:(level)))))) stack:True)) (piece ""Disc"" Each (move Step Orthogonal (to if:(if (is Enemy (who at:(to))) (or {(= (value Piece at:(to) level:0) (* (value Piece at:(from) level:(level)) (count Steps (from) (to)))) (= (value Piece at:(to) level:0) (/ (value Piece at:(from) level:(level)) (count Steps (from) (to)))) (!= 0 (count Sites in:(forEach (sites Occupied by:Mover) if:(and {(!= (from) (site)) (is In (to) (sites To (forEach Level (site) FromBottom (if (= (what at:(site) level:(level)) (id ""Disc"" Mover)) (step (from (site) level:(level)) Orthogonal (to if:(not (is Friend (who at:(to)))))) (if (= (what at:(site) level:(level)) (id ""Triangle"" Mover)) (slide (from (site) level:(level)) Diagonal (between (exact 2) if:(is Empty (between))) (to if:(is Enemy (who at:(to))))) (if (= (what at:(site) level:(level)) (id ""Square"" Mover)) (slide (from (site) level:(level)) Orthogonal (between (exact 3) if:(is Empty (between))) (to if:(is Enemy (who at:(to))))))))))) (= (value Piece at:(to) level:0) (+ (value Piece at:(from) level:(level)) (value Piece at:(site))))})))) (!= 0 (count Sites in:(forEach (sites Occupied by:Mover) if:(and {(!= (from) (site)) (is In (to) (sites To (forEach Level (site) FromBottom (if (= (what at:(site) level:(level)) (id ""Disc"" Mover)) (step (from (site) level:(level)) Orthogonal (to if:(not (is Friend (who at:(to)))))) (if (= (what at:(site) level:(level)) (id ""Triangle"" Mover)) (slide (from (site) level:(level)) Diagonal (between (exact 2) if:(is Empty (between))) (to if:(is Enemy (who at:(to))))) (if (= (what at:(site) level:(level)) (id ""Square"" Mover)) (slide (from (site) level:(level)) Orthogonal (between (exact 3) if:(is Empty (between))) (to if:(is Enemy (who at:(to))))))))))) (= (value Piece at:(to) level:0) (abs (- (value Piece at:(from) level:(level)) (value Piece at:(site)))))})))) (!= 0 (count Sites in:(forEach (sites Occupied by:Mover) if:(and {(!= (from) (site)) (is In (to) (sites To (forEach Level (site) FromBottom (if (= (what at:(site) level:(level)) (id ""Disc"" Mover)) (step (from (site) level:(level)) Orthogonal (to if:(not (is Friend (who at:(to)))))) (if (= (what at:(site) level:(level)) (id ""Triangle"" Mover)) (slide (from (site) level:(level)) Diagonal (between (exact 2) if:(is Empty (between))) (to if:(is Enemy (who at:(to))))) (if (= (what at:(site) level:(level)) (id ""Square"" Mover)) (slide (from (site) level:(level)) Orthogonal (between (exact 3) if:(is Empty (between))) (to if:(is Enemy (who at:(to))))))))))) (= (value Piece at:(to) level:0) (* (value Piece at:(from) level:(level)) (value Piece at:(site))))})))) (!= 0 (count Sites in:(forEach (sites Occupied by:Mover) if:(and {(!= (from) (site)) (is In (to) (sites To (forEach Level (site) FromBottom (if (= (what at:(site) level:(level)) (id ""Disc"" Mover)) (step (from (site) level:(level)) Orthogonal (to if:(not (is Friend (who at:(to)))))) (if (= (what at:(site) level:(level)) (id ""Triangle"" Mover)) (slide (from (site) level:(level)) Diagonal (between (exact 2) if:(is Empty (between))) (to if:(is Enemy (who at:(to))))) (if (= (what at:(site) level:(level)) (id ""Square"" Mover)) (slide (from (site) level:(level)) Orthogonal (between (exact 3) if:(is Empty (between))) (to if:(is Enemy (who at:(to))))))))))) (or (and (!= 0 (value Piece at:(site))) (= (value Piece at:(to)) (/ (value Piece at:(from) level:(level)) (value Piece at:(site))))) (and (!= 0 (value Piece at:(from))) (= (value Piece at:(to)) (/ (value Piece at:(site) level:(level)) (value Piece at:(from))))))}))))}) (is Empty (to))) (apply (if (is Enemy (who at:(to))) (forEach Level (to) FromTop (remove (to) level:(level)))))) stack:True)) (regions P1 (expand (sites Bottom) steps:7)) (regions P2 (expand (sites Top) steps:7))}) (rules (start {(place ""Square1"" coord:""A1"" value:289) (place ""Square1"" coord:""B1"" value:169) (place ""Square1"" coord:""G1"" value:81) (place ""Square1"" coord:""H1"" value:25) (place ""Square1"" coord:""A2"" value:153) (place ""Square1"" coord:""G2"" value:45) (place ""Square1"" coord:""H2"" value:15) (place ""Triangle1"" coord:""G3"" value:6) (place ""Triangle1"" coord:""E2"" value:20) (place ""Triangle1"" coord:""D2"" value:42) (place ""Triangle1"" coord:""B3"" value:72) (place ""Triangle1"" coord:""H3"" value:9) (place ""Triangle1"" coord:""F2"" value:25) (place ""Triangle1"" coord:""C2"" value:49) (place ""Triangle1"" coord:""A3"" value:81) (place ""Disc1"" coord:""F4"" value:2) (place ""Disc1"" coord:""E4"" value:4) (place ""Disc1"" coord:""F3"" value:4) (place ""Disc1"" coord:""D4"" value:6) (place ""Disc1"" coord:""C4"" value:8) (place ""Disc1"" coord:""E3"" value:16) (place ""Disc1"" coord:""D3"" value:36) (place ""Disc1"" coord:""C3"" value:64) (place ""Square2"" coord:""H16"" value:361) (place ""Square2"" coord:""G16"" value:225) (place ""Square2"" coord:""B16"" value:121) (place ""Square2"" coord:""A16"" value:49) (place ""Square2"" coord:""G15"" value:120) (place ""Square2"" coord:""B15"" value:66) (place ""Square2"" coord:""A15"" value:28) (place ""Triangle2"" coord:""B14"" value:12) (place ""Triangle2"" coord:""D15"" value:30) (place ""Triangle2"" coord:""E15"" value:56) (place ""Triangle2"" coord:""G14"" value:90) (place ""Triangle2"" coord:""A14"" value:16) (place ""Triangle2"" coord:""C15"" value:36) (place ""Triangle2"" coord:""F15"" value:64) (place ""Triangle2"" coord:""H14"" value:100) (place ""Disc2"" coord:""C13"" value:3) (place ""Disc2"" coord:""D13"" value:5) (place ""Disc2"" coord:""E13"" value:7) (place ""Disc2"" coord:""F13"" value:9) (place ""Disc2"" coord:""C14"" value:9) (place ""Disc2"" coord:""D14"" value:25) (place ""Disc2"" coord:""E14"" value:49) (place ""Disc2"" coord:""F14"" value:81) (place Stack ""Square1"" 9 value:36) (place Stack ""Square1"" 9 value:25) (place Stack ""Triangle1"" 9 value:16) (place Stack ""Triangle1"" 9 value:9) (place Stack ""Disc1"" 9 value:4) (place Stack ""Disc1"" 9 value:1) (place Stack ""Square2"" 119 value:64) (place Stack ""Square2"" 119 value:49) (place Stack ""Triangle2"" 119 value:36) (place Stack ""Triangle2"" 119 value:25) (place Stack ""Disc2"" 119 value:16)}) (play (or (forEach Piece) (forEach Site (sites Occupied by:Next) (forEach Level (site) FromBottom (if (and (!= (count Sites in:(sites To (if (= (what at:(site) level:(level)) (id ""Disc"" Next)) (step (from (site) level:(level)) Orthogonal (to if:(is Friend (who at:(to))))) (if (= (what at:(site) level:(level)) (id ""Triangle"" Next)) (slide (from (site) level:(level)) Diagonal (between (exact 2) if:(is Empty (between))) (to if:(is Friend (who at:(to))) (apply if:(is Friend (who at:(to)))))) (if (= (what at:(site) level:(level)) (id ""Square"" Next)) (slide (from (site) level:(level)) Orthogonal (between (exact 3) if:(is Empty (between))) (to if:(is Friend (who at:(to))) (apply if:(is Friend (who at:(to))))))))))) 0) (= (count Sites in:(sites To (if (= (what at:(site) level:(level)) (id ""Disc"" Next)) (step (from (site) level:(level)) Orthogonal (to if:(or (is Empty (to)) (is Enemy (who at:(to)))))) (if (= (what at:(site) level:(level)) (id ""Triangle"" Next)) (slide (from (site) level:(level)) Diagonal (between (exact 2) if:(is Empty (between))) (to if:(is Enemy (who at:(to))))) (if (= (what at:(site) level:(level)) (id ""Square"" Next)) (slide (from (site) level:(level)) Orthogonal (between (exact 3) if:(is Empty (between))) (to if:(is Enemy (who at:(to)))))))))) 0)) (move Remove (site) level:(level))))))) (end (if (and (or {(if (is In (last To) (sites Next)) (or {(if (and (!= (ahead (last To) N) (last To)) (!= (ahead (last To) S) (last To))) (and {(is Mover (who at:(ahead (last To) N))) (is Mover (who at:(ahead (last To) S))) (is In (ahead (last To) N) (sites Next)) (is In (ahead (last To) S) (sites Next)) (= (abs (- (value Piece at:(ahead (last To) N)) (value Piece at:(last To)))) (abs (- (value Piece at:(ahead (last To) S)) (value Piece at:(last To)))))})) (if (and (!= (ahead (last To) N) (last To)) (!= (ahead (last To) steps:2 N) (last To))) (and {(is Mover (who at:(ahead (last To) N))) (is Mover (who at:(ahead (last To) steps:2 N))) (is In (ahead (last To) N) (sites Next)) (is In (ahead (last To) steps:2 N) (sites Next)) (= (abs (- (value Piece at:(ahead (last To) N)) (value Piece at:(last To)))) (abs (- (value Piece at:(ahead (last To) steps:2 N)) (value Piece at:(ahead (last To) N)))))})) (if (and (!= (ahead (last To) S) (last To)) (!= (ahead (last To) steps:2 S) (last To))) (and {(is Mover (who at:(ahead (last To) S))) (is Mover (who at:(ahead (last To) steps:2 S))) (is In (ahead (last To) S) (sites Next)) (is In (ahead (last To) steps:2 S) (sites Next)) (= (abs (- (value Piece at:(ahead (last To) S)) (value Piece at:(last To)))) (abs (- (value Piece at:(ahead (last To) steps:2 S)) (value Piece at:(ahead (last To) S)))))})) (if (and (!= (ahead (last To) E) (last To)) (!= (ahead (last To) W) (last To))) (and {(is Mover (who at:(ahead (last To) E))) (is Mover (who at:(ahead (last To) W))) (is In (ahead (last To) E) (sites Next)) (is In (ahead (last To) W) (sites Next)) (= (abs (- (value Piece at:(ahead (last To) E)) (value Piece at:(last To)))) (abs (- (value Piece at:(ahead (last To) W)) (value Piece at:(last To)))))})) (if (and (!= (ahead (last To) E) (last To)) (!= (ahead (last To) steps:2 E) (last To))) (and {(is Mover (who at:(ahead (last To) E))) (is Mover (who at:(ahead (last To) steps:2 E))) (is In (ahead (last To) E) (sites Next)) (is In (ahead (last To) steps:2 E) (sites Next)) (= (abs (- (value Piece at:(ahead (last To) E)) (value Piece at:(last To)))) (abs (- (value Piece at:(ahead (last To) steps:2 E)) (value Piece at:(ahead (last To) E)))))})) (if (and (!= (ahead (last To) W) (last To)) (!= (ahead (last To) steps:2 W) (last To))) (and {(is Mover (who at:(ahead (last To) W))) (is Mover (who at:(ahead (last To) steps:2 W))) (is In (ahead (last To) W) (sites Next)) (is In (ahead (last To) steps:2 W) (sites Next)) (= (abs (- (value Piece at:(ahead (last To) W)) (value Piece at:(last To)))) (abs (- (value Piece at:(ahead (last To) steps:2 W)) (value Piece at:(ahead (last To) W)))))})) (if (and (!= (ahead (last To) NE) (last To)) (!= (ahead (last To) SW) (last To))) (and {(is Mover (who at:(ahead (last To) NE))) (is Mover (who at:(ahead (last To) SW))) (is In (ahead (last To) NE) (sites Next)) (is In (ahead (last To) SW) (sites Next)) (= (abs (- (value Piece at:(ahead (last To) NE)) (value Piece at:(last To)))) (abs (- (value Piece at:(ahead (last To) SW)) (value Piece at:(last To)))))})) (if (and (!= (ahead (last To) NE) (last To)) (!= (ahead (last To) steps:2 NE) (last To))) (and {(is Mover (who at:(ahead (last To) NE))) (is Mover (who at:(ahead (last To) steps:2 NE))) (is In (ahead (last To) NE) (sites Next)) (is In (ahead (last To) steps:2 NE) (sites Next)) (= (abs (- (value Piece at:(ahead (last To) NE)) (value Piece at:(last To)))) (abs (- (value Piece at:(ahead (last To) steps:2 NE)) (value Piece at:(ahead (last To) NE)))))})) (if (and (!= (ahead (last To) SW) (last To)) (!= (ahead (last To) steps:2 SW) (last To))) (and {(is Mover (who at:(ahead (last To) SW))) (is Mover (who at:(ahead (last To) steps:2 SW))) (is In (ahead (last To) SW) (sites Next)) (is In (ahead (last To) steps:2 SW) (sites Next)) (= (abs (- (value Piece at:(ahead (last To) SW)) (value Piece at:(last To)))) (abs (- (value Piece at:(ahead (last To) steps:2 SW)) (value Piece at:(ahead (last To) SW)))))})) (if (and (!= (ahead (last To) SE) (last To)) (!= (ahead (last To) NW) (last To))) (and {(is Mover (who at:(ahead (last To) SE))) (is Mover (who at:(ahead (last To) NW))) (is In (ahead (last To) SE) (sites Next)) (is In (ahead (last To) NW) (sites Next)) (= (abs (- (value Piece at:(ahead (last To) SE)) (value Piece at:(last To)))) (abs (- (value Piece at:(ahead (last To) NW)) (value Piece at:(last To)))))})) (if (and (!= (ahead (last To) SE) (last To)) (!= (ahead (last To) steps:2 SE) (last To))) (and {(is Mover (who at:(ahead (last To) SE))) (is Mover (who at:(ahead (last To) steps:2 SE))) (is In (ahead (last To) SE) (sites Next)) (is In (ahead (last To) steps:2 SE) (sites Next)) (= (abs (- (value Piece at:(ahead (last To) SE)) (value Piece at:(last To)))) (abs (- (value Piece at:(ahead (last To) steps:2 SE)) (value Piece at:(ahead (last To) SE)))))})) (if (and (!= (ahead (last To) NW) (last To)) (!= (ahead (last To) steps:2 NW) (last To))) (and {(is Mover (who at:(ahead (last To) NW))) (is Mover (who at:(ahead (last To) steps:2 NW))) (is In (ahead (last To) NW) (sites Next)) (is In (ahead (last To) steps:2 NW) (sites Next)) (= (abs (- (value Piece at:(ahead (last To) NW)) (value Piece at:(last To)))) (abs (- (value Piece at:(ahead (last To) steps:2 NW)) (value Piece at:(ahead (last To) NW)))))}))})) (if (is In (last To) (sites Next)) (or {(if (and (!= (ahead (last To) N) (last To)) (!= (ahead (last To) S) (last To))) (and {(is Mover (who at:(ahead (last To) N))) (is Mover (who at:(ahead (last To) S))) (is In (ahead (last To) N) (sites Next)) (is In (ahead (last To) S) (sites Next)) (!= 0 (value Piece at:(last To))) (!= 0 (value Piece at:(ahead (last To) S))) (= (/ (value Piece at:(ahead (last To) N)) (value Piece at:(last To))) (/ (value Piece at:(last To)) (value Piece at:(ahead (last To) S))))})) (if (and (!= (ahead (last To) N) (last To)) (!= (ahead (last To) steps:2 N) (last To))) (and {(is Mover (who at:(ahead (last To) N))) (is Mover (who at:(ahead (last To) steps:2 N))) (is In (ahead (last To) N) (sites Next)) (is In (ahead (last To) steps:2 N) (sites Next)) (!= 0 (value Piece at:(last To))) (!= 0 (value Piece at:(ahead (last To) N))) (= (/ (value Piece at:(ahead (last To) N)) (value Piece at:(last To))) (/ (value Piece at:(ahead (last To) steps:2 N)) (value Piece at:(ahead (last To) N))))})) (if (and (!= (ahead (last To) S) (last To)) (!= (ahead (last To) steps:2 S) (last To))) (and {(is Mover (who at:(ahead (last To) S))) (is Mover (who at:(ahead (last To) steps:2 S))) (is In (ahead (last To) S) (sites Next)) (is In (ahead (last To) steps:2 S) (sites Next)) (!= 0 (value Piece at:(last To))) (!= 0 (value Piece at:(ahead (last To) S))) (= (/ (value Piece at:(ahead (last To) S)) (value Piece at:(last To))) (/ (value Piece at:(ahead (last To) steps:2 S)) (value Piece at:(ahead (last To) S))))})) (if (and (!= (ahead (last To) E) (last To)) (!= (ahead (last To) W) (last To))) (and {(is Mover (who at:(ahead (last To) E))) (is Mover (who at:(ahead (last To) W))) (is In (ahead (last To) E) (sites Next)) (is In (ahead (last To) W) (sites Next)) (!= 0 (value Piece at:(last To))) (!= 0 (value Piece at:(ahead (last To) W))) (= (/ (value Piece at:(ahead (last To) E)) (value Piece at:(last To))) (/ (value Piece at:(last To)) (value Piece at:(ahead (last To) W))))})) (if (and (!= (ahead (last To) E) (last To)) (!= (ahead (last To) steps:2 E) (last To))) (and {(is Mover (who at:(ahead (last To) E))) (is Mover (who at:(ahead (last To) steps:2 E))) (is In (ahead (last To) E) (sites Next)) (is In (ahead (last To) steps:2 E) (sites Next)) (!= 0 (value Piece at:(last To))) (!= 0 (value Piece at:(ahead (last To) E))) (= (/ (value Piece at:(ahead (last To) E)) (value Piece at:(last To))) (/ (value Piece at:(ahead (last To) steps:2 E)) (value Piece at:(ahead (last To) E))))})) (if (and (!= (ahead (last To) W) (last To)) (!= (ahead (last To) steps:2 W) (last To))) (and {(is Mover (who at:(ahead (last To) W))) (is Mover (who at:(ahead (last To) steps:2 W))) (is In (ahead (last To) W) (sites Next)) (is In (ahead (last To) steps:2 W) (sites Next)) (!= 0 (value Piece at:(last To))) (!= 0 (value Piece at:(ahead (last To) W))) (= (/ (value Piece at:(ahead (last To) W)) (value Piece at:(last To))) (/ (value Piece at:(ahead (last To) steps:2 W)) (value Piece at:(ahead (last To) W))))})) (if (and (!= (ahead (last To) NE) (last To)) (!= (ahead (last To) SW) (last To))) (and {(is Mover (who at:(ahead (last To) NE))) (is Mover (who at:(ahead (last To) SW))) (is In (ahead (last To) NE) (sites Next)) (is In (ahead (last To) SW) (sites Next)) (!= 0 (value Piece at:(last To))) (!= 0 (value Piece at:(ahead (last To) SW))) (= (/ (value Piece at:(ahead (last To) NE)) (value Piece at:(last To))) (/ (value Piece at:(last To)) (value Piece at:(ahead (last To) SW))))})) (if (and (!= (ahead (last To) NE) (last To)) (!= (ahead (last To) steps:2 NE) (last To))) (and {(is Mover (who at:(ahead (last To) NE))) (is Mover (who at:(ahead (last To) steps:2 NE))) (is In (ahead (last To) NE) (sites Next)) (is In (ahead (last To) steps:2 NE) (sites Next)) (!= 0 (value Piece at:(last To))) (!= 0 (value Piece at:(ahead (last To) NE))) (= (/ (value Piece at:(ahead (last To) NE)) (value Piece at:(last To))) (/ (value Piece at:(ahead (last To) steps:2 NE)) (value Piece at:(ahead (last To) NE))))})) (if (and (!= (ahead (last To) SW) (last To)) (!= (ahead (last To) steps:2 SW) (last To))) (and {(is Mover (who at:(ahead (last To) SW))) (is Mover (who at:(ahead (last To) steps:2 SW))) (is In (ahead (last To) SW) (sites Next)) (is In (ahead (last To) steps:2 SW) (sites Next)) (!= 0 (value Piece at:(last To))) (!= 0 (value Piece at:(ahead (last To) SW))) (= (/ (value Piece at:(ahead (last To) SW)) (value Piece at:(last To))) (/ (value Piece at:(ahead (last To) steps:2 SW)) (value Piece at:(ahead (last To) SW))))})) (if (and (!= (ahead (last To) SE) (last To)) (!= (ahead (last To) NW) (last To))) (and {(is Mover (who at:(ahead (last To) SE))) (is Mover (who at:(ahead (last To) NW))) (is In (ahead (last To) SE) (sites Next)) (is In (ahead (last To) NW) (sites Next)) (!= 0 (value Piece at:(last To))) (!= 0 (value Piece at:(ahead (last To) NW))) (= (/ (value Piece at:(ahead (last To) SE)) (value Piece at:(last To))) (/ (value Piece at:(last To)) (value Piece at:(ahead (last To) NW))))})) (if (and (!= (ahead (last To) SE) (last To)) (!= (ahead (last To) steps:2 SE) (last To))) (and {(is Mover (who at:(ahead (last To) SE))) (is Mover (who at:(ahead (last To) steps:2 SE))) (is In (ahead (last To) SE) (sites Next)) (is In (ahead (last To) steps:2 SE) (sites Next)) (!= 0 (value Piece at:(last To))) (!= 0 (value Piece at:(ahead (last To) SE))) (= (/ (value Piece at:(ahead (last To) SE)) (value Piece at:(last To))) (/ (value Piece at:(ahead (last To) steps:2 SE)) (value Piece at:(ahead (last To) SE))))})) (if (and (!= (ahead (last To) NW) (last To)) (!= (ahead (last To) steps:2 NW) (last To))) (and {(is Mover (who at:(ahead (last To) NW))) (is Mover (who at:(ahead (last To) steps:2 NW))) (is In (ahead (last To) NW) (sites Next)) (is In (ahead (last To) steps:2 NW) (sites Next)) (!= 0 (value Piece at:(last To))) (!= 0 (value Piece at:(ahead (last To) NW))) (= (/ (value Piece at:(ahead (last To) NW)) (value Piece at:(last To))) (/ (value Piece at:(ahead (last To) steps:2 NW)) (value Piece at:(ahead (last To) NW))))}))})) (if (is In (last To) (sites Next)) (or {(if (and (!= (ahead (last To) N) (last To)) (!= (ahead (last To) S) (last To))) (and {(is Mover (who at:(ahead (last To) N))) (is Mover (who at:(ahead (last To) S))) (is In (ahead (last To) N) (sites Next)) (is In (ahead (last To) S) (sites Next)) (!= 0 (value Piece at:(last To))) (!= 0 (value Piece at:(ahead (last To) S))) (= (/ (value Piece at:(ahead (last To) N)) (value Piece at:(last To))) (/ (value Piece at:(last To)) (value Piece at:(ahead (last To) S))))})) (if (and (!= (ahead (last To) N) (last To)) (!= (ahead (last To) steps:2 N) (last To))) (and {(is Mover (who at:(ahead (last To) N))) (is Mover (who at:(ahead (last To) steps:2 N))) (is In (ahead (last To) N) (sites Next)) (is In (ahead (last To) steps:2 N) (sites Next)) (!= 0 (value Piece at:(last To))) (!= 0 (value Piece at:(ahead (last To) N))) (= (/ (value Piece at:(ahead (last To) N)) (value Piece at:(last To))) (/ (value Piece at:(ahead (last To) steps:2 N)) (value Piece at:(ahead (last To) N))))})) (if (and (!= (ahead (last To) S) (last To)) (!= (ahead (last To) steps:2 S) (last To))) (and {(is Mover (who at:(ahead (last To) S))) (is Mover (who at:(ahead (last To) steps:2 S))) (is In (ahead (last To) S) (sites Next)) (is In (ahead (last To) steps:2 S) (sites Next)) (!= 0 (value Piece at:(last To))) (!= 0 (value Piece at:(ahead (last To) S))) (= (/ (value Piece at:(ahead (last To) S)) (value Piece at:(last To))) (/ (value Piece at:(ahead (last To) steps:2 S)) (value Piece at:(ahead (last To) S))))})) (if (and (!= (ahead (last To) E) (last To)) (!= (ahead (last To) W) (last To))) (and {(is Mover (who at:(ahead (last To) E))) (is Mover (who at:(ahead (last To) W))) (is In (ahead (last To) E) (sites Next)) (is In (ahead (last To) W) (sites Next)) (!= 0 (value Piece at:(last To))) (!= 0 (value Piece at:(ahead (last To) W))) (= (/ (value Piece at:(ahead (last To) E)) (value Piece at:(last To))) (/ (value Piece at:(last To)) (value Piece at:(ahead (last To) W))))})) (if (and (!= (ahead (last To) E) (last To)) (!= (ahead (last To) steps:2 E) (last To))) (and {(is Mover (who at:(ahead (last To) E))) (is Mover (who at:(ahead (last To) steps:2 E))) (is In (ahead (last To) E) (sites Next)) (is In (ahead (last To) steps:2 E) (sites Next)) (!= 0 (value Piece at:(last To))) (!= 0 (value Piece at:(ahead (last To) E))) (= (/ (value Piece at:(ahead (last To) E)) (value Piece at:(last To))) (/ (value Piece at:(ahead (last To) steps:2 E)) (value Piece at:(ahead (last To) E))))})) (if (and (!= (ahead (last To) W) (last To)) (!= (ahead (last To) steps:2 W) (last To))) (and {(is Mover (who at:(ahead (last To) W))) (is Mover (who at:(ahead (last To) steps:2 W))) (is In (ahead (last To) W) (sites Next)) (is In (ahead (last To) steps:2 W) (sites Next)) (!= 0 (value Piece at:(last To))) (!= 0 (value Piece at:(ahead (last To) W))) (= (/ (value Piece at:(ahead (last To) W)) (value Piece at:(last To))) (/ (value Piece at:(ahead (last To) steps:2 W)) (value Piece at:(ahead (last To) W))))})) (if (and (!= (ahead (last To) NE) (last To)) (!= (ahead (last To) SW) (last To))) (and {(is Mover (who at:(ahead (last To) NE))) (is Mover (who at:(ahead (last To) SW))) (is In (ahead (last To) NE) (sites Next)) (is In (ahead (last To) SW) (sites Next)) (!= 0 (value Piece at:(last To))) (!= 0 (value Piece at:(ahead (last To) SW))) (= (/ (value Piece at:(ahead (last To) NE)) (value Piece at:(last To))) (/ (value Piece at:(last To)) (value Piece at:(ahead (last To) SW))))})) (if (and (!= (ahead (last To) NE) (last To)) (!= (ahead (last To) steps:2 NE) (last To))) (and {(is Mover (who at:(ahead (last To) NE))) (is Mover (who at:(ahead (last To) steps:2 NE))) (is In (ahead (last To) NE) (sites Next)) (is In (ahead (last To) steps:2 NE) (sites Next)) (!= 0 (value Piece at:(last To))) (!= 0 (value Piece at:(ahead (last To) NE))) (= (/ (value Piece at:(ahead (last To) NE)) (value Piece at:(last To))) (/ (value Piece at:(ahead (last To) steps:2 NE)) (value Piece at:(ahead (last To) NE))))})) (if (and (!= (ahead (last To) SW) (last To)) (!= (ahead (last To) steps:2 SW) (last To))) (and {(is Mover (who at:(ahead (last To) SW))) (is Mover (who at:(ahead (last To) steps:2 SW))) (is In (ahead (last To) SW) (sites Next)) (is In (ahead (last To) steps:2 SW) (sites Next)) (!= 0 (value Piece at:(last To))) (!= 0 (value Piece at:(ahead (last To) SW))) (= (/ (value Piece at:(ahead (last To) SW)) (value Piece at:(last To))) (/ (value Piece at:(ahead (last To) steps:2 SW)) (value Piece at:(ahead (last To) SW))))})) (if (and (!= (ahead (last To) SE) (last To)) (!= (ahead (last To) NW) (last To))) (and {(is Mover (who at:(ahead (last To) SE))) (is Mover (who at:(ahead (last To) NW))) (is In (ahead (last To) SE) (sites Next)) (is In (ahead (last To) NW) (sites Next)) (!= 0 (value Piece at:(last To))) (!= 0 (value Piece at:(ahead (last To) NW))) (= (/ (value Piece at:(ahead (last To) SE)) (value Piece at:(last To))) (/ (value Piece at:(last To)) (value Piece at:(ahead (last To) NW))))})) (if (and (!= (ahead (last To) SE) (last To)) (!= (ahead (last To) steps:2 SE) (last To))) (and {(is Mover (who at:(ahead (last To) SE))) (is Mover (who at:(ahead (last To) steps:2 SE))) (is In (ahead (last To) SE) (sites Next)) (is In (ahead (last To) steps:2 SE) (sites Next)) (!= 0 (value Piece at:(last To))) (!= 0 (value Piece at:(ahead (last To) SE))) (= (/ (value Piece at:(ahead (last To) SE)) (value Piece at:(last To))) (/ (value Piece at:(ahead (last To) steps:2 SE)) (value Piece at:(ahead (last To) SE))))})) (if (and (!= (ahead (last To) NW) (last To)) (!= (ahead (last To) steps:2 NW) (last To))) (and {(is Mover (who at:(ahead (last To) NW))) (is Mover (who at:(ahead (last To) steps:2 NW))) (is In (ahead (last To) NW) (sites Next)) (is In (ahead (last To) steps:2 NW) (sites Next)) (!= 0 (value Piece at:(last To))) (!= 0 (value Piece at:(ahead (last To) NW))) (= (/ (value Piece at:(ahead (last To) NW)) (value Piece at:(last To))) (/ (value Piece at:(ahead (last To) steps:2 NW)) (value Piece at:(ahead (last To) NW))))}))}))}) (all Sites (sites Occupied by:Next) if:(= 1 (size Stack at:(site))))) (result Mover Win)))))","###Description -8x16 board. Two players, one black, one white. Each player has three types of pieces: Circles, triangle, squares, and one pyramid made up of multiple pieces stacked. Circles move one space orthogonally. Triangles move two spaces diagonally. Squares move three spaces orthogonally. Pyramids may move in any of the directions allowed by one of its constituent pieces. Each piece has a number. For white—circles: 2, 4, 6, 8, 4, 16, 36, 64; triangles: 6, 20 , 42, 72, 9, 25, 49, 81; squares: 15, 45, 153, 25, 81, 169, 289; pyramid (91) from the base: square 36, square 25, triangle 16, triangle 9, circle 4, circle 1. For black—circles: 3, 5, 7, 9, 9, 25, 49, 81; triangles: 12, 30, 56, 90, 16, 36, 64, 100; squares: 28, 66, 120, 49, 121, 225, 361; pyramid (190): from the base: square 64, square 49, triangle 36, triangle 25, circle 16. Pieces capture other pieces by mathematical allowances based on the numbers on the pieces. There are nine scenarios in which pieces can be taken when a piece moves to a space occupied by an opponent's piece. Multiplication with distance: If the value of the piece to be taken equals the value of the piece making the capture multiplied by the distance between the two pieces; Division by distance: If the value of the piece to be taken equals the value of the piece making the capture divided by the distance between the pieces. Addition: When two pieces can both move to the space of an opponent's piece, if the sum of the two pieces equals the value of the opponent's piece, it is captured and the player chooses which piece to move to that space. Subtraction: When two pieces can both move to the space of an opponent's piece, if the difference between the value of these pieces equals the value of the opponent's piece, it is taken, and the player chooses which piece to move to the space. Multiplication: When two pieces can both move to the space of an opponent's piece, if the product of the values of the two pieces equals the value of the opponent's piece, it is taken and the player chooses which piece to move to the space. Division: When two pieces can both move to the space of an opponent's piece, if the quotient of the values of the two pieces equals the value of the opponent's piece, it is taken and the player chooses which piece to move to the space. Encirclement: If pieces are positioned such that there is no possible move or capture for the opponent's piece, the opponent's piece is taken. Pyramid capture: A pyramid can be captured by capturing its constituent pieces one-by-one according to the above methods; by encircling it so it cannot move, or by obtaining the sum of the constituent pieces or of its base pieces according to the above rules; A pyramid captures as a single one of its component pieces according to the above rules (the direction of the move is independent of the value chosen), or by using the sum of its pieces according to the above rules. The goal of the game is to capture the opponent's pyramid and to create an alignment on the opponent's half of the board forming a mathematical progression. The progression may be arithmetic (a sequence where the difference between the values is constant), geometric (where each value after the first is determined by multiplying the previous value by a fixed number), or harmonic (1/a, 1/a+d, 1/a+2d, 1/a+3d). The pieces in the progression must be in a straight orthogonal or diagonal line or in a chevron shape, and must be equally spaced. - -###Ludii -(game ""Rithmomachia"" (players 2) (equipment {(board (rectangle 16 8)) (piece ""Square"" Each (move Slide Orthogonal (between (exact 3) if:(is Empty (between))) (to if:(and (is Enemy (who at:(to))) (or {(= (value Piece at:(to) level:0) (* (value Piece at:(from) level:(level)) (count Steps (from) (to)))) (= (value Piece at:(to) level:0) (/ (value Piece at:(from) level:(level)) (count Steps (from) (to)))) (!= 0 (count Sites in:(forEach (sites Occupied by:Mover) if:(and {(!= (from) (site)) (is In (to) (sites To (forEach Level (site) FromBottom (if (= (what at:(site) level:(level)) (id ""Disc"" Mover)) (step (from (site) level:(level)) Orthogonal (to if:(not (is Friend (who at:(to)))))) (if (= (what at:(site) level:(level)) (id ""Triangle"" Mover)) (slide (from (site) level:(level)) Diagonal (between (exact 2) if:(is Empty (between))) (to if:(is Enemy (who at:(to))))) (if (= (what at:(site) level:(level)) (id ""Square"" Mover)) (slide (from (site) level:(level)) Orthogonal (between (exact 3) if:(is Empty (between))) (to if:(is Enemy (who at:(to))))))))))) (= (value Piece at:(to) level:0) (+ (value Piece at:(from) level:(level)) (value Piece at:(site))))})))) (!= 0 (count Sites in:(forEach (sites Occupied by:Mover) if:(and {(!= (from) (site)) (is In (to) (sites To (forEach Level (site) FromBottom (if (= (what at:(site) level:(level)) (id ""Disc"" Mover)) (step (from (site) level:(level)) Orthogonal (to if:(not (is Friend (who at:(to)))))) (if (= (what at:(site) level:(level)) (id ""Triangle"" Mover)) (slide (from (site) level:(level)) Diagonal (between (exact 2) if:(is Empty (between))) (to if:(is Enemy (who at:(to))))) (if (= (what at:(site) level:(level)) (id ""Square"" Mover)) (slide (from (site) level:(level)) Orthogonal (between (exact 3) if:(is Empty (between))) (to if:(is Enemy (who at:(to))))))))))) (= (value Piece at:(to) level:0) (abs (- (value Piece at:(from) level:(level)) (value Piece at:(site)))))})))) (!= 0 (count Sites in:(forEach (sites Occupied by:Mover) if:(and {(!= (from) (site)) (is In (to) (sites To (forEach Level (site) FromBottom (if (= (what at:(site) level:(level)) (id ""Disc"" Mover)) (step (from (site) level:(level)) Orthogonal (to if:(not (is Friend (who at:(to)))))) (if (= (what at:(site) level:(level)) (id ""Triangle"" Mover)) (slide (from (site) level:(level)) Diagonal (between (exact 2) if:(is Empty (between))) (to if:(is Enemy (who at:(to))))) (if (= (what at:(site) level:(level)) (id ""Square"" Mover)) (slide (from (site) level:(level)) Orthogonal (between (exact 3) if:(is Empty (between))) (to if:(is Enemy (who at:(to))))))))))) (= (value Piece at:(to) level:0) (* (value Piece at:(from) level:(level)) (value Piece at:(site))))})))) (!= 0 (count Sites in:(forEach (sites Occupied by:Mover) if:(and {(!= (from) (site)) (is In (to) (sites To (forEach Level (site) FromBottom (if (= (what at:(site) level:(level)) (id ""Disc"" Mover)) (step (from (site) level:(level)) Orthogonal (to if:(not (is Friend (who at:(to)))))) (if (= (what at:(site) level:(level)) (id ""Triangle"" Mover)) (slide (from (site) level:(level)) Diagonal (between (exact 2) if:(is Empty (between))) (to if:(is Enemy (who at:(to))))) (if (= (what at:(site) level:(level)) (id ""Square"" Mover)) (slide (from (site) level:(level)) Orthogonal (between (exact 3) if:(is Empty (between))) (to if:(is Enemy (who at:(to))))))))))) (or (and (!= 0 (value Piece at:(site))) (= (value Piece at:(to)) (/ (value Piece at:(from) level:(level)) (value Piece at:(site))))) (and (!= 0 (value Piece at:(from))) (= (value Piece at:(to)) (/ (value Piece at:(site) level:(level)) (value Piece at:(from))))))}))))})) (apply (if (is Enemy (who at:(to))) (forEach Level (to) FromTop (remove (to) level:(level)))))) stack:True)) (piece ""Triangle"" Each (move Slide Diagonal (between (exact 2) if:(is Empty (between))) (to if:(and (is Enemy (who at:(to))) (or {(= (value Piece at:(to) level:0) (* (value Piece at:(from) level:(level)) (count Steps (from) (to)))) (= (value Piece at:(to) level:0) (/ (value Piece at:(from) level:(level)) (count Steps (from) (to)))) (!= 0 (count Sites in:(forEach (sites Occupied by:Mover) if:(and {(!= (from) (site)) (is In (to) (sites To (forEach Level (site) FromBottom (if (= (what at:(site) level:(level)) (id ""Disc"" Mover)) (step (from (site) level:(level)) Orthogonal (to if:(not (is Friend (who at:(to)))))) (if (= (what at:(site) level:(level)) (id ""Triangle"" Mover)) (slide (from (site) level:(level)) Diagonal (between (exact 2) if:(is Empty (between))) (to if:(is Enemy (who at:(to))))) (if (= (what at:(site) level:(level)) (id ""Square"" Mover)) (slide (from (site) level:(level)) Orthogonal (between (exact 3) if:(is Empty (between))) (to if:(is Enemy (who at:(to))))))))))) (= (value Piece at:(to) level:0) (+ (value Piece at:(from) level:(level)) (value Piece at:(site))))})))) (!= 0 (count Sites in:(forEach (sites Occupied by:Mover) if:(and {(!= (from) (site)) (is In (to) (sites To (forEach Level (site) FromBottom (if (= (what at:(site) level:(level)) (id ""Disc"" Mover)) (step (from (site) level:(level)) Orthogonal (to if:(not (is Friend (who at:(to)))))) (if (= (what at:(site) level:(level)) (id ""Triangle"" Mover)) (slide (from (site) level:(level)) Diagonal (between (exact 2) if:(is Empty (between))) (to if:(is Enemy (who at:(to))))) (if (= (what at:(site) level:(level)) (id ""Square"" Mover)) (slide (from (site) level:(level)) Orthogonal (between (exact 3) if:(is Empty (between))) (to if:(is Enemy (who at:(to))))))))))) (= (value Piece at:(to) level:0) (abs (- (value Piece at:(from) level:(level)) (value Piece at:(site)))))})))) (!= 0 (count Sites in:(forEach (sites Occupied by:Mover) if:(and {(!= (from) (site)) (is In (to) (sites To (forEach Level (site) FromBottom (if (= (what at:(site) level:(level)) (id ""Disc"" Mover)) (step (from (site) level:(level)) Orthogonal (to if:(not (is Friend (who at:(to)))))) (if (= (what at:(site) level:(level)) (id ""Triangle"" Mover)) (slide (from (site) level:(level)) Diagonal (between (exact 2) if:(is Empty (between))) (to if:(is Enemy (who at:(to))))) (if (= (what at:(site) level:(level)) (id ""Square"" Mover)) (slide (from (site) level:(level)) Orthogonal (between (exact 3) if:(is Empty (between))) (to if:(is Enemy (who at:(to))))))))))) (= (value Piece at:(to) level:0) (* (value Piece at:(from) level:(level)) (value Piece at:(site))))})))) (!= 0 (count Sites in:(forEach (sites Occupied by:Mover) if:(and {(!= (from) (site)) (is In (to) (sites To (forEach Level (site) FromBottom (if (= (what at:(site) level:(level)) (id ""Disc"" Mover)) (step (from (site) level:(level)) Orthogonal (to if:(not (is Friend (who at:(to)))))) (if (= (what at:(site) level:(level)) (id ""Triangle"" Mover)) (slide (from (site) level:(level)) Diagonal (between (exact 2) if:(is Empty (between))) (to if:(is Enemy (who at:(to))))) (if (= (what at:(site) level:(level)) (id ""Square"" Mover)) (slide (from (site) level:(level)) Orthogonal (between (exact 3) if:(is Empty (between))) (to if:(is Enemy (who at:(to))))))))))) (or (and (!= 0 (value Piece at:(site))) (= (value Piece at:(to)) (/ (value Piece at:(from) level:(level)) (value Piece at:(site))))) (and (!= 0 (value Piece at:(from))) (= (value Piece at:(to)) (/ (value Piece at:(site) level:(level)) (value Piece at:(from))))))}))))})) (apply (if (is Enemy (who at:(to))) (forEach Level (to) FromTop (remove (to) level:(level)))))) stack:True)) (piece ""Disc"" Each (move Step Orthogonal (to if:(if (is Enemy (who at:(to))) (or {(= (value Piece at:(to) level:0) (* (value Piece at:(from) level:(level)) (count Steps (from) (to)))) (= (value Piece at:(to) level:0) (/ (value Piece at:(from) level:(level)) (count Steps (from) (to)))) (!= 0 (count Sites in:(forEach (sites Occupied by:Mover) if:(and {(!= (from) (site)) (is In (to) (sites To (forEach Level (site) FromBottom (if (= (what at:(site) level:(level)) (id ""Disc"" Mover)) (step (from (site) level:(level)) Orthogonal (to if:(not (is Friend (who at:(to)))))) (if (= (what at:(site) level:(level)) (id ""Triangle"" Mover)) (slide (from (site) level:(level)) Diagonal (between (exact 2) if:(is Empty (between))) (to if:(is Enemy (who at:(to))))) (if (= (what at:(site) level:(level)) (id ""Square"" Mover)) (slide (from (site) level:(level)) Orthogonal (between (exact 3) if:(is Empty (between))) (to if:(is Enemy (who at:(to))))))))))) (= (value Piece at:(to) level:0) (+ (value Piece at:(from) level:(level)) (value Piece at:(site))))})))) (!= 0 (count Sites in:(forEach (sites Occupied by:Mover) if:(and {(!= (from) (site)) (is In (to) (sites To (forEach Level (site) FromBottom (if (= (what at:(site) level:(level)) (id ""Disc"" Mover)) (step (from (site) level:(level)) Orthogonal (to if:(not (is Friend (who at:(to)))))) (if (= (what at:(site) level:(level)) (id ""Triangle"" Mover)) (slide (from (site) level:(level)) Diagonal (between (exact 2) if:(is Empty (between))) (to if:(is Enemy (who at:(to))))) (if (= (what at:(site) level:(level)) (id ""Square"" Mover)) (slide (from (site) level:(level)) Orthogonal (between (exact 3) if:(is Empty (between))) (to if:(is Enemy (who at:(to))))))))))) (= (value Piece at:(to) level:0) (abs (- (value Piece at:(from) level:(level)) (value Piece at:(site)))))})))) (!= 0 (count Sites in:(forEach (sites Occupied by:Mover) if:(and {(!= (from) (site)) (is In (to) (sites To (forEach Level (site) FromBottom (if (= (what at:(site) level:(level)) (id ""Disc"" Mover)) (step (from (site) level:(level)) Orthogonal (to if:(not (is Friend (who at:(to)))))) (if (= (what at:(site) level:(level)) (id ""Triangle"" Mover)) (slide (from (site) level:(level)) Diagonal (between (exact 2) if:(is Empty (between))) (to if:(is Enemy (who at:(to))))) (if (= (what at:(site) level:(level)) (id ""Square"" Mover)) (slide (from (site) level:(level)) Orthogonal (between (exact 3) if:(is Empty (between))) (to if:(is Enemy (who at:(to))))))))))) (= (value Piece at:(to) level:0) (* (value Piece at:(from) level:(level)) (value Piece at:(site))))})))) (!= 0 (count Sites in:(forEach (sites Occupied by:Mover) if:(and {(!= (from) (site)) (is In (to) (sites To (forEach Level (site) FromBottom (if (= (what at:(site) level:(level)) (id ""Disc"" Mover)) (step (from (site) level:(level)) Orthogonal (to if:(not (is Friend (who at:(to)))))) (if (= (what at:(site) level:(level)) (id ""Triangle"" Mover)) (slide (from (site) level:(level)) Diagonal (between (exact 2) if:(is Empty (between))) (to if:(is Enemy (who at:(to))))) (if (= (what at:(site) level:(level)) (id ""Square"" Mover)) (slide (from (site) level:(level)) Orthogonal (between (exact 3) if:(is Empty (between))) (to if:(is Enemy (who at:(to))))))))))) (or (and (!= 0 (value Piece at:(site))) (= (value Piece at:(to)) (/ (value Piece at:(from) level:(level)) (value Piece at:(site))))) (and (!= 0 (value Piece at:(from))) (= (value Piece at:(to)) (/ (value Piece at:(site) level:(level)) (value Piece at:(from))))))}))))}) (is Empty (to))) (apply (if (is Enemy (who at:(to))) (forEach Level (to) FromTop (remove (to) level:(level)))))) stack:True)) (regions P1 (expand (sites Bottom) steps:7)) (regions P2 (expand (sites Top) steps:7))}) (rules (start {(place ""Square1"" coord:""A1"" value:289) (place ""Square1"" coord:""B1"" value:169) (place ""Square1"" coord:""G1"" value:81) (place ""Square1"" coord:""H1"" value:25) (place ""Square1"" coord:""A2"" value:153) (place ""Square1"" coord:""G2"" value:45) (place ""Square1"" coord:""H2"" value:15) (place ""Triangle1"" coord:""G3"" value:6) (place ""Triangle1"" coord:""E2"" value:20) (place ""Triangle1"" coord:""D2"" value:42) (place ""Triangle1"" coord:""B3"" value:72) (place ""Triangle1"" coord:""H3"" value:9) (place ""Triangle1"" coord:""F2"" value:25) (place ""Triangle1"" coord:""C2"" value:49) (place ""Triangle1"" coord:""A3"" value:81) (place ""Disc1"" coord:""F4"" value:2) (place ""Disc1"" coord:""E4"" value:4) (place ""Disc1"" coord:""F3"" value:4) (place ""Disc1"" coord:""D4"" value:6) (place ""Disc1"" coord:""C4"" value:8) (place ""Disc1"" coord:""E3"" value:16) (place ""Disc1"" coord:""D3"" value:36) (place ""Disc1"" coord:""C3"" value:64) (place ""Square2"" coord:""H16"" value:361) (place ""Square2"" coord:""G16"" value:225) (place ""Square2"" coord:""B16"" value:121) (place ""Square2"" coord:""A16"" value:49) (place ""Square2"" coord:""G15"" value:120) (place ""Square2"" coord:""B15"" value:66) (place ""Square2"" coord:""A15"" value:28) (place ""Triangle2"" coord:""B14"" value:12) (place ""Triangle2"" coord:""D15"" value:30) (place ""Triangle2"" coord:""E15"" value:56) (place ""Triangle2"" coord:""G14"" value:90) (place ""Triangle2"" coord:""A14"" value:16) (place ""Triangle2"" coord:""C15"" value:36) (place ""Triangle2"" coord:""F15"" value:64) (place ""Triangle2"" coord:""H14"" value:100) (place ""Disc2"" coord:""C13"" value:3) (place ""Disc2"" coord:""D13"" value:5) (place ""Disc2"" coord:""E13"" value:7) (place ""Disc2"" coord:""F13"" value:9) (place ""Disc2"" coord:""C14"" value:9) (place ""Disc2"" coord:""D14"" value:25) (place ""Disc2"" coord:""E14"" value:49) (place ""Disc2"" coord:""F14"" value:81) (place Stack ""Square1"" 9 value:36) (place Stack ""Square1"" 9 value:25) (place Stack ""Triangle1"" 9 value:16) (place Stack ""Triangle1"" 9 value:9) (place Stack ""Disc1"" 9 value:4) (place Stack ""Disc1"" 9 value:1) (place Stack ""Square2"" 119 value:64) (place Stack ""Square2"" 119 value:49) (place Stack ""Triangle2"" 119 value:36) (place Stack ""Triangle2"" 119 value:25) (place Stack ""Disc2"" 119 value:16)}) (play (or (forEach Piece) (forEach Site (sites Occupied by:Next) (forEach Level (site) FromBottom (if (and (!= (count Sites in:(sites To (if (= (what at:(site) level:(level)) (id ""Disc"" Next)) (step (from (site) level:(level)) Orthogonal (to if:(is Friend (who at:(to))))) (if (= (what at:(site) level:(level)) (id ""Triangle"" Next)) (slide (from (site) level:(level)) Diagonal (between (exact 2) if:(is Empty (between))) (to if:(is Friend (who at:(to))) (apply if:(is Friend (who at:(to)))))) (if (= (what at:(site) level:(level)) (id ""Square"" Next)) (slide (from (site) level:(level)) Orthogonal (between (exact 3) if:(is Empty (between))) (to if:(is Friend (who at:(to))) (apply if:(is Friend (who at:(to))))))))))) 0) (= (count Sites in:(sites To (if (= (what at:(site) level:(level)) (id ""Disc"" Next)) (step (from (site) level:(level)) Orthogonal (to if:(or (is Empty (to)) (is Enemy (who at:(to)))))) (if (= (what at:(site) level:(level)) (id ""Triangle"" Next)) (slide (from (site) level:(level)) Diagonal (between (exact 2) if:(is Empty (between))) (to if:(is Enemy (who at:(to))))) (if (= (what at:(site) level:(level)) (id ""Square"" Next)) (slide (from (site) level:(level)) Orthogonal (between (exact 3) if:(is Empty (between))) (to if:(is Enemy (who at:(to)))))))))) 0)) (move Remove (site) level:(level))))))) (end (if (and (or {(if (is In (last To) (sites Next)) (or {(if (and (!= (ahead (last To) N) (last To)) (!= (ahead (last To) S) (last To))) (and {(is Mover (who at:(ahead (last To) N))) (is Mover (who at:(ahead (last To) S))) (is In (ahead (last To) N) (sites Next)) (is In (ahead (last To) S) (sites Next)) (= (abs (- (value Piece at:(ahead (last To) N)) (value Piece at:(last To)))) (abs (- (value Piece at:(ahead (last To) S)) (value Piece at:(last To)))))})) (if (and (!= (ahead (last To) N) (last To)) (!= (ahead (last To) steps:2 N) (last To))) (and {(is Mover (who at:(ahead (last To) N))) (is Mover (who at:(ahead (last To) steps:2 N))) (is In (ahead (last To) N) (sites Next)) (is In (ahead (last To) steps:2 N) (sites Next)) (= (abs (- (value Piece at:(ahead (last To) N)) (value Piece at:(last To)))) (abs (- (value Piece at:(ahead (last To) steps:2 N)) (value Piece at:(ahead (last To) N)))))})) (if (and (!= (ahead (last To) S) (last To)) (!= (ahead (last To) steps:2 S) (last To))) (and {(is Mover (who at:(ahead (last To) S))) (is Mover (who at:(ahead (last To) steps:2 S))) (is In (ahead (last To) S) (sites Next)) (is In (ahead (last To) steps:2 S) (sites Next)) (= (abs (- (value Piece at:(ahead (last To) S)) (value Piece at:(last To)))) (abs (- (value Piece at:(ahead (last To) steps:2 S)) (value Piece at:(ahead (last To) S)))))})) (if (and (!= (ahead (last To) E) (last To)) (!= (ahead (last To) W) (last To))) (and {(is Mover (who at:(ahead (last To) E))) (is Mover (who at:(ahead (last To) W))) (is In (ahead (last To) E) (sites Next)) (is In (ahead (last To) W) (sites Next)) (= (abs (- (value Piece at:(ahead (last To) E)) (value Piece at:(last To)))) (abs (- (value Piece at:(ahead (last To) W)) (value Piece at:(last To)))))})) (if (and (!= (ahead (last To) E) (last To)) (!= (ahead (last To) steps:2 E) (last To))) (and {(is Mover (who at:(ahead (last To) E))) (is Mover (who at:(ahead (last To) steps:2 E))) (is In (ahead (last To) E) (sites Next)) (is In (ahead (last To) steps:2 E) (sites Next)) (= (abs (- (value Piece at:(ahead (last To) E)) (value Piece at:(last To)))) (abs (- (value Piece at:(ahead (last To) steps:2 E)) (value Piece at:(ahead (last To) E)))))})) (if (and (!= (ahead (last To) W) (last To)) (!= (ahead (last To) steps:2 W) (last To))) (and {(is Mover (who at:(ahead (last To) W))) (is Mover (who at:(ahead (last To) steps:2 W))) (is In (ahead (last To) W) (sites Next)) (is In (ahead (last To) steps:2 W) (sites Next)) (= (abs (- (value Piece at:(ahead (last To) W)) (value Piece at:(last To)))) (abs (- (value Piece at:(ahead (last To) steps:2 W)) (value Piece at:(ahead (last To) W)))))})) (if (and (!= (ahead (last To) NE) (last To)) (!= (ahead (last To) SW) (last To))) (and {(is Mover (who at:(ahead (last To) NE))) (is Mover (who at:(ahead (last To) SW))) (is In (ahead (last To) NE) (sites Next)) (is In (ahead (last To) SW) (sites Next)) (= (abs (- (value Piece at:(ahead (last To) NE)) (value Piece at:(last To)))) (abs (- (value Piece at:(ahead (last To) SW)) (value Piece at:(last To)))))})) (if (and (!= (ahead (last To) NE) (last To)) (!= (ahead (last To) steps:2 NE) (last To))) (and {(is Mover (who at:(ahead (last To) NE))) (is Mover (who at:(ahead (last To) steps:2 NE))) (is In (ahead (last To) NE) (sites Next)) (is In (ahead (last To) steps:2 NE) (sites Next)) (= (abs (- (value Piece at:(ahead (last To) NE)) (value Piece at:(last To)))) (abs (- (value Piece at:(ahead (last To) steps:2 NE)) (value Piece at:(ahead (last To) NE)))))})) (if (and (!= (ahead (last To) SW) (last To)) (!= (ahead (last To) steps:2 SW) (last To))) (and {(is Mover (who at:(ahead (last To) SW))) (is Mover (who at:(ahead (last To) steps:2 SW))) (is In (ahead (last To) SW) (sites Next)) (is In (ahead (last To) steps:2 SW) (sites Next)) (= (abs (- (value Piece at:(ahead (last To) SW)) (value Piece at:(last To)))) (abs (- (value Piece at:(ahead (last To) steps:2 SW)) (value Piece at:(ahead (last To) SW)))))})) (if (and (!= (ahead (last To) SE) (last To)) (!= (ahead (last To) NW) (last To))) (and {(is Mover (who at:(ahead (last To) SE))) (is Mover (who at:(ahead (last To) NW))) (is In (ahead (last To) SE) (sites Next)) (is In (ahead (last To) NW) (sites Next)) (= (abs (- (value Piece at:(ahead (last To) SE)) (value Piece at:(last To)))) (abs (- (value Piece at:(ahead (last To) NW)) (value Piece at:(last To)))))})) (if (and (!= (ahead (last To) SE) (last To)) (!= (ahead (last To) steps:2 SE) (last To))) (and {(is Mover (who at:(ahead (last To) SE))) (is Mover (who at:(ahead (last To) steps:2 SE))) (is In (ahead (last To) SE) (sites Next)) (is In (ahead (last To) steps:2 SE) (sites Next)) (= (abs (- (value Piece at:(ahead (last To) SE)) (value Piece at:(last To)))) (abs (- (value Piece at:(ahead (last To) steps:2 SE)) (value Piece at:(ahead (last To) SE)))))})) (if (and (!= (ahead (last To) NW) (last To)) (!= (ahead (last To) steps:2 NW) (last To))) (and {(is Mover (who at:(ahead (last To) NW))) (is Mover (who at:(ahead (last To) steps:2 NW))) (is In (ahead (last To) NW) (sites Next)) (is In (ahead (last To) steps:2 NW) (sites Next)) (= (abs (- (value Piece at:(ahead (last To) NW)) (value Piece at:(last To)))) (abs (- (value Piece at:(ahead (last To) steps:2 NW)) (value Piece at:(ahead (last To) NW)))))}))})) (if (is In (last To) (sites Next)) (or {(if (and (!= (ahead (last To) N) (last To)) (!= (ahead (last To) S) (last To))) (and {(is Mover (who at:(ahead (last To) N))) (is Mover (who at:(ahead (last To) S))) (is In (ahead (last To) N) (sites Next)) (is In (ahead (last To) S) (sites Next)) (!= 0 (value Piece at:(last To))) (!= 0 (value Piece at:(ahead (last To) S))) (= (/ (value Piece at:(ahead (last To) N)) (value Piece at:(last To))) (/ (value Piece at:(last To)) (value Piece at:(ahead (last To) S))))})) (if (and (!= (ahead (last To) N) (last To)) (!= (ahead (last To) steps:2 N) (last To))) (and {(is Mover (who at:(ahead (last To) N))) (is Mover (who at:(ahead (last To) steps:2 N))) (is In (ahead (last To) N) (sites Next)) (is In (ahead (last To) steps:2 N) (sites Next)) (!= 0 (value Piece at:(last To))) (!= 0 (value Piece at:(ahead (last To) N))) (= (/ (value Piece at:(ahead (last To) N)) (value Piece at:(last To))) (/ (value Piece at:(ahead (last To) steps:2 N)) (value Piece at:(ahead (last To) N))))})) (if (and (!= (ahead (last To) S) (last To)) (!= (ahead (last To) steps:2 S) (last To))) (and {(is Mover (who at:(ahead (last To) S))) (is Mover (who at:(ahead (last To) steps:2 S))) (is In (ahead (last To) S) (sites Next)) (is In (ahead (last To) steps:2 S) (sites Next)) (!= 0 (value Piece at:(last To))) (!= 0 (value Piece at:(ahead (last To) S))) (= (/ (value Piece at:(ahead (last To) S)) (value Piece at:(last To))) (/ (value Piece at:(ahead (last To) steps:2 S)) (value Piece at:(ahead (last To) S))))})) (if (and (!= (ahead (last To) E) (last To)) (!= (ahead (last To) W) (last To))) (and {(is Mover (who at:(ahead (last To) E))) (is Mover (who at:(ahead (last To) W))) (is In (ahead (last To) E) (sites Next)) (is In (ahead (last To) W) (sites Next)) (!= 0 (value Piece at:(last To))) (!= 0 (value Piece at:(ahead (last To) W))) (= (/ (value Piece at:(ahead (last To) E)) (value Piece at:(last To))) (/ (value Piece at:(last To)) (value Piece at:(ahead (last To) W))))})) (if (and (!= (ahead (last To) E) (last To)) (!= (ahead (last To) steps:2 E) (last To))) (and {(is Mover (who at:(ahead (last To) E))) (is Mover (who at:(ahead (last To) steps:2 E))) (is In (ahead (last To) E) (sites Next)) (is In (ahead (last To) steps:2 E) (sites Next)) (!= 0 (value Piece at:(last To))) (!= 0 (value Piece at:(ahead (last To) E))) (= (/ (value Piece at:(ahead (last To) E)) (value Piece at:(last To))) (/ (value Piece at:(ahead (last To) steps:2 E)) (value Piece at:(ahead (last To) E))))})) (if (and (!= (ahead (last To) W) (last To)) (!= (ahead (last To) steps:2 W) (last To))) (and {(is Mover (who at:(ahead (last To) W))) (is Mover (who at:(ahead (last To) steps:2 W))) (is In (ahead (last To) W) (sites Next)) (is In (ahead (last To) steps:2 W) (sites Next)) (!= 0 (value Piece at:(last To))) (!= 0 (value Piece at:(ahead (last To) W))) (= (/ (value Piece at:(ahead (last To) W)) (value Piece at:(last To))) (/ (value Piece at:(ahead (last To) steps:2 W)) (value Piece at:(ahead (last To) W))))})) (if (and (!= (ahead (last To) NE) (last To)) (!= (ahead (last To) SW) (last To))) (and {(is Mover (who at:(ahead (last To) NE))) (is Mover (who at:(ahead (last To) SW))) (is In (ahead (last To) NE) (sites Next)) (is In (ahead (last To) SW) (sites Next)) (!= 0 (value Piece at:(last To))) (!= 0 (value Piece at:(ahead (last To) SW))) (= (/ (value Piece at:(ahead (last To) NE)) (value Piece at:(last To))) (/ (value Piece at:(last To)) (value Piece at:(ahead (last To) SW))))})) (if (and (!= (ahead (last To) NE) (last To)) (!= (ahead (last To) steps:2 NE) (last To))) (and {(is Mover (who at:(ahead (last To) NE))) (is Mover (who at:(ahead (last To) steps:2 NE))) (is In (ahead (last To) NE) (sites Next)) (is In (ahead (last To) steps:2 NE) (sites Next)) (!= 0 (value Piece at:(last To))) (!= 0 (value Piece at:(ahead (last To) NE))) (= (/ (value Piece at:(ahead (last To) NE)) (value Piece at:(last To))) (/ (value Piece at:(ahead (last To) steps:2 NE)) (value Piece at:(ahead (last To) NE))))})) (if (and (!= (ahead (last To) SW) (last To)) (!= (ahead (last To) steps:2 SW) (last To))) (and {(is Mover (who at:(ahead (last To) SW))) (is Mover (who at:(ahead (last To) steps:2 SW))) (is In (ahead (last To) SW) (sites Next)) (is In (ahead (last To) steps:2 SW) (sites Next)) (!= 0 (value Piece at:(last To))) (!= 0 (value Piece at:(ahead (last To) SW))) (= (/ (value Piece at:(ahead (last To) SW)) (value Piece at:(last To))) (/ (value Piece at:(ahead (last To) steps:2 SW)) (value Piece at:(ahead (last To) SW))))})) (if (and (!= (ahead (last To) SE) (last To)) (!= (ahead (last To) NW) (last To))) (and {(is Mover (who at:(ahead (last To) SE))) (is Mover (who at:(ahead (last To) NW))) (is In (ahead (last To) SE) (sites Next)) (is In (ahead (last To) NW) (sites Next)) (!= 0 (value Piece at:(last To))) (!= 0 (value Piece at:(ahead (last To) NW))) (= (/ (value Piece at:(ahead (last To) SE)) (value Piece at:(last To))) (/ (value Piece at:(last To)) (value Piece at:(ahead (last To) NW))))})) (if (and (!= (ahead (last To) SE) (last To)) (!= (ahead (last To) steps:2 SE) (last To))) (and {(is Mover (who at:(ahead (last To) SE))) (is Mover (who at:(ahead (last To) steps:2 SE))) (is In (ahead (last To) SE) (sites Next)) (is In (ahead (last To) steps:2 SE) (sites Next)) (!= 0 (value Piece at:(last To))) (!= 0 (value Piece at:(ahead (last To) SE))) (= (/ (value Piece at:(ahead (last To) SE)) (value Piece at:(last To))) (/ (value Piece at:(ahead (last To) steps:2 SE)) (value Piece at:(ahead (last To) SE))))})) (if (and (!= (ahead (last To) NW) (last To)) (!= (ahead (last To) steps:2 NW) (last To))) (and {(is Mover (who at:(ahead (last To) NW))) (is Mover (who at:(ahead (last To) steps:2 NW))) (is In (ahead (last To) NW) (sites Next)) (is In (ahead (last To) steps:2 NW) (sites Next)) (!= 0 (value Piece at:(last To))) (!= 0 (value Piece at:(ahead (last To) NW))) (= (/ (value Piece at:(ahead (last To) NW)) (value Piece at:(last To))) (/ (value Piece at:(ahead (last To) steps:2 NW)) (value Piece at:(ahead (last To) NW))))}))})) (if (is In (last To) (sites Next)) (or {(if (and (!= (ahead (last To) N) (last To)) (!= (ahead (last To) S) (last To))) (and {(is Mover (who at:(ahead (last To) N))) (is Mover (who at:(ahead (last To) S))) (is In (ahead (last To) N) (sites Next)) (is In (ahead (last To) S) (sites Next)) (!= 0 (value Piece at:(last To))) (!= 0 (value Piece at:(ahead (last To) S))) (= (/ (value Piece at:(ahead (last To) N)) (value Piece at:(last To))) (/ (value Piece at:(last To)) (value Piece at:(ahead (last To) S))))})) (if (and (!= (ahead (last To) N) (last To)) (!= (ahead (last To) steps:2 N) (last To))) (and {(is Mover (who at:(ahead (last To) N))) (is Mover (who at:(ahead (last To) steps:2 N))) (is In (ahead (last To) N) (sites Next)) (is In (ahead (last To) steps:2 N) (sites Next)) (!= 0 (value Piece at:(last To))) (!= 0 (value Piece at:(ahead (last To) N))) (= (/ (value Piece at:(ahead (last To) N)) (value Piece at:(last To))) (/ (value Piece at:(ahead (last To) steps:2 N)) (value Piece at:(ahead (last To) N))))})) (if (and (!= (ahead (last To) S) (last To)) (!= (ahead (last To) steps:2 S) (last To))) (and {(is Mover (who at:(ahead (last To) S))) (is Mover (who at:(ahead (last To) steps:2 S))) (is In (ahead (last To) S) (sites Next)) (is In (ahead (last To) steps:2 S) (sites Next)) (!= 0 (value Piece at:(last To))) (!= 0 (value Piece at:(ahead (last To) S))) (= (/ (value Piece at:(ahead (last To) S)) (value Piece at:(last To))) (/ (value Piece at:(ahead (last To) steps:2 S)) (value Piece at:(ahead (last To) S))))})) (if (and (!= (ahead (last To) E) (last To)) (!= (ahead (last To) W) (last To))) (and {(is Mover (who at:(ahead (last To) E))) (is Mover (who at:(ahead (last To) W))) (is In (ahead (last To) E) (sites Next)) (is In (ahead (last To) W) (sites Next)) (!= 0 (value Piece at:(last To))) (!= 0 (value Piece at:(ahead (last To) W))) (= (/ (value Piece at:(ahead (last To) E)) (value Piece at:(last To))) (/ (value Piece at:(last To)) (value Piece at:(ahead (last To) W))))})) (if (and (!= (ahead (last To) E) (last To)) (!= (ahead (last To) steps:2 E) (last To))) (and {(is Mover (who at:(ahead (last To) E))) (is Mover (who at:(ahead (last To) steps:2 E))) (is In (ahead (last To) E) (sites Next)) (is In (ahead (last To) steps:2 E) (sites Next)) (!= 0 (value Piece at:(last To))) (!= 0 (value Piece at:(ahead (last To) E))) (= (/ (value Piece at:(ahead (last To) E)) (value Piece at:(last To))) (/ (value Piece at:(ahead (last To) steps:2 E)) (value Piece at:(ahead (last To) E))))})) (if (and (!= (ahead (last To) W) (last To)) (!= (ahead (last To) steps:2 W) (last To))) (and {(is Mover (who at:(ahead (last To) W))) (is Mover (who at:(ahead (last To) steps:2 W))) (is In (ahead (last To) W) (sites Next)) (is In (ahead (last To) steps:2 W) (sites Next)) (!= 0 (value Piece at:(last To))) (!= 0 (value Piece at:(ahead (last To) W))) (= (/ (value Piece at:(ahead (last To) W)) (value Piece at:(last To))) (/ (value Piece at:(ahead (last To) steps:2 W)) (value Piece at:(ahead (last To) W))))})) (if (and (!= (ahead (last To) NE) (last To)) (!= (ahead (last To) SW) (last To))) (and {(is Mover (who at:(ahead (last To) NE))) (is Mover (who at:(ahead (last To) SW))) (is In (ahead (last To) NE) (sites Next)) (is In (ahead (last To) SW) (sites Next)) (!= 0 (value Piece at:(last To))) (!= 0 (value Piece at:(ahead (last To) SW))) (= (/ (value Piece at:(ahead (last To) NE)) (value Piece at:(last To))) (/ (value Piece at:(last To)) (value Piece at:(ahead (last To) SW))))})) (if (and (!= (ahead (last To) NE) (last To)) (!= (ahead (last To) steps:2 NE) (last To))) (and {(is Mover (who at:(ahead (last To) NE))) (is Mover (who at:(ahead (last To) steps:2 NE))) (is In (ahead (last To) NE) (sites Next)) (is In (ahead (last To) steps:2 NE) (sites Next)) (!= 0 (value Piece at:(last To))) (!= 0 (value Piece at:(ahead (last To) NE))) (= (/ (value Piece at:(ahead (last To) NE)) (value Piece at:(last To))) (/ (value Piece at:(ahead (last To) steps:2 NE)) (value Piece at:(ahead (last To) NE))))})) (if (and (!= (ahead (last To) SW) (last To)) (!= (ahead (last To) steps:2 SW) (last To))) (and {(is Mover (who at:(ahead (last To) SW))) (is Mover (who at:(ahead (last To) steps:2 SW))) (is In (ahead (last To) SW) (sites Next)) (is In (ahead (last To) steps:2 SW) (sites Next)) (!= 0 (value Piece at:(last To))) (!= 0 (value Piece at:(ahead (last To) SW))) (= (/ (value Piece at:(ahead (last To) SW)) (value Piece at:(last To))) (/ (value Piece at:(ahead (last To) steps:2 SW)) (value Piece at:(ahead (last To) SW))))})) (if (and (!= (ahead (last To) SE) (last To)) (!= (ahead (last To) NW) (last To))) (and {(is Mover (who at:(ahead (last To) SE))) (is Mover (who at:(ahead (last To) NW))) (is In (ahead (last To) SE) (sites Next)) (is In (ahead (last To) NW) (sites Next)) (!= 0 (value Piece at:(last To))) (!= 0 (value Piece at:(ahead (last To) NW))) (= (/ (value Piece at:(ahead (last To) SE)) (value Piece at:(last To))) (/ (value Piece at:(last To)) (value Piece at:(ahead (last To) NW))))})) (if (and (!= (ahead (last To) SE) (last To)) (!= (ahead (last To) steps:2 SE) (last To))) (and {(is Mover (who at:(ahead (last To) SE))) (is Mover (who at:(ahead (last To) steps:2 SE))) (is In (ahead (last To) SE) (sites Next)) (is In (ahead (last To) steps:2 SE) (sites Next)) (!= 0 (value Piece at:(last To))) (!= 0 (value Piece at:(ahead (last To) SE))) (= (/ (value Piece at:(ahead (last To) SE)) (value Piece at:(last To))) (/ (value Piece at:(ahead (last To) steps:2 SE)) (value Piece at:(ahead (last To) SE))))})) (if (and (!= (ahead (last To) NW) (last To)) (!= (ahead (last To) steps:2 NW) (last To))) (and {(is Mover (who at:(ahead (last To) NW))) (is Mover (who at:(ahead (last To) steps:2 NW))) (is In (ahead (last To) NW) (sites Next)) (is In (ahead (last To) steps:2 NW) (sites Next)) (!= 0 (value Piece at:(last To))) (!= 0 (value Piece at:(ahead (last To) NW))) (= (/ (value Piece at:(ahead (last To) NW)) (value Piece at:(last To))) (/ (value Piece at:(ahead (last To) steps:2 NW)) (value Piece at:(ahead (last To) NW))))}))}))}) (all Sites (sites Occupied by:Next) if:(= 1 (size Stack at:(site))))) (result Mover Win)))))" "BGG rules 1976 version","(game ""Shogun"" (players {(player N) (player S)}) (equipment {(board (square 8)) (piece ""Pawn"" Each (move (from (from)) (to (intersection (sites To (if (= 1 (value Piece at:(from))) (step Orthogonal (to if:(not (is Friend (who at:(to)))))) (forEach Site (sites To (slide (from) Orthogonal (between (range 1 3) if:(is Empty (between))) (to if:(is Enemy (who at:(to))) (apply if:(is Empty (to)))))) (slide (from (site)) Orthogonal (between (range 1 3) if:(is Empty (between))) (to if:(is Enemy (who at:(to)))))))) (sites Distance Orthogonal from:(from) (exact (value Piece at:(from))))) if:(not (is Friend (who at:(to)))) (apply (set Value at:(from) (value Random (range 1 4))))))) (piece ""King"" Each (move (from (from)) (to (intersection (sites To (if (= 1 (value Piece at:(from))) (step Orthogonal (to if:(not (is Friend (who at:(to)))))) (forEach Site (sites To (slide (from) Orthogonal (between (range 1 3) if:(is Empty (between))) (to if:(is Enemy (who at:(to))) (apply if:(is Empty (to)))))) (slide (from (site)) Orthogonal (between (range 1 3) if:(is Empty (between))) (to if:(is Enemy (who at:(to)))))))) (sites Distance Orthogonal from:(from) (exact (value Piece at:(from))))) if:(not (is Friend (who at:(to)))) (apply (set Value at:(from) (value Random (range 1 2)))))))}) (rules (start {(place ""Pawn1"" coord:""A1"" value:(value Random (range 1 4))) (place ""Pawn1"" coord:""B1"" value:(value Random (range 1 4))) (place ""Pawn1"" coord:""C1"" value:(value Random (range 1 4))) (place ""Pawn1"" coord:""D1"" value:(value Random (range 1 4))) (place ""Pawn1"" coord:""F1"" value:(value Random (range 1 4))) (place ""Pawn1"" coord:""G1"" value:(value Random (range 1 4))) (place ""Pawn1"" coord:""H1"" value:(value Random (range 1 4))) (place ""King1"" coord:""E1"" value:(value Random (range 1 2))) (place ""Pawn2"" coord:""A8"" value:(value Random (range 1 4))) (place ""Pawn2"" coord:""B8"" value:(value Random (range 1 4))) (place ""Pawn2"" coord:""C8"" value:(value Random (range 1 4))) (place ""Pawn2"" coord:""E8"" value:(value Random (range 1 4))) (place ""Pawn2"" coord:""F8"" value:(value Random (range 1 4))) (place ""Pawn2"" coord:""G8"" value:(value Random (range 1 4))) (place ""Pawn2"" coord:""H8"" value:(value Random (range 1 4))) (place ""King2"" coord:""D8"" value:(value Random (range 1 2)))}) (play (forEach Piece)) (end (if (or (no Pieces Next ""King"") (<= (count Pieces Next) 2)) (result Mover Win)))))","###Description BGG rules 1976 version