(game "Nim"
(mode 2)
(equipment {
(board (rect 1 5) (square))
(ball None)
}
)
(rules
(start {
(place "Ball0" 0 count:3 true)
(place "Ball0" 1 count:4 true)
(place "Ball0" 2 count:5 true)
(place "Ball0" 3 count:4 true)
(place "Ball0" 4 count:3 true)
}
)
(play
(if (equal (previous) (mover))
(or
(select (column (lastToMove)) (then (and (remove (lastToMove) ) (if (not (equal (height (lastToMove) ) 1) ) (replay) ) ) ) )
(pass)
)
(select (own 0) (then (and (remove (lastToMove) ) (if (not (equal (height (lastToMove) ) 1) ) (replay) ) ) ) )
)
)
(end
(stalemated Next)
(result Next Win)
)
)
)
(metadata
{ "hideBoard" "true" }
{ "rules" "Nim is a mathematical game of strategy in which two players take turns removing objects from distinct heaps or piles.
On each turn, a player must remove at least one object, and may remove any number of objects provided they all come from the same heap/pile
The goal of the game is to avoid taking the last object." }
)