(define "CondemnedState" 1) (define "CanPlaceKnight" (or (is Empty (to)) (and ("IsEnemyAt" (to)) ("IsEmptyOrSingletonStack" (to)) ) ) ) // #1 - site (define "PossibleKnightSites" (sites To (move Leap (from #1) // Cannot use "KnightWalk" macro because it does not work in the "Missing Corners" option. { { F F R F } { F F L F } { F R F F } { F L F F } } (to if:("CanPlaceKnight")) ) ) ) (define "MoveCondemnPiece" (move Select (from if:(and ("IsTopLevel" (from)) (<= 2 (count Sites in:("PossibleKnightSites" (from)))) ) ) (then (do (set Var "CondemnedSite" (last From)) next:(do (set State at:(var "CondemnedSite") ("CondemnedState")) next:(moveAgain) ) ) ) ) ) (define "MoveFirstKnight" (move Add (to ("PossibleKnightSites" (var "CondemnedSite"))) stack:True (then (do (set Pending) next:(moveAgain) ) ) ) ) (define "MoveSecondKnight" (move Add (to ("PossibleKnightSites" (var "CondemnedSite"))) stack:True (then (remove (var "CondemnedSite")) ) ) ) // #1 - "Row"/"Column" // #2 - index (define "OpponentSites" (intersection (sites #1 #2) (sites Occupied by:Next container:"Board") ) ) // #1 - "Row"/"Column" // #2 - index (define "OpponentCount" (count Sites in:("OpponentSites" #1 #2)) ) //------------------------------------------------------------------------------ (game "Callanish" (players 2) (equipment { (board ) (piece "Disc" Each ("MoveCondemnPiece")) }) (rules phases: { (phase "Opening" (play (move Add (to (sites Empty)))) (nextPhase (>= (count Turns) 2) "Playing") ) (phase "Playing" (play (if "SameTurn" (if (is Pending) ("MoveSecondKnight") ("MoveFirstKnight") ) (forEach Piece) ) ) ) } (end { (if (and (= (% (- (count Moves) 2) 3) 0) (or { (<= ("OpponentCount" Row 0)) (<= ("OpponentCount" Row 1)) (<= ("OpponentCount" Row 2)) (<= ("OpponentCount" Row 3)) (<= ("OpponentCount" Row 4)) (<= ("OpponentCount" Row 5)) (<= ("OpponentCount" Row 6)) (<= ("OpponentCount" Column 0)) (<= ("OpponentCount" Column 1)) (<= ("OpponentCount" Column 2)) (<= ("OpponentCount" Column 3)) (<= ("OpponentCount" Column 4)) (<= ("OpponentCount" Column 5)) (<= ("OpponentCount" Column 6)) }) ) (result Mover Loss) ) (if (no Moves Mover) (result Mover Loss)) }) ) ) //------------------------------------------------------------------------------ (option "Board Size" args:{ } { (item "7x7" < (square 7) > <4> <4> <4> <> <> "If, at the end of your opponent’s turn, you have at least 4 of your stones and/or stacks in the same rank, or in the same file, you win.") (item "9x9" < (square 9) > <5> <5> <5> < (<= 5 ("OpponentCount" Row 7)) (<= 5 ("OpponentCount" Row 8)) > < (<= 5 ("OpponentCount" Column 7)) (<= 5 ("OpponentCount" Column 8)) > "If, at the end of your opponent’s turn, you have at least 5 of your stones and/or stacks in the same rank, or in the same file, you win.")** (item "Missing Corners" < (remove (square 9) cells:{0 1 7 8 9 17 63 71 72 73 79 80}) > <5> <4> <3> < (<= 4 ("OpponentCount" Row 7)) (<= 3 ("OpponentCount" Row 8)) > < (<= 4 ("OpponentCount" Column 7)) (<= 3 ("OpponentCount" Column 8)) > "You win for having any of the following at the end of your opponent’s turn: 3 stones along the outermost files and ranks (a, i, 1, or 9); 4 stones along files b or h, or ranks 2 or 8; and 5 stones along the central files and ranks (c – g and 3 – 7).") (item "11x11" < (square 11) > <6> <6> <6> < (<= 6 ("OpponentCount" Row 7)) (<= 6 ("OpponentCount" Row 8)) (<= 6 ("OpponentCount" Row 9)) (<= 6 ("OpponentCount" Row 10)) > < (<= 6 ("OpponentCount" Column 7)) (<= 6 ("OpponentCount" Column 8)) (<= 6 ("OpponentCount" Column 9)) (<= 6 ("OpponentCount" Column 10)) > "If, at the end of your opponent’s turn, you have at least 6 of your stones and/or stacks in the same rank, or in the same file, you win.") (item "13x13" < (square 13) > <7> <7> <7> < (<= 7 ("OpponentCount" Row 7)) (<= 7 ("OpponentCount" Row 8)) (<= 7 ("OpponentCount" Row 9)) (<= 7 ("OpponentCount" Row 10)) (<= 7 ("OpponentCount" Row 11)) (<= 7 ("OpponentCount" Row 12)) > < (<= 7 ("OpponentCount" Column 7)) (<= 7 ("OpponentCount" Column 8)) (<= 7 ("OpponentCount" Column 9)) (<= 7 ("OpponentCount" Column 10)) (<= 7 ("OpponentCount" Column 11)) (<= 7 ("OpponentCount" Column 12)) > "If, at the end of your opponent’s turn, you have at least 7 of your stones and/or stacks in the same rank, or in the same file, you win.") }) //------------------------------------------------------------------------------ (metadata (info { (description "On the Isle of Lewis (Outer Hebrides, Scotland) are located some of the most impressive prehistoric megalithic structures in Europe. The most important sites are around the area of Callanish, and include stone circles, cairns, and stone alignments.The goal of Callanish is to create an alignment of a certain number of stones or stacks of your colour orthogonally along any file or rank of the board.") (rules "The board is initially empty. Each player chooses a colour: White or Black. White starts by placing a stone on a vacant square. Black does the same. Players continue taking turns; however, your turn goes as follows: 1. Mark one of your exposed stones for removal from the board (i.e. it cannot be under an enemy stone). 2. Add one of your stones to the board. 3. Add another one of your stones to the board, at which point the marked stone is removed. The following rules constrain where you can add each stone: It must be a “knight’s move” away from the marked stone. That is to say, either 2 spaces vertically and 1 horizontally, or 2 spaces horizontally, and 1 vertically away from the marked stone. The space on which you place it must have none of your stones, and either: be vacant, or have an enemy stone, in which case you will place yours on top, creating a stack that you control.") (id "1213") (source "nestorgames") (version "1.3.12") (classification "board/space/line") (author "José Manuel Astilleros García-Monge") (publisher "nestorgames (used with permission)") (credit "Nicholas Bamber") (date "2014") } ) (graphics { (board Colour Phase0 (colour 223 178 110)) (board Colour InnerEdges (colour Black)) (board Colour OuterEdges (colour Black)) (piece Foreground state:("CondemnedState") image:"X" edgeColour:(colour Red) scale:0.4) }) )