Posted on 22nd February 2020

One of the examples that always seems to comes up when I'm looking for JavaScript/React learning material is tutorials about remaking the classic noughts and crosses game everyone knows and loves. Except in the examples they always call it tic-tac-toe which is a stupid name if you ask me.

I decided to take a shot at making it myself, without following along with any tutorials - a bit risky, but I knew I could always fall back on the official React tutorial if I got stuck. To bring the game up to date with modern parlance I've replaced the X's and O's with the "clap" and "poop" emojis. I used styled components and the React useState hook for this one.

If you want to play it right now you can head over to my experiments page - don't play it by yourself though, it's a lot easier to win that way. If you think you're not that bothered about playing, here's a screenshot showing you what you're missing out on - GOTY 2020 for sure!

An example of the tictactoe game

There's too much code to paste it all in here, but in future I will extract this (and all other) experiments into their own github repos so I can more easily share them. For now, as always, if you spot any issues with this experiment, feel free to let me know.

Enjoyed this post? Feel free to share it with your audience using the links below:

Don't see your favourite social network on the list? Feel free to let me know and I'll get it added.


©2022 Pursuit of Loot. All rights reserved.