(define "ConnectedEdges" (!= 0 (count Sites in:(forEach (sites Occupied by:#1) if:(is Connected at:(site) Orthogonal #1)))) ) //------------------------------------------------------------------------------ (game "Kanguruh" (players 2) (equipment { (board (square 8)) (piece "Kangaroo" Each (move Hop (between if:(is Occupied (between))) (to if:(is Empty (to)) (apply (and { (if ("IsEnemyAt" (between)) (remove (between)) ) (remember Value (from)) (remember Value (to)) }) ) ) (then ("ReplayIfCanMove" (hop (from (last To)) (between if:(is Occupied (between))) (to if:(and (is Empty (to)) (not (is In (to) (values Remembered))))) ) (forget Value All) ) ) ) ) }) (rules (start { (place "Kangaroo1" (expand (sites Bottom))) (place "Kangaroo2" (expand (sites Top))) }) (play (if ("SameTurn") (or (move Pass (then (forget Value All)) ) (move Hop (from (last To)) (between if:(is Occupied (between))) (to if:(and (is Empty (to)) (not (is In (to) (values Remembered)))) (apply (and (if ("IsEnemyAt" (between)) (remove (between)) ) (remember Value (to)) ) ) ) (then ("ReplayIfCanMove" (hop (from (last To)) (between if:(is Occupied (between))) (to if:(and (is Empty (to)) (not (is In (to) (values Remembered))))) ) (forget Value All) ) ) ) ) (forEach Piece) ) ) (end (if (no Moves Next) (byScore { (score P1 (count Pieces P1)) (score P2 (count Pieces P2)) }) ) ) ) ) //------------------------------------------------------------------------------ (metadata (info { (description "This game is played on the following 8x8 square board.") (rules "TURNS - At each turn, each player must move one of his stones (called Kangaroos): - A stone must jump over one (orthogonal or diagonal) adjacent stone landing on the immediate next empty cell. - If the jumped enemy stones are captured and removed from the board. - Jumps can be multiple but are not mandatory. GOAL - The game ends when one player cannot move. The winner is the one with more stones.") (id "1815") (source "www.di.fc.ul.pt") (version "1.3.12") (classification "board/war/leaping/orthogonal") (author "Milton Bradley") (credit "Eric Piette") (date "1985") } ) (graphics { (player Colour P1 (colour yellow)) (player Colour P2 (colour Red)) (board Colour Phase0 (colour 51 156 51)) (board Colour OuterEdges (colour White)) (board Colour InnerEdges (colour White)) }) (ai "Kanguruh_ai" ) )