(define "ThreeStones" (or { (= 3 (count Sites in: (forEach (sites Row (row of:(last To))) if:("IsFriendAt" (site)) ) ) ) (= 3 (count Sites in: (forEach (sites Column (column of:(last To))) if:("IsFriendAt" (site)) ) ) ) (= 3 (count Sites in: (forEach (union (sites Direction from:(last To) NE included:True) (sites Direction from:(last To) SW)) if:("IsFriendAt" (site)) ) ) ) (= 3 (count Sites in: (forEach (union (sites Direction from:(last To) NW included:True) (sites Direction from:(last To) SE)) if:("IsFriendAt" (site)) ) ) ) }) ) //------------------------------------------------------------------------------ (game "Trianon" (players 2) (equipment { (board (square 5) use:Vertex) (piece "Ball" Each) }) (rules (play (move Add (to (sites Empty)))) (end (if ("ThreeStones") (result Mover Loss))) ) ) //------------------------------------------------------------------------------ (metadata (info { (description "Trianon is a game played on a 5x5 board.") (rules "TURN - On each turn, each player drops a stone on an empty cell GOAL - A player loses if he has 3 friendly stones on an orthogonal or diagonal line (they don't need to be adjacent to each other).") (id "1810") (source "www.di.fc.ul.pt") (version "1.3.14") (classification "board/space/line") (author "Hans van Maanen") (credit "Eric Piette") (date "1992") } ) (graphics { (show Edges Diagonal (colour Hidden)) (board Background image:"square.svg" fillColour:(colour 223 178 110) edgeColour:(colour 223 178 110) scale:1.25) (board Colour OuterEdges (colour Black)) (board Colour InnerEdges (colour Black)) (board Colour OuterVertices (colour Hidden)) (board Colour InnerVertices (colour Hidden)) (show Symbol "disc" (sites Corners) fillColour:(colour Black) edgeColour:(colour Black) scale:0.3) }) (ai "Trianon_ai" ) )