Strryke / betafish

A chess engine and AI move finder written in Javascript. Beats Stockfish level 6 on Lichess.
https://betafish.gavinong.com
MIT License
96 stars 10 forks source link

promotion : other then Queen ? #8

Open tissatussa opened 3 days ago

tissatussa commented 3 days ago

i like your betafish javascript engine, it seems well written, although i don't understand all code .. but i managed to extend the script with some nice features :

*) fullmove number is still not always correct, it may show a broken number like '1.5' : i wasn't able to solve that yet ..

last thing i want to add is selecting the promotion piece : i added a select element to set that piece type before promoting, but i'm unable to make it work : it seems betafish can promote to e.g. a kNight (test FEN 6n1/5P1k/7p/8/8/8/1B4K1/8 w - - 0 1 : the move f7-f8n will give mate and indeed betafish plays that move), but when the user promotes a pawn, a Queen is always set .. how to change that ?

see my current development version at https://www.imoma.eu/projects/betafish-test/

btw. i had to include the code of js/betafish.js and js/main.js into the index.html because loading those scripts the original way gave errors !?

i really hope you can help me with this. promoting to any piece would make the project complete !

tissatussa commented 3 days ago

@Strryke this evening ChatGPT helped me a lot to create such function : the move generator should add all promotions to the move list, then adjust the data shift logic and it will work. Soon-

tissatussa commented 2 days ago

newest version at https://www.imoma.eu/projects/betafish-js/ : promotion is fixed ! also the notation now shows reached depth, like CuteChess does. UPDATE: it's NOT fixed .. still working on it, sorry ..

tissatussa commented 2 days ago

btw. and i managed to import betafish.js and main.js properly (the ES6 way).