marcusbuffett / command-line-chess

A python program to play chess against an AI in the terminal.
MIT License
501 stars 163 forks source link

Fixed Bug: When player chooses BLACK, AI should make the first move as WHITE #39

Closed sohang3112 closed 2 years ago

sohang3112 commented 2 years ago

Previously, in 2-Player Mode, AI would ask the player to make the first move when the player chose BLACK. This is wrong because WHITE always makes the first move.

This is fixed in this PR - now the AI makes the first move as WHITE when the player chooses BLACK.

sohang3112 commented 2 years ago

This closes Issue 38

ClasherKasten commented 2 years ago

This would fix the bug, but opens a new one. Following your implementation, the program would think the player plays with white, even if he chose black. So the AI would move first, but then the player can't play any black piece because the legal moves don't get correctly calculated.

Also i already pushed a fix.