King and Rook Checkmate - bad move after 7 moves?

Back to General discussions forum

cire     2025-01-13 02:35:25

I am hitting an error I can't figure out. It is (for example):

bad move (format) after setup: Gf6 Kc2 Re1, moves: Re4 Gf5 Ra4 Ge5 Kd3 Gd5 Ra5 Ge6 Ke4 Gd6 Rb5 Ge6 Rb6 Ge7

Curiously it always reports with both sides having made seven moves.

I assume it means white's next move is invalid. However when I replay such failed games, white makes a perfectly valid move and goes on (by inventing black's moves) to checkmake in less than 50 moves. For example, for the above game state, white's next move is consistently Ke5.

My current program does not guarantee white to win every board in 50 moves, but that doesn't seem an issue for this failure type.

An earlier version of my program failed for exceeding 50 moves (I didn't know that was a requirement at first). My program since then has not changed how it writes to stdout, so I don't know how I could suddenly be hitting some I/O problem around move 8.

Is there any more information on this type of error?

Rodion (admin)     2025-01-14 11:00:07
User avatar

Hi, I reviewed the code of the checker and it seems that (format) is intended to mean some unexpected input for the move (rather than bad logic of a move).

if w:match('^[KRkr]%a%d$') == nil then return 'format'

Sorry for such incomprehensible message... this may be caused by some forgotten debug output etc

cire     2025-01-14 23:57:14

Indeed, my last bug fix (and leftover debug print) was for a game that failed at -- you guessed it -- move 8. Thanks for checking!

Please login and solve 5 problems to be able to post at forum