Finished, picoEngine?

picoEngineComplet

Today I released version 1.0 of picoEngine.

That’s right! My UCI compatible chess engine is now released as picoEngine version 1.0! You can view the tag on my GitLab. Now you too can download and compile picoEngine for yourself! It comes with a generic 64 bit version that I tested on Ubuntu 18.04 with both Arena and PyChess interfaces. Here’s the information on this release:

Version 1.0

Features:

  • UCI compatible engine!
  • Accepts both FEN and MovePos standard inputs.
  • Up to 8 ply weighted moves.
  • Has an optional random move mode for easy chess players.
  • Fast, even at 8 ply only takes a second on a modern 64 bit machine.
  • Light weight, it only takes 2 MB of ram to run this engine.
  • Small size, the (Linux 64 bit) compiled engine is only 364.2 KB in size.
  • Small source code, the entire source repository is less than 1.3 MB in size.
  • Can output moves and engine evaluation (only displayed by interfaces that support it).

I hope you enjoy it! If the prebuilt doesn’t work, just review the read me for simple compiling instructions, involving just one command. (I like to keep things simple.)

Linux – keep it simple.

Make a move picoEngine….

picoEngineMoves

For the first time ever, picoEngine made it’s very own move.

While no where near as important as my children taking their first steps, it was really a monumental moment for me when picoEngine made it’s very first move using UCI commands while loaded in Arena. That’s right, after several hours of tinkering, I loaded the picoEngine into the chess application called Arena, and let it make it’s very first move!

Of course, at this point, the only thing it can move is the knight, since that’s all I’ve programmed it for, but still, it was a monumental step in the direction of C++ chess engine programming for me!

While I’ve made two chess engines in Java, for various Android apps, this is different. Not only am I programming in C++, but my goal is to use the Universal Chess Interface so my chess engine can be loaded into any chess program. That is making things a bit tough. But now that I have successfully made a move, hopefully it will be smooth sailing from here on out.

string Moves::bestMove(string boardPositions, bool whoseTurn, bool styleRandom){
string candidateList = Moves::available(boardPositions, whoseTurn);
string chosenMove = “”;
if (candidateList.size() > 0){
//if (styleRandom) {
srand((int)time(0) + candidateList.size());
int r = (rand() % (candidateList.size()/5));
for (int a = 0; a < 4; a++) {
chosenMove += candidateList[(5*r)+a];
}
//} else {

//}
}
return chosenMove;
}

The check for available moves and king safety are things we already covered, so essentially, I just needed to make it choose the best move of the ones available. In the future, this will hopefully be a weighted decision, but for now, I’m just passing a random choice of the available moves in the list, which, of course, only features the knights at present.

As always, you can check out the full commit on my GitLab.

Linux – keep it simple.