Simple Chess


I’ve created pretty simple chess for Arduboy, using SAF and my chess library/engine smallchesslib found here. Graphically it’s nothing impressive, just very simple interface, I was focused on just making Arduboy play chess – if you want, you can use my library to create something more shiny. Of course everything is CC0, public domain.

chess.hex (45.3 KB)

source code

The library/engine is one of my KISS/suckless C libraries, it supports all you need for playing chess and manipulating some standard chess formats plus it includes a moderately strong AI – the strength depends on settings and hardware, I’ve let it play as a bot on under the nickname smolchessbot and it achieved an ELO of about 1600 (well not really ELO but “Glicko” rating). On Arduboy I’ve limited AI to maximum level of 2 which is a lot weaker than this, it’s because of the CPU speed, something stronger would take too long to compute a move.

Some features and limitations of this program:

  • All rules of chess are implemented, even the lesser known such as en passant etc. 50 move rule also applies. Draw via repetition is also implemented, but for simplicity only consecutive positions are considered.
  • Board is automatically rotated if the game thinks it should be rotated.
  • Each player can be either human or AI of strength 1 to 2. This can be changed any time during play.
  • Sometimes the stronger AI needs more time to compute the move and there is no indication of it working so it seems frozen, just wait :slight_smile:
  • On Arduboy if two AIs play against each other, you have to press A after each move. This is basically for technical reasons and due to simplicity of SAF (basically if I let AIs just move as they wish there’s no “multithreading” and when AI is computing for a long time it delays a frame for very long and it messes up rendering so that you wouldn’t see the game unwind until it would end).
  • On Arduboy some of the menu items aren’t available (this is a simplified version of a multiplatform game).

Nice work !

I see you have released a Pokitto version too.

Thanks. It’s a SAF game so it runs on all open consoles that I have, it also runs on PC. For Arduboy I’ve simplified it quite a bit more, for example I removed recording games because there simply isn’t too much RAM.


Yes, it’s great, games done for Pokitto, Arduboy, ESPboy and Gamebuino META. A nice ‘classic’ game using SAF engine to let port games between these hardware and illustrate use of the new library. Gratz Drummyfish

1 Like

Wow that’s cool I like how you can switch to a CPU half way through a match, I got tired of playing against myself lol.