- Capture all of your opponent's pieces.
- Have more pieces than your opponent when the game ends.
A higher resolution is required to access the IDE
- 2
Learning Opportunities
This puzzle can be solved using the following concepts. Practice using these concepts and improve your skills.
Statement
Rules
The game is played on a 7x7 board.
The board is chosen from one of the 596 possible configurations.
The game goes on until both players can no longer move or a player has no more pieces.
Board coordinates
- Columns are labeled
a throughg from left to right. - Rows are labeled
1 throught7 from bottom to top. - Coordinates are written as a column followed by a row. For example,
a1 is the bottom-left corner of the board andg7 is the top-right corner.
Legal actions
- Player
0 always goes first. - Players take turns performing one of the two available actions, Spawn and Jump.
- Spawn: A player may spawn a piece on an empty square adjacent (vertically, horizonally or diagonally) to one of their existing pieces.
- Jump: A player may move one of their pieces to an empty square that is two squares away in any direction (vertically, horizontally or diagonally).
- After a Spawn or Jump action, all adjacent opponent pieces are converted to the color of the player who moved.
Output
- A player must output either:
- the coordinates of the square for a Spawn (e.g. b7), or
- the coordinates of the source and the destination squares for a Jump (e.g. a7c7).
- If the coordinates are outside the board, the game ends and the other player wins.
- If the coordinates are inside the board but the target square is occupied or a wall, the game ends and the other player wins.
Expert Rules
The game ends in a draw if it reaches 300 turns, or if the same position occurs three times (the same board configuration and the same player to move).
Victory Conditions
Loss Conditions
- You have no pieces.
- You do not respond in time or you output an unrecognized command.
Game Protocol
Initial input
First line: id: your player ID (0 or 1 ).
Input for one game turn
Next line: A string lastAction for the last action made by the opponent.
Next line: An integer actionsCount for the number of legal actions for this turn.
Next actionsCount lines: A string action representing a legal action.
Output for one game turn
A single line containing either:
You can also print a message after the action, e.g.a7c7 message .
- the coordinates where you want to jump from and to, e.g.
a7c7 , or - the coordinates where you want to spawn a piece, e.g.
b7 , or random .
You can also print a message after the action, e.g.
Constraints
Response time first turn is ≤
Response time per turn is ≤
A higher resolution is required to access the IDE