- Be the last to move.
A higher resolution is required to access the IDE
- 10
Learning Opportunities
This puzzle can be solved using the following concepts. Practice using these concepts and improve your skills.
Statement
The Game
This game is strongly inspired from Knight Isolation, a Udacity model game.
Click here for the referee.
Rules
The game is played on a 8x8 chess board with three players: Red, Green, Blue. Each player has one single piece: a knight. The goal of the game is to "isolate" the opponent knights.
Whenever a knight occupies a square, that square becomes unavailable for the remainder of the game. An open square available for a knight to move into is called a "liberty". A player with no remaining liberties for their piece during their turn leaves the game. Therefore, the last player to move wins the game.
The initial positions of the pieces are random but borders are excluded to ensure equal chances for all players.
How to play:Red starts the game, then Green, then Blue. Each player alternate taking turns moving their knight to an available square. Knights can move to any open square that is 2-rows and 1-column or 2-columns and 1-row away from their current position on the board.
The game ends when only one player remains.
Ending a turn:- A bot must output the destination coordinates of its piece. Coordinates are expressed in chess notation e.g.
e3
- If the destination square is outside of the board,
- If the destination square is not available,
- If the move is not a knight move,
the player leaves the game.
Expert Rules
- The game has been deliberately designed to be simple. Focus on search algorithms !
- You cannot move your knight.
- You do not respond in time.
- You output an unrecognized command or an illegal move.
Game Input/Output
Next
Next line: moveCount: the number of legal moves for this turn.
Next moveCount lines: move: a string of characters representing a legal move.
- You can display a (short) comment in the viewer by adding a space after the move and writing its content, e.g.
e3 message . - You can play a random move (chosen amongst all legal moves) by outputting
random instead of specific coordinates.
Response time per turn is ≤
A higher resolution is required to access the IDE