Isola (C++ implementation)
Also known as: Isolation, Stranded.
Isola is a two-player board game. It is played on a 7x7 grid which is initially filled with squares. Both players have one piece; it is in the middle position of the row closest to his/her side of the board. Players can place their piece on empty squares only.
A move consists of two subsequent actions:
- Moving a piece to a neighboring (horizontally, vertically, or diagonally) position that contains an empty square.
- Removing an empty square.
The player who cannot make any move loses the game.
The input is a 7x7 matrix consisting only of _
, 1
, 2
and #
. Then another line follows with 1
or 2
, which is your player id.
The cell marked _
means it contains an empty square. The cell marked 1
means it contains player 1's piece. The cell marked 2
means it contains player 2's piece. The cell marked #
means it doesn't contain the square.
In the given matrix, top-left is (0, 0) and bottom-right is (6, 6). The x-coordinate increases from top to bottom, and y-coordinate increases from left to right.
___2___
_______
_______
_______
_______
_______
___1___
1
___2___
_______
___#___
_______
_______
___1___
_______
2
The coordinates of the empty square (x, y) where you want to move your piece. In next line, the (x, y) coordinates of empty square to remove.
3 5
3 2