SebLague / Chess-Challenge

Create your own tiny chess bot!
https://www.youtube.com/watch?v=Ne40a5LkK6A
MIT License
1.77k stars 1.06k forks source link

Move generation fails #399

Closed 0qln closed 1 year ago

0qln commented 1 year ago

I am using version 1.17

Start position: 1r6/8/3r4/8/2K5/7Q/7Q/1k1r4 w - - 0 1 After the move c4c3 from whites king, the output of

var moves = _board.GetLegalMoves();
moves.ToList().ForEach(m => Console.WriteLine(m));

is:

Move: 'a1b1'
Move: 'd1a1'
Move: 'd1b1'
Move: 'd1c1'
Move: 'd1e1'
Move: 'd1f1'
Move: 'd1g1'
Move: 'd1h1'
Move: 'd1d2'
Move: 'd1d3'
Move: 'd1d4'
Move: 'd1d5'
Move: 'd6d2'
Move: 'd6d3'
Move: 'd6d4'
Move: 'd6d5'
Move: 'd6a6'
Move: 'd6b6'
Move: 'd6c6'
Move: 'd6e6'
Move: 'd6f6'
Move: 'd6g6'
Move: 'd6h6'
Move: 'd6d7'
Move: 'd6d8'
Move: 'b8b1'
Move: 'b8b2'
Move: 'b8b3'
Move: 'b8b4'
Move: 'b8b5'
Move: 'b8b6'
Move: 'b8b7'
Move: 'b8a8'
Move: 'b8c8'
Move: 'b8d8'
Move: 'b8e8'
Move: 'b8f8'
Move: 'b8g8'
Move: 'b8h8'

The move a1b1 is an illegal one.

DrBrask commented 1 year ago

There is no black king...