marcusbuffett / command-line-chess

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

Fix castling and spelling of en passant #9 #11

Closed ddugovic closed 6 years ago

ddugovic commented 6 years ago

Verified that O-O and O-O-O (using letters, not using zeroes) play correctly for both players. Changed variable pessant to passant. Added build/ and dist/ to .gitignore

marcusbuffett commented 6 years ago

This looks great! Thanks for the contribution. Just one question, what do the stringRep changes do? Unfortunately I’m not near a computer right now so I can’t run it to see the beautified version.

ddugovic commented 6 years ago

Thanks! This is the result of those stringRep changes (fewer coordinate markers and newlines are placed more intelligently):

It's your move. Type '?' for options. ? Nf3
Making move : Nf3

8  R N B Q K B N R
7  p p p p p p p p
6  
5  
4  
3            N
2  p p p p p p p p
1  R N B Q K B   R

   a b c d e f g h

AI thinking...
Making move : b6

8  R N B Q K B N R
7  p   p p p p p p
6    p
5  
4  
3            N
2  p p p p p p p p
1  R N B Q K B   R

   a b c d e f g h

It's your move. Type '?' for options. ? 
ddugovic commented 6 years ago

Oops, PGN specifies that the moves should be input as 0-0 and 0-0-0 (using numbers) but should be printed in a PGN file using letters.