Tic-Tac-Toe

published date Dec 20, 2024
published date
#reactjs#websocket#nodejs#game-theory

Want to create something that’s fun, AI-driven, and uses networking? In less than 1K lines of code? I just did.

As we grow as engineers, we tend to focus on “big software,” often mistaking big for complex. But just a few lines of code can get very complex; take, for example, any sophisticated algorithm.

My use of AI, networking, and a bit of CLI came in the form of… surprise, surprise… tic-tac-toe.

Wait, what?

If you’re like me, you’d associate tic-tac-toe with an introductory Python book for someone who has never coded before. But that little game can pack quite a punch, especially if you add an AI opponent while also supporting multiplayer mode with another human.

In short, you can turn something as simple as tic-tac-toe into a “multiplayer AI-opponent based game”, and get all the sophistication you’d ever want from something very simple.

Quick Presentation

What parts do I need?

Package Diagram

Let’s dive in:

  1. ReactJS for the frontend. Pick your choice;
  2. NodeJS to implement the brain. For me, NodeJS and ReactJS resided in the same repo. Else, pick your choice;
  3. WebSockets to provide gaming experience real-time;

That’s it?

For now, yes. If you would like to know how I built this project, do drop an email from Contact. I will plan to release a learning material around this.

Back to Projects