[Game]Simple Noughts And Crosses

noughts

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.

7 Likes

There were two tic-tac-toe games made for the pokitto previously. For some strange reason, it seems like the one I could have sworn was on the games list has vanished.

This older one may have been abandoned:

I really thought I remembered this one being on the games list at one point:

Anyway, I’ll be sure to try this one out soon.

1 Like

Huh, maybe I didn’t look hard enough.
(In fairness I didn’t look until after I’d finished.)

You can never have too many noughts and crosses games though.

Maybe I’ll get bonus points for minimalism? ¯\_(ツ)_/¯

(Ironically I’d actually 'like’d the first one.)

1 Like

You are correct!! I need to find out why. It should be visible

2 Likes

I tried it out. It’s a nice, if minimal, game of noughts and crosses/tic-tac-toe. I think it would be nice if the C button could reset the board just so the game can be restarted without power cycling.

@jonne, good to hear I’m not just going crazy and that the game used to be there. When I checked, I didn’t notice any other missing games, so hopefully it’s just some quirk with that one.

I might add more to it at a later date.
I mainly just threw it together for practice.

To be honest though, apart from one or two things like score tracking and saving or a start screen/menu, I can’t think of much to add.

What do you mean “without power cycling”?
Does the B button use more battery than the C button?

No I think the PHP script is cutting off the results. It was the last game on the list.

2 Likes

Sorry, I should have looked closer at the controls in your first post. I didn’t realize that I had to hold B.

Ah, fair enough. Maybe I need to add more bold?

Also note that the board is only resettable when a game has reached a ‘finishing state’ (win/lose/draw).
I did that partly to stop people accidentally clearing the board by mistake and partly to try to prevent people cheating.

1 Like

@Pharap has earned his first Game Maker badge!

3 Likes

Just noticed this isn’t on the games page.

Is possible that the search algorithm only picking up certain variations of [Game]?
e.g. [GAME] but not [Game] or [Game]Name and not [Game] Name

I need to debug that script

1 Like

So it is the space it doesn’t like?
Is that intentional or accidental?

Intentional. I am struggling with the search algorithms (or the lack of them) in Discourse

Kind of a shame because I prefer the space, but fair enough.

I’m guessing it doesn’t have regular expression support then?
(Or perhaps regexes would be too slow?)

I don’t know what the backend is like so I could be completely wrong, but isn’t it possible to add a sort of ‘listener’ to look for when a new post is added?

If so you could get the server to check the name when a new entry is added rather than having to continually do a full search and then maybe just run a full search once a day/once a week on a background thread?

(Just throwing an idea out there.)

@Pharap: use the PokittoEmulator to create a .gif for your game

440x352 is best, use ezgif.com to resize (gifsicle resize engine) if needed

1 Like