Purchasing new hardware? Read our latest product comparisons

Video game teaches Java programming language to players


April 9, 2013

One of the CodeSpells gnomes, that players help using spells written in Java

One of the CodeSpells gnomes, that players help using spells written in Java

Image Gallery (3 images)

They say that one of the most effective ways of teaching someone a skill is to turn it into a game. Well, that’s just what a team at the University of California, San Diego have done with their CodeSpells video game – it teaches its players how to use the Java programming language.

CodeSpells was developed by a group of graduate students led by computer scientist William Griswold, and is intended for elementary to highschool-aged students. The idea was to develop a method of learning that could be structured by the student in a creative manner, that they would willingly spend hours doing.

Within the universe of the first-person game, the player is a wizard in a land inhabited by gnomes. Because the gnomes have lost their ability to use magic, the player helps them out by casting spells for them. Those spells are written in Java by the player, with some assistance from the game. Along with helping the gnomes, players can also earn merit badges by completing simple quests, that once again require the use of the Java spells.

The game has been tested on a group of 40 girls aged 10 to 12, who had no prior education in programming. The girls reportedly became quite engrossed in the game, and within an hour had gotten the hang of some basic components of Java, which they used to devise new ways of playing the game.

According to the university, “By the time players complete the game’s first level, they have learned the main components of the Java programming language, such as parameters, for if statements, for loops and while loops, among other skills.”

Griswold and his team plan on conducting some more field tests of the game in schools, but ultimately plan on making it freely available to any educators who wish to use it. Some of the gameplay can be seen in the video below.

Source: USCD Jacobs School of Engineering

About the Author
Ben Coxworth An experienced freelance writer, videographer and television producer, Ben's interest in all forms of innovation is particularly fanatical when it comes to human-powered transportation, film-making gear, environmentally-friendly technologies and anything that's designed to go underwater. He lives in Edmonton, Alberta, where he spends a lot of time going over the handlebars of his mountain bike, hanging out in off-leash parks, and wishing the Pacific Ocean wasn't so far away. All articles by Ben Coxworth

thats pretty cool, wish there was a game like that when I was at school

Calum Mchaffie

I thought due to security reasons with Java, the plan was to try and move all this to html5?


The problem of security lies in running java as a plug in within a web browser. Java itself is a programming language that compiles to bytecode which is run on a computer like any other program. Browsers have plugins that will run java that is from another computer. This is where the problem. If the program is installed locally on your desktop / laptop then no worries (except the normal ones about all programs having bugs and what not).

In my 17 years of programming I have never written a java program to be run in a web page and can not think of any reason why I would. This is because it is really not suited to it despite that being its original purpose. HTML5 / javascript (very very different to java, only the name is similar) is the way forward for web browsers. This game however is like any other game you would install and play.


This kind of innovation in teaching makes my heart sing.

Susan Perry

As popular as Minecraft is, I find this much more useful and would be happy to pay a subscription fee for this program. It would be a far better use of my kids' time than Minecraft or Mario.

Rogan Rattray


Minecraft might not be as educational as this but as games go it could be worse. You can build some pretty complex contraptions in Minecraft with red stone and switches.

For programming I think the concepts might be useful to kids but the syntax is not really.


These guys are behind, Colobot was a game created around 2001 where you use a programming language similar to Java called C-BOT. The aim of the game was to fly to other planets and build robots that you can then program to do certain tasks, such as a vehicle that collects resources or shoots at aliens.

It was also "recommended by the Polish Ministry Of Education as a teaching aid in learning of basic algorithms and object-oriented programming".


Not available for windows... Are you serious?

Andrew Zuckerman
Post a Comment

Login with your Gizmag account:

Related Articles
Looking for something? Search our articles