2048

I’m in the software business by trade, so it should come as no surprise that my work environment has been using AI as soon as it was available. First endeavors were testing the security and guardrail components, model differences, and integration patterns such as retrieval-augmented generation and now model context protocol. This has led to some solid business outcomes, including faster time-to-resolution for customer tickets through issue summary generation and identified resolution actions.

It wasn’t until the last few months though that I noticed developers integrating AI into their IDE to help with end-to-end coding. That has been insanely powerful, and a bit unnerving. Traditional coding is being replaced with prompt engineering, lowering the bar of access to compute. Innovation in so many domains is about to get so much faster. So, it is in this frame that I bring my AI learnings back home to play.

In one of my old drafts from 2016, I was playing around with Google Go and implemented a 2048 emulator as a side project to understand that language. If you aren’t familiar with 2048, it’s a fun game that progressively gets harder as you try to combine 2s and 4s together on a 4×4 grid to make a 2048 tile. You know, I suck at explaining these things – if you don’t know what 2048 is, watch this youtube. I came back and forth to making this emulator over the course of many nights (remember, I’m a Dad first). This was all hand-coding. Yes granted, with a new language, but still. It was arduous.

So now here I am on a random Saturday with 3 hours to kill. What a difference 9 years make. I updated VSCode to enable Github Copilot, picked good-old reliable python, and starting prompting the AI to build me an emulator:

i'd like to create a 2048 game emulator. This should be played via command line. This game should have a 4 x 4 square, where upon start a "2" appears randomly in one cell. The player decides to push the numbers right, left, up, or down - which moves the numbers all the way to those directions. Should a 2 find another 2, then it combines and 4 is created. The 2s that went into it disappear. If a 4 meets a 4, an 8 is created and the 4s that went into it disappear. Same for 8s, 16s, 32s, 64s, etc. The goal of the game is to get a cell to 2048.

It took that and started configuring my environment, and spat out:

Rock and Roll. It got it wrong. Just a couple tests and I found left and up weren’t working right. They weren’t pushing all tiles to the left or right.

Prompt –> Fix

Then I found down was broken.

Prompt –> Fix

Then I found that ‘4’ wasn’t being generated. My fault, initial prompt error.

Prompt –> Fix

Boom. I had a working emulator. Sweet, fast, and brainless. I’m back where I was in 2016 — but it only too me about an hour.

And I’m not done. My new project off this is to find the right sequence to play to get as close to 2048 as possible. Stay tuned as I have AI develop ML.

One thought on “2048

Add yours

  1. Pingback: 2048 part 2

Leave a Reply

WordPress.com.

Up ↑

Discover more from

Subscribe now to keep reading and get access to the full archive.

Continue reading