|This is the archived CodeCup 2005 website.|
Click here to go to the new CodeCup website.
Rules of the game Lamistra
Stratego is a game published by Hausemann & Hotte BV (Jumbo) Amsterdam the Netherlands. All copyrights with respect to the Stratego game and all adaptations thereof belong to Jumbo. Jumbo is owner of the trademark Stratego. Jumbo has authorized the adaptation of Stratego by Stichting NIO in the form of Lamistra for the purpose of NIO and the design of programs by the participants on the basis thereof. Use of Stratego and Lamistra other than through the design of the program in the course of NIO and any other use of the program a than strict personal use is not permitted and will be considered an infringement of the rights of Jumbo. .
You know the game Stratego: Two players place their pieces on a board so that the opponent cannot see them. After this they move the pieces, trying to capture the opponents flag. Ministratego is the same game, but played on a smaller game board, reducing the number of pieces. Latent Ministratego or Lamistra adds a new element: You can postpone the choice for the value of a piece until you or your opponent make a capture. Of course it is requested that the choice you make at that instant is consistent with the game history so far.
Lamistra is played on a grid with 7 by 7 cells. These cells are named like in chess; the cell left at the bottom is called a1, the cell right at the top is called g7. The cells b4 and f4 are called lakes; these cells can not be entered by the pieces.
Both players can use 21 pieces. These pieces get a role during the game. The possible roles are:
Red starts, with the pieces placed on the cells a1-g3, blue plays with pieces on a5-g7.
A move is represented with a 5 character string: The name of the initial place, a minus-sign and the name of the destination (for example a3-b3 or c2-c3).
When your program has to decide which role a piece gets, a symbol from the table above has to be used (See also the example for input and output). All symbols for roles are upper case.
The following rules apply for Lamistra:
Write a program that reads input from standard input and writes output to standard output. Your program reads one line of input and outputs a move, based on and consistent with the information known so far. This will be repeated until the games ends. At the end of the game your program has to exit normally.
If the first line of input contains the word 'Start' , it means your program will play red and has to move first. If the first line is a move, than that is the move of your opponent and you will have to play blue.
When it is your programs turn to move, you have to choose a move. You will output a line with this move. If you are performing an attack, your program will output a second line stating the role of the attacking piece, even if this role was already known. Now the time for your program stops until the opponent has reacted. If your opponent performed an attack, you will output a line stating the role of the attacked piece, even if this role was already known. Now you will get an input line containing the role of the attacking piece. Then it is your turn to move.
For a game your program can use 30 seconds. This time will be measured on a competition machine, Pentium IV, 2.8 GHz, with 64 MB internal memory available for your program. This time may be divided between your moves the way it suits you best. Only the time between reading input and writing output will be measured.
Your program will be offered only valid input lines: Legal moves, valid pieces. When your program or the program of the opponent has made an irregularity, you will read a line containing 'X' meaning that you will have to close your program. If a flag is captured, your program also will have to be closed.
In all cases when the game is ended, your program must exit. This will occur in the following situations:
Example input and output