bgrassy / chess-engine

A simple chess engine in C++.
0 stars 1 forks source link

Illegal move after promotion #2

Open tissatussa opened 2 weeks ago

tissatussa commented 2 weeks ago

Recently your chess engine popped up on the FaceBook' Chess Engines Diary, although it seems 6 years old. I was able to compile it myself and in my first game (in CuteChess GUI) it made an illegal move and lost. This was probably due to the promotion of an opponent' pawn, not sure though .. but this must be a bug :

BGrassy-illegal-move

[ i'm on Xubuntu 22.04 ]

bgrassy commented 5 days ago

Hi @tissatussa! Thanks for the notification on this - I hadn't heard of the Chess Engines Diary before. I took a quick look and fixed the bug that contributed to this, as well as another separate bug. Feel free to rebuild and try again if you'd like! This was a project from when I was in college, so it lacks a comprehensive testing framework and is likely rather unoptimized. I may take another look at this and see if there is any low hanging fruit that I can address!

tissatussa commented 5 days ago

yeah, i'm already running that newest version in normal games (10 min because BGrassy needs it..) - no ep. or promotions happened so far .. i will let you know.

tissatussa commented 5 days ago

you can learn a lot by programming a chess engine, because many aspects / functions / structures are invloved and we can directly see en test the result. Recently i found a Javascript engine, the author tells about his coding adventures here

Building Betafish A Javascript Chess Engine & AI. https://gavinong.com/projects/betafish

and here's one of the nice links in his story : Chess Engines: A Zero to One SEE https://chessengines.super.site

you can play against it here : https://betafish.gavinong.com/ i had to adjust the code a bit to make that work on my server, but i succeeded and now i can embed it into a web page, using an iFrame.