A cute robot coding at an old-fashioned computer terminal. AI code generation is great for making language games!

AI for Language Games : We’re All Developers, Now!

I’ve been developing games for language learners for over two decades now. Learning those programming skills was a labour of love, started when I was still a classroom teacher. Honing my own coding skills took years of practice. But now, thanks to ever-improving generative AI models, you can skip that step.

All it takes to create interactive language games is a good set of prompts!

Generative AI is an uncanny fit for language learners and teachers, who quickly realised how useful it could be for authentic(ish) text creation. But it doesn’t have to be static. By specifying the kind of features you want in a prompt, you can come up with great self-contained digital ‘worksheets’ with self-marking activities.

It’s possible to go well beyond this – into actual interactive gaming. Today’s generation of AI platforms are capable of taking your brief, then coding it up efficiently and intelligently as a working game, without any further input from you.

Now, if you can imagine it, you can make it.

Language Tetris

Let’s take a classic gaming example: a version of Tetris with a language learning twist. Blocks fall from the top of the screen, labelled with a word in either German or English. Students must manoeuvre the blocks with the arrow keys in order to land German-English equivalents together, whereupon they pop and disappear from the stack. The game speeds up as students progress; the aim is to prevent the blocks from stacking to the top for as long as possible.

It’s fun, and fantastic for improving recall with a set of vocab items.

An AI-generated interactive language learning game. Blocks fall from the top of the screen - the student must match them and avoid them piling to the top.

An AI-generated interactive language learning game. Blocks fall from the top of the screen – the student must match them and avoid them piling to the top. (Pictured is a ‘boom’ block that gives the students a lifeline!)

You can play a working version of it here, and you’ll see what I mean: it’s fun, it gets quite fast and furious, and it does a great job of drilling words. It may not look particularly pretty in its current state, but it’s completely playable; with a bit of visual sprucing, it wouldn’t look out of place on any language learning website.

It’s the kind of thing that would make a nice intermediate coding challenge for someone learning web app development. Maybe a weekend project, or something to do across a series of evenings.

But it took just a few minutes with ChatGPT.

Prompting for Language Games

Here’s the prompt I used for the initial version (and you’ll see some similarities with the interactive worksheet prompt, too):

Let’s create a language learning game in JavaScript, completely self-contained on a single HTML page. It will be like Tetris, adapted for language learning as follows:
– blocks will have either a German or an English word on them from a pot of ten vocabulary items on the topic ‘Clothing’
– blocks will descend from the top of the screen
– as they fall, students use the left, right and down arrows to manoeuvre the blocks before they land
– if a matching German block and English block touch (above, below or to the side), they go POP and disappear – and the game speeds up slightly
– ensure that ‘gravity’ is respected, so if there are blocks above one that ‘pops’, they fall into place accordingly
– the aim is to avoid the blocks stacking up to the top
– every few blocks (maybe every 5-10 at random), a ‘boom’ block falls that ‘pops’ every block it touches on landing (just to clear the space and make it a bit easier)

If you pop this into Claude Sonnet 3.5 right now – as long as you have Artifacts turned on – you should be able to play what comes up straight away. If you’re using ChatGPT or another platform, there’s an extra (easy-ish) step to do before you can play: you just need to save your code in some text editor as an HTML file.

Code output from a prompt in ChatGPT

Code output from a prompt in ChatGPT

Live Preview – Without Claude’s Artifacts

In fact, one free editor for coding – Phoenix Code – also shows you a live preview of the page working as you paste the code in, Claude Artifacts-style. If you really get into language games generation with AI, it’s well worth a download.

Using Phoenix to save and preview AI-generated language games

Using Phoenix Code to save and preview AI-generated language games

One important caveat: your game may well not be perfect on the first go. It might have a bug or two – AI might have missed the point occasionally. My initial version of Language Tetris, for example, allowed students to move the block across existing columns, unlike in the classic game.

But by prompting and re-prompting, requesting tweaks and changes as you go along, you can produce some amazing results. Change the styling, add features, include fiendish rules of play.

The sky’s the limit.

Pulling It All Together

