From: Reijer Grimbergen ETL GO JP> Date: 26 oct 1998 Subject: The 9th CSA Computer Shogi Championships 1998 This is a forwarded message by Takenobu Takizawa, co-organiser of the CSA Computer Shogi Championships. Please feel free to forward it to everyone you think might be interested. Reijer ============================================================================== Announcement of the 9th Computer Shogi Championship It is my pleasure to announce that the 9th Computer Shogi Championship will be held in Japan in March 1999. Takenobu Takizawa Chairman of the Executive Comittee Vice-Chairman of the Computer Shogi Association (CSA) -------------------------------------------------------------------- The 9th Computer Shogi Championship Competition Dates: March 18-19, 1999 Competition Venue: Sheraton Grande Tokyo Bay Hotel & Towers 1-9 Maihama, Urayasu, Chiba 279, Japan Phone: 0473-55-5555 FAX: 0473-55-5566 Registration Deadline: November 30, 1998 Prizes: First: 300,000 yen and a personal computer Second: 200,000 yen Third: 100,000 yen Eligibility Open to anyone of any nationality. Only originally produced programs may be entered. The program should allow a move to be adjusted,in case of input error. (Extra time will be reimbursed.) Any computer may be used. Competitors are strongly urged to bring their own computer. CSA may provide an IBM compatible, but it might be a relatively slow machine. Operator: The operator must be one of the principal programmers of the entered program. If none of the programmers can come to the tournament, one proxy must be prepared by the entrant. The operator may recompile the program/modify parameters before starting each game. All games will be evenly played (hirate). Perpetual repetition: Draw, 1/2 win point (except perpetual check). 1st day: Preliminary Contest The top 3 of the last tournament will be exempted from this day, and proceed directly to the Final. The Preliminary Contest is divided into two groups. The upper division will consist of 16 programs (first through 19th seeds except three direct finalists). The lower division contest will be held in the morning. There will be 5 Swiss-style games. The top 4 programs and programs which lose only once will join the upper division contest. If the number of such programs is odd, the CSA will add an extra program by invitation. The upper division contest will be held in the afternoon. There will be 7 Swiss-style games. The top 5 programs will proceed to the second day of copetition. The invited program will not proceed to the second day. 2nd day: The Final Round robin of 8 programs with each program playing each other once. Time Limits: To complete a game, each program is allowed 20 minutes in the lower division contest and 25 minutes in both the upper division contest and the final. If one side runs out of time before it wins or declares a win, then it loses the game. The program must measure the time spent on each move. The minimum of the time spent on each move is one second, i.e. if the time spent on a move is one second or less, then the program must count it as one second. If the time spent on a move is more than one second, then the program may count in whole seconds, not counting any fractions. Handling (input move) time will be excepted in the case of a communication breakdown. Declaration of a win in case of Nyugyoku: In case of NYUGYOKU (JISHOGI), the CSA applies the following declaration rule: The program may declare WIN (send %KACHI if communication available) if the following conditions are satisfied. If one of the conditions is not satisfied, the declaring side loses. (1) The King of the declaring side is in the third rank or beyond. (2) The declaring side has 28 (the first player (sente, black)) or 27 (the second player (gote, white)) piece points or more. Piece points are counted only for pieces of the declaring side that are in hand or in the third rank or beyond. Piece points are counted as follows: King:0; Rook, Bishop, Promoted Rook or Promoted Bishop:5; Other:1. (3) The declaring side has 10 or more pieces other than the King in the third rank or beyond. (4) No check on the King of the declaring side. (5) The declaring side has at least one second left. Outcome of Game: The outcome of a game will be determined by the following rules in the order given: 1) the time limit has been exceeded 2) the usual shogi rules (except JISHOGI) 3) declaration of a win (by the computer) Tournament Results: Tournament results will be determined by the following rules in the order given: 1) number of wins 2) sum of all opponents' scores 3) sum of defeated opponents' scores 4) sum of defeated opponents' scores without top and bottom 5) result of head-to-head competition 6) order in the last tournament (top 3) or preliminary contest draw: 1/2 point Game Records: Each player must provide a record at the end of each game. The format is free. Communication Each player must prepare communication ability. If the program itself is not able to do this, the operator may use a proxy program running on the same computer or another NOTEBOOK computer. Communication Protocol ( CSA Format 1998 ) Major changes: 1) Adding "SENNICHITE" and "JISHOGI" command 2) Changing the standard connector from DSUB-25 pins to DSUB-9 pins 3) Resolution of ambiguity for starting, restarting, and ending a game (1) Command (a) Move: Turn:: Sente(Black) for "+" , Gote(White) for "-" Source Square:: x y coordinate Destination Square:: x y coordinate Piece Name after move:: Before promotion After promotion Fu(Pawn): FU TO Kyo(Lance): KY NY Keima(Knight): KE NK Gin(Silver): GI NG Kin(Gold): KI Kaku(Bishop): KA UM Hisha(Rook): HI RY Ou(King): OU Note: Top Right square coordinate is (1,1) Bottom Left square coordinate is (9,9) Source square for dropping move is 00 Promotion is specified by the name of the piece after promotion Example: +7776FU Black moves Pawn from (7,7) to (7,6) -0034KA White drops Bishop to (3,4) +2423TO Black moves Pawn from (2,4) to (2,3) and promotes (b) Special command ( do not prefix + nor - ) Resign : %TORYO Take Back: %MATTA Interruption: %CHUDAN Repetition: %SENNICHITE Draw: %JISHOGI Declaring a win after the king has entered the opponent's camp: %KACHI Declaring a draw after the king has entered the opponent's camp: %HIKIWAKE For (a) and (b), attach a line feed LF(0x0a) character at the end of the move and command string A Take-Back command can be only be issued by the communication program being used by the operator of a shogi program without communication capability. If the operator makes a mistake entering a move in the communication program, the operator should wait before issuing the Tack-Back command until the operator side gets his/her turn. If a shogi-program receives a Tack-Back command, it must retract to the position of two moves prior. Draw, Declare-Win, Declare-draw is defined by the tournament rules. (2) Communication Conditions We use an RS232C communication line between the two computers. Baud rate: 1200 BPS Data length: 8 bit Parity: No Stop Bit: 1 bit X-flow-control: ON (3) Connector and Cable Computer's Connector: D-Sub 9 pins male connector Cable's Connector: D-sub 9 pins female connector Cable: Reverse cable For computers without a D-Sub 9 pins male connector, the operator can use the converting connector to comply with the standard. A cable with converting connector can be used if necessary. (4) At the start: Confirm that the opponent is ready to receive a move. The program with black's turn will start. (5) At the end: (a) Resign The game will end by sending a resign command. When a program decides to resign, it will send the resign command(%TORYO). When a program checkmates the opponent, the program should wait until it receives a resign command from the opponent. The game will continue until the receipt of a resign command. (b) Repetition A program can issue the repetition command(%SENNICHITE) on its turn when it has detected that the current position is a repeated position and the game will end. Although a program can detect a repeated position after making a move by itself, it should wait for the repetition command from the opponent (it should not interrupt the game by itself). Upon receipt of a repetition command, the game will end. In either case, the program is required to have the capability to restart the game from that position. (c) Draw When a program has determined that the position is draw, it should send the draw(%JISHOGI) command and end the game. (A draw is determined by the tournament rules.) (d) Interruption During the receiving state, programs must be capable of being interrupted by a human operation. If such an operation is performed by a human, it should carry out the same process as if it had received an interruption command from its opponent. (6) Restarting( desirable capabilities ) Ideally, a program will have the capability of restarting from an interrupted position. If the number of moves played by the two playing programs is different, the operator of the program that has played more moves will retract to the opponent's position so that both program will have the same position. The time also will be retracted accordingly. (a) For programs with communication-capability The program not having a turn will be put into the receiving state. The program having a turn will be put in the thinking state. (b) For programs without communication-capability The program not having a turn will be put into the waiting state for its opponent's move. The program having a turn will be put in the thinking state. (7) In case of trouble In case of receiving illegal moves or an unknown string, the program should display the receiving string on the screen and perform the interrupt process. (8) ETC When two programs are playing directly using a communication protocol, neither program is allowed to issue or accept the Take-Back and Interrupt commands. ====================================================================== With the permission of Mr. Yoshimura, here are the source codes for a communication program. ====================================================================== The following are the source codes using 32 bit API for communication programming in a windows environment. It has been tested successfully with Morita-Shogi, Kanazawa-Shogi and Kakinoki-Shogi, but I cannot guarantee that the codes are free of bugs. You can use the codes in your program, but it is your responsibility to make your own communication routines. static HANDLE hCom; int RS_init( ) /* Initilaize Communication port */ { DCB dcb ; COMMTIMEOUTS CommTimeOuts ; if ( ( hCom = CreateFile ( "COM1", /* Open file name as "COM1" */ GENERIC_READ | GENERIC_WRITE, /* Open file for read and write */ 0, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL ) ) == INVALID_HANDLE_VALUE ) { return 1; // error } CommTimeOuts.ReadIntervalTimeout = MAXDWORD; CommTimeOuts.ReadTotalTimeoutMultiplier = 0; CommTimeOuts.ReadTotalTimeoutConstant = 1000; CommTimeOuts.WriteTotalTimeoutMultiplier = 0; CommTimeOuts.WriteTotalTimeoutConstant = 1000; if ( !SetCommTimeouts( hCom, &CommTimeOuts )){ CloseHandle(hCom); return 2; // SetCommTimeouts error } dcb.DCBlength = sizeof ( DCB ) ; dcb.BaudRate = 1200 ; dcb.fBinary = TRUE ; dcb.fParity = 0; dcb.fOutxCtsFlow = 0; // CTS output flow control dcb.fOutxDsrFlow = 0; // DSR output flow control dcb.fDtrControl = 1; // DTR flow control type dcb.fDsrSensitivity = 0; // DSR sensitivity dcb.fTXContinueOnXoff = 0; // XOFF continues Tx dcb.fOutX = 1; // XON/XOFF out flow control dcb.fInX = 1; // XON/XOFF in flow control dcb.fErrorChar = 0; // enable error replacement dcb.fNull = 0; // enable null stripping dcb.fRtsControl = 1; // RTS flow control dcb.fAbortOnError = 0; // abort reads/writes on error dcb.XonLim = 2048; // transmit XON threshold dcb.XoffLim = 512; // transmit XOFF threshold dcb.ByteSize = 8; // number of bits/byte, 4-8 dcb.Parity = NOPARITY; // 0-4=no,odd,even,mark,space dcb.StopBits = ONESTOPBIT; // 0,1,2 = 1, 1.5, 2 dcb.XonChar = 17; // Tx and Rx XON character dcb.XoffChar = 19; // Tx and Rx XOFF character dcb.ErrorChar = 0; // error replacement character dcb.EofChar = 0; // end of input character dcb.EvtChar = 0; // received event character if ( !SetCommState( hCom, &dcb ) ){ CloseHandle(hCom); return 3;//SetCommState error } return(0); } void RS_close () /* Close Communication port */ { CloseHandle( hCom ); } /* Read one character when it reads a character, it returns 1 when there is no character to read, it returns 0 */ int RS_read(unsigned char *c) { DWORD length; if( !ReadFile(hCom, c, 1, &length, NULL) ) return 0; return length; } /* Send a character */ void RS_send(unsigned char c) { DWORD length; WriteFile(hCom, &c, 1, &length, NULL); } ---------------------------------------------------------------------------- The 9th Computer Shogi Championship: Application Form 1. Your Name (or Team Name) 2. Address 3. Telephone No. 4. E-mail Address 5. Computer (CPU, Clock) 6. Name of the Computer Program 7. Programming Language 8. Communication Availability ---------------------------------------------------------------------------- Application Fee: 10,000 yen Please transfer the fee to the following bank account by cable: Dai-ichi Kangyo Bank, Machida Branch, Tokyo, Japan Ordinary Account No. 2117839 Account Holder: The Computer Shogi Association Payment in cash will also be accepted at the tournament. Tournament Referees: There will be a number of referees managing the tournament. The Rules and Regulations of the Computer Shogi Championship are available in both Japanese and English. In all questions of interpretation, the Japanese version shall be regarded as authoritative. Takenobu Takizawa -- Reijer Grimbergen Complex Games Lab Electrotechnical Laboratory 1-1-4 Umezono, Tsukuba-shi, Ibaraki-ken, 305 JAPAN E-mail: grimberg etl go jp URL: http://www.etl.go.jp/etl/suiron/~grimberg/ Tel: +81-(0)298-54-3316 Fax: +81-(0)298-54-5918