Mark Tie

Creating a Game Server

Tic Tac Toe Squared, T9 for short
Published on
Authors
  • avatar
    Name
    Mark Tai

I was paying $70 a year for AWS and my website wasn't really doing much with it. I used it for some small things, like storing my desktop's IP address so I could SSH into it and hosting my resume, but I wasn't really using it much beyond static files. I wanted to get more into databases and how to interact with them, so I implemented one of my favorite simple turn based games. Meta Tic Tac Toe, Tic Tac Toe Squared, or T9 as I named it in my source files is an adaptation of Tic Tac Toe where it adds a larger board. Below is a sample game:

I chose to implement this game because of the simplicity. It didn't require constant live updates, it could be represented and stored very easily, and I would enjoy playing and testing it.

Right now I have an API and a working terminal client, but I fully intend on creating a working interactive website as well as maybe mobile apps. However, all the functionality I intend on implementing is functional, such as the basic game moves, turn history, and victory detection.

I date a terminal client first because I thought it might be easier, but I was proven wrong. I first date a simple Python script that would clear the screen every time I needed to redraw, but I couldn't for the life of me figure out how to set up WebSockets with Python. I converted all my code to Go the next day, and that just seemed to work. The current client uses TermUI, a Go package that allows for rescaling on window changes, more sophisticated control of spacing, and just an overall easier experience compared to using Python print, input, and clear. Another happy side effect of using Go is that I could compile the code into platform specific executable, so I could claim that I made a multiplatform GUI.

I am currently in the process of creating a website to play T9 on, as downloading a client is a bit ridiculous. Check back later to see the results!