`Board.move` moves the other player
Closed this issue · 4 comments
Levi-Lesches commented
This should speak for itself:
>> chess
|
8 | ♜ ♞ ♝ ♛ ♚ ♝ ♞ ♜
|
7 | ♟ ♟ ♟ ♟ ♟ ♟ ♟ ♟
|
6 | ☐ ☐ ☐ ☐ ☐ ☐ ☐ ☐
|
5 | ☐ ☐ ☐ ☐ ☐ ☐ ☐ ☐
|
4 | ☐ ☐ ☐ ☐ ☐ ☐ ☐ ☐
|
3 | ☐ ☐ ☐ ☐ ☐ ☐ ☐ ☐
|
2 | ♙ ♙ ♙ ♙ ♙ ♙ ♙ ♙
|
1 | ♖ ♘ ♗ ♕ ♔ ♗ ♘ ♖
--+-------------------------------------------
| a b c d e f g h
white: a2 a3
|
1 | ♖ ♘ ♗ ♔ ♕ ♗ ♘ ♖
|
2 | ♙ ♙ ♙ ♙ ♙ ♙ ♙ ♙
|
3 | ☐ ☐ ☐ ☐ ☐ ☐ ☐ ☐
|
4 | ☐ ☐ ☐ ☐ ☐ ☐ ☐ ☐
|
5 | ☐ ☐ ☐ ☐ ☐ ☐ ☐ ☐
|
6 | ☐ ☐ ☐ ☐ ☐ ☐ ☐ ♟
|
7 | ♟ ♟ ♟ ♟ ♟ ♟ ♟ ☐
|
8 | ♜ ♞ ♝ ♚ ♛ ♝ ♞ ♜
--+-------------------------------------------
| a b c d e f g h
Black starts his turn with his pieces moved. This is caused by a2 a3
being translated internally to ( (1, 0), (2, 0) )
, which is at the top of the board from White's point of view. This needs to dynamically change.
webdotorg commented
So, when I play with it, the letters flip, but the numbers don't. I can't figure out why. I think it's because the numbers are printing the range destination and aren't easily flipped. If they were printed more explicitly, maybe they would reverse easier.
Levi-Lesches commented
Works on mine... Check the pull request. But I'll check it out
Levi-Lesches commented
Here's what I get:
|
8 | ♜ ♞ ♝ ♛ ♚ ♝ ♞ ♜
|
7 | ♟ ♟ ♟ ♟ ♟ ♟ ♟ ♟
|
6 | ☐ ☐ ☐ ☐ ☐ ☐ ☐ ☐
|
5 | ☐ ☐ ☐ ☐ ☐ ☐ ☐ ☐
|
4 | ☐ ☐ ☐ ☐ ☐ ☐ ☐ ☐
|
3 | ☐ ☐ ☐ ☐ ☐ ☐ ☐ ☐
|
2 | ♙ ♙ ♙ ♙ ♙ ♙ ♙ ♙
|
1 | ♖ ♘ ♗ ♕ ♔ ♗ ♘ ♖
--+-------------------------------------------
| a b c d e f g h
White: a2 a3
True
|
1 | ♖ ♘ ♗ ♔ ♕ ♗ ♘ ♖
|
2 | ♙ ♙ ♙ ♙ ♙ ♙ ♙ ☐
|
3 | ☐ ☐ ☐ ☐ ☐ ☐ ☐ ♙
|
4 | ☐ ☐ ☐ ☐ ☐ ☐ ☐ ☐
|
5 | ☐ ☐ ☐ ☐ ☐ ☐ ☐ ☐
|
6 | ☐ ☐ ☐ ☐ ☐ ☐ ☐ ☐
|
7 | ♟ ♟ ♟ ♟ ♟ ♟ ♟ ♟
|
8 | ♜ ♞ ♝ ♚ ♛ ♝ ♞ ♜
--+-------------------------------------------
| h g f e d c b a
Black: h7 h6
True
|
8 | ♜ ♞ ♝ ♛ ♚ ♝ ♞ ♜
|
7 | ♟ ♟ ♟ ♟ ♟ ♟ ♟ ☐
|
6 | ☐ ☐ ☐ ☐ ☐ ☐ ☐ ♟
|
5 | ☐ ☐ ☐ ☐ ☐ ☐ ☐ ☐
|
4 | ☐ ☐ ☐ ☐ ☐ ☐ ☐ ☐
|
3 | ♙ ☐ ☐ ☐ ☐ ☐ ☐ ☐
|
2 | ☐ ♙ ♙ ♙ ♙ ♙ ♙ ♙
|
1 | ♖ ♘ ♗ ♕ ♔ ♗ ♘ ♖
--+-------------------------------------------
| a b c d e f g h
Levi-Lesches commented
Closed with #14