All about problems in Volume 2. If there is a thread about your problem, please use it. If not, create one with its number in the subject.
Moderator: Board moderators
- New poster
- Posts: 46
- Joined: Fri Nov 03, 2006 7:53 pm
- Location: Madrid
You don't have to watch for any string "EOF" at the end of the input. EOF stands for End Of File and means "no data", that is, after the last description of a board there is nothing. In C, you should do something like this:
where buffer is an array of at least 64+1 chars.
- Learning poster
- Posts: 65
- Joined: Fri Jul 13, 2007 3:17 pm
I think the output is "game is not over", since the king can move south..
is there any other cases ?
- Posts: 5947
- Joined: Thu Sep 01, 2011 9:09 am
- Location: San Jose, CA, USA
It's checkmate, not checkermate.
Check input and AC output for thousands of problems on uDebug
- Experienced poster
- Posts: 139
- Joined: Wed May 18, 2011 3:04 pm
The problem statement is not so clear.
When a pawn is in the 8th row, do I have to count it as any potentially promoted piece?
NO, you can assume that potential promotion already took place. so, a pawn in the 8th row is just a pawn.
The input is given as row by row, first a1 - h1, then a2 - h2, etc.
- New poster
- Posts: 4
- Joined: Tue Dec 13, 2016 1:41 pm
The problem statement is completely messed up IMO. The possible values for the characters indicating the pieces (e.g. 's' for knights, 'd' for queens) don't match at all with the provided sample input which uses a different character set, e.g. including a 'q' (which I suppose is for queens) and a 'p' (pawns?).
Also, there are no spaces at all in the sample input so the black king wouldn't have a possible move in any of them.