Microsoft Research launches Code Hunt browser game, helps teach coding

Microsoft Research has launched a new web browser based game that's been designed to introduce anyone to the world of computer programming. It's called Code Hunt, and the site went live earlier today after being used in a programming event in China.

In a post on the Microsoft Research blog, the company describes how Code Hunt works:

It uses puzzles, which players explore by means of clues presented as test cases. Players iteratively modify their code to match the functional behavior of secret solutions. Once their code matches, lights flash and sounds play, letting players know that they have “captured” the code. Players then get a score, which depends on how elegant their solution is, and are encouraged to move on to the next puzzle or level.

Microsoft Research Asia showed off an early version of Code Hunt in April at the Beauty of Programming competition in China. The blog says that the 2,353 students who played the game during the event solved an average of 55.7 percent of Code Hunt's puzzles. 350 of those students solved all of the puzzles in the game and only took an average of 7.6 tries to finish each puzzle, versus an average of 41 tries for the rest of the students.

Microsoft Research previously released Kodu, a set of simple game programming tools designed to help teach kids about making applications.

Source: Microsoft | Image via Microsoft

Report a problem with article
Previous Story

Google offers Hangouts video plugin for Microsoft Outlook users

Next Story

Apple and Google settle their smartphone patent fight

26 Comments

Commenting is disabled on this article.

Hi, I'm not a beginner.
Over the past 30 years, I've written about 1 million LoC including some award-winning software. And, I've taught CS for 20 years (including SW engineering) in addition to being an algorithm specialist in engineering.

This "game" is more damaging than useful because it promotes hacking (e.g., through the changing test suite) rather than real CS: requirements, analysis, design, implementation, testing and testability, etc. There isn't any context for the applications, no rules, etc. Just bang away until it works.

This puerile gamification is like starting with a pile of steel on one side of the river and randomly welding and cutting until you reach the other side. The result is junk.

Computer science is a creative discipline. Without discipline, creativity is for nought.

Hi, I'm an absolute beginner, it's been at least 25 years since i've even had an arithmetic class. I'm stuck on 1.06 already. Reading thru some of the comments here, it seems there is a format I've never seen before. For example, someone was discussing x++ and ++x. I can do basic algebra, but those make no sense to me. Is there somewhere you can recommend I go to get a basic introduction or a glossary of terms or something? Is 1.06 really simple?

Ok, this is driving me crazy. Level 1.13 and 1.14 make absolutely no sense to me at all. I got through all the others for level 1 with no problem, but those 2 I cannot figure out to save my life, and it won't let me continue without it. Anybody have any ideas on them?

1.13 (says you have to use modulo, %)
1 input (x) with the following:
x = 0, expected = 1
x = 23, expected = 3
x = -8, expected = -1
x = 4, expected = 2

1.14 (says you have to use modulo, %)
1 input (x) with the following:
x = 3, expected = 1
x = 10, expected = 0
x = 7, expected = 3
x = 1, expected = 0
x = 4, expected = 2

Thanks. For 1.14, I had 100 % x, because the extra ones that popped up.

Edit: And yeah, 2.05 sucks. I thought it was going to be simple, but it's not :( I got the rest though. Wondering about the last 2 though. Is there a better way than doing it this way:

int result = 0;
for(int i = 0; i < s.Length; i++)
if (s == 'a') //There is a bracket i after s, but the editor takes it away
++result;

return result;

Edited by IceBreakerG, May 19 2014, 1:09am :

Hi, I didn't have time for it, I'm still at 2.05, can you help me with that?

I heard that some solutions of some level(s) were rated as "elegant" when regular expressions were used. Even if it was slower than a normal cycle.

That's pretty cool, even if the kids aren't necessarily interested in programming they are small problem solving exercises too.

And it is also buggy. Sometimes when I click Capture Code, it totally changes the expected result and thus the code you wrote fails. It is like there is some sort of sync issue.

Done playing, buggy stuff.

I think it's slow because it's actually sending and compiling the code server-side (presumably in some VM), then sending the results back.

The result changes because your code does not work for that variable, I cant code, but even I managed to do several levels with just logical mathematics.
And more then 50% of the levels have been completed before during the event, and thus work. So don't say that its buggy, its more likely bad coding from your side.

elenarie said,
And it is also buggy. Sometimes when I click Capture Code, it totally changes the expected result and thus the code you wrote fails. It is like there is some sort of sync issue.

More likely, it's intentional. You aren't always given the entire set of inputs on the first attempt, so you can't write something too specialized for that input set.

elenarie said,
And it is also buggy. Sometimes when I click Capture Code, it totally changes the expected result and thus the code you wrote fails. It is like there is some sort of sync issue.

Done playing, buggy stuff.

It's not buggy. It doesn't always show you all the expected results... because if it did, you could just write a an if statement for every one.

It adds more expected results if your code works for the few they gave, but you didn't implement the expected behavior for all possible input values.

Wall-swe said,
And more then 50% of the levels have been completed before during the event, and thus work. So don't say that its buggy, its more likely bad coding from your side.

Sigh. It is buggy! You wait a full minute for a simple "return -x" statement to be checked if it is correct. By then I just refresh the page or click on the reset level button which further screws up the whole thing.

rfirth said,

It's not buggy. It doesn't always show you all the expected results... because if it did, you could just write a an if statement for every one.

It adds more expected results if your code works for the few they gave, but you didn't implement the expected behavior for all possible input values.

It is definitely buggy as hell. Too many things change around for basic stuff. Example, one of the solutions is just adding 1 to the input value. Trying to use "return x++;" failed, but "return ++x;" didn't. In the real world (ie. at work), I use x++ all the time with no issues, but here it would make my result like 0 or 1, instead of whatever x is plus 1.

IceBreakerG said,

It is definitely buggy as hell. Too many things change around for basic stuff. Example, one of the solutions is just adding 1 to the input value. Trying to use "return x++;" failed, but "return ++x;" didn't. In the real world (ie. at work), I use x++ all the time with no issues, but here it would make my result like 0 or 1, instead of whatever x is plus 1.

x++ evaluates to x. ++x evalutes to x + 1. Both increment the value of x, but the value of the expression is not the same.

Try the following (in any language with an equivalent print statement):

int x = 3;
Console.WriteLine(x++); // prints 3

int y = 3;
Console.WriteLine(++y); // prints 4

See http://fairwaytech.com/2012/03...d-decrement-operators-in-c/

Edited by Andre S., May 17 2014, 4:30pm :