Hacker News new | ask | show | jobs
by eddington 4679 days ago
There appears to be a bug. Here is the state I reached (notice that "white" now has two bishops of the same color).

      a b c d e f g h
    8 ♖ ♘ ♗ ♕ ♔   ♘ ♖ 
    7 ♙ ♙ ♙ ♙ ♙ ♗     
    6                 
    5             ♙   
    4     ♝ ♟ ♟       
    3               ♙ 
    2 ♟ ♟ ♟     ♟ ♟ ♟ 
    1 ♜ ♞ ♝   ♚   ♞ ♜ 

Someone want to submit a pull request? :-)

edit: For anyone who wants to reproduce ("black" went first, since black appears as white on the board)

    1. e4 h5
    2. d4 h4
    3. Bb4 h3
    4. Qf3 g5
    5. Qxf7 Bxf7??
3 comments

On my first game I got an even better bug:

  a b c d e f g h
8 ♔       ♛ ♝ ♘

7 ♙ ♙ ♙ ♙

6

5         ♙

4       ♟ ♟     ♕

3   ♟ ♞

2 ♟   ♟     ♟   ♟

1 ♜     ♛ ♚ ♝   ♜

After performing en passant the computer went crazy and the King started taking all the pieces between down row 8. I ended up with a very easy checkmate as I walked my pawn the remaining three rows, unfettered even when it was under double pressure from the night and queen.

I wonder if this is perhaps an issue caused by the fact I used OS X's BSD sed.

Edit: Hmm, can't seem to format it right. Anyways, the bug seems to be present in gnu sed as well. Really the whole game was screwy. I started with e2 e4 and it all went down hill from their for my opponent :).

The readme says passant isn't implemented, and there's no validation of the player's moves. So you did an illegal move.
Interesting. Either way my opening seemed to be more problematic as the computer still went out of its way to checkmate itself without the en passant. Still a cool achievement.
I just tried this in real life and got the same bug. Hmmm.
It also seems to allow some illegal moves. The computer moved its bishop like a rook.