(define "ReverseBoundedPieces" (custodial (from (last To)) Adjacent (between if:(!= (state at:(between)) (state at:(last To))) (apply (allCombinations (add (piece "Disc0" state:(mover)) (to (last To))) (flip (between)) ) ) ) (to if:(= (state at:(to)) (state at:(last To)))) ) ) (define "HorizontalLine" (!= 0 (count Sites in:(forEach (sites Column 0) if:(or (all Sites (sites Row (row of:(site))) if:(= 1 (state at:(site)))) (all Sites (sites Row (row of:(site))) if:(= 2 (state at:(site)))) ) ) )) ) (define "VerticalLine" (!= 0 (count Sites in:(forEach (sites Row 0) if:(or (all Sites (sites Column (column of:(site))) if:(= 1 (state at:(site)))) (all Sites (sites Column (column of:(site))) if:(= 2 (state at:(site)))) ) ) )) ) //------------------------------------------------------------------------------ (game "Minefield" (players 2) (equipment { (board (square 8)) (piece "Disc" Neutral (flips 1 2)) }) (rules (start { (place "Disc0" (sites Phase 0) state:1) (place "Disc0" (sites Phase 1) state:2) }) (play (move Select (from (sites Board)) (then (flip (last To) (then ("ReverseBoundedPieces")) ) ) ) ) (end { (if (and ("HorizontalLine") ("VerticalLine")) (result Mover Loss) ) (if ("HorizontalLine") (result P1 Win) ) (if ("VerticalLine") (result P2 Win) ) }) ) ) //------------------------------------------------------------------------------ (metadata (info { (description "The game is played on a 8x8 square board. The game has similarities with Othello but the main goal is to create a line of 8 of either colour in a specific direction.") (rules "DROP - On each turn, each player picks any stone of either color, and changes its color. Then, like in Othello, flips all stones of the other color that are between that stone and the next of same color, in any orthogonal or diagonal direction. GOAL - One player wins if it is able to make an horizontal 8 in-a-row of stones of any color. The other player wins by making a vertical 8 in-a-row. If, after a move, there are one horizontal and one vertical 8 in-a-row, the player that made the move losses.") (id "1809") (source "www.di.fc.ul.pt") (version "1.3.14") (classification "board/space/line") (author "Chris") (credit "Eric Piette") (date "2000") } ) (graphics { (piece Colour state:1 fillColour:(colour White)) (piece Colour state:2 fillColour:(colour Black)) (board Colour OuterEdges (colour Black)) (board Colour InnerEdges (colour Black)) (board StyleThickness InnerEdges 0.5) (board Colour Symbols (colour Black)) (board Colour Phase0 (colour 52 158 52)) (show Symbol "dot" Vertex {20 24 56 60} scale:0.2) }) (ai "Minefield_ai" ) )