In which I vibe-code a Dr. Mario clone for emacs

The interface of “Dr. Macsio,” a Dr. Mario clone in emacs

On a long train ride, I decided to try some light vibe-coding with this $20-a-month Claude subscription I pickd up for a project. The end result can be seen on GitHub and I attempted to use a “literate programming” style to make the code itself pretty self-documenting. This is a companion post to talk about the experience of turning AI loose (relatively speaking; we’re not Ralph Looping yet) on this project, things that surprised me, and things to remember.

I started with querying Gemini for a basic overview of the emacs gamegrid library and how to load images into it, with a lot of help from blog posts by Alessio Vanni on the topic. This proved workable but lengthy; Gemini made a lot of bad guesses (it wasn’t plugged directly into my development context, I was just querying through a conversation that begun from the Google web interface). The problem domain in question was working with an under-documented library (gamegrid.el, Old-Version 1.02, the version coupled to GNU Emacs 31.1 (build 2, x86_64-pc-linux-gnu, GTK+ Version 3.24.52, cairo version 1.18.4) of 2026-09-21); given enough time, I could probably have sussed out what every piece of gamegrid does, but this got me off the ground quicker (which will incentivize me to maybe take a look at gamegrid and document it!).

In this project, I used a literate programming approach that mixes description and code more thoroughly than most styles of programming (if you’ve used R or Jupyter notebooks you may be familiar with this style). As a result, Claude had more context on what I intended to do, though I don’t know if it could take advantage of that.

One funny thing that did start to happen: as I laid down the algorithm for dropping pills, Claude offered suggestions because it recognized the game we were implementing even though the name did not at the time show up in the conversation or the source code. It recommended algorithm improvements on the pill-drop and combo logic based on the game. I queried Claude as to how that was possible and was told this.

Question: do you know if your training data included source code for implementations of Dr. Mario? I ask because you make suggestions for correcting the game logic that imply you have information about the standard rules of games like this.

I don’t know. I can’t inspect or list what was in my training data, so I can’t say whether it included Dr. Mario implementations. It likely included public code for Dr. Mario clones and other falling-block puzzle games, plus wikis, forum posts and strategy guides that describe the rules. But I can’t point to a specific source, and I’d be guessing if I named one.

What I can say is how the suggestions came about:

  • Where they came from: it’s general knowledge of how the game behaves. Examples are that a half left behind by a clear falls on its own, that viruses don’t fall, and that a horizontal pill needs support under both halves to stay up. It’s the sort of knowledge you’d get from descriptions and gameplay accounts, and it isn’t necessarily from reading an implementation.
  • How reliable they are: that knowledge can be wrong or fuzzy. I didn’t check any of it against a rules reference or the original game during this session. When I wrote “as in the original game,” that came from memory. Details such as exact fall timing, combo rules and virus placement are where I’d be least sure.
  • Why it matters here: this is your game, so your spec should win wherever it differs from what I remember. When I suggested something beyond what you asked for, like unlinking the surviving half after a clear or making whole pills fall, I flagged it so you could decide. That’s the right way to treat my claims about the original: as suggestions to confirm, not as authoritative.

If you need the original’s behavior to be exact, check it against a rules reference or play footage rather than relying on me.

The LLM was remarkably good at extrapolation. I didn’t mention in the rules that the initial configuration of viruses should not create four of the same color in a row; it inferred that and put it into the logic of virus creation. I suspect it is relying upon training data of other Dr. Mario game implementations here, but I don’t know how to prove or disprove that.

On using AI for something like this, general meta-thought

There are various concerns around AI for programming, and I share them. The energy consumption one is the one I’m most concerned about; when I’m not on the road I would like to try this experiment again with Qwen running on my local machine, but the laptop I drag on trains doesn’t have a NVIDIA graphics card and my attempts to potato it into working with opencode had poor outcomes (opencode wants to feed thousands of tokens of context into the LLM; that pegged my CPU rapidly and refused to let go).

I think this project creates an interesting example of how complex the question of ripping off other people’s work is, however. I used Claude and Gemini; I did not start from scratch. But there was no scenario where I was ever going to start from scratch on a project like this; both gamegrid and the games that use it bundled with emacs are GPL, and the initial scaffold of the game was heavily influenced by tetris.el. Nothing about the GPL philosophy, at least, has ever said that you have to start from scratch; it says “Share and enjoy.” Of course, the actual AI model used was not trained only on open-source and GPL software, so I can see concerns people might have with tainting the result.

We live in interesting times.

Comments