Once you’re done with one game, it can serve as a template for others. It’s usually clear in the code where to change the vocabulary items to something else. Just change, Save As… a new filename, and build up a library of topical games.

A snippet of code produced by ChatGPT

It’s usually clear from a glance at the code where you can change the vocabulary.

In terms of styling, these games do tend to be graphically quite simple. That said, you can easily prompt for more visually appealing elements. And why not use a AI image generation tool like Bing to make some more attractive graphics to integrate into your creations?

Finally, you might be wondering if educational games developers like me are feeling a bit… well, put out by all this. My answer is a resounding not at all! If anything, AI code generation is a brilliant proof-of-concept, prototyping tool to try out new gaming ideas before setting fingers to keyboard. It’s incredibly useful to test if something will really work before pouring hours into coding it.

And of course, you can pick up with your own skills where AI leaves off, to create something even more special with that irreplaceable human touch.

Have you been using AI as your own coding assistant? Let us know in the comments what you’ve been creating together!

An owl, much like the Duolingo mascot!

Duolingo: Five reasons it’s a show-stopper for linguists

I was quite late to the Duolingo party. It might be a wee bit of jealousy, perhaps; as an educational app developer, you look at software like Duolingo and think: wow, that is an educational app. But lately, I’ve bitten the bullet, and have become completely hooked on the green owl (a euphemism everybody should become familiar with).

As one of the most popular apps – let alone educational ones – the web isn’t short of reasons to love it. But here are a few of the very special things that make Duolingo the golden standard for me.

Perfectly paced

The Duolingo environment uses a health system, borrowed from video gaming, to monitor how well you’re performing in a topic. If you start making lots of mistakes, you deplete your health reserves and have to wait until later to continue.

Now, as frustrating as this sounds, it’s a brilliant way to stop language junkies like me from overloading the brain. We all have our limits, and when you enjoy what you’re doing, you can forget where the most efficient place to stop is. The health approach is genius at forcing breaks when learning falls below optimum.

Silly sentences

I’m a huge fan of silly sentences as a memory aid and motivator in language learning. Playing with words in funny ways builds flexibility in a way that learning set phrases doesn’t. And Duolingo embodies the spirit of this to a tee.

No, I hope I will not need to say “cats are not food” if I visit Korea. But having translated that in the app, I’m unlikely to forget the words ‘cats’ and ‘food’, remembered with a silly smile.

Incidentally, a whole Twitter feed has sprung up to celebrate Duolingo’s comedic bent!

Unique content per language

Duolingo avoids a cookie-cutter approach to language learning by providing unique content in each language. Proceeding in exactly the same way in each language might not suit every tongue; instead, each course seems to have been put together from scratch by separate groups of subject experts. It’s quite refreshing to have multiple, bespoke paths available across the (ever-growing) range of languages on offer.

Deductive learning

Duolingo breaks free from the traditional presentation-practice mode of language learning. Sometimes, questions will contain a word or two that you haven’t come across before. As such, it can seem a bit more challenging, like ‘deep end’ learning.

However, rather than frustrating the learner, it encourages a bit of deduction. Can you make an educated guess? Or can you research the mystery word elsewhere? If you’ve had to work to find out the meaning rather than have it handed to you on a plate, it may well be more likely to stick. It highlights the unpredictability of language and the need to experiment and think on your feet – skills that are missing in many more conventional courses.

The Duolingo Universe is growing

Finally, Duolingo wins just on sheer choice. From a few initial language offerings, the app has grown to take in many more, bursting out of the traditional French/German/Spanish bubble. Finding apps for learning Polish – let alone good apps for learning Polish – was tricky in the not-so-distant past. Given the Duolingo treatment, there’s now an excellent solution for learning the basics.

What’s more, the app keeps growing; new languages are being worked on, while existing languages are expanding with new topics. It’s Aladdin’s Cave for a language junkie, and will spark some polyglot roving for inquisitive minds of all ages.

Duolingo has set the bar very high for educational apps in general, and language apps in particular. That certainly keeps educational app developers on their toes. But as a model for digital, self-paced learning, it’s an inspiration for the industry as much as it is a gem for linguaphiles. I’m already looking forward to the next languages to be added!