Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

java library for legal move generation in chess [closed]

I am looking for a an API to generate legal moves validation in chess, preferably in the Java language.

I could write my own but it would be a naive implementation, and it would be slow. So I need a working library allowing more or less the following operations:

Board board = new Board();
board.reset();
board.isMoveLegal(playerNum, fromSquare, toSquare);
board.inputMove(playerNum, fromSquare, toSquare);

What I want to avoid is having to browse a full chess game's code source with GUI, internet connectivity, or other functions than move generation. It would be a big waste of time for me and I'd rather spend a few hours to program my own move validator, no matter how slow. I also don't need any guidelines for writing my own library, as I have found plenty of which on the internet.

I'm asking this here because I have run several searches on google and didn't find what I was looking for. So it would be nice of you to point me out a link to such a working code if you knew any. Thanks.

like image 1000
Joel Avatar asked Jul 25 '11 12:07

Joel


1 Answers

See ChesspressoTM. Specifically Move.isValid().

like image 189
Vlad Avatar answered Nov 13 '22 02:11

Vlad