(define "UpdateScore" (if (>= (count Sites in:(sites Group at:(last To) Orthogonal)) (score #1)) (set Score #1 (count Sites in:(sites Group at:(last To) Orthogonal))) ) ) //------------------------------------------------------------------------- (game "Taiji" (players 2) (equipment { (board (square 9)) (piece "Marker" Each) }) (rules (play (if ("SameTurn") (move Add (piece (id "Marker" Next)) (to (intersection (sites Around (last To) Orthogonal) (sites Empty) ) ) (then ("UpdateScore" Next) ) ) (move Add (to (sites Empty) if:(> (count Sites in:(intersection (sites Around (to) Orthogonal) (sites Empty)) ) 0 ) ) (then (and ("UpdateScore" Mover) (moveAgain) ) ) ) ) ) (end { (if (and (no Moves Next) (= (score Mover) (score Next))) (result P2 Win) ) (if (and (no Moves Next) (> (score Mover) (score Next))) (result Mover Win) ) (if (and (no Moves Next) (< (score Mover) (score Next))) (result Next Win) ) }) ) ) //------------------------------------------------------------------------- (metadata (info { (description "TAIJI is a Chinese term that means ‘Great Duality’ and represents the fight of Good vs. Evil, Light vs. Darkness, YIN vs. YANG.") (rules "The game is played on a 9x9 board. On each turn, a player places a stone of their color on an empty space, and then places an opponent's stone orthogonally adjacent to the stone they just placed. The player with the largest group of orthogonally connected stones of their own color when there are no more possible moves wins the game. If both players have the same size for their largest group, the second player wins.") (id "4300") (source "BGG") (version "1.3.14") (classification "board/space/group") (author "Néstor Romeral Andrés") (credit "Achille Morenville") (date "2007") } ) )