- Connect first all your checkers.
Lines Of Action
58 CodinGamers in the Lines Of Action arena
Approved by leojean890 jacek trictrac
A higher resolution is required to access the IDE
- 5
Learning Opportunities
This puzzle can be solved using the following concepts. Practice using these concepts and improve your skills.
Statement
The Game
This is a port of the board game Lines Of Action.
Click here for the referee.
Rules
The game is played on a 8x8 board with two players. Each player has 12 checkers.
The initial position of checkers is shown in the following picture:
The goal of the game is to bring all of your own checkers together into a single connected group. Checkers can be connected vertically, horizontally or diagonally.
How to play:Black starts the game. Checkers move horizontally, vertically, or diagonally.
- A checker moves exactly as many spaces as there are checkers (both friendly and opponent) on the line in which it is moving.
- A checker may not jump over an opponent checker.
- A checker may jump over friendly checkers.
- A checker may land on an empty square or a square occupied by an opponent checker, resulting in the latter's capture and removal from the game.
The game ends when one player has connected all his checkers or when
- A bot must output the coordinates of the piece he wants to move followed by its destination coordinates. Coordinates are expressed in chess notation e.g. "
e2e3 "
- If the starting or destination coordinates are outside of the board,
- If the starting square is occupied by an opponent checker,
- If the destination square is occupied by an own checker,
- If the checker path is blocked by one or more opponent checkers,
- If the checker does not move exactly as many spaces as there are checkers (both friendly and opponent) on the line in which it is moving,
the game will end and the other player will win.
Expert Rules
- If your last move connects simultaneously your checkers and the opponent checkers, it is considered as a win for you.
- In very rare occurences, a player will not have any legal moves left. This is not considered as a losing position for the player and he must issue a "
pass " move to continue the game.
- You fail to connnect your checkers before the opponent.
- You do not respond in time or output an unrecognized command.
Game Input/Output
Next line: lastMove: the last move by the opponent ("
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. "
e2e3 message ". - You can play a random move by outputting "
random " instead of a move. This is admittedly only useful for stub code generation.
Response time per turn is ≤
A higher resolution is required to access the IDE