text
stringlengths
218
3.08k
### PRE: (game "GAME_NAME" (players {(player N) (player S)}) (equipment {(board (square 8)) (piece "PIECE_ALPHA" Each (or {(if (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 (remove (to)))))})) (piece "PIECE_BETA" Each (move Slide Orthogonal (to if:(is Enemy (who at:(to))) (apply (if (is Enemy (who at:(to))) (remove (to))))))) (piece "PIECE_GAMMA" Each ### SUF: ) (piece "PIECE_DELTA" Each (move Slide Diagonal (to if:(is Enemy (who at:(to))) (apply (if (is Enemy (who at:(to))) (remove (to))))))) (piece "PIECE_EPSILON" 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))))))) (piece "PIECE_ZETA" Each (move Slide (to if:(is Enemy (who at:(to))) (apply (if (is Enemy (who at:(to))) (remove (to))))))) (regions "Promotion" P1 (sites Top)) (regions "Promotion" P2 (sites Bottom))}) (rules (start {(place "PIECE_ALPHA1" (sites Row 1)) (place "PIECE_ALPHA2" (sites Row 6)) (place "PIECE_BETA1" {"A1" "H1"}) (place "PIECE_EPSILON1" {"B1" "G1"}) (place "PIECE_DELTA1" {"C1" "F1"}) (place "PIECE_ZETA1" coord:"D1") (place "PIECE_GAMMA1" coord:"E1") (place "PIECE_BETA2" {"A8" "H8"}) (place "PIECE_EPSILON2" {"B8" "G8"}) (place "PIECE_DELTA2" {"C8" "F8"}) (place "PIECE_ZETA2" coord:"D8") (place "PIECE_GAMMA2" coord:"E8")}) phases:{(phase "Opening" (play (do (forEach Piece) ifAfterwards:(not (is Threatened (id "PIECE_GAMMA" Mover))) (then (and (set Value Mover (+ 1 (value Player Mover))) (if (!= (value Player Mover) 1) (moveAgain)))))) (nextPhase Mover (= 2 (value Player Mover)) "Playing")) (phase "Playing" (play (if (is Prev Mover) (move Promote (last To) (piece {"PIECE_ZETA" "PIECE_EPSILON" "PIECE_DELTA" "PIECE_BETA"}) Mover) (do (forEach Piece) ifAfterwards:(not (is Threatened (id "PIECE_GAMMA" Mover)))))))} (end (if (and (is Threatened (id "PIECE_GAMMA" Next)) (not (can Move (do (forEach Piece Next) ifAfterwards:(not (is Threatened (id "PIECE_GAMMA" Next))))))) (result Mover Win))))) ### MID: (move Step (to if:(not (is Friend (who at:(to)))) (apply (if (is Enemy (who at:(to))) (remove (to))))))
### PRE: (game "GAME_NAME" (players 2) (equipment {(board (square 8)) (piece "PIECE_ALPHA" P1 N) (piece "PIECE_ALPHA" P2 S) (piece "PIECE_BETA" Each) (regions P1 (sites Bottom)) (regions P2 (sites Top))}) (rules (start {(place "PIECE_ALPHA1" (difference (expand (sites Bottom) steps:(- 3 1)) (sites Phase 1))) (place "PIECE_ALPHA2" (difference (expand (sites Top) steps:(- 3 1)) (sites Phase 1)))}) (play (if (is Prev Mover) (if (= (what at:(last To)) (id "PIECE_ALPHA" Mover)) (move Hop (from (last To)) Diagonal (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)) Diagonal (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) (if (is In (last To) (sites Next)) (promote (last To) (piece "PIECE_BETA") Mover))))) (max Moves (move Hop (from (last To)) Diagonal (between before:(count Rows) after:(count Rows) 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 (hop (from (last To)) Diagonal (between before:(count Rows) after:(count Rows) if:(and (not (is In (between) (sites ToClear))) (is Enemy (who at:(between))))) (to if:(is Empty (to))))) (moveAgain)))))) (priority {(or (forEach Piece "PIECE_ALPHA" (move Hop (from) Diagonal (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)) Diagonal (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) (if (is In (last To) (sites Next)) (promote (last To) (piece "PIECE_BETA") Mover)))))) (max Moves (forEach Piece "PIECE_BETA" (move Hop Diagonal (between before:(count Rows) after:(count Rows) if:(is Enemy (who at:(between))) (apply (remove (between) at:EndOfTurn))) (to if:(is Empty (to))) (then (if (can Move (hop (from (last To)) Diagonal (between before:(count Rows) after: ### SUF: if:(and (not (is In (between) (sites ToClear))) (is Enemy (who at:(between))))) (to if:(is Empty (to))))) (moveAgain))))))) (or (forEach Piece "PIECE_ALPHA" (move Step (directions {FR FL}) (to if:(is Empty (to)))) (then (if (is In (last To) (sites Next)) (promote (last To) (piece "PIECE_BETA") Mover)))) (forEach Piece "PIECE_BETA" (move Slide Diagonal)))}))) (end (if (no Moves Next) (result Mover Win))))) ### MID: (count Rows)
### PRE: (game "GAME_NAME" (players 2) (equipment {(board (rectangle 4 20) {(track "Track1" "0,E,N1,W,N1,E,N1,W" P1 directed:True) (track "Track2" "79,W,S1,E,S1,W,S1,E" P2 directed:True)} use:Vertex) (piece "PIECE_ALPHA" Each (if (or (= (state at:(from)) 0) (and (or (= 1 (mapEntry (count Pips))) (= 6 (mapEntry (count Pips)))) (= (state at:(from)) 1))) (if (!= (trackSite Move steps:(if (= (state at: ### SUF: ) 1) 1 (mapEntry (count Pips)))) -1) (if (or (is In (trackSite Move steps:(if (= (state at:(from)) 1) 1 (mapEntry (count Pips)))) (sites Empty)) (is Enemy (who at:(trackSite Move steps:(if (= (state at:(from)) 1) 1 (mapEntry (count Pips))))))) (move (from) (to (trackSite Move steps:(if (= (state at:(from)) 1) 1 (mapEntry (count Pips)))) (apply if:(is Enemy (who at:(to))) (remove (to)))))) (then (if (= (state at:(last To)) 1) (set State at:(last To) 0)))))) (regions "AllSites" (sites Board)) (dice d:2 from:0 num:6) (map {(pair 0 6) (pair 1 0) (pair 2 2) (pair 3 1) (pair 4 1) (pair 5 0) (pair 6 6)}) (regions P1 (sites Bottom)) (regions P2 (sites Top))}) (rules (start {(place "PIECE_ALPHA1" (sites Bottom) state:1) (place "PIECE_ALPHA2" (sites Top) state:1)}) (play (do (roll) next:(forEach Piece))) (end {(if (no Pieces Next) (result Next Loss)) (if (and (= (count Sites in:(difference (sites Occupied by:P1) (sites P2))) 0) (= (count Sites in:(difference (sites Occupied by:P2) (sites P1))) 0)) (result Mover Draw))}))) ### MID: (from)
### PRE: (game "GAME_NAME" (players 2) (equipment {(board (concentric Square rings:2) use:Vertex) (hand Each) (piece "PIECE_ALPHA" Each (move Step (to if:(is Empty (to))) (then (if (is Line 3 Orthogonal exact:True) (moveAgain)))))}) (rules (start (place "PIECE_ALPHA" "Hand" count:5)) 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 (is Line 3 Orthogonal exact:True) (moveAgain)))))) ### SUF: ) (phase "Movement" (play (if (is Prev Mover) (move Remove (sites Occupied by:Enemy container:"Board")) (forEach Piece))))} (end (if (<= (count Pieces Next) 2) (result Next Loss))))) ### MID: (nextPhase Mover (all Sites (sites Hand Mover) if:(= 0 (count Cell at:(site)))) "Movement")
### PRE: (game "GAME_NAME" (players {(player N) (player S)}) (equipment {(board (square 8)) (hand Each size:5) (piece "PIECE_ALPHA" Each (move Step (to if:(not (is Friend (who at:(to)))) (apply (if (is Enemy (who at:(to))) (remove (to))))))) (piece "PIECE_BETA" Each (move Slide Orthogonal (to if:(is Enemy (who at:(to))) (apply (remove (to)))))) (piece "PIECE_GAMMA" Each (move Hop Diagonal (between (exact 2) if:True) (to if:(not (is Friend (who at:(to)))) (apply (if (is Enemy (who at:(to))) (remove (to))))))) (piece "PIECE_DELTA" 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))))))) (piece "PIECE_EPSILON" Each (or { ### SUF: (move Step (directions {FR FL}) (to if:(is Enemy (who at:(to))) (apply (remove (to)))))} (then (if (is In (last To) (sites Mover "Promotion")) (promote (last To) (piece "PIECE_ZETA") Mover))))) (piece "PIECE_ZETA" Each (move Step Diagonal (to if:(not (is Friend (who at:(to)))) (apply (remove (to)))))) (regions "Promotion" P1 (sites Top)) (regions "Promotion" P2 (sites Bottom))}) (rules (start {(place "PIECE_EPSILON1" (sites Row 1)) (place "PIECE_EPSILON2" (sites Row 6)) (place "PIECE_BETA1" {"A1" "H1"}) (place "PIECE_DELTA1" {"B1" "G1"}) (place "PIECE_GAMMA1" {"C1" "F1"}) (place "PIECE_ZETA1" coord:"D1") (place "PIECE_ALPHA1" coord:"E1") (place "PIECE_BETA2" {"A8" "H8"}) (place "PIECE_DELTA2" {"B8" "G8"}) (place "PIECE_GAMMA2" {"C8" "F8"}) (place "PIECE_ZETA2" coord:"D8") (place "PIECE_ALPHA2" coord:"E8")}) (play (do (forEach Piece) ifAfterwards:(not (is Threatened (id "PIECE_ALPHA" Mover))) (then (if (and (> (count Pieces P1) 1) (> (count Pieces P2) 1)) (set Counter))))) (end {(if (and (is Threatened (id "PIECE_ALPHA" Next)) (not (can Move (do (forEach Piece Next) ifAfterwards:(not (is Threatened (id "PIECE_ALPHA" Next))))))) (result Mover Win)) (if (and (or (= (count Pieces P1) 1) (= (count Pieces P2) 1)) (= (counter) 20)) (result Mover Draw))}))) ### MID: (move Step Forward (to if:(is Empty (to))))
### PRE: (game "GAME_NAME" (players 6) (equipment {(board (hex Star 4)) (piece "PIECE_ALPHA" Each) (regions "Home" P1 (expand origin:(coord row:0 column:4) steps:(- 4 1))) (regions "Home" P2 (expand origin:(coord row:4 column:(* 4 3)) steps:(- 4 1))) ### SUF: (regions "Home" P4 (expand origin:(coord row:(* 4 4) column:(* 4 3)) steps:(- 4 1))) (regions "Home" P5 (expand origin:(coord row:(* 4 3) column:4) steps:(- 4 1))) (regions "Home" P6 (expand origin:(coord row:4 column:0) steps:(- 4 1))) (map {(pair 1 4) (pair 2 5) (pair 3 6) (pair 4 1) (pair 5 2) (pair 6 3)})}) (rules (start {(place "PIECE_ALPHA1" (sites P1)) (place "PIECE_ALPHA2" (sites P2)) (place "PIECE_ALPHA3" (sites P3)) (place "PIECE_ALPHA4" (sites P4)) (place "PIECE_ALPHA5" (sites P5)) (place "PIECE_ALPHA6" (sites P6))}) phases:{(phase "Movement" (play (forEach Piece (or (move Hop (from (from)) (between if:(is Occupied (between))) (to if:(and (and (is Empty (to)) (not (is Visited (to)))) (or (not (is In (from) (sites (player (mapEntry (mover)))))) (is In (to) (sites (player (mapEntry (mover)))))))) (then (if (can Move (move Hop (from (last To)) (between if:(is Occupied (between))) (to if:(and (and (is Empty (to)) (not (is Visited (to)))) (or (not (is In (last To) (sites (player (mapEntry (mover)))))) (is In (to) (sites (player (mapEntry (mover)))))))))) (moveAgain)))) (move Step (to if:(and (is Empty (to)) (or (not (is In (from) (sites (player (mapEntry (mover)))))) (is In (to) (sites (player (mapEntry (mover)))))))))))) (nextPhase (is Mover (next)) "MultiJump")) (phase "MultiJump" (play (or (move Hop (from (last To)) (between if:(is Occupied (between))) (to if:(and (and (is Empty (to)) (not (is Visited (to)))) (or (not (is In (last To) (sites (player (mapEntry (mover)))))) (is In (to) (sites (player (mapEntry (mover)))))))) (then (if (can Move (move Hop (from (last To)) (between if:(is Occupied (between))) (to if:(and (and (is Empty (to)) (not (is Visited (to)))) (or (not (is In (last To) (sites (player (mapEntry (mover)))))) (is In (to) (sites (player (mapEntry (mover)))))))))) (moveAgain)))) (move Pass))) (nextPhase (not (is Mover (next))) "Movement"))} (end (if (= (sites Occupied by:Mover) (sites (player (mapEntry (mover))))) (result Mover Win))))) ### MID: (regions "Home" P3 (expand origin:(coord row:(* 4 3) column:(* 4 4)) steps:(- 4 1)))
### PRE: (game "GAME_NAME" (players 2) (equipment {(board (square 9)) (piece "PIECE_ALPHA" Each (or (move Step Orthogonal (to if:(and (is Empty (to)) (all Sites (sites Occupied by:Shared on:Edge) if:(not (is In (site) (intersection (sites Incident Edge of:Cell at:(from)) (sites Incident Edge of:Cell at:(to))))))))) (move Hop Orthogonal (between if:(is Enemy (who at:(between)))) (to if:(and {(is Empty (to)) (all Sites (sites Occupied by:Shared on:Edge) if:(not (is In (site) (intersection (sites Incident Edge of:Cell at:(from)) (sites Incident Edge of:Cell at:(between)))))) (all Sites (sites Occupied by:Shared on:Edge) if:(not (is In (site) (intersection (sites Incident Edge of:Cell at:(between)) (sites Incident Edge of:Cell at:(to))))))}))))) (piece "PIECE_BETA" Shared) (hand Each) (regions P1 (sites Top)) (regions P2 (sites Bottom))}) (rules (start {(place "PIECE_BETA" (handSite P1) count:10) (place "PIECE_BETA" (handSite P2) count:10) (place "PIECE_ALPHA1" (intersection (sites Bottom) (sites Column (column of:(centrePoint))))) (place "PIECE_ALPHA2" (intersection (sites Top) (sites Column (column of:(centrePoint)))))}) (play (or (do (if (is Occupied (handSite Mover)) (move (from (handSite Mover)) (to Edge (difference (sites Empty Edge) (sites Outer Edge))))) ifAfterwards:(and {(!= Infinity (count Steps (step Orthogonal (to if:(and (is Empty (to)) (all Sites (sites Occupied by:Shared on:Edge) if:(not (is In (site) (intersection (sites Incident Edge of:Cell at:(from)) (sites Incident Edge of:Cell at:(to))))))))) (where "PIECE_ALPHA" P1) (sites P1))) (!= Infinity (count Steps (step Orthogonal (to if:(and ### SUF: (all Sites (sites Occupied by:Shared on:Edge) if:(not (is In (site) (intersection (sites Incident Edge of:Cell at:(from)) (sites Incident Edge of:Cell at:(to))))))))) (where "PIECE_ALPHA" P2) (sites P2)))})) (forEach Piece))) (end (if (and (is LastTo Cell) (is In (last To) (sites Mover))) (result Mover Win))))) ### MID: (is Empty (to))
### PRE: (game "GAME_NAME" (players 2) (equipment {(board (hex Limping 5) use:Cell) (piece "PIECE_ALPHA" Each)}) (rules (start (set Score Each 0)) (play (if (was Pass) (or (move Pass) (priority (move Add (to (sites Empty) if:(not (is Within (id "PIECE_ALPHA" Mover) in:(sites LineOfSight Piece at:(to))))) (then (addScore Mover 1))) (forEach Piece (do (or {(if (<= 1 (count Pieces Next in:(sites Around (from)))) (move (from (from)) (to (intersection (sites Empty) (sites Around (from)))))) (if (<= 2 (count Pieces Next in:(sites Around (from)))) (move (from (from)) (to (intersection (sites Empty) (sites Around (intersection (sites Empty) (sites Around (from)))))))) (if (<= 3 (count Pieces Next in:(sites Around (from)))) (move (from (from)) (to (intersection (sites Empty) (sites Around (intersection ### SUF: (sites Around (intersection (sites Empty) (sites Around (from)))))))))) (if (<= 4 (count Pieces Next in:(sites Around (from)))) (move (from (from)) (to (intersection (sites Empty) (sites Around (intersection (sites Empty) (sites Around (intersection (sites Empty) (sites Around (intersection (sites Empty) (sites Around (from)))))))))))) (if (<= 5 (count Pieces Next in:(sites Around (from)))) (move (from (from)) (to (intersection (sites Empty) (sites Around (intersection (sites Empty) (sites Around (intersection (sites Empty) (sites Around (intersection (sites Empty) (sites Around (intersection (sites Empty) (sites Around (from))))))))))))))}) ifAfterwards:(can Move (add (to (sites Empty) if:(not (is Within (id "PIECE_ALPHA" Mover) in:(sites LineOfSight Piece at:(to))))))))))) (or {(move Add (to (sites Empty) if:(not (is Within (id "PIECE_ALPHA" Mover) in:(sites LineOfSight Piece at:(to))))) (then (addScore Mover 1))) (forEach Piece (or {(if (<= 1 (count Pieces Next in:(sites Around (from)))) (move (from (from)) (to (intersection (sites Empty) (sites Around (from)))))) (if (<= 2 (count Pieces Next in:(sites Around (from)))) (move (from (from)) (to (intersection (sites Empty) (sites Around (intersection (sites Empty) (sites Around (from)))))))) (if (<= 3 (count Pieces Next in:(sites Around (from)))) (move (from (from)) (to (intersection (sites Empty) (sites Around (intersection (sites Empty) (sites Around (intersection (sites Empty) (sites Around (from)))))))))) (if (<= 4 (count Pieces Next in:(sites Around (from)))) (move (from (from)) (to (intersection (sites Empty) (sites Around (intersection (sites Empty) (sites Around (intersection (sites Empty) (sites Around (intersection (sites Empty) (sites Around (from)))))))))))) (if (<= 5 (count Pieces Next in:(sites Around (from)))) (move (from (from)) (to (intersection (sites Empty) (sites Around (intersection (sites Empty) (sites Around (intersection (sites Empty) (sites Around (intersection (sites Empty) (sites Around (intersection (sites Empty) (sites Around (from))))))))))))))})) (move Pass)}))) (end {(if (and (all Passed) (> (score Mover) (score Next))) (result Mover Win)) (if (and (all Passed) (<= (score Mover) (score Next))) (result Next Win))}))) ### MID: (sites Empty)
### PRE: (game "GAME_NAME" (players 2) (equipment {(board (square 11)) (regions "Fortresses" (sites Corners)) (piece "PIECE_ALPHA" P1 (move Slide Orthogonal (between if:(and (not (is In (between) (union (sites Centre) (sites "Fortresses")))) (is Empty (between)))) (then (or {(custodial (from (last To)) Orthogonal (between (max 1) if:(= (what at:(between)) (id "PIECE_ALPHA2")) (apply (remove (between)))) (to if:(or (is Friend (who at:(to))) (is In (to) (union (sites Centre) (sites "Fortresses")))))) (custodial (from (last To)) Orthogonal (between (max 1) if:(= (what at:(between)) (id "PIECE_BETA" P2)) (apply (trigger "Surrounded" P2))) (to if:(or (is Friend (who at:(to))) (is In (to) (union (sites Centre) (sites "Fortresses"))))))})))) (piece "PIECE_ALPHA" P2 (move Slide Orthogonal (between if:(and (not (is In (between) (union (sites Centre) (sites "Fortresses")))) (is Empty (between)))) (then (custodial (from (last To)) Orthogonal (between (max 1) if:(= (what at:(between)) (id "PIECE_ALPHA1")) (apply (remove (between)))) (to if:(or (is Friend (who at:(to))) (is In (to) (union (sites Centre) (sites "Fortresses"))))))))) (piece "PIECE_BETA" P2 (move Slide Orthogonal (then (custodial (from (last To)) Orthogonal (between (max 1) if:(= (what at:(between)) (id "PIECE_ALPHA1")) (apply (remove (between)))) (to if:(or (is Friend (who at:(to))) (is In (to) (union (sites Centre) (sites "Fortresses")))))))))}) (rules (start {(place "PIECE_ALPHA1" {"D1" "E1" "F1" "G1" "H1" "F2" "A4" "A5" "A6" "A7" "A8" "B6" "K4" "K5" "K6" "K7" "K8" "J6" "F10" "D11" "E11" "F11" "G11" "H11" "F10"}) (place "PIECE_ALPHA2" {"F3" "F4" "F5" "C6" "D6" "E6" "G6" "H6" "I6" "F7" "F8" "F9"}) (place "PIECE_BETA2" (centrePoint))}) (play ### SUF: ) (end {(if (is Within (id "PIECE_BETA2") in:(sites Outer)) (result P2 Win)) (if (is Triggered "Surrounded" P2) (result P1 Win))}))) ### MID: (forEach Piece)
### PRE: (game "GAME_NAME" (players 2) (equipment {(board (rectangle 2 13) {(track "Track1" {12 11 10 9 8 7 5 4 3 2 1 0 13 14 15 16 17 18 20 21 22 23 24 25} P1 directed:True) (track "Track2" {25 24 23 22 21 20 18 17 16 15 14 13 0 1 2 3 4 5 7 8 9 10 11 12} P2 directed:True)} use:Vertex) (dice num:2) (regions P1 {20 21 22 23 24 25}) (regions P2 {7 8 9 10 11 12}) (piece "PIECE_ALPHA" Each (forEach Die replayDouble:True if:(and {(!= (pips) 0) (!= (trackSite Move from:(from) steps:(pips)) -1) (!= (trackSite Move from:(from) steps:(pips)) -2)}) (move (from (from)) (to (trackSite Move from:(from) steps:(pips)) if:(or (not (is Enemy (who at:(to)))) (= 1 (size Stack at:(to))))))))}) (rules (start {(place Stack "PIECE_ALPHA1" 12 count:15) (place Stack "PIECE_ALPHA2" 25 count:15)}) (play (do (if (not (is Prev Mover)) (roll)) next:(if (all Sites (sites Occupied by:Mover) if:(is In (site) (sites Mover))) (forEach Die replayDouble:True if:(!= (pips) 0) (forEach Site (sites Occupied by:Mover) (if (and (is Occupied (site)) (!= (trackSite Move from:(site) steps:(pips)) -1)) (if (= (trackSite Move from:(site) steps:(pips)) -2) (move Remove (from)) (move (from (site)) (to (trackSite Move from:(site) steps:(pips)) if:(or (not (is Enemy (who at:(to)))) (= 1 (size Stack at:(to)))))))) noMoveYet:(firstMoveOnTrack "Track" Mover (if (and (is Friend (who at:(site))) (< (trackSite Move from:(site) steps:(pips)) 0)) (move Remove (from)))) (then (if (not (all DiceUsed)) (moveAgain))))) (max Distance "Track" Mover (forEach Piece top:True (then (if (not (all DiceUsed)) (moveAgain)))))))) (end {(if (no Pieces Mover) (byScore {(score P1 (if (is Mover P1) (if (= (size Stack in:(sites Occupied by:P2)) 15) 2 1) 0)) (score P2 (if (is Mover P2) (if (= (size Stack in:(sites Occupied by:P1)) 15) 2 1) 0))})) (if (and (= (what at:12 level:0) (id "PIECE_ALPHA1" P1)) (= (what at:12 level:1) (id "PIECE_ALPHA2" P2))) (byScore {(score P1 0) ### SUF: })) (if (and (= (what at:25 level:0) (id "PIECE_ALPHA2" P2)) (= (what at:25 level:1) (id "PIECE_ALPHA1" P1))) (byScore {(score P1 2) (score P2 0)}))}))) ### MID: (score P2 2)
### PRE: (game "GAME_NAME" (players 2) (equipment {(board (square 3)) (piece "PIECE_ALPHA1" Each) (piece "PIECE_ALPHA2" Each) (piece "PIECE_ALPHA3" Each) (hand Each size:3)}) (rules (start {(place Stack "PIECE_ALPHA11" (handSite P1) count:3) (place Stack "PIECE_ALPHA12" (handSite P2) count:3) (place Stack "PIECE_ALPHA21" (handSite P1 1) count:3) (place Stack "PIECE_ALPHA22" (handSite P2 1) count:3) (place Stack "PIECE_ALPHA31" (handSite P1 2) count:3) (place Stack "PIECE_ALPHA32" (handSite P2 2) count:3)}) (play (or (move (from (sites Hand Mover)) (to (sites Board) if:(and (!= (from) (to)) (or (is Empty (to)) (< (- (what at:(from) level:(topLevel at:(from))) (who at:(from) level:(topLevel at:(from)))) (- (what at:(to) level:(topLevel at:(to))) (who at:(to) level:(topLevel at: ### SUF: )))))))) (move (from (sites Occupied by:Mover top:True)) (to (sites Board) if:(and (!= (from) (to)) (or (is Empty (to)) (< (- (what at:(from) level:(topLevel at:(from))) (who at:(from) level:(topLevel at:(from)))) (- (what at:(to) level:(topLevel at:(to))) (who at:(to) level:(topLevel at:(to))))))))))) (end (forEach Player if:(is Line 3 Player top:True) (result Player Win))))) ### MID: (to)
### PRE: (game "GAME_NAME" (players 4) (equipment {(board (square 5) {(track "Track1" "2,W,N,E,S,W1,N3,W2,S2,E1,N1" P1 directed:True) (track "Track2" "22,E,S,W,N,E1,S3,E2,N2,W1,S1" P2 directed:True) (track "Track3" "14,S,W,N,E,S1,W3,S2,E2,N1,W1" P3 directed:True) (track "Track4" "10,N,E,S,W,N1,E3,N2,W2,S1,E1" P4 directed:True)}) (dice d:2 from:0 num:4) (piece "PIECE_ALPHA" Each (if (!= (trackSite Move steps:(count Pips)) -1) (move (from (from) level: ### SUF: ) (to (trackSite Move steps:(count Pips)) (apply if:(is Enemy (who at:(to))) (fromTo (from (to)) (to (mapEntry (who at:(to)))))))) (then (if (= 12 (last To)) (remove (last To)))))) (map {(pair 1 "C1") (pair 2 "C5") (pair 3 "E3") (pair 4 "A3")})}) (rules (start {(place Stack "PIECE_ALPHA1" (mapEntry 1) count:2) (place Stack "PIECE_ALPHA2" (mapEntry 2) count:2) (place Stack "PIECE_ALPHA3" (mapEntry 3) count:2) (place Stack "PIECE_ALPHA4" (mapEntry 4) count:2)}) (play (do (roll) next:(if (!= 0 (count Pips)) (forEach Piece) (move Pass)))) (end (if (no Pieces Mover) (result Mover Win))))) ### MID: (level)
### PRE: (game "GAME_NAME" (players 2) (equipment {(board (rectangle 2 13) {(track "Track1" {6 0 1 2 3 4 5 7 8 9 10 11 12 25 24 23 22 21 20 18 17 16 15 14 13} P1 directed:True) (track "Track2" {19 13 14 15 16 17 18 20 21 22 23 24 25 12 11 10 9 8 7 5 4 3 2 1 0} P2 directed:True)} use:Vertex) (dice d:6 num:2) (piece "PIECE_ALPHA" Each (move (from (from)) (to (trackSite Move from:(from) steps:(min (face 26) (face 27))) if:(and (or (is Empty (to)) (and (= (to) (mapEntry "FinalPoint" Mover)) (no Pieces Next in:(sites {(mapEntry "FinalPoint" Mover)})))) (if (< 1 (min (face 26) (face 27))) (no Pieces Mover in:(sites Track Mover from:(trackSite Move from:(from) steps:1) to:(trackSite Move from:(from) steps:(- (min (face 26) (face 27)) 1)))) True)) (apply (if (and (is Enemy (who at:(mapEntry "Opposite" (to)))) (= 1 (size Stack at:(mapEntry "Opposite" (to))))) (fromTo (from (mapEntry "Opposite" (to))) (to (mapEntry "Bar" Next)))))))) (map "FinalPoint" {(pair P1 13) (pair P2 0)}) (map "Bar" {(pair P1 6) (pair P2 19)}) (map "Opposite" {(pair 0 13) (pair 1 14) (pair 2 15) (pair 3 16) (pair 4 17) (pair 5 18) (pair 7 20) (pair 8 21) (pair 9 22) (pair 10 23) (pair 11 24) (pair 12 25) (pair 13 0) (pair 14 1) (pair 15 2) (pair 16 3) (pair 17 4) (pair 18 5) (pair 20 7) (pair 21 8) (pair 22 9) (pair 23 10) (pair 24 11) (pair 25 12)})}) (rules (start { ### SUF: (place Stack "PIECE_ALPHA2" 19 count:3)}) (play (do (roll) next:(forEach Piece top:True))) (end (if (= 3 (count Pieces Mover in:(sites {(mapEntry "FinalPoint" Mover)}))) (result Mover Win))))) ### MID: (place Stack "PIECE_ALPHA1" 6 count:3)
### PRE: (game "GAME_NAME" (players 2) (equipment {(board (makeFaces ### SUF: ) use:Vertex) (piece "PIECE_ALPHA" P1 (move Step (to if:(is Empty (to))))) (piece "PIECE_BETA" P2 (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))) (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))))) (moveAgain))))))}) (rules (start {(place Stack "PIECE_ALPHA1" (sites {"B2" "D2" "B4" "D4"}) counts:{5 5 5 5}) (place "PIECE_BETA2" (sites {"C1" "C5"}))}) (play (if (is Prev Mover) (or (move Pass) (move Hop (from (last To)) (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))))) (moveAgain))))) (forEach Piece top:True))) (end {(if (no Moves P2) (result P1 Win)) (if (no Pieces P1) (result P2 Win))}))) ### MID: (remove (square 5 diagonals:Alternating) edges:{{{0 0} {1 1}} {{1 1} {2 2}} {{2 2} {3 3}} {{3 3} {4 4}} {{4 0} {3 1}} {{3 1} {2 2}} {{2 2} {1 3}} {{1 3} {0 4}}})
### PRE: (game "GAME_NAME" (players 2) (equipment {(board (square 8)) (piece "PIECE_ALPHA" P1 N) (piece "PIECE_ALPHA" P2 S) (piece "PIECE_BETA" Each) (regions P1 (sites Bottom)) (regions P2 (sites Top))}) (rules (start {(place "PIECE_ALPHA1" (union (sites Row 1) (sites Row 2))) (place "PIECE_ALPHA2" (union (sites Row 5) (sites Row 6)))}) (play (if (is Prev Mover) (if (= (what at:(last To)) (id "PIECE_ALPHA" Mover)) (max Moves (move Hop (from (last To)) (directions {Forward Rightward Leftward}) (between if:(is Enemy (who at:(between))) (apply (remove (between)))) (to if:(is Empty (to))) (then (if (can Move (move Hop (from (last To)) (directions {Forward Rightward Leftward}) (between if:(is Enemy (who at:(between))) (apply (remove (between)))) (to if:(is Empty (to))))) (moveAgain) (if (is In (last To) (sites Next)) (promote (last To) (piece "PIECE_BETA") Mover)))))) (max Moves (move Hop (from (last To)) (difference Orthogonal OppositeDirection) (between before:(count Rows) after:(count Rows) if:(is Enemy (who at:(between))) (apply (remove (between)))) (to if:(is Empty (to))) (then (if (can Move (move Hop (from (last To)) (difference Orthogonal OppositeDirection) (between before:(count Rows) after:(count Rows) if:(and (not (is In (between) (sites ToClear))) (is Enemy (who at:(between)))) (apply (remove (between)))) (to if:(is Empty (to))))) (moveAgain)))))) (priority {(max Moves (or (forEach Piece "PIECE_ALPHA" (move Hop (from (from)) (directions {Forward Rightward Leftward}) (between if:(is Enemy (who at: ### SUF: )) (apply (remove (between)))) (to if:(is Empty (to))) (then (if (can Move (move Hop (from (last To)) (directions {Forward Rightward Leftward}) (between if:(is Enemy (who at:(between))) (apply (remove (between)))) (to if:(is Empty (to))))) (moveAgain) (if (is In (last To) (sites Next)) (promote (last To) (piece "PIECE_BETA") Mover)))))) (forEach Piece "PIECE_BETA" (move Hop (from) Orthogonal (between before:(count Rows) after:(count Rows) if:(is Enemy (who at:(between))) (apply (remove (between)))) (to if:(is Empty (to))) (then (if (can Move (move Hop (from (last To)) (difference Orthogonal OppositeDirection) (between before:(count Rows) after:(count Rows) if:(and (not (is In (between) (sites ToClear))) (is Enemy (who at:(between)))) (apply (remove (between)))) (to if:(is Empty (to))))) (moveAgain))))))) (or (forEach Piece "PIECE_ALPHA" (move Step (directions {Forward Rightward Leftward}) (to if:(is Empty (to)))) (then (if (is In (last To) (sites Next)) (promote (last To) (piece "PIECE_BETA") Mover)))) (forEach Piece "PIECE_BETA" (move Slide Orthogonal)))}))) (end (if (no Moves Next) (result Mover Win))))) ### MID: (between)
### PRE: (game "GAME_NAME" (players 2) (equipment {(board (add (remove (scale 1 2 (wedge 3)) vertices:{5}) edges:{{4 5}}) use:Vertex) (hand P1) (piece "PIECE_ALPHA" P1 (move Step (to if:(is Empty (to))))) (piece "PIECE_BETA" P2 (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))))))}) ### SUF: ) ### MID: (rules (start {(place "PIECE_ALPHA1" (handSite P1) count:3) (place "PIECE_BETA2" (sites Top))}) phases:{(phase "Opening" P1 (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 P2) (result P1 Win)) (if (< (count Pieces P1) 3) (result P2 Win))}))
### PRE: (game "GAME_NAME" (players {(player N) (player S)}) (equipment {(board (square 9)) (piece "PIECE_ALPHA" 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)))) ### SUF: ))) (piece "PIECE_BETA" 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 "PIECE_GAMMA" 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 "PIECE_DELTA" 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 "PIECE_EPSILON" 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 "PIECE_ZETA" 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 "PIECE_ALPHA1" coord:"E1") (place "PIECE_BETA1" {"D1" "F1"}) (place "PIECE_GAMMA1" {"C1" "G1"}) (place "PIECE_DELTA1" {"B1" "H1"}) (place "PIECE_EPSILON1" {"A1" "I1"}) (place "PIECE_ZETA1" (sites Row 1)) (place "PIECE_ALPHA2" coord:"E9") (place "PIECE_BETA2" {"D9" "F9"}) (place "PIECE_GAMMA2" {"C9" "G9"}) (place "PIECE_DELTA2" {"B9" "H9"}) (place "PIECE_EPSILON2" {"A9" "I9"}) (place "PIECE_ZETA2" (sites Row 7))}) (play (forEach Piece)) (end (if (no Pieces Next) (result Next Loss))))) ### MID: (to if:(is Empty (to)))
### PRE: (game "GAME_NAME" (players 2) (equipment {(board (hex 5)) (piece "PIECE_ALPHA" 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) 1))) (forEach Site (sites) (set State at:(site) 0)))))))) (end (if (is Full) {(if ### SUF: (byScore)) (if True (byScore {(score P1 (- (count Groups if:(= (id P1) (who at:(to)))))) (score P2 (- (count Groups if:(= (id P2) (who at:(to))))))}))})))) ### MID: (= (count Groups if:(= (id P1) (who at:(to)))) (count Groups if:(= (id P2) (who at:(to)))))
### PRE: (game "GAME_NAME" (players 2) (equipment {(boardless Hexagonal) (tile "Hex" Each numSides:6)}) (rules (start {(place "Hex1" (centrePoint)) (place "Hex2" (ahead (centrePoint) E))}) (play ### SUF: ) (end {(if (or (is Loop surround:Next) (is Line 5)) (result Mover Win)) (if (= (count Moves) (* (count Players) 24)) (result Mover Draw))}))) ### MID: (move Add (to (sites Playable) if:(<= 2 (count Sites in:(sites Around (to) NotEmpty)))))
### PRE: (game "GAME_NAME" (players 2) (equipment {(board (rectangle 2 13) {(track "Track1" {7 8 9 10 11 12} P1 directed:True) (track "Track2" {18 17 16 15 14 13} P2 directed:True)} use:Vertex) (dice d:6 num:2) (piece "PIECE_ALPHA" Each (forEach Die if:(!= (pips) 0) (if (= (trackSite Move steps:(pips)) -1) (move Remove ### SUF: ) (move (from) (to (trackSite Move steps:(pips))))))) (map "StartTrack" {(pair P1 7) (pair P2 18)})}) (rules (start {(place Stack "PIECE_ALPHA1" (sites {7 8 9}) count:2) (place Stack "PIECE_ALPHA1" (sites {10 11 12}) count:3) (place Stack "PIECE_ALPHA2" (sites {13 14 15}) count:3) (place Stack "PIECE_ALPHA2" (sites {16 17 18}) count:2)}) phases:{(phase "UnStacking" (play (do (if (not (is Prev Mover)) (roll)) next:(forEach Die if:(!= (pips) 0) (or (if (= (state at:(trackSite Move from:(mapEntry "StartTrack" (mover)) steps:(- (pips) 1))) 0) (move Select (from (trackSite Move from:(mapEntry "StartTrack" (mover)) steps:(- (pips) 1))) (then (and (if (= 3 (size Stack at:(last To))) (forEach Level (last To) (set State at:(last To) level:(level) 1)) (forEach Level (last To) (set State at:(last To) level:(level) 2))) (if (not (all DiceUsed)) (moveAgain)))))) (if (= (state at:(trackSite Move from:(mapEntry "StartTrack" (mover)) steps:(- (pips) 1))) 1) (move Select (from (trackSite Move from:(mapEntry "StartTrack" (mover)) steps:(- (pips) 1))) (then (and (forEach Level (last To) (set State at:(last To) level:(level) 2)) (if (not (all DiceUsed)) (moveAgain)))))))))) (nextPhase Mover (all Sites (sites Occupied by:Mover) if:(not (or (= (state at:(site)) 0) (= (state at:(site)) 1)))) "BearingOff")) (phase "BearingOff" (play (do (if (or (all DiceEqual) (not (is Prev Mover))) (roll)) next:(forEach Piece top:True) (then (if (not (all DiceUsed)) (moveAgain))))) (end (if (no Pieces Mover) (result Mover Win))))})) ### MID: (from)
### PRE: (game "GAME_NAME" (players 2) (equipment {(board (rotate 90 (merge {(rectangle 3 3 diagonals:Alternating) (shift 1.5 0.5 (rotate -90 (wedge 2))) (shift -1.5 0.5 (rotate 90 (wedge 2)))})) use:Vertex) (piece "PIECE_ALPHA" P1 (move Step (to if:(is Empty (to))))) (piece "PIECE_ALPHA" P2 N (move Step (directions {Forwards Rightward Leftward}) (to if:(is Empty (to))))) (regions "Home" P2 (sites {"B1" "C2" "A2"})) (regions "Home" P1 (sites {"B2"}))}) (rules (start {(place "PIECE_ALPHA1" (sites P1)) (place "PIECE_ALPHA2" (sites P2))}) (play (forEach Piece)) ### SUF: )) ### MID: (end {(if (no Moves P1) (result P2 Win)) (if (is In (where "PIECE_ALPHA" P1) (sites P2)) (result P1 Win))})
### PRE: (game "GAME_NAME" (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 "PIECE_ALPHA" 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: ### SUF: ))) (= 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 "PIECE_ALPHA1" 11 count:8) (place Stack "PIECE_ALPHA1" 6 count:3) (place Stack "PIECE_ALPHA1" 7 count:4) (place Stack "PIECE_ALPHA2" (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))))) ### MID: (to)
### PRE: (game "GAME_NAME" (players 2) (equipment {(board (concentric Square rings:3 joinCorners:True) use:Vertex) (hand Each) (piece "PIECE_ALPHA" Each (move Step (to if:(is Empty (to))) (then (if (is Line 3 if:(= 1 (size Stack at:(to)))) (moveAgain)))))}) ### SUF: ) ### MID: (rules (start {(place Stack "PIECE_ALPHA1" (handSite P1) count:12) (place Stack "PIECE_ALPHA2" (handSite P2) count:12)}) phases:{(phase "Placement" (play (if (is Prev Mover) (move (from (handSite Mover)) (to (forEach (sites Occupied by:Next container:"Board") if:(= (size Stack at:(site)) 1)))) (if (not (all Sites (sites Hand Mover) if:(= 0 (count Cell at:(site))))) (move (from (handSite Mover)) (to (sites Empty)) (then (if (is Line 3 if:(= 1 (size Stack at:(to)))) (moveAgain))))) (then (if (and (not (is Next Mover)) (and (all Sites (sites Hand P1) if:(= 0 (count Cell at:(site)))) (all Sites (sites Hand P2) if:(= 0 (count Cell at:(site)))))) (and (forEach Site (forEach (sites Occupied by:P1 container:"Board") if:(= (size Stack at:(site)) 2)) (and {(remove (site)) (remove (site)) (add (piece (id "PIECE_ALPHA" P1)) (to (site)))})) (forEach Site (forEach (sites Occupied by:P2 container:"Board") if:(= (size Stack at:(site)) 2)) (and {(remove (site)) (remove (site)) (add (piece (id "PIECE_ALPHA" P2)) (to (site)))}))))))) (nextPhase (and (not (is Next Mover)) (and (all Sites (sites Hand P1) if:(= 0 (count Cell at:(site)))) (all Sites (sites Hand P2) 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) 3) (forEach Piece) (move (from (sites Occupied by:Mover)) (to (sites Empty)))))) (end (if (no Moves Next) (result Mover Win))))})
### PRE: (game "GAME_NAME" (players 2) (equipment {(board (square 8)) (piece "PIECE_ALPHA" P1 N) (piece "PIECE_ALPHA" P2 S) (piece "PIECE_BETA" Each) (regions P1 (sites Bottom)) (regions P2 (sites Top))}) (rules (start {(place "PIECE_ALPHA1" (union (sites Row 1) (sites Row 2))) (place "PIECE_ALPHA2" (union (sites Row 5) (sites Row 6)))}) (play (if (is Prev Mover) (if (= (what at:(last To)) (id "PIECE_ALPHA" Mover)) (max Moves (move Hop (from (last To)) (directions {Forward Rightward Leftward}) (between if:(is Enemy (who at:(between))) (apply (remove (between)))) (to if:(is Empty (to))) (then (if (can Move (move Hop (from (last To)) (directions {Forward Rightward Leftward}) (between if:(is Enemy (who at:(between))) (apply (remove (between)))) (to if:(is Empty (to))))) (moveAgain) (if (is In (last To) (sites Next)) (promote (last To) (piece "PIECE_BETA") Mover)))))) (max Moves (move Hop (from (last To)) (difference Orthogonal OppositeDirection) (between if:(is Enemy (who at:(between))) (apply (remove (between)))) (to if:(is Empty (to))) (then (if (can Move (move Hop (from (last To)) (difference Orthogonal OppositeDirection) (between if:(is Enemy (who at:(between))) (apply (remove (between)))) (to if:(is Empty (to))))) (moveAgain)))))) (priority {(max Moves (or {(forEach Piece "PIECE_ALPHA" (move Hop (from (from)) (directions {Forward Rightward Leftward}) (between if:(is Enemy (who at:(between))) (apply (remove (between)))) (to if:(is Empty (to))) (then (if (can Move (move Hop (from (last To)) (directions {Forward Rightward Leftward}) (between if:(is Enemy (who at:(between))) (apply (remove (between)))) (to if:(is Empty (to))))) (moveAgain) (if (is In (last To) (sites Next)) (promote (last To) (piece "PIECE_BETA") Mover)))))) (forEach Piece "PIECE_BETA" (move Hop (from) Orthogonal (between if:(is Enemy (who at:(between))) (apply (remove (between)))) (to if:(is Empty (to))) (then (if (can Move (move Hop (from (last To)) Orthogonal (between if:(is Enemy (who at:(between))) (apply (remove (between)))) (to if:(is Empty (to))))) (moveAgain)))))})) (or (forEach Piece "PIECE_ALPHA" (move Step (directions {Forwards Rightward Leftward}) (to if:(is Empty (to)))) (then (if (is In (last To) (sites Next)) (promote (last To) (piece "PIECE_BETA") Mover)))) (forEach Piece "PIECE_BETA" (move Step (to if:(is Empty (to))))))}))) (end (if (no Pieces Next) ### SUF: )))) ### MID: (result Next Loss)
### PRE: (game "GAME_NAME" (players 2) (equipment {(board (rectangle 5 10) use:Vertex) (piece "PIECE_ALPHA" Each) (piece "PIECE_ALPHA" Neutral)}) (rules (start {(place "PIECE_ALPHA1" (intersection (expand (sites Bottom)) (sites Right))) (place "PIECE_ALPHA2" (intersection (expand (sites Top)) ### SUF: ))}) (play (or (move Add (to (intersection (sites Direction from:(sites Occupied by:Mover) Diagonal stop:(is Occupied (to))) (sites Empty)))) (move Select (from (forEach (sites Occupied by:Next) if:(!= 0 (count Sites in:(intersection (sites LineOfSight at:(site) Diagonal) (sites Occupied by:Mover)))))) (then (and (remove (last To)) (add (piece (id "PIECE_ALPHA" Neutral)) (to (last To)))))))) (end (if (and (no Moves P1) (no Moves P2)) (byScore {(score P1 (count Pieces P1)) (score P2 (count Pieces P2))}))))) ### MID: (sites Left)
### PRE: (game "GAME_NAME" (players {(player N) (player S)}) (equipment {(board (square 8)) (hand Each size:5) (piece "PIECE_ALPHA" Each (or (move Step (to if:(not (is Friend (who at:(to)))) (apply (remove (to))))) (if (= 1 (state at:(from))) (move Leap {{F F R F} {F F L F}} (to if:(is Empty (to))))) (then (if (= (state at:(last To)) 1) (set State at:(last To) 0))))) (piece "PIECE_BETA" Each (move Slide Orthogonal (to if:(is Enemy (who at:(to))) (apply (remove (to)))))) (piece "PIECE_GAMMA" Each (or (move Step Diagonal (to if:(not (is Friend (who at:(to)))) (apply (remove (to))))) (move Step Forward (to if:(not (is Friend (who at:(to)))) (apply (remove (to))))))) (piece "PIECE_DELTA" 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))))))) (piece "PIECE_EPSILON" Each (or {(move Step Forward (to if:(is Empty (to)))) (move Step (directions {FR FL}) (to if:(is Enemy (who at:(to))) (apply (remove (to)))))} (then (if (is In (last To) (sites Mover "Promotion")) (promote (last To) (piece "PIECE_ZETA") Mover))))) (piece "PIECE_ZETA" Each (or (move Step Diagonal (to if:(not (is Friend (who at:(to)))) (apply (remove (to))))) (if (= 1 (state at:(from))) (move Hop Forward (between if:True) (to if:(not (is Friend (who at:(to)))) (apply (remove (to)))))) (then (if (= (state at:(last To)) 1) (set State at:(last To) 0))))) (regions "Promotion" P1 (sites Row 5)) (regions "Promotion" P2 (sites Row 2))}) (rules (start {(place "PIECE_EPSILON1" (sites Row 2)) (place "PIECE_EPSILON2" (sites Row 5)) ### SUF: (place "PIECE_DELTA1" {"B1" "G1"}) (place "PIECE_GAMMA1" {"C1" "F1"}) (place "PIECE_ZETA1" coord:"D1" state:1) (place "PIECE_ALPHA1" coord:"E1" state:1) (place "PIECE_BETA2" {"A8" "H8"}) (place "PIECE_DELTA2" {"B8" "G8"}) (place "PIECE_GAMMA2" {"C8" "F8"}) (place "PIECE_ZETA2" coord:"D8" state:1) (place "PIECE_ALPHA2" coord:"E8" state:1)}) (play (do (forEach Piece) ifAfterwards:(not (is Threatened (id "PIECE_ALPHA" Mover))))) (end {(if (and (is Threatened (id "PIECE_ALPHA" Next)) (not (can Move (do (forEach Piece Next) ifAfterwards:(not (is Threatened (id "PIECE_ALPHA" Next))))))) (result Mover Win)) (if (no Moves Mover) (result Mover Draw))}))) ### MID: (place "PIECE_BETA1" {"A1" "H1"})
### PRE: (game "GAME_NAME" (players {(player N) (player S)}) (equipment {(board (rotate 90 (hex 4))) (piece "PIECE_ALPHA" Each (move Step All (to if:(or (is In (to) (sites Empty)) (is Enemy (who at:(to)))) (apply (if (is Enemy (who at:(to))) (remove (to) (then (set Counter)))))))) (piece "PIECE_BETA" Each (move Slide (to if:(is Enemy (who at:(to))) (apply (remove (to) (then (set Counter))))))) (piece "PIECE_GAMMA" Each (move Slide Orthogonal (to if:(is Enemy (who at:(to))) (apply (remove (to) (then (set Counter))))))) (piece "PIECE_DELTA" Each (move Slide Diagonal (to if:(is Enemy (who at:(to))) (apply (remove (to) (then (set Counter))))))) (piece "PIECE_EPSILON" 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 Counter)))))))) (piece "PIECE_ZETA" Each (or {(move Step Forward (to if:(is Empty (to)))) (move Step (if ### SUF: (directions {NNW NNE}) (directions {SSW SSE})) (to if:(is Enemy (who at:(to))) (apply (remove (to)))))} (then (and (if (is In (last To) (sites Mover "PromotionZone")) (moveAgain)) (set Counter))))) (regions "PromotionZone" P1 (union (sites Side NW) (sites Side NE))) (regions "PromotionZone" P2 (union (sites Side SW) (sites Side SE))) (regions "Region-Dark" (sites Phase 2)) (regions "Region-Light" (sites Phase 1)) (regions "Region-Medium" (sites Phase 0))}) (rules (start {(place "PIECE_ALPHA1" coord:"B2") (place "PIECE_GAMMA1" coord:"B1") (place "PIECE_DELTA1" coord:"A1") (place "PIECE_EPSILON1" coord:"A2") (place "PIECE_ALPHA2" coord:"F6") (place "PIECE_GAMMA2" coord:"F7") (place "PIECE_DELTA2" coord:"G7") (place "PIECE_EPSILON2" coord:"G6") (place "PIECE_ZETA1" {"A3" "B3" "C3" "C2" "C1"}) (place "PIECE_ZETA2" {"E7" "E6" "E5" "F5" "G5"})}) phases:{(phase "Movement" (play (if (is Prev Mover) (move Promote (last To) (piece {"PIECE_GAMMA" "PIECE_DELTA" "PIECE_EPSILON"}) Mover) (do (forEach Piece) ifAfterwards:(not (is Threatened (id "PIECE_ALPHA" Mover)))))) (end {(if (and (is Threatened (id "PIECE_ALPHA" Next)) (not (can Move (do (forEach Piece Next) ifAfterwards:(not (is Threatened (id "PIECE_ALPHA" Next))))))) (result Mover Win)) (if (or (no Moves Mover) (= (counter) 100)) (result Mover Draw))}))})) ### MID: (is Mover P1)
### PRE: (game "GAME_NAME" (players 2) (equipment {(board (rectangle 5 5 diagonals:Alternating) use:Vertex) (piece "PIECE_ALPHA" Each (or (move Hop (between if:(is Enemy (who at:(between))) (apply (remove (between)))) ### SUF: ) (move Step (to if:(is Empty (to))))))}) (rules (start {(place "PIECE_ALPHA1" (forEach (sites Board) if:(< (site) (centrePoint)))) (place "PIECE_ALPHA2" (forEach (sites Board) if:(> (site) (centrePoint))))}) (play (forEach Piece)) (end (if (no Pieces Next) (result Next Loss))))) ### MID: (to if:(is Empty (to)))
### PRE: (game "GAME_NAME" (players 2) (equipment {(board (rectangle 5 5 diagonals:Alternating) use:Vertex) (hand Each) (piece "PIECE_ALPHA" Each (move Step (to if:(is Empty (to))) (then (if (is Line 3 Orthogonal exact:True) (moveAgain)))))}) (rules (start (place "PIECE_ALPHA" "Hand" count:6)) 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 Orthogonal exact:True) (moveAgain)))))) (nextPhase Mover (all Sites (sites Hand Mover) if:(= 0 (count Cell at:(site)))) "Movement")) (phase "Movement" (play (if (is Prev Mover) ### SUF: (forEach Piece))))} (end (if (no Pieces Next) (result Next Loss))))) ### MID: (move Remove (forEach (sites Occupied by:Enemy container:"Board") if:(not (is Line 3 Orthogonal through:(site)))))
### PRE: (game "GAME_NAME" (players 2) (equipment {(board (concentric Square rings:3 joinCorners:True) use:Vertex) (hand Each) (piece "PIECE_ALPHA" Each (move Step (to if:(is Empty (to))) (then (if (is Line 3 if:(= 1 ### SUF: )) (moveAgain)))))}) (rules (start {(place Stack "PIECE_ALPHA1" (handSite P1)) (place Stack "PIECE_ALPHA2" (handSite P2))}) phases:{(phase "Placement" (play (if (is Prev Mover) (move Remove (forEach (sites Occupied by:Next container:"Board") if:(= 1 (size Stack at:(site))))) (move (from (handSite Mover)) (to (union (forEach (sites Occupied by:Next container:"Board") if:(= 1 (size Stack at:(site)))) (sites Empty))) copy:True (then (if (is Line 3 if:(= 1 (size Stack at:(to)))) (moveAgain)))) (then (if (and (not (is Next Mover)) (is Full)) (and {(forEach Site (forEach (sites Occupied by:P1 container:"Board") if:(= (size Stack at:(site)) 2)) (and (remove (site)) (remove (site)))) (forEach Site (forEach (sites Occupied by:P2 container:"Board") if:(= (size Stack at:(site)) 2)) (and (remove (site)) (remove (site)))) (set Pending)}))))) (nextPhase (is Pending) "Movement")) (phase "Movement" (play (if (is Prev Mover) (move Remove (forEach (sites Occupied by:Next container:"Board") if:(= 1 (size Stack at:(site))))) (forEach Piece))) (end (if (all Sites (sites Occupied by:Next) if:(not (is In (site) (sites Board)))) (result Mover Win))))})) ### MID: (size Stack at:(to))
### PRE: (game "GAME_NAME" (players 2) (equipment {(board (rectangle 2 13) {(track "Track1" {7 8 9 10 11 12} P1 directed:True) (track "Track2" {18 17 16 15 14 13} P2 directed:True)} use:Vertex) (dice d:6 num:2) (piece "PIECE_ALPHA" Each (forEach Die if:(!= (pips) 0) (if (= (trackSite Move steps:(pips)) -1) (move Remove (from)) (move (from) (to (trackSite Move steps:(pips))))))) (map "StartTrack" {(pair P1 7) (pair P2 18)})}) (rules (start {(place Stack "PIECE_ALPHA1" (sites {7 8 9 10 11 12}) count:2) (place Stack "PIECE_ALPHA2" (sites {13 14 15 16 17 18}) count:2)}) phases:{(phase "UnStacking" (play (do (if (or (is Pending) (not (is Prev Mover))) (roll)) next:(forEach Die if:(!= (pips) 0) (if (= (state at:(trackSite Move from:(mapEntry "StartTrack" (mover)) steps:(- (pips) 1))) 0) (move Select (from (trackSite Move from:(mapEntry "StartTrack" (mover)) steps:(- (pips) 1))) (then (and (forEach Level (last To) (set State at:(last To) level:(level) 1)) (if (not (all DiceUsed)) (moveAgain))))))) (then (if (all DiceEqual) (and (set Pending) (moveAgain)))))) (nextPhase Mover (all Sites (sites Occupied by:Mover) if:(not (= (state at:(site)) 0))) "Stacking")) (phase "Stacking" (play (do (if (or (is Pending) (not (is Prev Mover))) (roll)) next:(forEach Die if:(!= (pips) 0) (if (= (state at:(trackSite Move from:(mapEntry "StartTrack" (mover)) steps:(- (pips) 1))) 1) (move Select (from (trackSite Move from:(mapEntry "StartTrack" (mover)) steps:(- (pips) 1))) (then (and (forEach Level (last To) (set State at:(last To) level:(level) 0)) (if (not (all DiceUsed)) (moveAgain))))))) (then (if (all DiceEqual) (and (set Pending) (moveAgain)))))) (nextPhase Mover (all Sites (sites Occupied by:Mover) if:(not (= (state at:(site)) 1))) "BearingOff")) (phase "BearingOff" (play (do (if (or (all DiceEqual) (not (is Prev Mover))) (roll)) next: ### SUF: (then (if (or (not (all DiceUsed)) (all DiceEqual)) (moveAgain))))) (end (if (no Pieces Mover) (result Mover Win))))})) ### MID: (forEach Piece top:True)
### PRE: (game "GAME_NAME" (players {(player N) (player S)}) (equipment {(board (rectangle 7 8)) (piece "PIECE_ALPHA" Each) (regions "RomanGoal1" P1 (sites Top)) (regions "GaulGoal2" P2 (sites Bottom))}) (rules (start {(place Stack "PIECE_ALPHA1" (sites {0 1 2 3 4 5 6 7}) count:2) (place Stack "PIECE_ALPHA2" (sites {48 49 50 51 52 53 54 55}) count:2)}) (play (if (is Prev Mover) (or (move (from (last From)) (to (last To)) stack:True (then (and (remove (last To)) (remove (last To))))) (move Pass)) (forEach Piece "PIECE_ALPHA" (or {(move Hop (from if:(and (is Mover (who at:(from))) (= (size Stack at:(from)) 2))) (between if:(or (is Empty (between)) (and (is Mover (who at:(between))) (< (size Stack at:(between)) 2))) (apply (fromTo (from) (to (between))))) (to if:(or (is Empty (to)) (and (is Mover (who at:(to))) (< (size Stack at:(to)) 2)))) stack:True) (move Step (from if:(and (is Mover (who at:(from))) (= (size Stack at:(from)) 2))) (to if:(and (is Enemy (who at:(to))) (= 1 (size Stack at:(to)))) (apply (remove (to)))) stack:True (then (and (fromTo (from (last To)) (to (last From))) (remove (last To))))) (move Step (from if:(and (is Mover (who at:(from))) (= (size Stack at:(from)) 2))) (to if:(and (is Enemy (who at:(to))) (= (size Stack at:(to)) 3)) (apply (remove (to)))) stack:True ### SUF: ) (move Hop (from if:(and (is Mover (who at:(from))) (= (size Stack at:(from)) 3))) (difference All Backwards) (between (range 1 2) if:True) (to if:(and (not (is Enemy (who at:(to)))) (not (is Mover (who at:(to))))))) (move Hop (from if:(and (is Mover (who at:(from))) (= (size Stack at:(from)) 3))) (difference All Backwards) (between (range 1 2) if:True) (to if:(is Enemy (who at:(to)))) (then (and (remove (last To)) (remove (last To)))))}) top:True))) (end {(if (no Moves Next) (result Mover Win)) (if (and {(is In (last To) (sites Mover)) (not (is Enemy (who at:(last To)))) (is Mover (who at:(last To)))}) (result Mover Win))}))) ### MID: (then (and {(fromTo (from (last To)) (to (last From))) (remove (last To)) (moveAgain)}))
### PRE: (game "GAME_NAME" (players 2) (equipment {(board (hex Triangle 13)) (piece "PIECE_ALPHA")}) (rules phases:{(phase "Opening" P1 (play ### SUF: ) (nextPhase "Playing")) (phase "Playing" (play (move Add (to (sites Empty)) (then (if (= 0 (count MovesThisTurn)) (moveAgain))))))} (end (if (is Connected 3 Sides) (result Mover Win))))) ### MID: (move Add (to (sites Empty)))
### PRE: (game "GAME_NAME" (players 2) (equipment {(board (rectangle 1 8)) (piece "PIECE_ALPHA" Each (move Slide Orthogonal (to if:(is Enemy (who at:(to))) (apply (remove (to)))))) (piece "PIECE_BETA" Each (move Step (to if:(not (is Friend (who at:(to)))) (apply (if (is Enemy (who at:(to))) (remove (to))))))) (piece "PIECE_GAMMA" Each (move Leap {{F F}} (to if:(not (is Friend (who at:(to)))) (apply ### SUF: ))))}) (rules (start {(place "PIECE_ALPHA1" coord:"C1") (place "PIECE_GAMMA1" coord:"B1") (place "PIECE_BETA1" coord:"A1") (place "PIECE_ALPHA2" coord:"F1") (place "PIECE_GAMMA2" coord:"G1") (place "PIECE_BETA2" coord:"H1")}) (play (do (forEach Piece) ifAfterwards:(not (is Threatened (id "PIECE_BETA" Mover))))) (end {(if (and (is Threatened (id "PIECE_BETA" Next)) (not (can Move (do (forEach Piece Next) ifAfterwards:(not (is Threatened (id "PIECE_BETA" Next))))))) (result Mover Win)) (if (or (no Moves Mover) (= (counter) 100)) (result Mover Draw))}))) ### MID: (if (is Enemy (who at:(to))) (remove (to)))
### PRE: (game "GAME_NAME" (players 2) (equipment {(board (rectangle 2 13) {(track "Track1" {12 11 10 9 8 7 5 4 3 2 1 0 13 14 15 16 17 18 20 21 22 23 24 25} P1 directed:True) (track "Track2" {25 24 23 22 21 20 18 17 16 15 14 13 0 1 2 3 4 5 7 8 9 10 11 12} P2 directed:True)} use:Vertex) (dice num:2) (regions P1 {20 21 22 23 24 25}) (regions P2 {7 8 9 10 11 12}) (piece "PIECE_ALPHA" Each (forEach Die replayDouble:True if:(and {(!= (pips) 0) (!= (trackSite Move from:(from) steps:(pips)) -1) (!= (trackSite Move from:(from) steps:(pips)) -2)}) (move (from (from)) (to (trackSite Move from:(from) steps:(pips)) if:(or (not (is Enemy (who at:(to)))) (= 1 (size Stack at:(to))))))))}) (rules (start {(place Stack "PIECE_ALPHA1" 12 count:15) (place Stack "PIECE_ALPHA2" 25 count:15)}) (play (do (if ### SUF: (roll)) next:(if (all Sites (sites Occupied by:Mover) if:(is In (site) (sites Mover))) (forEach Die replayDouble:True if:(!= (pips) 0) (forEach Site (sites Occupied by:Mover) (if (and (is Occupied (site)) (!= (trackSite Move from:(site) steps:(pips)) -1)) (if (= (trackSite Move from:(site) steps:(pips)) -2) (move Remove (from)) (move (from (site)) (to (trackSite Move from:(site) steps:(pips)) if:(or (not (is Enemy (who at:(to)))) (= 1 (size Stack at:(to)))))))) noMoveYet:(firstMoveOnTrack "Track" Mover (if (and (is Friend (who at:(site))) (< (trackSite Move from:(site) steps:(pips)) 0)) (move Remove (from)))) (then (if (not (all DiceUsed)) (moveAgain))))) (max Distance "Track" Mover (forEach Piece top:True (then (if (not (all DiceUsed)) (moveAgain)))))))) (end {(if (no Pieces Mover) (byScore {(score P1 (if (is Mover P1) (if (= (size Stack in:(sites Occupied by:P2)) 15) 2 1) 0)) (score P2 (if (is Mover P2) (if (= (size Stack in:(sites Occupied by:P1)) 15) 2 1) 0))})) (if (and (= (what at:12 level:0) (id "PIECE_ALPHA1" P1)) (= (what at:12 level:1) (id "PIECE_ALPHA2" P2))) (byScore {(score P1 0) (score P2 2)})) (if (and (= (what at:25 level:0) (id "PIECE_ALPHA2" P2)) (= (what at:25 level:1) (id "PIECE_ALPHA1" P1))) (byScore {(score P1 2) (score P2 0)}))}))) ### MID: (not (is Prev Mover))
### PRE: (game "GAME_NAME" (players 2) (equipment {(board (merge {(rectangle 1 6) (shift 7 0 ### SUF: ) (shift 0 6 (rectangle 1 6)) (shift 7 6 (rectangle 1 6))}) {(track "Track1" {24 0 1 2 3 4 5 6 7 8 9 10 11 23 22 21 20 19 18 17 16 15 14 13 12} P1 directed:True) (track "Track2" {25 12 13 14 15 16 17 18 19 20 21 22 23 11 10 9 8 7 6 5 4 3 2 1 0} P2 directed:True)} use:Vertex) (dice d:6 num:3) (hand Each) (regions "StartingQuadrant" P1 (sites {0 1 2 3 4 5})) (regions "StartingQuadrant" P2 (sites {12 13 14 15 16 17})) (piece "PIECE_ALPHA" Each (forEach Die if:(!= (pips) 0) (if (= (trackSite Move steps:(pips)) -1) (move Remove (from)) (if (or {(is Empty (trackSite Move steps:(pips))) (and (is Friend (who at:(trackSite Move steps:(pips)))) (if (is In (to) (sites Mover "StartingQuadrant")) (not (= 1 (size Stack at:(trackSite Move steps:(pips))))) True)) (and (is Enemy (who at:(trackSite Move steps:(pips)))) (= 1 (size Stack at:(trackSite Move steps:(pips)))))}) (move (from) (to (trackSite Move steps:(pips)) (apply if:(is Enemy (who at:(to))) (fromTo (from (to)) (to (handSite (who at:(to))))))))))))}) (rules (start {(place Stack "PIECE_ALPHA1" 0 count:15) (place Stack "PIECE_ALPHA2" 12 count:15)}) (play (do (if (not (is Prev Mover)) (roll)) next:(or (forEach Piece top:True) (forEach Piece container:(mover) top:True) (then (if (not (all DiceUsed)) (moveAgain)))))) (end {(if (no Pieces Mover) (result Mover Win)) (if (and (no Moves P1) (no Moves P2)) (result Mover Draw))}))) ### MID: (rectangle 1 6)
### PRE: (game "GAME_NAME" (players 2) (equipment {(board (hex Limping (- 5 1)) use:Cell) (piece "PIECE_ALPHA" Each) (piece "PIECE_BETA" 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))) ### SUF: )) (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))})))) ### MID: (!= Infinity (count Steps (step Orthogonal (to if:(is Empty (to)))) (site) (difference (sites Outer) (site))))
### PRE: (game "GAME_NAME" (players 2) (equipment {(board (dual (tri Hexagon 7))) (piece "PIECE_ALPHA" Each) (piece "PIECE_BETA" P2) (hand P2)}) (rules (meta (swap)) phases:{(phase "Opening" (play (move Select (from (sites Empty)) (to ### SUF: if:(not (is In (from) (sites Around (to) includeSelf:True)))) (then (and (add (to (last To))) (add (to (last From))))))) (nextPhase (and (= 2 (count Sites in:(sites Occupied by:P1 component:"PIECE_ALPHA"))) (= 2 (count Sites in:(sites Occupied by:P2 component:"PIECE_ALPHA")))) "Play")) (phase "Play" (play (or (if (and {(< 0 (size Stack at:(handSite P2))) (= (mover) (id P2)) (< 0 (count Pieces Mover in:(sites Board)))}) (move Remove (handSite P2))) (move Add (to (sites Empty) if:(and (not (no Pieces Mover in:(sites Board))) (> Infinity (count Steps Orthogonal (step (to if:(or (is Empty (to)) (is Mover (who at:(to)))))) (to) (sites Occupied by:Mover))))) (then (forEach Group Orthogonal if:(is Enemy (who at:(to))) (if (not (and (< 0 (count Sites in:(difference (sites Occupied by:Enemy component:"PIECE_ALPHA") (sites)))) (not (all Sites (sites) if:(not (> Infinity (count Steps Orthogonal (step (to if:(or (is Empty (to)) (is Enemy (who at:(to)))))) (site) (difference (sites Occupied by:Enemy) (sites))))))))) (remove (sites)) (pass)) (then (forEach Group Orthogonal if:(is Mover (who at:(to))) (if (not (and (< 0 (count Sites in:(difference (sites Occupied by:Mover component:"PIECE_ALPHA") (sites)))) (not (all Sites (sites) if:(not (> Infinity (count Steps Orthogonal (step (to if:(or (is Empty (to)) (is Mover (who at:(to)))))) (site) (difference (sites Occupied by:Mover) (sites))))))))) (remove (sites)) (pass))))))))))} (end (if (and (no Moves Next) (< 2 (count Moves))) (result Next Loss))))) ### MID: (sites Empty)
### PRE: (game "GAME_NAME" (players 2) (equipment {(board (dual (remove (hex 4 5) cells:{0 1 15 20 25 32 36 39 44})) use:Vertex) (piece "PIECE_ALPHA" 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: ### SUF: ))) 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))))) ### MID: (sites Around (from) Orthogonal)
### PRE: (game "GAME_NAME" (players 2) (equipment {(board (square 8)) (piece "PIECE_ALPHA" P1 N) (piece "PIECE_ALPHA" P2 S) (piece "PIECE_BETA" Each) (regions P1 (sites Bottom)) (regions P2 (sites Top))}) (rules (start {(place "PIECE_ALPHA1" (union (sites Row 1) (sites Row 2))) (place "PIECE_ALPHA2" (union (sites Row 5) (sites Row 6)))}) (play (if (is Prev Mover) (if (= (what at:(last To)) (id "PIECE_ALPHA" Mover)) (max Moves (move Hop (from (last To)) (directions {Forward Rightward Leftward}) (between if:(is Enemy (who at:(between))) (apply (remove (between)))) (to if:(is Empty (to))) (then (if (can Move (move Hop (from (last To)) (directions {Forward Rightward Leftward}) (between if:(is Enemy (who at:(between))) (apply (remove (between)))) (to if:(is Empty (to))))) (moveAgain) (if (is In (last To) (sites Next)) (promote (last To) (piece "PIECE_BETA") Mover)))))) (max Moves (move Hop (from (last To)) (difference Orthogonal OppositeDirection) (between before:(count Rows) after:(count Rows) if:(is Enemy (who at:(between))) (apply (remove (between)))) (to if:(is Empty (to))) (then (if (can Move (move Hop (from (last To)) (difference Orthogonal OppositeDirection) (between before:(count Rows) after:(count Rows) if:(and (not (is In (between) (sites ToClear))) (is Enemy (who at:(between)))) (apply (remove (between)))) (to if:(is Empty (to))))) (moveAgain)))))) ### SUF: )) (end (if (no Moves Next) (result Mover Win))))) ### MID: (priority {(max Moves (priority {(forEach Piece "PIECE_BETA" (move Hop (from) Orthogonal (between before:(count Rows) after:(count Rows) if:(is Enemy (who at:(between))) (apply (remove (between)))) (to if:(is Empty (to))) (then (if (can Move (move Hop (from (last To)) (difference Orthogonal OppositeDirection) (between before:(count Rows) after:(count Rows) if:(and (not (is In (between) (sites ToClear))) (is Enemy (who at:(between)))) (apply (remove (between)))) (to if:(is Empty (to))))) (moveAgain))))) (forEach Piece "PIECE_ALPHA" (move Hop (from (from)) (directions {Forward Rightward Leftward}) (between if:(is Enemy (who at:(between))) (apply (remove (between)))) (to if:(is Empty (to))) (then (if (can Move (move Hop (from (last To)) (directions {Forward Rightward Leftward}) (between if:(is Enemy (who at:(between))) (apply (remove (between)))) (to if:(is Empty (to))))) (moveAgain) (if (is In (last To) (sites Next)) (promote (last To) (piece "PIECE_BETA") Mover))))))})) (or (forEach Piece "PIECE_ALPHA" (move Step (directions {Forward Rightward Leftward}) (to if:(is Empty (to)))) (then (if (is In (last To) (sites Next)) (promote (last To) (piece "PIECE_BETA") Mover)))) (forEach Piece "PIECE_BETA" (move Slide Orthogonal)))})
### PRE: (game "GAME_NAME" (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 "PIECE_ALPHA" P1) (piece "PIECE_ALPHA" 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 "PIECE_ALPHA1" Edge 36 count:2) (place Stack "PIECE_ALPHA2" 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))) ### SUF: )))) (end {(if (and {(is In (mover) (players Team1)) (= 1 (count Sites in:(sites Occupied by:Team1))) (= 36 (where "PIECE_ALPHA" Team1))}) (result Team1 Win)) (if (and {(is In (mover) (players Team2)) (= 1 (count Sites in:(sites Occupied by:Team2))) (= 38 (where "PIECE_ALPHA" Team2))}) (result Team2 Win))}))) ### MID: (moveAgain)
### PRE: (game "GAME_NAME" (players 2) (equipment {(board (rectangle 3 3 diagonals:Alternating) use:Vertex) (hand Each) (piece "PIECE_ALPHA" Each (move Step (to if:(is Empty ### SUF: ))))}) (rules (start (place "PIECE_ALPHA" "Hand" count:3)) phases:{(phase "Placement" (play (move (from (handSite Mover)) (to (sites Empty)))) (nextPhase (all Sites (sites Hand P2) if:(= 0 (count Cell at:(site)))) "Movement")) (phase "Movement" (play (forEach Piece)))} (end (if (is Line 3) (result Mover Win))))) ### MID: (to)
### PRE: (game "GAME_NAME" (players {(player N) (player S)}) (equipment {(board (square 8)) (piece "PIECE_ALPHA" P1 N) (piece "PIECE_ALPHA" P2 S) (piece "PIECE_BETA" Each) (regions P1 (sites Bottom)) (regions P2 (sites Top))}) (rules (start {(place "PIECE_ALPHA1" (difference (expand (sites Bottom) steps:(- 3 1)) (sites Phase 0))) (place "PIECE_ALPHA2" (difference (expand (sites Top) steps:(- 3 1)) (sites Phase 0)))}) (play (if (is Prev Mover) (if (= (what at:(last To)) (id "PIECE_ALPHA" Mover)) (or (move Pass (then (forEach Site (sites Next) (if (= (what at:(site)) (id "PIECE_ALPHA" Mover)) (promote (site) (piece "PIECE_BETA") Mover))))) (move Hop (from (last To)) Diagonal (between if:(is Enemy (who at:(between))) (apply (remove (between)))) (to if:(is Empty (to))) (then (if (can Move (move Hop (from (last To)) Diagonal (between if:(is Enemy (who at:(between))) (apply (remove (between)))) (to if:(is Empty (to))))) (moveAgain) (if (is In (last To) (sites Next)) (promote (last To) (piece "PIECE_BETA") Mover)))))) (or (move Pass) (move Hop (from (last To)) Diagonal (between before:(count Rows) (range 1 (count Rows)) after:(count Rows) if:(is Enemy (who at:(between))) (apply (remove (between)))) (to if:(is Empty (to))) (then (if (can Move (move Hop (from (last To)) Diagonal (between before:(count Rows) (range 1 (count Rows)) after:(count Rows) if:(is Enemy (who at:(between))) (apply (remove (between)))) (to if:(is Empty (to))))) (moveAgain)))))) (or (forEach Piece "PIECE_ALPHA" (or (move Step (directions {FR FL}) (to if:(is Empty (to))) (then (if (is In (last To) (sites Next)) (promote (last To) (piece "PIECE_BETA") Mover)))) (move Hop (from) Diagonal (between if:(is Enemy (who at:(between))) (apply (remove (between)))) (to if:(is Empty (to))) (then (if (can Move (move Hop (from (last To)) Diagonal (between if:(is Enemy (who at: ### SUF: )) (apply (remove (between)))) (to if:(is Empty (to))))) (moveAgain) (if (is In (last To) (sites Next)) (promote (last To) (piece "PIECE_BETA") Mover))))))) (forEach Piece "PIECE_BETA" (or (move Slide Diagonal) (move Hop (from) Diagonal (between before:(count Rows) (range 1 (count Rows)) after:(count Rows) if:(is Enemy (who at:(between))) (apply (remove (between)))) (to if:(is Empty (to))) (then (if (can Move (move Hop (from (last To)) Diagonal (between before:(count Rows) (range 1 (count Rows)) after:(count Rows) if:(is Enemy (who at:(between))) (apply (remove (between)))) (to if:(is Empty (to))))) (moveAgain))))))))) (end (if (no Pieces Next) (result Next Loss))))) ### MID: (between)
### PRE: (game "GAME_NAME" (players 2) (equipment {(board (square 12)) (piece "PIECE_ALPHA" Each (or {(move Step Forward (to if:(is Empty (to)))) (move Step (directions {FR FL}) (to if:(is Enemy (who at:(to))) (apply (remove (to)))))})) (piece "PIECE_BETA" Each (move Slide Orthogonal (to if:(is Enemy (who at:(to))) (apply (remove (to)))))) (piece "PIECE_GAMMA" Each (move Slide Orthogonal (to if:(is Enemy (who at:(to))) (apply (remove (to)))))) (piece "PIECE_DELTA" Each (move Slide Orthogonal (to if:(is Enemy (who at:(to))) (apply (remove (to)))))) (piece "PIECE_EPSILON" Each (move Step (to if:(not (is Friend (who at:(to)))) (apply (if (is Enemy (who at:(to))) (remove (to))))))) (piece "PIECE_ZETA" Each (move Slide Diagonal (to if:(is Enemy (who at:(to))) (apply (remove (to)))))) (piece "PIECE_ETA" Each (move Leap {{F F R F} {F F L F}} ### SUF: )) (piece "PIECE_THETA" Each (move Slide (to if:(is Enemy (who at:(to))) (apply (remove (to))))))}) (rules (start {(place "PIECE_ALPHA1" (sites Row 1)) (place "PIECE_ALPHA2" (sites Row 10)) (place "PIECE_BETA1" {"A1" "L1"}) (place "PIECE_ETA1" {"B1" "K1"}) (place "PIECE_GAMMA1" {"C1" "J1"}) (place "PIECE_DELTA1" {"D1" "I1"}) (place "PIECE_ZETA1" {"E1" "H1"}) (place "PIECE_THETA1" coord:"F1") (place "PIECE_EPSILON1" coord:"G1") (place "PIECE_BETA2" {"A12" "L12"}) (place "PIECE_ETA2" {"B12" "K12"}) (place "PIECE_GAMMA2" {"C12" "J12"}) (place "PIECE_DELTA2" {"D12" "I12"}) (place "PIECE_ZETA2" {"E12" "H12"}) (place "PIECE_THETA2" coord:"G12") (place "PIECE_EPSILON2" coord:"F12")}) (play (do (forEach Piece) ifAfterwards:(not (is Threatened (id "PIECE_EPSILON" Mover))))) (end (if (and (is Threatened (id "PIECE_EPSILON" Next)) (not (can Move (do (forEach Piece Next) ifAfterwards:(not (is Threatened (id "PIECE_EPSILON" Next))))))) (result Mover Win))))) ### MID: (to if:(not (is Friend (who at:(to)))) (apply (if (is Enemy (who at:(to))) (remove (to)))))
### PRE: (game "GAME_NAME" (players 2) (equipment {(board (square 5)) (piece "PIECE_ALPHA" P1 (move Step Orthogonal (to if:(is Enemy (who at:(to))) (apply (remove (to)))))) (piece "PIECE_BETA" P2 (move Step Orthogonal (to if:(is Empty (to)))))}) (rules (start {(place "PIECE_ALPHA1" {"A1" "C3" "E5"}) (place "PIECE_BETA2" (difference (sites Board) (sites {"A1" "C3" "E5"})))}) ### SUF: (end {(if (no Moves P1) (result P1 Win)) (if (and (is Mover P1) (is Line 3 Orthogonal contiguous:False)) (result P2 Win))}))) ### MID: (play (forEach Piece))
### PRE: (game "GAME_NAME" (players 2) (equipment {(board (hex Limping 3) use:Cell) (piece "PIECE_ALPHA" P1) (piece "PIECE_ALPHA" P2)}) (rules (start (set Score Each 0)) (play (or {(move Pass) (move Add (to (sites Empty) if:(not (is Within (id "PIECE_ALPHA" Mover) in:(intersection (sites LineOfSight Piece at:(to)) (sites Direction from:(to) distance:3))))) (then (do (forEach Site (sites Board) (apply if:(and (is Next (who at:(site))) (= 0 (count Sites in:(intersection (sites Empty) (sites Around (site) includeSelf:True))))) (remove (site)))) next:(and (set Score Mover (/ (+ (results from:(sites Occupied by:Mover) to:(sites Around (from) if:(is Mover (who at:(to)))) 1)) 2)) (set Score Next (/ (+ (results from:(sites Occupied by:Next) to:(sites Around (from) if:(is Next (who at:(to)))) 1)) 2)))))) (forEach Piece (or (move Step (to if:(and (is Empty (to)) (< (count Pieces Mover in:(sites Around (from))) (- (count Pieces Mover in:(sites Around (to))) 1)))) (then (do (forEach Site (sites Board) (apply if:(and (is Next ### SUF: ) (= 0 (count Sites in:(intersection (sites Empty) (sites Around (site) includeSelf:True))))) (remove (site)))) next:(and (set Score Mover (/ (+ (results from:(sites Occupied by:Mover) to:(sites Around (from) if:(is Mover (who at:(to)))) 1)) 2)) (set Score Next (/ (+ (results from:(sites Occupied by:Next) to:(sites Around (from) if:(is Next (who at:(to)))) 1)) 2)))))) (if (and (not (was Pass)) (not (can Move (move Step (to if:(and (is Empty (to)) (< (count Pieces Mover in:(sites Around (from))) (- (count Pieces Mover in:(sites Around (to))) 1)))) (then (do (forEach Site (sites Board) (apply if:(and (is Next (who at:(site))) (= 0 (count Sites in:(intersection (sites Empty) (sites Around (site) includeSelf:True))))) (remove (site)))) next:(and (set Score Mover (/ (+ (results from:(sites Occupied by:Mover) to:(sites Around (from) if:(is Mover (who at:(to)))) 1)) 2)) (set Score Next (/ (+ (results from:(sites Occupied by:Next) to:(sites Around (from) if:(is Next (who at:(to)))) 1)) 2))))))))) (move Step (to if:(and (is Empty (to)) (> (count Pieces Next in:(sites Around (from))) (count Pieces Next in:(sites Around (to)))))) (then (do (forEach Site (sites Board) (apply if:(and (is Next (who at:(site))) (= 0 (count Sites in:(intersection (sites Empty) (sites Around (site) includeSelf:True))))) (remove (site)))) next:(and (set Score Mover (/ (+ (results from:(sites Occupied by:Mover) to:(sites Around (from) if:(is Mover (who at:(to)))) 1)) 2)) (set Score Next (/ (+ (results from:(sites Occupied by:Next) to:(sites Around (from) if:(is Next (who at:(to)))) 1)) 2)))))))))})) (end {(if (and (all Passed) (> (score Mover) (score Next))) (result Mover Win)) (if (and (all Passed) (<= (score Mover) (score Next))) (result Next Win))}))) ### MID: (who at:(site))
### PRE: (game "GAME_NAME" (players 2) (equipment {(board (add (merge (rectangle 3 6) (shift 7 0 (rectangle 3 6))) edges:{{5 18} {11 24} {17 30}}) {(track "Track1" "36,6,E,N1,W,0,E,End" P1 directed:True) (track "Track2" "38,6,E,S1,W,12,E,End" P2 directed:True)} use:Vertex) (dice num:3) (hand Each size:2) (piece "PIECE_ALPHA" Each (forEach Die combined:True if:(and (!= (pips) 0) (!= (trackSite Move from:(from) steps:(pips)) -1)) (if (= (trackSite Move from:(from) steps:(pips)) -2) (move Select (from (from)) (then (if (= (count at:(last To)) 1) (remove (last To)) (set Count at:(last To) (- (count at:(last To)) 1))))) (move (from (from)) (to (trackSite Move from:(from) steps:(pips)) if:(not (and (is Enemy (who at:(to))) (> (count at:(to)) 1))) (apply if:(and (is Enemy (who at:(to))) (= (count at:(to)) 1)) (fromTo (from (to)) (to (handSite Next 1)))))))))}) (rules (start {(place "PIECE_ALPHA1" (handSite P1) count:15) (place "PIECE_ALPHA2" (handSite P2) count:15)}) (play (do (if (not (is Prev Mover)) (roll)) next:(if (!= (what at:(handSite Mover 1)) 0) (forEach Die combined:True if:(and (!= (pips) 0) (!= (trackSite Move from:(handSite Mover) steps:(pips)) -1)) (if (= (trackSite Move from:(handSite Mover) steps:(pips)) -2) (move Select (from (handSite Mover 1)) (then (if (= (count at:(last To)) 1) (remove ### SUF: ) (set Count at:(last To) (- (count at:(last To)) 1))))) (move (from (handSite Mover 1)) (to (trackSite Move from:(handSite Mover) steps:(pips)) if:(not (and (is Enemy (who at:(to))) (> (count at:(to)) 1))) (apply if:(and (is Enemy (who at:(to))) (= (count at:(to)) 1)) (fromTo (from (to)) (to (handSite Next 1)))))))) (or (forEach Piece) (forEach Piece container:(mover))) (then (if (can Move (if (!= (what at:(handSite Mover 1)) 0) (forEach Die combined:True if:(and (!= (pips) 0) (!= (trackSite Move from:(handSite Mover) steps:(pips)) -1)) (if (= (trackSite Move from:(handSite Mover) steps:(pips)) -2) (move Select (from (handSite Mover 1)) (then (if (= (count at:(last To)) 1) (remove (last To)) (set Count at:(last To) (- (count at:(last To)) 1))))) (move (from (handSite Mover 1)) (to (trackSite Move from:(handSite Mover) steps:(pips)) if:(not (and (is Enemy (who at:(to))) (> (count at:(to)) 1))) (apply if:(and (is Enemy (who at:(to))) (= (count at:(to)) 1)) (fromTo (from (to)) (to (handSite Next 1)))))))) (or (forEach Piece) (forEach Piece container:(mover))))) (moveAgain)))))) (end (if (no Pieces Mover) (result Mover Win))))) ### MID: (last To)
### PRE: (game "GAME_NAME" (players 2) (equipment {(board (tri {3 5 3 5 3}) use:Vertex) (piece "PIECE_ALPHA" Each)}) (rules (start (set Score Each 0)) (play (if (is Prev Mover) (if (= 0 (size Array (values Remembered))) (forEach Piece (move Hop (from if:(!= (from) (last To))) Orthogonal (between if:(is In (between) (difference (sites Occupied by:Next) (sites (values Remembered)))) (apply (set Pending (between)))) (to if:(is Empty (to))) (then (and {(remember Value (value Pending)) (remove (value Pending)) (add (piece (id "PIECE_ALPHA" Mover)) (to (value Pending)))} (then (and {(set Pending) (if (can Move (forEach Piece (move Hop (from (last To)) Orthogonal (between if:(is In (between) (difference (sites Occupied by:Next) (sites (values Remembered))))) (to if:(is Empty (to)))))) (moveAgain))})))))) (forEach Piece (move Hop (from if:(= (from) (last To))) Orthogonal (between if:(is In (between) (difference (sites Occupied by:Next) (sites (values Remembered)))) (apply (set Pending (between)))) (to if:(is Empty (to))) (then (and {(remember Value (value Pending)) (remove (value Pending)) (add (piece (id "PIECE_ALPHA" Mover)) (to (value Pending)))} (then (and {(set Pending) (if (can Move (forEach Piece (move Hop (from (last To)) Orthogonal (between if:(is In (between) (difference (sites Occupied by:Next) (sites (values Remembered))))) (to if:(is Empty (to)))))) (moveAgain))}))))))) (do (forget Value All) next:(move Add (piece (id "PIECE_ALPHA" Mover)) (to (sites Empty)) (then (if (can Move (forEach Piece (move Hop (from if:(!= (from) (last To))) Orthogonal (between if:(is In (between) (difference (sites Occupied by:Next) (sites ### SUF: ))) (apply (set Pending (between)))) (to if:(is Empty (to))) (then (and {(remember Value (value Pending)) (remove (value Pending)) (add (piece (id "PIECE_ALPHA" Mover)) (to (value Pending)))} (then (and {(set Pending) (if (can Move (forEach Piece (move Hop (from (last To)) Orthogonal (between if:(is In (between) (difference (sites Occupied by:Next) (sites (values Remembered))))) (to if:(is Empty (to)))))) (moveAgain))}))))))) (moveAgain))))) (then (and (set Score Mover (count Pieces Mover)) (set Score Next (count Pieces Next)))))) (end {(if (and (or {(no Moves Next) (all Passed)}) (= (score Mover) (score Next))) (result Mover Win)) (if (and (or {(no Moves Next) (all Passed)}) (!= (score Mover) (score Next))) (byScore))}))) ### MID: (values Remembered)
### PRE: (game "GAME_NAME" (players 2) (equipment {(board (rectangle 2 13) {(track "Track1" {7 8 9 10 11 12} P1 directed:True) (track "Track2" {18 17 16 15 14 13} P2 directed:True)} use:Vertex) (dice d:6 num:2) (piece "PIECE_ALPHA" Each (forEach Die if:(!= (pips) 0) (if (= (trackSite Move steps:(pips)) -1) (move Remove (from)) (move (from) (to (trackSite Move steps:(pips))))))) (map "StartTrack" {(pair P1 7) (pair P2 18)})}) (rules (start {(place Stack "PIECE_ALPHA1" (sites {7 8 9 10 11 12}) count:2) (place Stack "PIECE_ALPHA2" (sites {13 14 15 16 17 18}) count:2)}) phases:{(phase "UnStacking" (play (do (if (or (is Pending) (not (is Prev Mover))) (roll)) next:(forEach Die if:(!= (pips) 0) (if (= (state at:(trackSite Move from:(mapEntry "StartTrack" (mover)) steps:(- (pips) 1))) 0) (move Select (from (trackSite Move from:(mapEntry "StartTrack" (mover)) steps:(- (pips) 1))) (then (and (forEach Level (last To) (set State at:(last To) level:(level) 1)) (if (not (all DiceUsed)) (moveAgain))))))) (then (if (all DiceEqual) (and (set Pending) (moveAgain)))))) (nextPhase Mover (all Sites (sites Occupied by:Mover) if:(not (= (state at:(site)) 0))) "Stacking")) (phase "Stacking" (play (do (if (or (is Pending) (not (is Prev Mover))) (roll)) next:(forEach Die if:(!= (pips) 0) (if (= (state at:(trackSite Move from:(mapEntry "StartTrack" (mover)) steps:(- (pips) 1))) 1) (move Select (from (trackSite Move from:(mapEntry "StartTrack" (mover)) steps:(- (pips) 1))) (then (and (forEach Level (last To) (set State at:(last To) level:(level) 0)) (if (not (all DiceUsed)) (moveAgain))))))) (then (if ### SUF: (and (set Pending) (moveAgain)))))) (nextPhase Mover (all Sites (sites Occupied by:Mover) if:(not (= (state at:(site)) 1))) "BearingOff")) (phase "BearingOff" (play (do (if (or (all DiceEqual) (not (is Prev Mover))) (roll)) next:(forEach Piece top:True) (then (if (or (not (all DiceUsed)) (all DiceEqual)) (moveAgain))))) (end (if (no Pieces Mover) (result Mover Win))))})) ### MID: (all DiceEqual)
### PRE: (game "GAME_NAME" (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 "PIECE_ALPHA" 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: ### SUF: 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 "PIECE_ALPHA1" (sites Bottom)) (place "PIECE_ALPHA2" (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))))}))))) ### MID: (last To)
### PRE: (game "GAME_NAME" (players {(player N) (player S)}) (equipment {(board (square 8)) (hand Each size:5) (piece "PIECE_ALPHA" Each (move Step (to if:(not (is Friend (who at:(to)))) (apply (if (is Enemy (who at:(to))) (remove (to))))))) (piece "PIECE_BETA" Each (move Slide Orthogonal (to if:(is Enemy (who at:(to))) (apply (remove (to)))))) (piece "PIECE_GAMMA" Each (move Hop Diagonal (between if:True) (to if:(or (is Empty (to)) (is Enemy (who at:(to)))) (apply (remove (to)))))) (piece "PIECE_DELTA" Each (move Leap {{F F R F} {F F L F}} (to if: ### SUF: (apply (if (is Enemy (who at:(to))) (remove (to))))))) (piece "PIECE_EPSILON" Each (or {(move Step Forward (to if:(is Empty (to)))) (move Step (directions {FR FL}) (to if:(is Enemy (who at:(to))) (apply (remove (to))))) (if (is In (from) (sites Start (piece (what at:(from))))) (move Slide Forward (between (exact 2) if:(is Empty (between))) (to if:(is Empty (to)))))} (then (if (is In (last To) (sites Mover "Promotion")) (promote (last To) (piece "PIECE_ZETA") Mover))))) (piece "PIECE_ZETA" Each (move Step Diagonal (to if:(not (is Friend (who at:(to)))) (apply (remove (to)))))) (regions "Promotion" P1 (sites Top)) (regions "Promotion" P2 (sites Bottom))}) (rules (start {(place "PIECE_EPSILON1" (sites Row 1)) (place "PIECE_EPSILON2" (sites Row 6)) (place "PIECE_BETA1" {"A1" "H1"}) (place "PIECE_DELTA1" {"B1" "G1"}) (place "PIECE_GAMMA1" {"C1" "F1"}) (place "PIECE_ZETA1" coord:"D1") (place "PIECE_ALPHA1" coord:"E1") (place "PIECE_BETA2" {"A8" "H8"}) (place "PIECE_DELTA2" {"B8" "G8"}) (place "PIECE_GAMMA2" {"C8" "F8"}) (place "PIECE_ZETA2" coord:"D8") (place "PIECE_ALPHA2" coord:"E8")}) (play (do (forEach Piece) ifAfterwards:(not (is Threatened (id "PIECE_ALPHA" Mover))))) (end (if (and (is Threatened (id "PIECE_ALPHA" Next)) (not (can Move (do (forEach Piece Next) ifAfterwards:(not (is Threatened (id "PIECE_ALPHA" Next))))))) {(if (no Pieces Next "PIECE_EPSILON") (result Mover Win)) (if (!= (count Pieces Next "PIECE_EPSILON") 0) (result Mover Draw))})))) ### MID: (not (is Friend (who at:(to))))
### PRE: (game "GAME_NAME" (players 2) (equipment {(board (rotate 45 (merge {(rectangle 5 4) (shift -1 1 (rectangle 3 6)) (shift -2 2 (rectangle 1 8)) (shift 1 -1 (rectangle 7 2))})) use:Vertex) (piece "PIECE_ALPHA" P1 N) (piece "PIECE_ALPHA" P2 S) (piece "PIECE_BETA" Each) (regions P1 (sites Bottom)) (regions P2 (sites Top))}) (rules (start {(place "PIECE_ALPHA1" (expand (sites Bottom) steps:(- 3 1))) (place "PIECE_ALPHA2" (expand (sites Top) steps:(- 3 1)))}) (play (if (is Prev Mover) (or (if (= (what at:(last To)) (id "PIECE_ALPHA" Mover)) (move Hop (from (last To)) (directions {FR FL}) (between if:(is Enemy (who at:(between))) (apply (remove (between)))) (to if:(is Empty (to))) (then (if (can Move (move Hop (from (last To)) (directions {FR FL}) (between if:(is Enemy (who at:(between))) (apply (remove (between)))) (to if:(is Empty (to))))) (moveAgain) (if (is In (last To) (sites Next)) (promote (last To) (piece "PIECE_BETA") Mover))))) (move Hop (from (last To)) SameDirection (between before:(count Rows) after:(count Rows) if:(is Enemy (who at:(between))) (apply (remove (between)))) (to if:(is Empty (to))) (then (if (can Move (move Hop (from (last To)) SameDirection (between before:(count Rows) after:(count Rows) if:(is Enemy (who at:(between))) (apply (remove (between)))) (to if:(is Empty (to))))) (moveAgain))))) (move Pass)) (or {(forEach Piece "PIECE_ALPHA" (move Hop (from (from)) (directions {FR FL}) (between if:(is Enemy (who at:(between))) (apply (remove (between)))) (to if:(is Empty (to))) (then (if (can Move (move Hop (from (last To)) (directions {FR FL}) (between if:(is Enemy (who at:(between))) (apply (remove (between)))) (to if:(is Empty (to))))) (moveAgain) (if (is In (last To) (sites Next)) (promote (last To) (piece "PIECE_BETA") Mover)))))) (forEach Piece "PIECE_BETA" (move Hop (from) Orthogonal (between before:(count Rows) after:(count Rows) if:(is Enemy (who at:(between))) (apply (remove (between)))) (to if:(is Empty (to))) (then (if (can Move (move Hop (from (last To)) SameDirection (between before:(count Rows) after:(count Rows) if:(is Enemy (who at:(between))) (apply (remove (between)))) (to if:(is Empty (to))))) (moveAgain))))) (forEach Piece "PIECE_ALPHA" (move Step (directions {FR FL}) (to if:(is Empty (to)))) (then (if (is In (last To) (sites Next)) (promote (last To) (piece "PIECE_BETA") Mover)))) (forEach Piece "PIECE_BETA" (move Slide))}))) (end (if (no Moves Next) ### SUF: )))) ### MID: (result Mover Win)
### PRE: (game "GAME_NAME" (players 2) (equipment {(board (square 7)) (piece "PIECE_ALPHA" Each (move Step Orthogonal (to if:(is Empty (to))) (then (custodial (from (last To)) Orthogonal (between (max 1) if:(is Enemy (who at:(between))) (apply (remove (between)))) (to if:(is Friend (who at:(to)))) (then (if (can Move (step (from (last To)) Orthogonal (to if:(and (is Empty ### SUF: ) (or {(and (is Enemy (who at:(ahead (to) W))) (is Friend (who at:(ahead (to) steps:2 W)))) (and (is Enemy (who at:(ahead (to) E))) (is Friend (who at:(ahead (to) steps:2 E)))) (and (is Enemy (who at:(ahead (to) N))) (is Friend (who at:(ahead (to) steps:2 N)))) (and (is Enemy (who at:(ahead (to) S))) (is Friend (who at:(ahead (to) steps:2 S))))}))))) (moveAgain))))))) (hand Each)}) (rules (start (place "PIECE_ALPHA" "Hand" count:24)) phases:{(phase "Placement" (play (move (from (handSite Mover)) (to (if (no Pieces Mover in:(sites Board)) (forEach (sites Around (centrePoint) Orthogonal) if:(is Empty (site))) (difference (sites Board) (centrePoint))) if:(is Empty (to))) (then (if (not (is Prev Mover)) (moveAgain))))) (nextPhase Mover (is Empty (handSite Mover)) "Capture")) (phase "Capture" (play (if (is Prev Mover) (or (move Step (from (last To)) Orthogonal (to if:(and (is Empty (to)) (or {(and (is Enemy (who at:(ahead (to) W))) (is Friend (who at:(ahead (to) steps:2 W)))) (and (is Enemy (who at:(ahead (to) E))) (is Friend (who at:(ahead (to) steps:2 E)))) (and (is Enemy (who at:(ahead (to) N))) (is Friend (who at:(ahead (to) steps:2 N)))) (and (is Enemy (who at:(ahead (to) S))) (is Friend (who at:(ahead (to) steps:2 S))))}))) (then (custodial (from (last To)) Orthogonal (between (max 1) if:(is Enemy (who at:(between))) (apply (remove (between)))) (to if:(is Friend (who at:(to)))) (then (if (can Move (step (from (last To)) Orthogonal (to if:(and (is Empty (to)) (or {(and (is Enemy (who at:(ahead (to) W))) (is Friend (who at:(ahead (to) steps:2 W)))) (and (is Enemy (who at:(ahead (to) E))) (is Friend (who at:(ahead (to) steps:2 E)))) (and (is Enemy (who at:(ahead (to) N))) (is Friend (who at:(ahead (to) steps:2 N)))) (and (is Enemy (who at:(ahead (to) S))) (is Friend (who at:(ahead (to) steps:2 S))))}))))) (moveAgain)))))) (move Pass)) (forEach Piece))))} (end (if (no Moves Next) (result Mover Win))))) ### MID: (to)
### PRE: (game "GAME_NAME" (players 2) (equipment {(board (square 12)) (piece "PIECE_ALPHA" P1 N) (piece "PIECE_ALPHA" P2 S) (piece "PIECE_BETA" Each) (regions P1 (sites Bottom)) (regions P2 (sites Top))}) (rules (start {(place "PIECE_ALPHA1" (difference (expand ### SUF: steps:(- 5 1)) (sites Phase 0))) (place "PIECE_ALPHA2" (difference (expand (sites Top) steps:(- 5 1)) (sites Phase 0)))}) (play (if (is Prev Mover) (or (if (= (what at:(last To)) (id "PIECE_ALPHA" Mover)) (move Hop (from (last To)) Diagonal (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)) Diagonal (between if:(and (not (is In (between) (sites ToClear))) (is Enemy (who at:(between))))) (to if:(is Empty (to))))) (moveAgain)))) (move Hop (from (last To)) (if (is In (last To) (sites Outer)) (difference Diagonal OppositeDirection) SameDirection) (between before:(count Rows) if:(is Enemy (who at:(between))) (apply (remove (between)))) (to if:(is Empty (to))) (then (if (can Move (hop (from (last To)) (if (is In (last To) (sites Outer)) (difference Diagonal OppositeDirection) SameDirection) (between before:(count Rows) if:(and (not (is In (between) (sites ToClear))) (is Enemy (who at:(between)))) (apply (remove (between)))) (to if:(is Empty (to))))) (moveAgain))))) (move Pass)) (or (forEach Piece "PIECE_ALPHA" (or (move Hop Diagonal (between if:(is Enemy (who at:(between))) (apply (remove (between)))) (to if:(is Empty (to))) (then (if (can Move (hop (from (last To)) Diagonal (between if:(and (not (is In (between) (sites ToClear))) (is Enemy (who at:(between))))) (to if:(is Empty (to))))) (moveAgain)))) (move Step Diagonal (to if:(is Empty (to)))))) (forEach Piece "PIECE_BETA" (or (move Hop Diagonal (between before:(count Rows) if:(is Enemy (who at:(between))) (apply (remove (between)))) (to if:(is Empty (to))) (then (if (can Move (hop (from (last To)) (if (is In (last To) (sites Outer)) (difference Diagonal OppositeDirection) SameDirection) (between before:(count Rows) if:(and (not (is In (between) (sites ToClear))) (is Enemy (who at:(between)))) (apply (remove (between)))) (to if:(is Empty (to))))) (moveAgain)))) (move Slide (directions Diagonal))))) (then (if (and (= (what at:(last To)) (id "PIECE_ALPHA" Mover)) (is In (last To) (sites Next))) (promote (last To) (piece "PIECE_BETA") Mover))))) (end (if (no Moves Next) (result Mover Win))))) ### MID: (sites Bottom)
### PRE: (game "GAME_NAME" (players 2) (equipment {(board (merge {(rectangle 1 11) (shift 0 5 (rotate 90 (rectangle 1 11))) (shift 0 5 (rectangle 1 11)) (shift -5 10 (rotate 90 (rectangle 1 11))) (shift 5 10 (rotate 90 (rectangle 1 11))) (shift 0 15 (rectangle 1 11))}) {(track "Track1" "0,E5,N5,W,N,E,S,W5,N,End" P1 directed:True) (track "Track2" "10,W5,N5,E,N,W,S,E5,N,End" P2 directed:True)}) (piece "PIECE_ALPHA" Each (if (= (trackSite Move steps:(count Pips)) -2) (move Remove (from)) (if (!= (trackSite Move steps:(count Pips)) -1) (if (if (not (is Enemy (who at:(trackSite Move steps:(count Pips))))) True (not (is In (trackSite Move steps:(count Pips)) (sites "Protect")))) (move ### SUF: (to (trackSite Move steps:(count Pips)) (apply if:(is Enemy (who at:(to))) (fromTo (from (to)) (to (handSite (who at:(to)))) count:(count at:(to)))))))))) (dice d:2 from:0 num:7) (hand Each) (regions "Protect" (sites {0 10 5 16 21 23 30 36 46 56 51 42})) (map {(pair P1 0) (pair P2 10)})}) (rules (start {(place Stack "PIECE_ALPHA1" (handSite P1) count:5) (place Stack "PIECE_ALPHA2" (handSite P2) count:5)}) (play (do (roll) next:(if (can Move (or {(forEach Piece) (forEach Piece container:(mover)) (if (and {(or {(= (count Pips) 1) (= (count Pips) 5) (= (count Pips) 7)}) (not (all Sites (sites Hand Mover) if:(= 0 (count Cell at:(site))))) (or (is Empty (mapEntry (mover))) (is Friend (who at:(mapEntry (mover)))))}) (move (from (handSite (mover))) (to (mapEntry (mover)))))} (then (if (or {(= (count Pips) 1) (= (count Pips) 5) (= (count Pips) 7)}) (moveAgain))))) (or {(forEach Piece) (forEach Piece container:(mover)) (if (and {(or {(= (count Pips) 1) (= (count Pips) 5) (= (count Pips) 7)}) (not (all Sites (sites Hand Mover) if:(= 0 (count Cell at:(site))))) (or (is Empty (mapEntry (mover))) (is Friend (who at:(mapEntry (mover)))))}) (move (from (handSite (mover))) (to (mapEntry (mover)))))} (then (if (or {(= (count Pips) 1) (= (count Pips) 5) (= (count Pips) 7)}) (moveAgain)))) (move Pass (then (if (or {(= (count Pips) 1) (= (count Pips) 5) (= (count Pips) 7)}) (moveAgain))))))) (end (if (no Pieces Mover) (result Mover Win))))) ### MID: (from (from) level:(level))
### PRE: (game "GAME_NAME" (players 2) (equipment {(board (square 5)) (piece "PIECE_ALPHA" P1) (piece "PIECE_BETA" P2) (piece "PIECE_GAMMA" Neutral) (hand Each)}) (rules (start (place "PIECE_GAMMA0" (sites Board))) (play (if (is Prev Mover) (or {(move Select (from (difference (intersection (sites Left) (sites Row (row of:(last To)))) (sites {(last To)}))) (then (and {(push (from (last To)) E) (if (or (= (what at:(handSite (mover))) (id "PIECE_GAMMA0")) (= ### SUF: (mover))) (add (piece (mover)) (to (last To))) (add (piece (next)) (to (last To)))) (remove (handSite (mover)))}))) (move Select (from (difference (intersection (sites Right) (sites Row (row of:(last To)))) (sites {(last To)}))) (then (and {(push (from (last To)) W) (if (or (= (what at:(handSite (mover))) (id "PIECE_GAMMA0")) (= (what at:(handSite (mover))) (mover))) (add (piece (mover)) (to (last To))) (add (piece (next)) (to (last To)))) (remove (handSite (mover)))}))) (move Select (from (difference (intersection (sites Bottom) (sites Column (column of:(last To)))) (sites {(last To)}))) (then (and {(push (from (last To)) N) (if (or (= (what at:(handSite (mover))) (id "PIECE_GAMMA0")) (= (what at:(handSite (mover))) (mover))) (add (piece (mover)) (to (last To))) (add (piece (next)) (to (last To)))) (remove (handSite (mover)))}))) (move Select (from (difference (intersection (sites Top) (sites Column (column of:(last To)))) (sites {(last To)}))) (then (and {(push (from (last To)) S) (if (or (= (what at:(handSite (mover))) (id "PIECE_GAMMA0")) (= (what at:(handSite (mover))) (mover))) (add (piece (mover)) (to (last To))) (add (piece (next)) (to (last To)))) (remove (handSite (mover)))})))}) (move Select (from (sites Outer)) (then (and (fromTo (from (last To)) (to (handSite (mover)))) (moveAgain)))))) (end {(if (is Line 5 throughAny:(sites LastTo) what:(next)) (result Next Win)) (if (is Line 5 throughAny:(sites LastTo) what:(mover)) (result Mover Win))}))) ### MID: (what at:(handSite (mover)))
### PRE: (game "GAME_NAME" (players {(player N) (player S)}) (equipment {(board (square 8)) (piece "PIECE_ALPHA" P1 N) (piece "PIECE_ALPHA" P2 S) (piece "PIECE_BETA" Each) (regions P1 (sites Bottom)) (regions P2 (sites Top))}) (rules (start {(place "PIECE_ALPHA1" (difference (expand (sites Bottom) steps:(- 3 1)) (sites Phase 1))) (place "PIECE_ALPHA2" (difference (expand (sites Top) steps:(- 3 1)) (sites Phase 1)))}) (play (if (is Prev Mover) (or (if (= (what at: ### SUF: ) (id "PIECE_ALPHA" Mover)) (move Hop (from (last To)) (directions {FR FL}) (between if:(is Enemy (who at:(between))) (apply (remove (between)))) (to if:(is Empty (to))) (then (if (is In (last To) (sites Next)) (promote (last To) (piece "PIECE_BETA") Mover) (if (can Move (move Hop (from (last To)) (directions {FR FL}) (between if:(is Enemy (who at:(between))) (apply (remove (between)))) (to if:(is Empty (to))))) (moveAgain))))) (move Hop (from (last To)) Diagonal (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)) Diagonal (between if:(and (not (is In (between) (sites ToClear))) (is Enemy (who at:(between))))) (to if:(is Empty (to))))) (moveAgain))))) (move Pass)) (or (forEach Piece "PIECE_ALPHA" (or (move Hop (from) (directions {FR FL}) (between if:(is Enemy (who at:(between))) (apply (remove (between)))) (to if:(is Empty (to))) (then (if (is In (last To) (sites Next)) (promote (last To) (piece "PIECE_BETA") Mover) (if (can Move (move Hop (from (last To)) (directions {FR FL}) (between if:(is Enemy (who at:(between))) (apply (remove (between)))) (to if:(is Empty (to))))) (moveAgain))))) (move Step (directions {FR FL}) (to if:(is Empty (to)))) (then (if (is In (last To) (sites Next)) (promote (last To) (piece "PIECE_BETA") Mover))))) (forEach Piece "PIECE_BETA" (or (move Step Diagonal (to if:(is Empty (to)))) (move Hop Diagonal (between if:(is Enemy (who at:(between))) (apply (remove (between)))) (to if:(is Empty (to))) (then (if (can Move (hop (from (last To)) Diagonal (between if:(and (not (is In (between) (sites ToClear))) (is Enemy (who at:(between))))) (to if:(is Empty (to))))) (moveAgain))))))))) (end (if (no Pieces Next) (result Next Loss))))) ### MID: (last To)
### PRE: (game "GAME_NAME" (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" {11 10 9 8 7 6 5 4 3 2 1 0 12 13 14 15 16 17 18 19 20 21 22 23 -2} P1 directed:True) (track "Track2" {12 13 14 15 16 17 18 19 20 21 22 23 11 10 9 8 7 6 5 4 3 2 1 0 -2} P2 directed:True)} use:Vertex) (dice d:6 num:2) (piece "PIECE_ALPHA" Each (forEach Die replayDouble:True 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:(and {(or (not (is Enemy (who at:(to)))) (= 1 (size Stack at:(to)))) (if (not (is In (to) (sites Mover "StartingSide"))) True (> 2 (size Stack at:(to)))) ### SUF: }) (apply if:(is Enemy (who at:(to))) (fromTo (from (to)) (to (handSite Next))))))) (then (if (not (all DiceUsed)) (moveAgain))))) (hand Each) (regions "FinalQuadrant" P1 (sites {18 19 20 21 22 23})) (regions "FinalQuadrant" P2 (sites {0 1 2 3 4 5})) (regions "StartingSide" P1 (sites {0 1 2 3 4 5 6 7 8 9 10 11})) (regions "StartingSide" P2 (sites {12 13 14 15 16 17 18 19 20 21 22 23})) (regions "AfterPenultimate" P1 (sites {23})) (regions "AfterPenultimate" P2 (sites {0})) (map "Entry" {(pair P1 11) (pair P2 12)})}) (rules (start {(place Stack "PIECE_ALPHA1" 11 count:15) (place Stack "PIECE_ALPHA2" 12 count:15)}) (play (do (if (not (is Prev Mover)) (roll)) next:(or (if (is Occupied (handSite Mover)) (forEach Die replayDouble:True if:(!= (pips) 0) (move (from (handSite Mover)) (to (trackSite Move from:(mapEntry "Entry" Mover) steps:(- (pips) 1)) if:(is Empty (to)))) (then (if (not (all DiceUsed)) (moveAgain))))) (forEach Piece top:True)) (then (if (no Pieces Mover) (set Score Mover 2))))) (end (if (no Pieces Mover) (result Mover Win))))) ### MID: (if (not (is In (to) (sites Mover "AfterPenultimate"))) True (>= 10 (count Pieces in:(sites {(handSite Mover) (mapEntry "Entry" Mover)}))))
### PRE: (game "GAME_NAME" (players 2) (equipment {(board (rectangle 2 13) {(track "Track1" {7 8 9 10 11 12} P1 directed:True) (track "Track2" {18 17 16 15 14 13} P2 directed:True)} use:Vertex) (dice d:6 num:2) (piece "PIECE_ALPHA" Each (forEach Die if:(!= (pips) 0) (if (= (trackSite Move steps:(pips)) -1) (move Remove (from)) (move (from) (to (trackSite Move steps:(pips))))))) (map "StartTrack" {(pair P1 7) (pair P2 18)})}) (rules (start {(place Stack "PIECE_ALPHA1" (sites {7 8 9 10 11 12}) count:2) (place Stack "PIECE_ALPHA2" (sites {13 14 15 16 17 18}) count:2)}) phases:{(phase "UnStacking" (play (do (if (or (is Pending) (not (is Prev Mover))) (roll)) next:(forEach Die if:(!= (pips) 0) (if (= (state at:(trackSite Move from:(mapEntry "StartTrack" (mover)) steps:(- (pips) 1))) 0) (move Select (from (trackSite Move from:(mapEntry "StartTrack" (mover)) steps:(- (pips) 1))) (then (and (forEach Level (last To) (set State at:(last To) level:(level) 1)) (if (not (all DiceUsed)) (moveAgain))))))) (then (if (all DiceEqual) (and (set Pending) (moveAgain)))))) (nextPhase Mover (all Sites (sites Occupied by:Mover) if:(not (= (state at:(site)) 0))) "Stacking")) (phase "Stacking" (play (do (if (or (is Pending) (not (is Prev Mover))) (roll)) next:(forEach Die if:(!= (pips) 0) (if (= (state at:(trackSite Move from:(mapEntry "StartTrack" (mover)) steps:(- (pips) 1))) 1) (move Select (from (trackSite Move from:(mapEntry "StartTrack" (mover)) steps:(- (pips) 1))) (then (and (forEach Level (last To) (set State at:(last To) level:(level) 0)) (if (not (all DiceUsed)) (moveAgain))))))) (then (if (all DiceEqual) (and (set Pending) (moveAgain)))))) (nextPhase Mover (all Sites (sites Occupied by:Mover) if:(not (= (state at:(site)) 1))) "BearingOff")) (phase "BearingOff" (play (do (if (or ### SUF: (not (is Prev Mover))) (roll)) next:(forEach Piece top:True) (then (if (or (not (all DiceUsed)) (all DiceEqual)) (moveAgain))))) (end (if (no Pieces Mover) (result Mover Win))))})) ### MID: (all DiceEqual)
### PRE: (game "GAME_NAME" (players 2) (equipment {(board (add (square 7) edges:{{16 24} {24 32} {30 24} {24 18}}) use:Vertex) (piece "PIECE_ALPHA" Each (move Step (to if:(is Empty (to))) (then (if (> (count Sites in:(forEach (sites Around (last To)) if:(if (is Empty (site)) (or (and {(is In (last To) (sites {(ahead (site) N) (ahead (site) S) (ahead (site) W) (ahead (site) E)})) (is Mover (who at:(ahead (site) N))) (is Mover (who at:(ahead (site) S))) (is Mover (who at:(ahead (site) W))) (is Mover (who at:(ahead (site) E)))}) (and {(is In (last To) (sites {(ahead (site) NE) (ahead (site) SE) (ahead (site) SW) (ahead (site) NW)})) (is Mover (who at:(ahead (site) NE))) (is Mover (who at:(ahead (site) SE))) (is Mover (who at:(ahead (site) SW))) (is Mover (who at:(ahead (site) NW)))}))))) 0) (and (set Value Mover (count Sites in:(forEach (sites Around (last To)) if:(if (is Empty (site)) (or (and {(is In (last To) (sites {(ahead (site) N) (ahead (site) S) (ahead (site) W) (ahead (site) E)})) (is Mover (who at:(ahead (site) N))) (is Mover (who at:(ahead (site) S))) (is Mover (who at:(ahead (site) W))) (is Mover (who at:(ahead (site) E)))}) (and {(is In (last To) ### SUF: ) (is Mover (who at:(ahead (site) NE))) (is Mover (who at:(ahead (site) SE))) (is Mover (who at:(ahead (site) SW))) (is Mover (who at:(ahead (site) NW)))})))))) (moveAgain)))))) (hand Each)}) (rules (start (place "PIECE_ALPHA" "Hand" count:24)) phases:{(phase "FirstPlacement" P1 (play (move (from (handSite Mover)) (to (sites Centre)))) (nextPhase "Placement")) (phase "Placement" (play (move (from (handSite Mover)) (to (sites Empty)))) (nextPhase Mover (all Sites (sites Hand Mover) if:(= 0 (count Cell at:(site)))) "Playing")) (phase "Playing" (play (if (is Prev Mover) (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)))) (forEach Piece))))} (end (if (no Pieces Next) (result Next Loss))))) ### MID: (sites {(ahead (site) NE) (ahead (site) SE) (ahead (site) SW) (ahead (site) NW)})
### PRE: (game "GAME_NAME" (players 2) (equipment {(board (rectangle 4 13) {(track "Track1" "0,E,N1,W,N1,E,N1,W" P1 directed:True) (track "Track2" "51,W,S1,E,S1,W,S1,E" P2 directed:True)}) (dice d:2 from:0 num:4) (map {(pair 0 6) (pair 1 1) (pair 2 2) (pair 3 3) (pair 4 4)}) (piece "PIECE_ALPHA" Each (if (or (= (state at:(from)) 0) (and (= 1 (mapEntry (count Pips))) (= (state at:(from)) 1))) (if (!= (trackSite Move steps:(mapEntry (count Pips))) -1) (if (or (not (is In (from) (sites Next))) (and (is In (from) (sites Next)) (= (count Sites in:(intersection (sites Occupied by:Next) (sites Next))) 0))) (if (or (is In (trackSite Move steps:(mapEntry (count Pips))) (sites Empty)) (is Enemy (who at:(trackSite Move steps:(mapEntry (count Pips)))))) (or (if (= (+ (mapEntry (count Pips)) 1) (count at:(from))) (move (from) (to (trackSite Move steps:(mapEntry (count Pips))) (apply if:(is Enemy (who at:(to))) (remove (to) (then (addScore Mover 1))))) count:(mapEntry (count Pips)))) (move (from) (to (trackSite Move steps:(mapEntry (count Pips))) (apply if:(is Enemy (who at:(to))) (remove (to) (then (addScore Mover 1))))) count:(count at:(from)))) (if (and ### SUF: (is Friend (who at:(trackSite Move steps:(mapEntry (count Pips)))))) (move (from) (to (trackSite Move steps:(mapEntry (count Pips)))))))) (then (set State at:(last To) 0))))) (regions "AnotherThrow" (sites {1 4 6})) (regions "CentralRows" (union (sites Row 1) (sites Row 2))) (regions P1 (sites Bottom)) (regions P2 (sites Top))}) (rules (start {(place "PIECE_ALPHA1" (sites Bottom) state:1) (place "PIECE_ALPHA2" (sites Top) state:1)}) (play (do (roll) next:(if (can Move (forEach Piece)) (forEach Piece (then (if (is In (mapEntry (count Pips)) (sites "AnotherThrow")) (moveAgain)))) (move Pass (then (if (is In (mapEntry (count Pips)) (sites "AnotherThrow")) (moveAgain))))))) (end (if (or (and (= (count Sites in:(difference (sites Occupied by:P1) (sites P2))) 0) (= (count Sites in:(difference (sites Occupied by:P2) (sites P1))) 0)) (no Pieces Mover)) (byScore))))) ### MID: (is In (trackSite Move steps:(mapEntry (count Pips))) (sites "CentralRows"))
### PRE: (game "GAME_NAME" (players 2) (equipment {(board (square 7)) (regions "Fortresses" (sites Corners)) (piece "PIECE_ALPHA" P1 (move Slide Orthogonal (to (apply if:(not (is In (to) (union (sites Centre) (sites "Fortresses")))))) (then (or {(custodial ### SUF: Orthogonal (between (max 1) if:(= (what at:(between)) (id "PIECE_ALPHA2")) (apply (remove (between)))) (to if:(or {(is Friend (who at:(to))) (is In (to) (sites "Fortresses")) (and (is In (to) (sites Centre)) (is Empty (to)))}))) (surround (from (last To)) Orthogonal (between if:(and (= (what at:(between)) (id "PIECE_BETA" P2)) (is In (between) (expand origin:(centrePoint) Orthogonal))) (apply (trigger "Surrounded" P2))) (to if:(or (is Friend (who at:(to))) (is In (to) (sites Centre))))) (custodial (from (last To)) Orthogonal (between (max 1) if:(and (= (what at:(between)) (id "PIECE_BETA" P2)) (not (is In (between) (expand origin:(centrePoint) Orthogonal)))) (apply (trigger "Surrounded" P2))) (to if:(or (is Friend (who at:(to))) (is In (to) (sites "Fortresses")))))})))) (piece "PIECE_ALPHA" P2 (move Slide Orthogonal (to (apply if:(not (is In (to) (union (sites Centre) (sites "Fortresses")))))) (then (custodial (from (last To)) Orthogonal (between (max 1) if:(= (what at:(between)) (id "PIECE_ALPHA1")) (apply (remove (between)))) (to if:(or {(is Friend (who at:(to))) (is In (to) (sites "Fortresses")) (and (is In (to) (sites Centre)) (is Empty (to)))})))))) (piece "PIECE_BETA" P2 (move Slide Orthogonal (to (apply if:(not (= (to) (centrePoint))))) (then (custodial (from (last To)) Orthogonal (between (max 1) if:(= (what at:(between)) (id "PIECE_ALPHA1")) (apply (remove (between)))) (to if:(or {(is Friend (who at:(to))) (is In (to) (sites "Fortresses")) (and (is In (to) (sites Centre)) (is Empty (to)))}))))))}) (rules (start {(place "PIECE_ALPHA1" {"D1" "D2" "A4" "B4" "F4" "G4" "D6" "D7"}) (place "PIECE_ALPHA2" {"D3" "C4" "E4" "D5"}) (place "PIECE_BETA2" (centrePoint))}) (play (forEach Piece)) (end {(if (is Within (id "PIECE_BETA2") in:(sites "Fortresses")) (result P2 Win)) (if (is Triggered "Surrounded" P2) (result P1 Win))}))) ### MID: (from (last To))
### PRE: (game "GAME_NAME" (players 2) (equipment {(board (hole (hole (rectangle 3 8) (poly {{4 0} {4 1} {6 1} {6 0}})) (poly {{4 2} {4 3} {6 3} {6 2}})) {(track "Track1" "20,3,W,N1,E,S1,W,End" P1 directed:True) (track "Track2" "21,17,W,S1,E,N1,W,End" P2 directed:True)}) (dice d:2 from:0 num:4) (hand Each) (regions "Replay" (sites {"A1" "A3" "D2" "G1" "G3"})) (piece "PIECE_ALPHA" Each (if (= (trackSite Move steps:(count Pips)) -2) (move Remove (from)) (if (!= (trackSite Move steps:(count Pips)) -1) (if (or (is Empty (trackSite Move steps:(count Pips))) (and (not (is Friend (who at:(trackSite Move steps:(count Pips))))) (not (is In (trackSite Move steps:(count Pips)) (sites "Replay"))))) (move (from) (to (trackSite Move steps:(count Pips)) (apply if: ### SUF: (fromTo (from (to)) (to (handSite Next))))) (then (if (is In (last To) (sites "Replay")) (moveAgain))))))))}) (rules (start {(place "PIECE_ALPHA1" (handSite P1) count:7) (place "PIECE_ALPHA2" (handSite P2) count:7)}) (play (do (roll) next:(if (!= (count Pips) 0) (or (forEach Piece) (forEach Piece container:(mover)))))) (end (if (no Pieces Mover) (result Mover Win))))) ### MID: (is Enemy (who at:(to)))
### PRE: (game "GAME_NAME" (players 2) (equipment {(board (add (remove (merge {(square 5 diagonals:Alternating) ### SUF: (shift 0 -2 (wedge 3))}) vertices:{1 11 21 23 13 3}) edges:{{0 1} {1 2} {8 9} {9 10} {16 17} {17 18}}) use:Vertex) (piece "PIECE_ALPHA" Each (or (move Hop (between if:(is Enemy (who at:(between))) (apply (remove (between)))) (to if:(is Empty (to)))) (move Step (to if:(is Empty (to))))))}) (rules (start {(place "PIECE_ALPHA1" (union (sites {"A4" "E4"}) (expand (sites Bottom) steps:3))) (place "PIECE_ALPHA2" (union (sites {"A6" "E6"}) (expand (sites Top) steps:3)))}) (play (forEach Piece)) (end (if (no Pieces Next) (result Next Loss))))) ### MID: (shift 0 4 (rotate 180 (wedge 3)))
### PRE: (game "GAME_NAME" (players 2) (equipment {(board (rectangle 3 8) {(track "Track1" "0,E,N1,W,N1,E,S1,W" loop:True P1) (track "Track2" "23,W,S1,E,S1,W,N1,E" loop:True P2)}) (dice d:2 from:0 num:4) (piece "PIECE_ALPHA" Each (if (and {(if (!= 0 (state at:(from))) True (= 1 (count Pips)))}) (if (and (not (is Friend (who at:(trackSite Move steps:(count Pips))))) (if (not (is In (from) (sites Mover "Home"))) True (if (is In (trackSite Move steps:(count Pips)) (sites Mover "Home")) True (= (count Pieces Mover in:(difference (sites Board) (sites Mover "Home"))) 0)))) (move (from) (to (trackSite Move steps:(count Pips)) (apply if:(is Enemy (who at:(to))) (remove (to)))) (then (if (and (not (!= 0 (state at:(last To)))) (= 1 (count Pips))) (set State at:(last To) 1))))))) (regions "Home" P1 (sites Bottom)) (regions "Home" P2 (sites Top))}) (rules ### SUF: (play (do (roll) next:(if (= 1 (count Pips)) (priority {(forEach Piece (if (and {(if (!= 0 (state at:(from))) True (= 1 (count Pips))) (is In (from) (sites Mover "Home"))}) (if (and (not (is Friend (who at:(trackSite Move steps:(count Pips))))) (if (not (is In (from) (sites Mover "Home"))) True (if (is In (trackSite Move steps:(count Pips)) (sites Mover "Home")) True (= (count Pieces Mover in:(difference (sites Board) (sites Mover "Home"))) 0)))) (move (from) (to (trackSite Move steps:(count Pips)) (apply if:(is Enemy (who at:(to))) (remove (to)))) (then (if (and (not (!= 0 (state at:(last To)))) (= 1 (count Pips))) (set State at:(last To) 1))))))) (forEach Piece)}) (forEach Piece)) (then (if (= 1 (count Pips)) (moveAgain))))) (end (if (no Pieces Next) (result Next Loss))))) ### MID: (start {(place "PIECE_ALPHA1" (sites Bottom)) (place "PIECE_ALPHA2" (sites Top))})
### PRE: (game "GAME_NAME" (players {(player N) (player S)}) (equipment {(board (square 8)) (piece "PIECE_ALPHA" P1 N) (piece "PIECE_ALPHA" P2 S) (piece "PIECE_BETA" Each) (regions P1 (sites Bottom)) (regions P2 (sites Top))}) (rules (start {(place "PIECE_ALPHA1" (difference (expand (sites Bottom) steps:(- 3 1)) (sites Phase 1))) (place "PIECE_ALPHA2" (difference (expand (sites Top) steps:(- 3 1)) (sites Phase 1)))}) (play (if (is Prev Mover) (if (= (what at:(last To)) (id "PIECE_ALPHA" Mover)) (move Hop (from (last To)) (directions {FR FL}) (between if:(is Enemy (who at:(between))) (apply (remove (between)))) (to if:(is Empty (to))) (then (if (is In (last To) (sites Next)) (promote (last To) (piece "PIECE_BETA") Mover) (if (can Move (move Hop (from (last To)) (directions {FR FL}) (between if:(is Enemy (who at:(between))) (apply (remove (between)))) (to if:(is Empty (to))))) (moveAgain))))) (move Hop (from (last To)) Diagonal (between before:(count Rows) after:(count Rows) if:(and (not (is In (between) (sites ToClear))) (is Enemy (who at:(between)))) (apply (remove ### SUF: ))) (to if:(is Empty (to))) (then (if (can Move (hop (from (last To)) Diagonal (between before:(count Rows) after:(count Rows) if:(and (not (is In (between) (sites ToClear))) (is Enemy (who at:(between))))) (to if:(is Empty (to))))) (moveAgain))))) (priority {(or (forEach Piece "PIECE_ALPHA" (move Hop (from) (directions {FR FL}) (between if:(is Enemy (who at:(between))) (apply (remove (between)))) (to if:(is Empty (to))) (then (if (is In (last To) (sites Next)) (promote (last To) (piece "PIECE_BETA") Mover) (if (can Move (move Hop (from (last To)) (directions {FR FL}) (between if:(is Enemy (who at:(between))) (apply (remove (between)))) (to if:(is Empty (to))))) (moveAgain)))))) (forEach Piece "PIECE_BETA" (move Hop Diagonal (between before:(count Rows) after:(count Rows) if:(is Enemy (who at:(between))) (apply (remove (between)))) (to if:(is Empty (to))) (then (if (can Move (hop (from (last To)) Diagonal (between before:(count Rows) after:(count Rows) if:(and (not (is In (between) (sites ToClear))) (is Enemy (who at:(between))))) (to if:(is Empty (to))))) (moveAgain)))))) (or (forEach Piece "PIECE_ALPHA" (move Step (directions {FR FL}) (to if:(is Empty (to)))) (then (if (is In (last To) (sites Next)) (promote (last To) (piece "PIECE_BETA") Mover)))) (forEach Piece "PIECE_BETA" (move Slide Diagonal)))}))) (end (if (no Moves Next) (result Mover Win))))) ### MID: (between)
### PRE: (game "GAME_NAME" (players 2) (equipment {(board (concentric {1 8}) use:Vertex) (hand Each) (piece "PIECE_ALPHA" Each (move Step (to if:(is Empty (to)))))}) (rules ### SUF: phases:{(phase "Placement" (play (move (from (handSite Mover)) (to (sites Empty)))) (nextPhase (all Sites (sites Hand P2) if:(= 0 (count Cell at:(site)))) "Movement")) (phase "Movement" (play (forEach Piece)))} (end (if (is Line 3 through:(centrePoint) what:(mover)) (result Mover Win))))) ### MID: (start (place "PIECE_ALPHA" "Hand" count:3))
### PRE: ### SUF: ### MID: (game "GAME_NAME" (players 2) (equipment {(board (concentric Square rings:3 joinCorners:True) use:Vertex) (hand Each) (piece "PIECE_ALPHA" Each (move Step (to if:(is Empty (to))) (then (if (is Line 3 Orthogonal exact:True) (moveAgain)))))}) (rules (start (place "PIECE_ALPHA" "Hand" count:12)) phases:{(phase "Placement" (play (if (is Prev Mover) (if (can Move (move Remove (forEach (sites Occupied by:Enemy container:"Board") if:(not (is Line 3 Orthogonal through:(site)))))) (move Remove (forEach (sites Occupied by:Enemy container:"Board") if:(not (is Line 3 Orthogonal through:(site))))) (move Remove (sites Occupied by:Enemy container:"Board"))) (move (from (handSite Mover)) (to (sites Empty)) (then (if (is Line 3 Orthogonal exact:True) (moveAgain)))))) (nextPhase Mover (all Sites (sites Hand Mover) if:(= 0 (count Cell at:(site)))) "Movement")) (phase "Movement" (play (if (is Prev Mover) (if (can Move (move Remove (forEach (sites Occupied by:Enemy container:"Board") if:(not (is Line 3 Orthogonal through:(site)))))) (move Remove (forEach (sites Occupied by:Enemy container:"Board") if:(not (is Line 3 Orthogonal through:(site))))) (move Remove (sites Occupied by:Enemy container:"Board"))) (if (> (count Pieces Mover) 3) (forEach Piece) (move (from (sites Occupied by:Mover)) (to (sites Empty)))))))} (end (if (<= (count Pieces Next) 2) (result Next Loss)))))
### PRE: (game "GAME_NAME" (players 2) (equipment {(board (square 5)) (piece "PIECE_ALPHA" Each (or (move Hop (between if:(is Enemy (who at:(between))) (apply (remove (between)))) (to if:(is Empty (to))) (then (if (can Move (hop (from ### SUF: ) (between if:(and (not (is In (between) (sites ToClear))) (is Enemy (who at:(between))))) (to if:(is Empty (to))))) (moveAgain)))) (move Step (to if:(is Empty (to)))))) (hand Each)}) (rules (start (place "PIECE_ALPHA" "Hand" count:12)) phases:{(phase "Placement" (play (move (from (handSite Mover)) (to (difference (sites Board) (centrePoint)) if:(is Empty (to))))) (nextPhase Mover (is Empty (handSite Mover)) "Move")) (phase "Move" (play (if (is Prev Mover) (or (move Hop (from (last To)) (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))))) (moveAgain)))) (move Pass)) (forEach Piece))) (end (if (no Pieces Next) (result Next Loss))))})) ### MID: (last To)
### PRE: (game "GAME_NAME" (players 2) (equipment {(board (square 8) {(track "Track1" "3,E,N,W,S,E1,N6,E5,S5,W4,N4,E3,S3,W1" 1 directed:True) (track "Track2" "60,W,S,E,N,W1,S6,W5,N5,E4,S4,W3,N3,E1" 2 directed:True) (track "Track3" "31,N,W,S,E,N1,W6,N5,E5,S4,W4,N3,E3,S1" 3 directed:True) (track "Track4" "32,S,E,N,W,S1,E6,S5,W5,N4,E4,S3,W3,N1" 4 directed:True)}) (dice d:2 from:0 num:4) (hand Each) (map "DieValue" {(pair 4 8)}) (map "Entry" {(pair P1 "D1") (pair P2 "E8")}) (map "Exit" {(pair P1 "E3") (pair P2 "D6")}) (regions "Protect" (sites {"A1" "A4" "A5" "A8" "D1" "D4" "D5" "D8" "E1" "E4" "E5" "E8" "H1" "H4" "H5" "H8"})) (piece "PIECE_ALPHA" Each (if (!= (trackSite Move steps:(mapEntry "DieValue" (count Pips))) -1) (if (if (is In (trackSite Move steps:(mapEntry "DieValue" (count Pips))) (sites "Protect")) (not ### SUF: ) True) (move (from) (to (trackSite Move steps:(mapEntry "DieValue" (count Pips))) (apply if:(is Enemy (who at:(to))) (fromTo (from (to)) (to (handSite (who at:(to)))))))))))}) (rules (start {(place "PIECE_ALPHA1" (handSite P1) count:2) (place "PIECE_ALPHA2" (handSite P2) count:2)}) (play (do (if (not (is Prev Mover)) (roll)) next:(if (is Prev Mover) (or (forEach Piece (if (= (from) (mapEntry "Exit" Mover)) (move Remove (from)) (if (!= (trackSite Move steps:1) -1) (if (if (is In (trackSite Move steps:1) (sites "Protect")) (not (is Enemy (who at:(trackSite Move steps:1)))) True) (move (from) (to (trackSite Move steps:1) (apply if:(is Enemy (who at:(to))) (fromTo (from (to)) (to (handSite (who at:(to)))))))))))) (if (not (all Sites (sites Hand Mover) if:(= 0 (count Cell at:(site))))) (move (from (handSite Mover)) (to (mapEntry "Entry" Mover) if:(not (is Enemy (who at:(to)))))))) (if (can Move (forEach Piece)) (forEach Piece (then (if (= (count Pips) 3) (moveAgain)))) (move Pass (then (if (= (count Pips) 3) (moveAgain)))))))) (end (if (no Pieces Mover) (result Mover Win))))) ### MID: (is Enemy (who at:(trackSite Move steps:(mapEntry "DieValue" (count Pips)))))
### PRE: (game "GAME_NAME" (players 2) (equipment {(board (rotate 90 (hex 4))) (piece "PIECE_ALPHA" P1 (move Slide (between if:(and (!= (between) (centrePoint)) (is Empty (between)))) (then (and (surround (from (last To)) Orthogonal (between if:(and {(is In (between) (sites "Fortresses")) (is Enemy (who at:(between))) (all Sites (sites Around (between) Own) if:(all Sites (sites Around (site) Own) if:(not (is In (to) (sites Around (between) Own)))))}) (apply (remove (between)))) (to if:(is Friend (who at:(to)))) except:1) (custodial (from (last To)) Orthogonal (between (max 1) if:(and (!= (between) (centrePoint)) (is Enemy (who at:(between)))) (apply (remove (between)))) (to if:(is Friend (who at:(to))))))))) (piece "PIECE_ALPHA" P2 (move Slide (between if:(and (!= (between) (centrePoint)) (is Empty (between)))) (then (and {(surround (from (last To)) Orthogonal (between if:(and {(= (between) (centrePoint)) (= (what at:(between)) (id "PIECE_BETA" P1)) (all Sites (sites Around (between) Own) if:(all Sites (sites Around (site) Own) if:(not (is In (to) (sites Around (between) Own)))))}) (apply (remove (between)))) (to if:(is Friend (who at:(to)))) except:3) (surround (from (last To)) Orthogonal (between if:(and {(is In (between) (sites "Fortresses")) (is Enemy (who at:(between))) (all Sites (sites Around (between) Own) if:(all Sites (sites Around (site) Own) if:(not (is In (to) (sites Around (between) Own)))))}) (apply (remove (between)))) (to if:(is Friend (who at:(to)))) except:1) (custodial (from (last To)) Orthogonal (between (max 1) if:(and (!= (between) (centrePoint)) (is Enemy (who at:(between)))) (apply (remove (between)))) (to if:(is Friend (who at:(to)))))})))) (piece "PIECE_BETA" P1 (move Step (to if:(is Empty (to))) (then (and (surround (from (last To)) Orthogonal (between if:(and {(is In (between) (sites "Fortresses")) (is Enemy (who at:(between))) (all Sites (sites Around (between) Own) if: ### SUF: )}) (apply (remove (between)))) (to if:(is Friend (who at:(to)))) except:1) (custodial (from (last To)) Orthogonal (between (max 1) if:(and (!= (between) (centrePoint)) (is Enemy (who at:(between)))) (apply (remove (between)))) (to if:(is Friend (who at:(to))))))))) (regions "Fortresses" (sites Corners))}) (rules (start {(place "PIECE_BETA1" (centrePoint)) (place "PIECE_ALPHA2" (sites "Fortresses")) (place "PIECE_ALPHA1" {"D3" "C4" "E5"})}) (play (forEach Piece)) (end {(if (is Within (id "PIECE_BETA1") in:(sites "Fortresses")) (result P1 Win)) (if (= (where "PIECE_BETA" P1) -1) (result P2 Win))}))) ### MID: (all Sites (sites Around (site) Own) if:(not (is In (to) (sites Around (between) Own))))
### PRE: (game "GAME_NAME" (players 2) (equipment {(board (hex Hexagon 7)) (piece "PIECE_ALPHA" Each)}) (rules (meta (swap)) phases:{(phase "Opening" P1 (play (move Add (to (sites Empty)) (then (set Var (last To))))) (nextPhase)) (phase "Play" (play (move Add (to (sites LineOfSight Empty at:(var))) (then (set Var (last To))))))} (end {(if (no Moves Next) {(if (> (count Sites in:(intersection (sites Around (last To)) (sites Occupied by:P1))) (count Sites in:(intersection (sites Around (last To)) (sites Occupied by:P2)))) (result P1 Win)) (if (> (count Sites in:(intersection (sites Around (last To)) (sites Occupied by:P2))) (count Sites in:(intersection (sites Around (last To)) (sites Occupied by:P1)))) (result P2 Win)) (if (and (= (count Sites in:(intersection (sites Around (last To)) (sites Occupied by:P1))) (count Sites in:(intersection (sites Around (last To)) (sites Occupied by:P2)))) (is Mover P1)) (result P1 Win)) (if ### SUF: (result P2 Win))})}))) ### MID: (and (= (count Sites in:(intersection (sites Around (last To)) (sites Occupied by:P1))) (count Sites in:(intersection (sites Around (last To)) (sites Occupied by:P2)))) (is Mover P2))
### PRE: (game "GAME_NAME" (players 2) (equipment {(board (merge (wedge 4) (shift 0 3 (rotate 180 (wedge 4)))) use:Vertex) (piece "PIECE_ALPHA" Each (or (move Hop ### SUF: (to if:(is Empty (to)))) (move Step (to if:(is Empty (to))))))}) (rules (start {(place "PIECE_ALPHA1" (expand (sites Bottom) steps:2)) (place "PIECE_ALPHA2" (expand (sites Top) steps:2))}) (play (forEach Piece)) (end (if (no Pieces Next) (result Next Loss))))) ### MID: (between if:(is Enemy (who at:(between))) (apply (remove (between))))
### PRE: (game "GAME_NAME" (players 2) (equipment {(board (add (merge {(square 7) (shift 1 6 (rotate 180 (wedge 3))) (shift 1 -2 (wedge 3))}) edges:{{0 8} {8 16} {16 24} {24 32} {32 40} {40 48} {6 12} {12 18} {18 24} {24 30} {30 36} {36 42} {3 9} {9 15} {15 21} {21 29} {29 37} {37 45} {45 39} {39 33} {33 27} {27 19} {19 11} {11 3}}) use:Vertex) (piece "PIECE_ALPHA" Each (or (move Hop (between if:(is Enemy (who at:(between))) (apply (remove (between)))) (to if:(is Empty ### SUF: )) (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))))) (moveAgain)))) (move Step (to if:(is Empty (to))))))}) (rules (start {(place "PIECE_ALPHA1" (union (sites Bottom) (expand (sites Row 2)))) (place "PIECE_ALPHA2" (union (sites Top) (expand (sites Row 8))))}) (play (if (is Prev Mover) (or (move Hop (from (last To)) (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))))) (moveAgain)))) (move Pass)) (forEach Piece))) (end (if (no Pieces Next) (result Next Loss))))) ### MID: (to)
### PRE: (game "GAME_NAME" (players 2) (equipment {(board (square 12)) (piece "PIECE_ALPHA" P1 N) (piece "PIECE_ALPHA" P2 S) (piece "PIECE_BETA" Each) (regions P1 (sites Bottom)) (regions P2 (sites Top))}) (rules (start {(place "PIECE_ALPHA1" (difference (expand (sites Bottom) steps:(- 5 1)) (sites Phase 1))) (place "PIECE_ALPHA2" (difference ### SUF: (sites Phase 1)))}) (play (if (is Prev Mover) (if (= (what at:(last To)) (id "PIECE_ALPHA" Mover)) (max Moves (move Hop (from (last To)) Diagonal (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)) Diagonal (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) (if (is In (last To) (sites Next)) (promote (last To) (piece "PIECE_BETA") Mover)))))) (max Moves (move Hop (from (last To)) Diagonal (between before:(count Rows) after:(count Rows) 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 (hop (from (last To)) Diagonal (between before:(count Rows) after:(count Rows) if:(and (not (is In (between) (sites ToClear))) (is Enemy (who at:(between))))) (to if:(is Empty (to))))) (moveAgain)))))) (priority {(max Moves (or (forEach Piece "PIECE_ALPHA" (move Hop (from) Diagonal (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)) Diagonal (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) (if (is In (last To) (sites Next)) (promote (last To) (piece "PIECE_BETA") Mover)))))) (forEach Piece "PIECE_BETA" (move Hop Diagonal (between before:(count Rows) after:(count Rows) if:(is Enemy (who at:(between))) (apply (remove (between) at:EndOfTurn))) (to if:(is Empty (to))) (then (if (can Move (hop (from (last To)) Diagonal (between before:(count Rows) after:(count Rows) if:(and (not (is In (between) (sites ToClear))) (is Enemy (who at:(between))))) (to if:(is Empty (to))))) (moveAgain))))))) (or (forEach Piece "PIECE_ALPHA" (move Step (directions {FR FL}) (to if:(is Empty (to)))) (then (if (is In (last To) (sites Next)) (promote (last To) (piece "PIECE_BETA") Mover)))) (forEach Piece "PIECE_BETA" (move Slide Diagonal)))}))) (end (if (no Moves Next) (result Mover Win))))) ### MID: (expand (sites Top) steps:(- 5 1))
### PRE: (game "GAME_NAME" (players 2) (equipment {(board (square 17)) (piece "PIECE_ALPHA" Each) (hand Each) (regions "Secret Meeting Place" (sites {106 107 108 109 110 111 112 113 114 123 124 125 126 127 128 129 130 131 140 141 142 143 144 145 146 147 148 157 158 159 160 161 162 163 164 165 174 175 176 177 178 179 180 181 182})) (regions "Sanctuaries" (sites {"A1" "B1" "D1" "F1" "H1" "J1" "L1" "N1" "P1" "Q1" "A2" "Q2" "A4" "Q4" "A6" "Q6" "A8" "Q8" "A9" "Q9" "A10" "Q10" "A12" "Q12" "A14" "Q14" "A16" "Q16" "A17" "B17" "D17" "F17" "H17" "I17" "J17" "L17" "L17" "N17" "P17" "Q17"}))}) (rules (start {(place "PIECE_ALPHA1" (handSite P1) count:21) (place "PIECE_ALPHA2" (handSite P2) count:21)}) phases:{(phase "Placement" (play (move (from (handSite Mover)) (to (forEach (sites "Secret Meeting Place") if:(is Empty (site)))))) (nextPhase ### SUF: "Movement")) (phase "Movement" (play (if (is Prev Mover) (or (move Hop (from (last To)) (between if:(is Occupied (between))) (to if:(and (is Empty (to)) (not (is Visited (to))))) (then (if (and (not (is In (last To) (sites "Sanctuaries"))) (can Move (move Hop (from (last To)) (between if:(is Occupied (between))) (to if:(and (is Empty (to)) (not (is Visited (to)))))))) (moveAgain)))) (move Pass)) (forEach Piece (if (not (is In (from) (sites "Sanctuaries"))) (or (move Hop (from (from)) (between if:(is Occupied (between))) (to if:(and (is Empty (to)) (not (is Visited (to))))) (then (if (and (not (is In (last To) (sites "Sanctuaries"))) (can Move (move Hop (from (last To)) (between if:(is Occupied (between))) (to if:(and (is Empty (to)) (not (is Visited (to)))))))) (moveAgain)))) (move Step (to if:(is Empty (to))))))))) (end (if (all Sites (sites Occupied by:Mover) if:(is In (site) (sites "Sanctuaries"))) (result Mover Win))))})) ### MID: (and (all Sites (sites Hand P1) if:(= 0 (count Cell at:(site)))) (all Sites (sites Hand P2) if:(= 0 (count Cell at:(site)))))
### PRE: (game "GAME_NAME" (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} 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} P2 directed:True)} use:Vertex) (dice num:3) (map {(pair 1 19) (pair 2 6)}) (piece "PIECE_ALPHA" Each)}) (rules (start {(place Stack "PIECE_ALPHA1" 10 count:5) (place Stack "PIECE_ALPHA1" 11 count:5) (place Stack "PIECE_ALPHA1" 12 count:5) (place Stack "PIECE_ALPHA2" 23 count:5) (place Stack "PIECE_ALPHA2" 24 count:5) (place Stack "PIECE_ALPHA2" 25 count:5)}) (play (do (if (not (is Prev Mover)) (roll)) next:(forEach Die if:(!= (pips) 0) (forEach Site (sites Occupied by:Mover) (if (= (trackSite Move from:(site) steps:(pips)) -1) (move Remove (site)) (move (from (site)) ### SUF: ))) (then (if (not (all DiceUsed)) (moveAgain)))))) (end (if (no Pieces Mover) (result Mover Win))))) ### MID: (to (trackSite Move from:(site) 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 (mapEntry (mover))))))
### PRE: (game "GAME_NAME" (players 2) (equipment {(board (square 12)) (piece "PIECE_ALPHA" P1 N) (piece "PIECE_ALPHA" P2 S) (piece "PIECE_BETA" Each) (regions P1 (sites Bottom)) (regions P2 (sites Top))}) (rules (start {(place "PIECE_ALPHA1" (difference (expand (sites Bottom) steps:(- 5 1)) (sites Phase 1))) (place "PIECE_ALPHA2" (difference (expand (sites Top) steps:(- 5 1)) (sites Phase 1)))}) (play (if (is Prev Mover) (if (= (what at:(last To)) (id "PIECE_ALPHA" Mover)) (max Moves (move Hop (from (last To)) Diagonal (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)) Diagonal (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) (if (is In (last To) (sites Next)) (promote (last To) (piece "PIECE_BETA") Mover)))))) (max Moves (move Hop (from (last To)) Diagonal (between before:(count Rows) after:(count Rows) 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 (hop (from (last To)) Diagonal (between before:(count Rows) after:(count Rows) if:(and (not (is In (between) (sites ToClear))) (is Enemy (who at:(between))))) (to if:(is Empty (to))))) (moveAgain)))))) (priority {(max Moves (or (forEach Piece "PIECE_ALPHA" (move Hop (from) Diagonal (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 ### SUF: ) (moveAgain) (if (is In (last To) (sites Next)) (promote (last To) (piece "PIECE_BETA") Mover)))))) (forEach Piece "PIECE_BETA" (move Hop Diagonal (between before:(count Rows) after:(count Rows) if:(is Enemy (who at:(between))) (apply (remove (between) at:EndOfTurn))) (to if:(is Empty (to))) (then (if (can Move (hop (from (last To)) Diagonal (between before:(count Rows) after:(count Rows) if:(and (not (is In (between) (sites ToClear))) (is Enemy (who at:(between))))) (to if:(is Empty (to))))) (moveAgain))))))) (or (forEach Piece "PIECE_ALPHA" (move Step (directions {FR FL}) (to if:(is Empty (to)))) (then (if (is In (last To) (sites Next)) (promote (last To) (piece "PIECE_BETA") Mover)))) (forEach Piece "PIECE_BETA" (move Slide Diagonal)))}))) (end (if (no Moves Next) (result Mover Win))))) ### MID: (move Hop (from (last To)) Diagonal (between if:(and (not (is In (between) (sites ToClear))) (is Enemy (who at:(between)))) (apply (remove (between) at:EndOfTurn))) (to if:(is Empty (to))))
### PRE: (game "GAME_NAME" (players 2) (equipment {(board (square 5)) (piece "PIECE_ALPHA" Each (move Step (to if:(and {(is Empty (to)) (not (is In (to) (sites "RedDots"))) (can Move (do (set Var (to)) next:(forEach Site (difference (sites Occupied by:Mover) (from)) (step (from (site)) (directions Cell from:(from) to:(var)) (to if:(and (is Empty (to)) (not (is In (to) (sites "RedDots")))))))))})) (then (moveAgain)))) (regions "RedDots" (sites {"B2" "B4" "D2" "D4"}))}) (rules (start {(place "PIECE_ALPHA1" (sites Bottom)) (place "PIECE_ALPHA2" (sites Top))}) (play (if (is Prev Mover) (forEach Site (difference (sites Occupied by:Mover) (last To)) (move Step (from (site)) (directions Cell from: ### SUF: to:(last To)) (to if:(and (is Empty (to)) (not (is In (to) (sites "RedDots"))))))) (forEach Piece))) (end {(if (and (is Mover P1) (all Sites (sites Occupied by:P1) if:(is In (site) (sites Top)))) (result P1 Win)) (if (and (is Mover P2) (all Sites (sites Occupied by:P2) if:(is In (site) (sites Bottom)))) (result P2 Win))}))) ### MID: (last From)
### PRE: (game "GAME_NAME" (players 2) (equipment {(board (rectangle 4 20) {(track "Track1" "0,E,N1,W,N1,E,N1,W" P1 directed:True) (track "Track2" "79,W,S1,E,S1,W,S1,E" P2 directed:True)} use:Vertex) (piece "PIECE_ALPHA" Each (if (or (= (state at:(from)) 0) (and (or (= 1 (mapEntry (count Pips))) (= 6 (mapEntry (count Pips)))) (= (state at:(from)) 1))) (if (!= (trackSite Move steps:(if (= (state at:(from)) 1) 1 (mapEntry (count Pips)))) -1) (if (or (is In (trackSite Move steps:(if (= (state at:(from)) 1) 1 (mapEntry (count Pips)))) (sites Empty)) (is Enemy (who at:(trackSite Move steps:(if (= (state at:(from)) 1) 1 (mapEntry (count Pips))))))) (move (from) (to (trackSite Move steps:(if (= (state at:(from)) 1) 1 (mapEntry (count Pips)))) (apply if:(is Enemy (who at:(to))) (remove (to)))))) (then (if ### SUF: (set State at:(last To) 0)))))) (regions "AllSites" (sites Board)) (dice d:2 from:0 num:6) (map {(pair 0 6) (pair 1 0) (pair 2 2) (pair 3 1) (pair 4 1) (pair 5 0) (pair 6 6)}) (regions P1 (sites Bottom)) (regions P2 (sites Top))}) (rules (start {(place "PIECE_ALPHA1" (sites Bottom) state:1) (place "PIECE_ALPHA2" (sites Top) state:1)}) (play (do (roll) next:(forEach Piece))) (end {(if (no Pieces Next) (result Next Loss)) (if (and (= (count Sites in:(difference (sites Occupied by:P1) (sites P2))) 0) (= (count Sites in:(difference (sites Occupied by:P2) (sites P1))) 0)) (result Mover Draw))}))) ### MID: (= (state at:(last To)) 1)
### PRE: (game "GAME_NAME" (players 2) (equipment {(board (square 10)) (piece "PIECE_ALPHA" Each (move Step Orthogonal (to if:(and (is Empty ### SUF: ) (< (+ (results from:(sites {(from)}) to:(sites Around (from) Orthogonal) (if (= (from) (to)) 0 (if (is Friend (who at:(to))) 1 (if (is Enemy (who at:(to))) -1 0))))) (+ (results from:(sites {(from)}) to:(sites Around (to) Orthogonal) (if (= (from) (to)) 0 (if (is Friend (who at:(to))) 1 (if (is Enemy (who at:(to))) -1 0))))))))))}) (rules (start {(place "PIECE_ALPHA1" (sites {23 25 27 32 34 36 43 47 52 63 72 74 76 65 67 56})) (place "PIECE_ALPHA2" (sites {22 24 26 33 35 37 42 46 53 57 62 64 66 73 75 77}))}) (play (forEach Piece)) (end (if (no Moves Next) (result Mover Win))))) ### MID: (to)
### PRE: (game "GAME_NAME" (players 2) (equipment {(board (square 3 diagonals:Alternating) use:Vertex) (hand Each) (piece "PIECE_ALPHA" Each (move (from) (to (sites Empty))))}) (rules (start (place "PIECE_ALPHA" "Hand" count: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 ### SUF: ))} (end (if (is Line 3) (result Mover Win))))) ### MID: (forEach Piece)
### PRE: (game "GAME_NAME" (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 "PIECE_ALPHA" 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) ### SUF: (pair 3 14) (pair 4 10)}) (dice d:2 from:0 num:4)}) (rules (start {(place Stack "PIECE_ALPHA1" 2 count:4) (place Stack "PIECE_ALPHA2" 22 count:4) (place Stack "PIECE_ALPHA3" 14 count:4) (place Stack "PIECE_ALPHA4" 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))))) ### MID: (pair 2 22)
### PRE: (game "GAME_NAME" (players {(player N) (player S)}) (equipment {(board (square 8)) (piece "PIECE_ALPHA" P1 N) (piece "PIECE_ALPHA" P2 S) (piece "PIECE_BETA" Each) (regions P1 (sites Bottom)) (regions P2 (sites Top))}) (rules (start {(place "PIECE_ALPHA1" (difference (expand (sites Bottom) steps:(- 3 1)) (sites Phase 1))) (place "PIECE_ALPHA2" (difference (expand (sites Top) steps:(- 3 1)) (sites Phase 1)))}) (play (if (is Prev Mover) (if (= (what at:(last To)) (id "PIECE_ALPHA" Mover)) (move Hop (from (last To)) (directions {FR FL}) (between if:(is Enemy (who at:(between))) (apply (remove (between)))) (to if:(is Empty (to))) (then (if (is In (last To) (sites Next)) (promote (last To) (piece "PIECE_BETA") Mover) (if (can Move (move Hop (from (last To)) (directions {FR FL}) (between if:(is Enemy (who at:(between))) (apply (remove (between)))) (to if:(is Empty (to))))) (moveAgain))))) (move Hop (from (last To)) Diagonal (between before:(count Rows) after:(count Rows) 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)) Diagonal (between before:(count Rows) after:(count Rows) if:(and (not (is In (between) (sites ToClear))) (is Enemy (who at:(between))))) (to if:(is Empty (to))))) (moveAgain))))) (priority {(or (forEach Piece "PIECE_ALPHA" (move Hop (from) (directions {FR FL}) (between if:(is Enemy (who at:(between))) (apply (remove (between)))) (to if:(is Empty (to))) (then (if (is In (last To) (sites Next)) (promote (last To) (piece "PIECE_BETA") Mover) (if (can Move (move Hop ### SUF: (directions {FR FL}) (between if:(is Enemy (who at:(between))) (apply (remove (between)))) (to if:(is Empty (to))))) (moveAgain)))))) (forEach Piece "PIECE_BETA" (move Hop Diagonal (between before:(count Rows) after:(count Rows) if:(is Enemy (who at:(between))) (apply (remove (between)))) (to if:(is Empty (to))) (then (if (can Move (hop (from (last To)) Diagonal (between before:(count Rows) after:(count Rows) if:(and (not (is In (between) (sites ToClear))) (is Enemy (who at:(between))))) (to if:(is Empty (to))))) (moveAgain)))))) (or (forEach Piece "PIECE_ALPHA" (move Step (directions {FR FL}) (to if:(is Empty (to)))) (then (if (is In (last To) (sites Next)) (promote (last To) (piece "PIECE_BETA") Mover)))) (forEach Piece "PIECE_BETA" (move Slide Diagonal)))}))) (end (if (no Moves Next) (result Mover Win))))) ### MID: (from (last To))
### PRE: (game "GAME_NAME" (players 2) (equipment {(board (merge {(rectangle 1 6) (shift 7 0 (rectangle 1 6)) ### SUF: (shift 7 6 (rectangle 1 6))}) {(track "Track1" {24 23 22 21 20 19 18 -2} P1 directed:True) (track "Track2" {25 23 22 21 20 19 18 -2} P2 directed:True)} use:Vertex) (dice d:6 num:2) (piece "PIECE_ALPHA" Each (or (forEach Die replayDouble:True if:(!= (pips) 0) (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)))) (if (is Empty (handSite Mover)) (forEach Die replayDouble:True if:(and (!= (pips) 0) (= (trackSite Move from:(from) steps:(pips)) -2)) (move Remove (from)) (then (if (not (all DiceUsed)) (moveAgain))))))) (hand Each)}) (rules (start {(place Stack "PIECE_ALPHA1" (handSite P1) count:15) (place Stack "PIECE_ALPHA2" (handSite P2) count:15)}) (play (do (if (not (is Prev Mover)) (roll)) next:(or (forEach Piece) (forEach Piece container:(mover))))) (end (if (no Pieces Mover) (result Mover Win))))) ### MID: (shift 0 6 (rectangle 1 6))
### PRE: (game "GAME_NAME" (players 2) (equipment {(board (square 5)) (hand Each) (regions P1 (expand (sites Bottom) steps:2)) (regions P2 (expand (sites Top) steps:2)) (regions "MarkedCells" (union {(sites Centre) (sites Corners) (intersection (sites Outer) (sites Row (row of:(centrePoint)))) (intersection (sites Outer) (sites Column (column of:(centrePoint))))})) (piece "PIECE_ALPHA" Each (move Step Orthogonal (to if: ### SUF: )))}) (rules (start {(place "PIECE_ALPHA1" (handSite P1) count:10) (place "PIECE_ALPHA2" (handSite P2) count:12) (place "PIECE_ALPHA2" (centrePoint))}) phases:{(phase "Placement" (play (move (from (handSite Mover)) (to (intersection (sites Empty) (sites Mover))))) (nextPhase (and (all Sites (sites Hand P1) if:(= 0 (count Cell at:(site)))) (all Sites (sites Hand P2) if:(= 0 (count Cell at:(site))))) "Movement")) (phase "Movement" (play (forEach Piece (then (custodial (from (last To)) (between if:(is Enemy (who at:(between))) (apply (remove (between)))) (to if:(is Friend (who at:(to)))))))) (end {(if (no Moves P1) (result P2 Win)) (if (< (count Pieces P2) 2) (result P1 Win))}))})) ### MID: (is Empty (to))
### PRE: (game "GAME_NAME" (players 2) (equipment { ### SUF: (hand Each) (piece "PIECE_ALPHA" P1 (move Step Orthogonal (to if:(is Empty (to))) (then (if (is Line 3 Orthogonal) (moveAgain))))) (piece "PIECE_BETA" Each (move Step Orthogonal (to if:(is Empty (to))) (then (if (is Line 3 Orthogonal) (moveAgain)))))}) (rules (start {(place "PIECE_ALPHA1" (handSite P1) count:12) (place "PIECE_BETA2" (handSite P2) count:12)}) phases:{(phase "Placement" (play (do (move (from (handSite Mover)) (to (sites Empty))) ifAfterwards:(not (is Line 3 Orthogonal)))) (nextPhase (all Sites (sites Hand P2) if:(= 0 (count Cell at:(site)))) "Movement")) (phase "Movement" (play (if (is Prev Mover) (move Remove (sites Occupied by:Enemy container:"Board")) (forEach Piece))))} (end (if (no Pieces Next) (result Next Loss))))) ### MID: (board (rectangle 5 6))
### PRE: (game "GAME_NAME" (players {(player N) (player S)}) (equipment {(board (square 8)) (piece "PIECE_ALPHA" Each (or {(move Step Forward (to if:(is Empty (to)))) (move Step (directions {FR FL}) (to if:(is Enemy (who at:(to))) (apply (remove (to)))))} (then (if (is In (last To) (sites Mover "Promotion")) (moveAgain))))) (piece "PIECE_BETA" Each (move Slide Orthogonal (to if:(is Enemy (who at:(to))) (apply (remove (to)))))) (piece "PIECE_GAMMA" Each (move Step (to if:(not (is Friend (who at:(to)))) (apply (if (is Enemy (who at:(to))) (remove (to))))))) (piece "PIECE_DELTA" Each (move Hop Diagonal (between if:True) (to if:(or (is Empty (to)) (is Enemy (who at:(to)))) (apply (remove (to)))))) (piece "PIECE_EPSILON" 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))))))) (piece "PIECE_ZETA" Each (move Step Diagonal (to if:(not (is Friend (who at:(to)))) (apply (remove (to)))))) (regions "Promotion" P1 (sites Top)) (regions "Promotion" P2 (sites Bottom))}) ### SUF: ) ### MID: (rules (start {(place "PIECE_ALPHA1" (sites Row 1)) (place "PIECE_ALPHA2" (sites Row 6)) (place "PIECE_BETA1" {"A1" "H1"}) (place "PIECE_EPSILON1" {"B1" "G1"}) (place "PIECE_DELTA1" {"C1" "F1"}) (place "PIECE_ZETA1" coord:"D1") (place "PIECE_GAMMA1" coord:"E1") (place "PIECE_BETA2" {"A8" "H8"}) (place "PIECE_EPSILON2" {"B8" "G8"}) (place "PIECE_DELTA2" {"C8" "F8"}) (place "PIECE_ZETA2" coord:"D8") (place "PIECE_GAMMA2" coord:"E8")}) (play (if (is Prev Mover) (move Promote (last To) (piece "PIECE_ZETA") Mover) (do (forEach Piece) ifAfterwards:(not (is Threatened (id "PIECE_GAMMA" Mover)))))) (end {(if (and (is Threatened (id "PIECE_GAMMA" Next)) (not (can Move (do (forEach Piece Next) ifAfterwards:(not (is Threatened (id "PIECE_GAMMA" Next))))))) (result Mover Win)) (if (= (count Pieces Next) 1) (result Mover Win)) (if (no Moves Next) (result Mover Win))}))
### PRE: (game "GAME_NAME" (players {(player N) (player S)}) (equipment {(board (square 8)) (piece "PIECE_ALPHA" Each (move Step (to if:(not (is Friend (who at:(to)))) (apply (if (is Enemy (who at:(to))) (remove (to))))))) (piece "PIECE_BETA" (or (move Slide (to if:(is Enemy (who at:(to))) (apply (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 "PIECE_GAMMA" (move Slide Diagonal (between if:(or (is In (between) (sites Around (from))) (is Empty (between)))) (to if:(and (not (= (what at:(to)) (id "PIECE_GAMMA" Next))) (is Enemy (who at:(to)))) (apply if:(not (is In (to) (sites Around (from)))) (if (is Enemy (who at:(to))) (remove (to))))))) (piece "PIECE_DELTA" 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))))))) (piece "PIECE_EPSILON" Each (move Slide Orthogonal (to if:(is Enemy (who at:(to))) (apply (remove (to)))))) (piece "PIECE_ZETA" Each (or {(move Step Forward (to if:(is Empty (to)))) (move Step (directions {FR FL}) (to if:(is Enemy (who at:(to))) (apply (remove (to)))))} (then (if (is In (last To) (sites Mover "Promotion")) ### SUF: )))) (regions "Promotion" P1 (sites Top)) (regions "Promotion" P2 (sites Bottom))}) (rules (start {(place "PIECE_ZETA1" (sites Row 1)) (place "PIECE_ZETA2" (sites Row 6)) (place "PIECE_EPSILON1" {"A1" "H1"}) (place "PIECE_DELTA1" {"B1" "G1"}) (place "PIECE_GAMMA1" {"C1" "F1"}) (place "PIECE_BETA1" coord:"D1") (place "PIECE_ALPHA1" coord:"E1") (place "PIECE_EPSILON2" {"A8" "H8"}) (place "PIECE_DELTA2" {"B8" "G8"}) (place "PIECE_GAMMA2" {"C8" "F8"}) (place "PIECE_BETA2" coord:"D8") (place "PIECE_ALPHA2" coord:"E8")}) (play (do (forEach Piece) ifAfterwards:(not (is Threatened (id "PIECE_ALPHA" Mover))))) (end {(if (and (is Threatened (id "PIECE_ALPHA" Next)) (not (can Move (do (forEach Piece Next) ifAfterwards:(not (is Threatened (id "PIECE_ALPHA" Next))))))) (result Mover Win)) (if (no Moves Mover) (result Mover Loss))}))) ### MID: (promote (last To) (piece "PIECE_BETA") Mover)
### PRE: (game "GAME_NAME" (players {(player N) (player S)}) (equipment {(piece "PIECE_ALPHA" Each (or {(move Step Forward (to if:(is Empty (to)))) (move Step (directions {FR FL}) (to if:(is Enemy (who at:(to))) (apply (remove (to)))))} (then (if (is In (last To) (sites Mover "Promotion")) (if (= (where "PIECE_BETA" Mover) -1) (promote (last To) (piece "PIECE_BETA") Mover) (remove (last To))))))) (piece "PIECE_GAMMA" Each (move Step (to if:(not (is Friend (who at:(to)))) (apply (if (is Enemy (who at:(to))) (remove (to))))))) (piece "PIECE_BETA" Each (move Step Diagonal (to if:(not (is Friend (who at:(to)))) (apply (remove (to)))))) (piece "PIECE_DELTA" 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: ### SUF: )) (remove (to))))))) (piece "PIECE_EPSILON" Each (move Step (to if:(not (is Friend (who at:(to)))) (apply (if (is Enemy (who at:(to))) (remove (to))))))) (piece "PIECE_ZETA" Each (move Slide Orthogonal (to if:(is Enemy (who at:(to))) (apply (remove (to)))))) (piece "PIECE_ETA" Each (move Hop Diagonal (between if:True) (to if:(or (is Empty (to)) (and (is Enemy (who at:(to))) (not (= (what at:(to)) (id "PIECE_ETA" Next))))) (apply (remove (to)))))) (regions "Promotion" P1 (sites Top)) (regions "Promotion" P2 (sites Bottom)) (board (square 10))}) (rules (start {(place "PIECE_ALPHA1" (sites Row 2)) (place "PIECE_ALPHA2" (sites Row 7)) (place "PIECE_ZETA1" (sites {"A1" "J1"})) (place "PIECE_ZETA2" (sites {"A10" "J10"})) (place "PIECE_DELTA1" (sites {"B1" "I1"})) (place "PIECE_DELTA2" (sites {"B10" "I10"})) (place "PIECE_ETA1" (sites {"C1" "H1"})) (place "PIECE_ETA2" (sites {"C10" "H10"})) (place "PIECE_EPSILON1" (sites {"D1" "G1"})) (place "PIECE_EPSILON2" (sites {"D10" "G10"})) (place "PIECE_BETA1" coord:"E1") (place "PIECE_BETA2" coord:"F10") (place "PIECE_GAMMA1" coord:"F1") (place "PIECE_GAMMA2" coord:"E10")}) (play (do (forEach Piece) ifAfterwards:(not (is Threatened (id "PIECE_GAMMA" Mover))))) (end {(if (and (is Threatened (id "PIECE_GAMMA" Next)) (not (can Move (do (forEach Piece Next) ifAfterwards:(not (is Threatened (id "PIECE_GAMMA" Next))))))) (result Mover Win)) (if (no Moves Next) (result Mover Win))}))) ### MID: (to)
### PRE: (game "GAME_NAME" (players 2) (equipment {(board (square 10)) (piece "PIECE_ALPHA" Each (move Step Orthogonal (to if:(and (is Empty (to)) (< (+ (results from:(sites {(from)}) to:(sites Around (from) Orthogonal) (if (= (from) (to)) 0 (if (is Friend (who at:(to))) 1 (if (is Enemy (who at:(to))) -1 0))))) (+ (results from:(sites {(from)}) to:(sites Around (to) Orthogonal) ### SUF: )))))))}) (rules (start {(place "PIECE_ALPHA1" (sites {23 25 27 32 34 36 43 47 52 63 72 74 76 65 67 56})) (place "PIECE_ALPHA2" (sites {22 24 26 33 35 37 42 46 53 57 62 64 66 73 75 77}))}) (play (forEach Piece)) (end (if (no Moves Next) (result Mover Win))))) ### MID: (if (= (from) (to)) 0 (if (is Friend (who at:(to))) 1 (if (is Enemy (who at:(to))) -1 0)))
### PRE: (game "GAME_NAME" (players 2) (equipment {(board (hex 5)) (piece "PIECE_ALPHA" Each (move Step Orthogonal (to if:(is Empty (to)))))}) (rules (play (or (move Add (to (sites Empty)) (then (set Counter))) (forEach Piece) (then (priority (surround (from (last To)) Orthogonal (between if:(is Friend (who at:(between))) (apply (trigger "Surrounded" (mover)))) (to if:(is Occupied (to)))) (surround (from (last To)) Orthogonal (between if:(is Enemy (who at:(between))) (apply (trigger "Surrounded" (next)))) (to if:(is Occupied (to)))))))) (end {(if (= (counter) 5) (result Mover Draw)) (if (= (count Sites in:(sites Around (last To) if:(is Empty (to)))) 0) (result Next Win)) ### SUF: (if (is Triggered "Surrounded" P2) (result P1 Win))}))) ### MID: (if (is Triggered "Surrounded" P1) (result P2 Win))
### PRE: (game "GAME_NAME" (players 2) (equipment {(board (hex 7)) (piece "PIECE_ALPHA" Each)}) (rules (meta (swap)) (play (move Add (to (sites Empty)))) (end (if (>= ### SUF: (max (results from:(difference (sites Board) (sites Group at:(last To))) to:2 (* (to) (count Sites in:(intersection (union (sites Outer) (sites {(centrePoint)})) (sites Group at:(from) if:(not (is In (to) (sites Group at:(last To))))))))))) (result Mover Win))))) ### MID: (count Sites in:(union (sites Outer) (sites {(centrePoint)})))
### PRE: (game "GAME_NAME" (players 2) (equipment {(board (add ### SUF: edges:{{0 2} {0 4} {0 6} {0 8}}) use:Vertex) (piece "PIECE_ALPHA" 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 "PIECE_ALPHA1" (difference (expand (sites Bottom) steps:2) (expand (sites Top) steps:2))) (place "PIECE_ALPHA2" (difference (expand (sites Top) steps:2) (expand (sites Bottom) steps:2)))}) (play (forEach Piece)) (end (if (no Pieces Next) (result Next Loss))))) ### MID: (concentric {1 0 8 8})
### PRE: (game "GAME_NAME" (players 2) (equipment {(board (merge {(square 5 diagonals:Alternating) (shift 0 4 (rotate 180 (wedge 3))) (shift 0 -2 (wedge 3))}) use:Vertex) (piece "PIECE_ALPHA" Each (or (move Hop (between if:(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 ### SUF: (sites ToClear))) (is Enemy (who at:(between))))) (to if:(is Empty (to))))) (moveAgain)))) (move Step (to if:(is Empty (to))))))}) (rules (start {(place "PIECE_ALPHA1" (union {(sites Row 0) (sites Row 1) (sites Row 2) (sites Row 3) (sites {13 14})})) (place "PIECE_ALPHA2" (union {(sites Row 5) (sites Row 6) (sites Row 7) (sites Row 8) (sites {10 11})}))}) (play (if (is Prev Mover) (or (move Hop (from (last To)) (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))))) (moveAgain)))) (move Pass)) (forEach Piece))) (end (if (no Pieces Next) (result Next Loss))))) ### MID: (between)
### PRE: (game "GAME_NAME" (players 2) (equipment {(board (tiling T3464 1) use:Vertex) (piece "PIECE_ALPHA" Each)}) (rules (start {(place "PIECE_ALPHA1" (sites {4 5 0 1})) (place "PIECE_ALPHA1" Cell 1) (place "PIECE_ALPHA1" Edge (sites {0 3 4 9})) (place "PIECE_ALPHA2" (sites {16 17 12 13})) (place "PIECE_ALPHA2" Cell 11) (place "PIECE_ALPHA2" Edge (sites {25 29 26 20}))}) (play (if (is Prev Mover) (move (from Cell (last To)) (to Cell (intersection ### SUF: (sites Incident Cell of:Cell at:(from))) if:(and (= 1 (count Sites in:(intersection {(sites Empty Edge) (sites Incident Edge of:Cell at:(from)) (sites Incident Edge of:Cell at:(to))}))) (!= (last From) (to))))) (or {(forEach Piece on:Vertex (or (move Step (from Vertex) (to if:(is Empty Vertex (to))) (then (forEach Site (intersection (sites Incident Edge of:Vertex at:(last From)) (sites Incident Edge of:Vertex at:(last To))) (if (is Enemy (who Edge at:(site))) (remove Edge (site)))))) (move (from Vertex) (to Cell (intersection (sites Empty Cell) (sites Incident Cell of:Vertex at:(from))))))) (forEach Piece on:Edge (or (move Step (from Edge) (to if:(is Empty Edge (to))) (then (forEach Site (intersection (sites Incident Vertex of:Edge at:(last From)) (sites Incident Vertex of:Edge at:(last To))) (if (is Enemy (who Vertex at:(site))) (remove Vertex (site)))))) (move (from Edge) (to Cell (intersection (sites Empty Cell) (sites Incident Cell of:Edge at:(from))))))) (forEach Piece on:Cell (or {(move (from Cell) (to Cell (intersection (sites Empty Cell) (sites Incident Cell of:Cell at:(from)))) (then (forEach Site (intersection (sites Incident Edge of:Cell at:(last From)) (sites Incident Edge of:Cell at:(last To))) (if (is Enemy (who Edge at:(site))) (remove Edge (site)))))) (move (from Cell) (to Cell (sites Incident Cell of:Cell at:(from)) if:(and (is Enemy (who Cell at:(to))) (= 1 (count Sites in:(intersection {(sites Empty Edge) (sites Incident Edge of:Cell at:(from)) (sites Incident Edge of:Cell at:(to))})))) (apply (remove Cell (to)))) (then (moveAgain))) (move (from Cell) (to Cell (forEach (sites Empty Cell) if:(= 1 (count Sites in:(intersection (sites Incident Vertex of:Cell at:(from)) (sites Incident Vertex of:Cell at:(site))))))) (then (forEach Site (intersection (sites Incident Vertex of:Cell at:(last From)) (sites Incident Vertex of:Cell at:(last To))) (if (is Enemy (who Vertex at:(site))) (remove Vertex (site)))))) (move (from Cell) (to Edge (intersection (sites Empty Edge) (sites Incident Edge of:Cell at:(from))))) (move (from Cell) (to Vertex (intersection (sites Empty Vertex) (sites Incident Vertex of:Cell at:(from)))))}))}))) (end (if (>= 1 (+ {(count Pieces Vertex Next) (count Pieces Edge Next) (count Pieces Cell Next)})) (result Mover Win))))) ### MID: (sites Empty Cell)
### PRE: (game "GAME_NAME" (players 2) (equipment {(board (square 9) use:Vertex) (regions P1 {(sites Side N) (sites Side S)}) (regions P2 {(sites Side W) (sites Side E)}) (piece "PIECE_ALPHA" P1) (piece "PIECE_ALPHA" P2)}) (rules (play (if (not (is Prev Mover)) (or (move Add (to (sites Empty)) (then (if (and (not (is Prev Mover)) (< 0 (count Sites in:(sites (results from:(last To) to:(sites Around (from) Diagonal if:(and (is Mover (who at:(to))) (= 2 (count Pieces Next in:(intersection (sites Around (to) Orthogonal) (sites Around (from) Orthogonal)))))) (to)))))) (set Var "LT" (last To) (then (moveAgain))) (set Var "LT" -1)))) (forEach Site (sites Occupied by:Mover) (do (set Var "LT" (site)) next:(forEach Site (intersection (sites Around (var "LT") Orthogonal) (sites Around (sites (results from:(var "LT") to:(sites Around (from) Diagonal if:(and (is Mover (who at:(to))) (= 2 (count Pieces Next in:(intersection (sites Around (to) Orthogonal) (sites Around (from) Orthogonal)))))) (to))) Orthogonal)) (move (from (var "LT")) (to (site) if:(!= (last From) (to)) (apply (remove (site)))) (then (and (add (piece (id "PIECE_ALPHA" Next)) (to (var "LT"))) (set Var "LT" (last To) (then (if (< 0 (count Sites in:(sites (results from:(var "LT") to:(sites Around (from) Diagonal if:(and (is Mover (who at:(to))) (= 2 (count Pieces Next in:(intersection (sites Around (to) Orthogonal) (sites Around (from) Orthogonal)))))) (to))))) (set NextPlayer (player (mover))) (set Var "LT" -1))))))))))) (if (<= 0 (var "LT")) (forEach Site (intersection (sites Around (var "LT") Orthogonal) (sites Around (sites (results from:(var "LT") to:(sites Around (from) Diagonal if:(and (is Mover (who at:(to))) (= 2 (count Pieces Next in:(intersection (sites Around (to) Orthogonal) (sites Around (from) Orthogonal)))))) (to))) Orthogonal)) (move (from (var "LT")) (to (site) if:(!= (last From) (to)) (apply (remove (site)))) (then (and (add (piece (id "PIECE_ALPHA" Next)) (to (var "LT"))) (set Var "LT" (last To) (then (if (< 0 (count Sites in:(sites (results from:(var "LT") to:(sites Around (from) Diagonal if:(and (is Mover (who at:(to))) (= 2 (count Pieces Next in:(intersection (sites Around (to) Orthogonal) (sites Around (from) Orthogonal)))))) (to))))) (set NextPlayer (player (mover))) (set Var "LT" -1)))))))) (move Add (to (sites Empty)) (then (if (and (not (is Prev Mover)) (< 0 (count Sites in:(sites (results from:(last To) to:(sites Around (from) Diagonal if:(and (is Mover (who at:(to))) (= 2 (count Pieces Next in:(intersection (sites Around (to) Orthogonal) (sites Around (from) Orthogonal)))))) ### SUF: ))))) (set Var "LT" (last To) (then (moveAgain))) (set Var "LT" -1))))))) (end {(if (is Connected Orthogonal Mover) (result Mover Win))}))) ### MID: (to)
### PRE: (game "GAME_NAME" (players 2) (equipment {(board (square 14)) (piece "PIECE_ALPHA" Each (or {(move Step Forward (to if:(is Empty (to)))) (move Step (directions {FR FL}) (to if:(is Enemy (who at:(to))) (apply (remove (to)))))})) (piece "PIECE_BETA" Each (move Slide Orthogonal (to if:(is Enemy (who at:(to))) (apply (remove (to)))))) (piece "PIECE_GAMMA" Each (move Slide Orthogonal (to if:(is Enemy (who at:(to))) (apply (remove (to)))))) (piece "PIECE_DELTA" Each (move Slide Orthogonal (to if:(is Enemy (who at:(to))) (apply (remove (to)))))) (piece "PIECE_EPSILON" Each (move Step (to if:(not (is Friend (who at:(to)))) (apply (if (is Enemy (who at:(to))) (remove (to))))))) (piece "PIECE_ZETA" Each (move Step (to if:(not (is Friend (who at:(to)))) (apply (if (is Enemy (who at:(to))) (remove (to))))))) (piece "PIECE_ETA" Each (move Slide Diagonal (to if:(is Enemy (who at:(to))) (apply (remove (to)))))) ### SUF: (piece "PIECE_IOTA" Each (move Slide (to if:(is Enemy (who at:(to))) (apply (remove (to)))))) (piece "PIECE_KAPPA" Each (move Slide (to if:(is Enemy (who at:(to))) (apply (remove (to))))))}) (rules (start {(place "PIECE_ALPHA1" (sites Row 1)) (place "PIECE_ALPHA2" (sites Row 12)) (place "PIECE_BETA1" {"A1" "N1"}) (place "PIECE_THETA1" {"B1" "M1"}) (place "PIECE_GAMMA1" {"C1" "L1"}) (place "PIECE_DELTA1" {"D1" "K1"}) (place "PIECE_ETA1" {"E1" "J1"}) (place "PIECE_KAPPA1" coord:"F1") (place "PIECE_IOTA1" coord:"G1") (place "PIECE_EPSILON1" coord:"H1") (place "PIECE_ZETA1" coord:"I1") (place "PIECE_BETA2" {"A14" "N14"}) (place "PIECE_THETA2" {"B14" "M14"}) (place "PIECE_GAMMA2" {"C14" "L14"}) (place "PIECE_DELTA2" {"D14" "K14"}) (place "PIECE_ETA2" {"E14" "J14"}) (place "PIECE_KAPPA2" coord:"I14") (place "PIECE_IOTA2" coord:"H14") (place "PIECE_EPSILON2" coord:"G14") (place "PIECE_ZETA2" coord:"F14")}) (play (do (forEach Piece) ifAfterwards:(not (is Threatened (id "PIECE_EPSILON" Mover))))) (end (if (and (is Threatened (id "PIECE_EPSILON" Next)) (not (can Move (do (forEach Piece Next) ifAfterwards:(not (is Threatened (id "PIECE_EPSILON" Next))))))) (result Mover Win))))) ### MID: (piece "PIECE_THETA" 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)))))))
### PRE: (game "GAME_NAME" (players {(player N) (player S)}) (equipment {(board (square 8)) (piece "PIECE_ALPHA" Each (or {(move Step Forward (to if:(is Empty (to)))) (move Step (directions {FR FL}) (to if:(is Enemy (who at:(to))) (apply (remove (to)))))} (then (if (is In (last To) (sites Mover "Promotion")) (moveAgain))))) (piece "PIECE_BETA" Each (move Slide Orthogonal (to if:(is Enemy (who at:(to))) (apply (remove (to)))))) (piece "PIECE_GAMMA" Each (move Step (to if:(not (is Friend (who at:(to)))) (apply (if (is Enemy (who at:(to))) (remove (to))))))) (piece "PIECE_DELTA" Each (move Hop Orthogonal (between if:True) (to if:(not (is Friend (who at:(to)))) (apply (remove (to)))))) (piece "PIECE_EPSILON" 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))) ### SUF: ))))) (piece "PIECE_ZETA" Each (move Step Diagonal (to if:(not (is Friend (who at:(to)))) (apply (remove (to)))))) (regions "Promotion" P1 (sites Top)) (regions "Promotion" P2 (sites Bottom))}) (rules (start {(place "PIECE_ALPHA1" (sites Row 1)) (place "PIECE_ALPHA2" (sites Row 6)) (place "PIECE_BETA1" {"A1" "H1"}) (place "PIECE_EPSILON1" {"B1" "G1"}) (place "PIECE_DELTA1" {"C1" "F1"}) (place "PIECE_ZETA1" coord:"D1") (place "PIECE_GAMMA1" coord:"E1") (place "PIECE_BETA2" {"A8" "H8"}) (place "PIECE_EPSILON2" {"B8" "G8"}) (place "PIECE_DELTA2" {"C8" "F8"}) (place "PIECE_ZETA2" coord:"E8") (place "PIECE_GAMMA2" coord:"D8")}) (play (if (is Prev Mover) (move Promote (last To) (piece "PIECE_ZETA") Mover) (do (forEach Piece) ifAfterwards:(not (is Threatened (id "PIECE_GAMMA" Mover)))))) (end {(if (and (is Threatened (id "PIECE_GAMMA" Next)) (not (can Move (do (forEach Piece Next) ifAfterwards:(not (is Threatened (id "PIECE_GAMMA" Next))))))) (result Mover Win)) (if (no Moves Mover) (result Mover Win)) (if (<= (count Pieces Next) 1) (result Next Loss))}))) ### MID: (remove (to))
### PRE: (game "GAME_NAME" (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 "PIECE_ALPHA" 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 ### SUF: 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 "PIECE_ALPHA1" (sites Bottom)) (place "PIECE_ALPHA2" (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))))}))))) ### MID: (from)