Not to mention the input syntax doesn't take into account which piece you are moving. With this as written, an input "C3" could refer to the white queen-side bishop's pawn advancing one square (pc3) or the queen-side knight moving forward and right (nc3). This would get more complicated as the game continues, where you could feasibly have 4+ pieces able to move to a given space.
Not really, the standard is to have a white square in the bottom right and top left corners of the board, and this would have white in top right and bottom left.
Edit: on closer inspection, since the unfilled pieces move first, the board is set up such that unfilled=white and filled=black, so the board is correctly oriented with respect to square color. This leaves the only issue being that the black king and queen are switched.
The clause between commas is true. However, what counts as a black square and what counts as a white square in the code snippet? Is the empty square black because it looks black on a dark theme? Or is it white because it isn't filled? It's ambiguous, that's why the original statement is debatable
As I was trying to respond to this, I looked closer and realized that since white moves first, the empty squares are white because they match the empty-colored pieces that move first. Assuming the programmer was consistent with the rules for who moves first, this board is in fact set up correctly.
9
u/[deleted] Apr 10 '23
The square colors are wrong