Skip to content

Bacteria from the 7th Guest

When I was a young kid we had a puzzle game on our PC called the 7th Guest. The premise was that you were trapped in a haunted house and had to solve puzzles to escape. Each puzzle would open up a new room with a new puzzle and some of these really got the young mind thinking. One of these puzzles stuck in my mind in particular, partially because it was so hard, but also because it was so fun. It was the one with the microscope that showed a bacteria culture. When you move the bacteria, it could claim new regions on the board but it would als "convert" all the bacteria around it to the same color. This led to loads of unexpected turns in the game and I remember spending hours trying to solve it.

With the advent of LLMs I was wondering how easy it might be to recreate it and ... it was pretty easy to get about 80% of the way there. Here's the game in HTML form with an easy AI to play against.

Bacteria Game vs AI

Your turn

Honestly, I'm really impressed with how easy it was to create this game. The fact that it understood "the 7th guest bacteria game" definately suprised me. The implementation as-is isn't perfect though: the initial board configuration is not accurate and the AI can be made better for sure. But this barely took me 20 minutes to get on my blog and I did not expect that. It got about 80% of it right just by using "bacteria game from the 7th guest but as an html5 app. use vanilla js." as a prompt.

At the same time, it also feels like I would have written this code differently and that I would rip it apart if I wanted to do something more serious with it. Partially because it feels like something like alpine.js can really remove a bunch of state-boilerplate but mostly because the code is very brittle. If I change boardSize variable in the codebase it will completely break the app. The generated code assumes this variable to remain constant and there are a bunch of little things like that.

More interactive prompting and steering might address some of it but these exercises, albeit impressive demonstrations, also help remind me that the cool demos are just that. They're not production code, and it would be a different kind of effort to use LLMs to write code for the long haul.