Inspiration

I am an aspiring polyglot with a current focus on Japanese. Japanese text are based on Kanji, which look like hieroglyphics to those who grew up with an alphabet, such as myself.

So how can I gamify the learning process ?

As a 90's kid, I played Pokémon on the GameBoy, which was very engaging and I learned a lot from playing it. So, I created an interactive memory palace, a memorization technique popularized by Cicero in Roman times, with a dash of Pokémon-esque styling. Goal is to create a story in the player’s mind that relates the meaning of Kanji to their associated object, in order to avoid rote based techniques. Here's a practical example and how it is used to memorize the images.

This submission proves that LLM are powerful enough to build a functional game using 1-shot prompting. In other words, if your insert the prompt you will get a fully functional game in return. Ultimately, we are pushing LLM to their limits, by asking them to handle complexity.

Read more about these practical benchmarks here.

What it does

No login, no sign up. You roam an interactive 2D environment, in search of 10 Kanji to capture. When you bump into a Kanji, you must type its meaning to capture it. To challenge one's self, they can hide the Kanji -- hidden by default to mimic Pokémon. Once all 10 Kanji are collected, the game is complete!

How it was built

It was built on a 1-shot prompt attempt. While the idea was mine, I heavily relied on Gemini to craft the prompt. Our tech stack is quite simple:

  • A single HTML file with embedded CSS and a element to render the drawings.

In order to dial in the level of detail needed for the memory palace, I created an array :

// Map data (0=renderGrass, 1=renderPath, 2=renderTree, 3=renderWater, F=renderFire, M=renderMountain, R=renderRiceField, P1=renderPerson, U=renderPerson (user's sprite)) 

this.mapData = [
[0,0,2,0,2,2,0,0,2,2,2,0,0,0,0,0,0,0,3,3,3,0,0,0,0,2,2,2,2,2],
[0,0,'一',0,'二',0,0,1,0,'三',0,2,2,2,2,0,0,0,0,3,0,0,0,0,0,1,1,0,0,0],
[0,0,2,2,2,2,2,1,0,0,2,1,1,1,2,0,0,0,0,1,0,0,0,0,0,U,1,0,0,0],
[0,0,2,1,1,1,2,1,0,0,2,1,2,2,2,0,0,0,0,1,0,0,0,0,0,0,1,1,0,0],
[0,0,2,1,3,1,2,1,0,0,0,1,0,0,0,0,0,0,0,1,0,3,3,3,3,2,2,1,0,0],
[0,0,2,3,3,1,2,1,1,1,1,1,1,1,1,1,1,1,1,1,1,3,3,3,3,2,2,1,1,0],
[0,0,2,2,2,1,1,1,0,0,0,0,1,0,0,0,0,0,0,0,0,3,3,3,3,2,2,0,1,0],
[0,0,2,0,0,1,2,1,0,2,2,2,1,2,2,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0],
[0,0,2,1,1,1,2,1,0,2,1,1,1,2,2,0,0,0,0,0,'P1',0,0,0,0,0,0,0,1,0],
[0,0,2,1,0,1,2,1,0,2,2,2,2,2,2,0,0,0,0,0,'人',0,0,0,0,0,0,0,1,0],
[0,0,2,1,0,2,2,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1],
[0,0,2,1,0,2,2,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,'R','R',0,0,0],
[0,0,2,1,1,1,2,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,'田','R',0,0,0],
[0,0,2,2,2,0,2,1,2,2,2,0,0,0,0,0,0,0,0,0,'M',0,0,0,0,'R','R',0,0,0],
[0,0,3,3,2,0,2,1,2,2,2,0,0,0,0,0,0,0,0,'山',0,0,0,0,2,2,2,2,2,2],
[0,0,3,3,3,3,3,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1],
[0,0,0,0,3,3,3,1,2,2,2,2,2,2,2,2,2,0,0,0,0,0,0,3,2,2,2,2,2,2],
[0,0,0,0,2,2,2,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3,3,3,3,3,3,3],
[0,0,0,'水',2,2,2,1,0,0,0,2,0,0,0,0,0,0,0,'F',0,0,0,0,0,0,0,0,'川',0],
[0,0,0,0,0,0,0,0,0,0,0,'木',0,0,0,0,0,0,'火',0,0,0,0,0,0,0,0,0,0,0]
];

This was a core component of the game design.

Challenges

There were 2 competing forces in the design of this game.

  1. Confining randomness
  2. Managing context length

In order to successfully 1-shot prompt a working game, explicit instructions are needed. However, I noticed that after 5000 tokens, Bolt.new performance would be inconsistent, even though clause-sonnet-4 has a context window of 200k tokens.

So I refined the core user experience and provided code blocks for the game's elements, such as the grass, trees, mountain, and water to name a few, in addition to the aforementioned grid.

Accomplishments to be proud of

  • Functional 1-shot prompt
  • Useful game for Beginners & Teachers alike in Japanese.
  • A framework for the game development for other ideogram based languages.
  • An open-source benchmark that can be used to assess future LLM development.

Learnings

Learnings or rather new questions that came about ?

  • A polished product can be generated with a well-tuned 1-shot prompt, so shouldn't this be a standard?
  • My final prompt was at 4101 tokens, not far off from the 5052 tokens I had for a much more elaborate game environment. Why was that an issue for claude-sonnet-4?

What's next for Kanjimon

Getting feedback from my target audience is the most important step. Are teachers interested in developing their own games as assignments perhaps ? Can this be applied to other languages ? What are other practical 1-shot prompts to add to my list of benchmarking LLM capabilities ?

Built With

Share this project:

Updates