It is possible but the problem is that it is impossible to get another pawnHi Dann,
does your parser recognize the errors (illegal positions) in the following fen strings?
8/8/3k2R1/8/8/8/3K4/8 w - - 0 1
8/8/8/8/8/1Kk5/8/1Q6 w - - 0 1
2p1P3/8/8/2k5/4K3/8/8/3p4 w - - 0 1
8/P7/P2k4/P7/P1P5/P7/P2K4/8 w - - 0 1
The first three ones are handled correct by my engine, but not the last one. I'm not sure if the last FEN string is an illegal position, but i think it's not possible to get 6 pawns from the same side during a game to the a or the h line.
The parser I posted will only count pieces and types and things of that nature. But you could have both kings in check or other clearly illegal positions and it will not recognize it. The only notion of the parser is to prevent some kinds of crashes and overwrites.Hi Dann,
does your parser recognize the errors (illegal positions) in the following fen strings?
8/8/3k2R1/8/8/8/3K4/8 w - - 0 1
8/8/8/8/8/1Kk5/8/1Q6 w - - 0 1
2p1P3/8/8/2k5/4K3/8/8/3p4 w - - 0 1
8/P7/P2k4/P7/P1P5/P7/P2K4/8 w - - 0 1
The first three ones are handled correct by my engine, but not the last one. I'm not sure if the last FEN string is an illegal position, but i think it's not possible to get 6 pawns from the same side during a game to the a or the h line.
white(1): setboard 8/8/3k2R1/8/8/8/3K4/8 w - - 0 1
8/8/3k2R1/8/8/8/3K4/8 w - - 0 1
ERROR (white to move but black king in check)
white(1): setboard 8/8/8/8/8/1Kk5/8/1Q6 w - - 0 1
8/8/8/8/8/1Kk5/8/1Q6 w - - 0 1
ERROR (white to move but black king in check)
white(1): setboard 2p1P3/8/8/2k5/4K3/8/8/3p4 w - - 0 1
2p1P3/8/8/2k5/4K3/8/8/3p4 w - - 0 1
ERROR (pawn in row 1 or 8)
white(1): setboard 8/P7/P2k4/P7/P1P5/P7/P2K4/8 w - - 0 1
8/P7/P2k4/P7/P1P5/P7/P2K4/8 w - - 0 1
My parser also does not check if there are 10 bishops on the same field color like the following:
6B1/5B2/3kB1B1/3B1B2/2B1B3/1B1B4/3K4/8 w - - 0 1
Perhaps there could be other positions, which are not illegal, but it's not possible during a game to reach such positions.
right. What about the following ones:It is possible but the problem is that it is impossible to get another pawnHi Dann,
does your parser recognize the errors (illegal positions) in the following fen strings?
8/8/3k2R1/8/8/8/3K4/8 w - - 0 1
8/8/8/8/8/1Kk5/8/1Q6 w - - 0 1
2p1P3/8/8/2k5/4K3/8/8/3p4 w - - 0 1
8/P7/P2k4/P7/P1P5/P7/P2K4/8 w - - 0 1
The first three ones are handled correct by my engine, but not the last one. I'm not sure if the last FEN string is an illegal position, but i think it's not possible to get 6 pawns from the same side during a game to the a or the h line.
in the c file after you have 6 pawns in the a file.
Uri
illegalright. What about the following ones:It is possible but the problem is that it is impossible to get another pawnHi Dann,
does your parser recognize the errors (illegal positions) in the following fen strings?
8/8/3k2R1/8/8/8/3K4/8 w - - 0 1
8/8/8/8/8/1Kk5/8/1Q6 w - - 0 1
2p1P3/8/8/2k5/4K3/8/8/3p4 w - - 0 1
8/P7/P2k4/P7/P1P5/P7/P2K4/8 w - - 0 1
The first three ones are handled correct by my engine, but not the last one. I'm not sure if the last FEN string is an illegal position, but i think it's not possible to get 6 pawns from the same side during a game to the a or the h line.
in the c file after you have 6 pawns in the a file.
Uri
r1nnk1br/P1bqpppp/P1pp2pp/P7/P7/P7/P2R4/3K4 w - - 0 1
5k2/8/8/8/8/PPPP4/PPPP4/2K5 w - - 0 1
Andreas
Hi Dann,The parser I posted will only count pieces and types and things of that nature. But you could have both kings in check or other clearly illegal positions and it will not recognize it. The only notion of the parser is to prevent some kinds of crashes and overwrites.Hi Dann,
does your parser recognize the errors (illegal positions) in the following fen strings?
8/8/3k2R1/8/8/8/3K4/8 w - - 0 1
8/8/8/8/8/1Kk5/8/1Q6 w - - 0 1
2p1P3/8/8/2k5/4K3/8/8/3p4 w - - 0 1
8/P7/P2k4/P7/P1P5/P7/P2K4/8 w - - 0 1
The first three ones are handled correct by my engine, but not the last one. I'm not sure if the last FEN string is an illegal position, but i think it's not possible to get 6 pawns from the same side during a game to the a or the h line.
white(1): setboard 8/8/3k2R1/8/8/8/3K4/8 w - - 0 1
8/8/3k2R1/8/8/8/3K4/8 w - - 0 1
ERROR (white to move but black king in check)
white(1): setboard 8/8/8/8/8/1Kk5/8/1Q6 w - - 0 1
8/8/8/8/8/1Kk5/8/1Q6 w - - 0 1
ERROR (white to move but black king in check)
white(1): setboard 2p1P3/8/8/2k5/4K3/8/8/3p4 w - - 0 1
2p1P3/8/8/2k5/4K3/8/8/3p4 w - - 0 1
ERROR (pawn in row 1 or 8)
white(1): setboard 8/P7/P2k4/P7/P1P5/P7/P2K4/8 w - - 0 1
8/P7/P2k4/P7/P1P5/P7/P2K4/8 w - - 0 1
My parser also does not check if there are 10 bishops on the same field color like the following:
6B1/5B2/3kB1B1/3B1B2/2B1B3/1B1B4/3K4/8 w - - 0 1
Perhaps there could be other positions, which are not illegal, but it's not possible during a game to reach such positions.
The code that I posted does not require that the EPD/FEN is converted into some kind of a board representation, where you can check for legality.
These are the things tested in the current version:
exactly one king of each color
between 0 and 10 black rooks
between 0 and 10 white rooks
between 0 and 10 black bishops
between 0 and 10 white bishops
between 0 and 10 black knights
between 0 and 10 white knights
between 0 and 9 black queens
between 0 and 9 white queens
between 0 and 8 black pawns
between 0 and 8 white pawns
exactly 7 row separators (/) and hence 8 rows
no rows wider than 8 files
16 or fewer white chessmen
16 or fewer black chessmen
zero or one black king in castling rights
zero or one white king in castling rights
zero or one black queen in castling rights
zero or one white queen in castling rights
zero or one 'no castling rights indicator' (-) and if it occurs, no king or queen castling is allowed
the e.p. square must be a valid e.p. target square for the color to move (but it does not check for a pawn to see if the move could be made or to see if there are any vulnerable pawns)
halfmove clock is a number from 0 to 99
fullmove number is a number from 1 to 6000
It is not very sophisticated, and has some design quirks that I am not proud of, but it serves the basic purpose.
be sure most chess programs, doesn't check such cases. Would be interesting, if the commercial chess programs are recognizing such illegal positions.illegalright. What about the following ones:It is possible but the problem is that it is impossible to get another pawnHi Dann,
does your parser recognize the errors (illegal positions) in the following fen strings?
8/8/3k2R1/8/8/8/3K4/8 w - - 0 1
8/8/8/8/8/1Kk5/8/1Q6 w - - 0 1
2p1P3/8/8/2k5/4K3/8/8/3p4 w - - 0 1
8/P7/P2k4/P7/P1P5/P7/P2K4/8 w - - 0 1
The first three ones are handled correct by my engine, but not the last one. I'm not sure if the last FEN string is an illegal position, but i think it's not possible to get 6 pawns from the same side during a game to the a or the h line.
in the c file after you have 6 pawns in the a file.
Uri
r1nnk1br/P1bqpppp/P1pp2pp/P7/P7/P7/P2R4/3K4 w - - 0 1
5k2/8/8/8/8/PPPP4/PPPP4/2K5 w - - 0 1
Andreas
h7 h7 g7 or a2 a3 b2 are illegal pawn structure so both are illegal positions.
It does not prevent movei to analyze them.
Uri
I added that after I saw your example positions.Hi Dann,
you are right, for checking, if the opponent king is in check, you need a board presentation. The other checks you are doing, are the same than i do in my parser. For an illegal move number or an illegal halvmove clock i give out only a warning and change them to valid values "0 1", because AFAIK this data you have only in a FEN string but not in a EPD string.
You can also check if there is a pawn on row 1 or row 8 without a board presentation. Just look if there is a "p" or "P"-character before the first row separator "/" and the last row separator and before the first space character.
Andreas
What is black last move before the diagram?legal:1BK5/p1p4k/8/8/8/8/8/8 w - - 0 1
illegal:1BK5/ppp4k/8/8/8/8/8/8 w - - 0 1
legal:8/8/8/8/8/8/1PPPPPPP/5KNk w - - 0 1
illegal:8/8/8/8/8/8/PPPPPPPP/5KNk w - - 0 1
legal:8/8/8/8/8/8/5PPP/5KNk w - - 0 1
it was a NullmoveWhat is black last move before the diagram?legal:1BK5/p1p4k/8/8/8/8/8/8 w - - 0 1
illegal:1BK5/ppp4k/8/8/8/8/8/8 w - - 0 1
legal:8/8/8/8/8/8/1PPPPPPP/5KNk w - - 0 1
illegal:8/8/8/8/8/8/PPPPPPPP/5KNk w - - 0 1
legal:8/8/8/8/8/8/5PPP/5KNk w - - 0 1
Same question
Uri
how comes the white bishop to b8, whithout capturing a pawn?legal:1BK5/p1p4k/8/8/8/8/8/8 w - - 0 1
illegal:1BK5/ppp4k/8/8/8/8/8/8 w - - 0 1
legal:8/8/8/8/8/8/1PPPPPPP/5KNk w - - 0 1
illegal:8/8/8/8/8/8/PPPPPPPP/5KNk w - - 0 1
legal:8/8/8/8/8/8/5PPP/5KNk w - - 0 1
illegal:8/8/8/8/8/8/5PPP/5KBk w - - 0 1
legal:8/8/8/8/8/8/3PPP2/3KNk2 w - - 0 1
illegal:8/8/8/8/8/8/3PPP2/3KBk2 w - - 0 1
legal:8/8/8/8/8/8/PPPP4/RNBk3K w - - 0 1
illegal:8/8/8/8/8/8/PPPP4/QNBk3K w - - 0 1
Best regards,
George
simply by underpromotion.Hi George,
nice positions, but...how comes the white bishop to b8, whithout capturing a pawn?legal:1BK5/p1p4k/8/8/8/8/8/8 w - - 0 1
illegal:1BK5/ppp4k/8/8/8/8/8/8 w - - 0 1
legal:8/8/8/8/8/8/1PPPPPPP/5KNk w - - 0 1
illegal:8/8/8/8/8/8/PPPPPPPP/5KNk w - - 0 1
legal:8/8/8/8/8/8/5PPP/5KNk w - - 0 1
illegal:8/8/8/8/8/8/5PPP/5KBk w - - 0 1
legal:8/8/8/8/8/8/3PPP2/3KNk2 w - - 0 1
illegal:8/8/8/8/8/8/3PPP2/3KBk2 w - - 0 1
legal:8/8/8/8/8/8/PPPP4/RNBk3K w - - 0 1
illegal:8/8/8/8/8/8/PPPP4/QNBk3K w - - 0 1
Best regards,
George
Perhaps a new chess variant, where the Bishops can jump over pawns
last black move was a nullmove?
also a nullmove by black before?
also a nullmove by black before?
also a nullmove by black before?
Andreas
Return to Archive (Old Parsimony Forum)
Users browsing this forum: No registered users and 29 guests