I’ve had my Pokitto for a while now without having really attempted to make a program or learn the API, so I decided to just sit down and make one.
(I’d made a few things like the PEX tutorials and glanced at the API, but I hadn’t bothered to sit down and work on something properly.)
I picked noughts and crosses for three main reasons.
Firstly because I’ve been advising someone on the Arduboy forums about making a noughts and crosses game (their first Arduboy game).
Secondly because as far as I’m aware the Pokitto doesn’t already have a noughts and crosses game.
And thirdly, following on from point two, I was hoping to make sure that the first implementation of noughts and crosses on the Pokitto was called ‘noughts and crosses’ and not ‘tic tac toe’.
Source Code (on Github):
Licence:
Apache 2.0 Licence
Essentially you’re free to edit the code as long as you:
- keep the licence/copyright notice
- document any changes that you make
Binary:
NoughtsAndCrosses.bin (40.9 KB)
(If I ever make any updates, I might forget to update this thread, so be sure to check the releases page and I’ll try to provide a binary alongside eachsource release.)
Controls:
- D-Pad = Move selector/cursor
- A = make a move
- B (hold) = reset board after winning/drawing
I hope to polish it up a bit more if I get chance.
At the moment it doesn’t track how many times each player has won, doesn’t do any saving of any kind and doesn’t have a titlescreen.
It’s just a simple black and white board with messages saying whose turn it is or which player has won if the game is over.
All in all, not too bad for a day’s work, on-and-off.