Inspiration
Growing up, my family took a lot of road trips. One car game that we played together to pass the time was Ghost. The rules are pretty simple:
- One player says a letter
- The next player adds a letter which spells towards a word, but does not complete a word
- The next player does the same thing
- The first person to spell a word loses and gains a G (then H, etc)
I’ve played around with making different forms of Ghost games since at least 2009 when I made a terrible version for Android (long since unpublished). I wanted to give it another shot, but this time in Norwegian – and with a proper implementation.
Process
The usual requirements applied:
- Minimal costs
- No backend
- Offline usage
- Accessible to all
As such, I reached for my tried-and-true solution: a React app on GitHub Pages.
Building
While building this, I was able to reuse the lessons I’d learned about building a trie from Ordkart – even if it wasn’t an especially good implementation, it was a foundation I could use.
The most interesting challenge came from building a turn-based logic into a React app. This interaction pattern wasn’t something I’d done before, and I’m sure I have lessons to learn here and further improvements to make. However, I got something that works well-enough running.
Launching
Once it was ready, I bought spøke.no and set it up on GitHub Pages.
However, I understand that many people – especially those who might be learning
Norwegian – might not have the ø
key on their keyboards, and getting to the
app might be difficult. To make that easier, I bought spoke.no as well.
At this point, I realized that GitHub Pages doesn’t support multiple domains or redirects. In the past, I had used Firebase Hosting which does support both of these features, but I:
- didn’t want to add another tech/company into the stack
- wanted to solve this challenge :-)
My DNS is all managed through Cloudflare, and they provide the ability to set up redirection rules. After poring through their docs and examples (which are geared towards much more advanced rules), I got the redirect sorted out.
In the end, it does add another technology/company into the stack, but .. I already use Cloudflare, so maybe that doesn’t count? Or maybe I should just move to Cloudflare Pages and have it all-in-one?
Another day.
I also wanted a cute icon and my graphic design abilities are nearly zero. I had a vision for what I wanted, but had no ability to make it. It even tried some of the LLM generators, but couldn’t get something I was happy with.
In the end, I wound up buying a real human creation on Etsy for $7, and tweaking it further in Inkscape to get the right shading and effects I wanted. I’m very happy with the result.
Reflections
This was fun to build, and reasonably fun to play – even if I get beat nearly every time.
I came up with different bot “personalities” for the different opponents, and it’s interesting to play against the different ones. Even more fun was when I added the ability to have multiple players, so I could pit the bots against each other. Some day, I’d like to have a huge tournament and see how the different bots perform against each other and which ones are the strongest/weakest in which positions.
It was also interesting to adjust my mindset around turn-based logic in a React app. I found myself wishing a bit for a classic OOP programming style since it might be more easy to reason about, but I’m not sure that would actually be true. I need to build more of these to get more practice :-)