Learn to code by playing cricket

Robo Cricket โ€” twelve balls of code, in Python, JavaScript, TypeScript, Java, C++ or Go. Play what you know, leave what you don't.

Pick a language, then face a target, twelve balls, and sixty seconds a ball. Every delivery is one question in that language with four strokes on it. Pick the right one and it pays by the clock โ€” six if it went inside twelve seconds, down to a single at the death. Pick the wrong one, or none at all, and you are bowled for four. Leave it alone on purpose and it is a dot ball, costing only the ball itself.

Play Robo Cricket โ†’

Free, and no account needed โ€” play as a guest. Runs in the browser โ€” nothing to install.

What it teaches

You choose the language before the first ball, and it stays for the whole innings. Each language has twelve topics, and a match prefers one it has not bowled yet, so twelve balls are twelve different ideas. Every language covers the basics โ€” variables, data types, operators, if-else, loops and strings โ€” and then the parts that make it itself:

LanguageAlso on its syllabus
Pythonlists, functions, dictionaries, classes & objects, exceptions, tuples & sets
JavaScriptarrays, functions, objects, closures, exceptions, promises & async
TypeScriptarrays, functions, interfaces & types, classes & objects, exceptions, generics
Javaarrays, methods, classes & objects, inheritance, exceptions, collections
C++arrays, functions, pointers & references, classes & objects, exceptions, STL containers
Goslices, functions, structs, interfaces, error handling, goroutines & channels

The difficulty climbs across the over rather than sitting flat:

BallsBandWhat it asks of
1โ€“4easysomebody who has written a first class
5โ€“8mediumsomebody who has finished a tutorial
9โ€“12hardsomebody who has read another person's code and worked out why it broke

What a ball pays

Answered inRuns
12s6
24s4
36s3
48s2
60s1

The clock is the scoring. Every button is worth the same, so the difference between a single and a six is only how fast the code was read. Inside the first fifth means the snippet was read and the answer known; the last fifth means it was worked out โ€” which still counts, but only for one. There is no five, because cricket has no five.

Why cricket, and why sixty seconds

The cricket is the mechanic; the code is the point. Sixty seconds is long enough to read a snippet you understand and far too short to work out one you do not โ€” so the clock sorts recognition from reconstruction without anyone having to ask you which it was. And because leaving a ball is a legal move that costs almost nothing, the game rewards knowing what you do not know, which most quizzes punish.

Questions and answers

Is this for complete beginners?

The first four balls assume you have written a little code in the language you picked. If you have not yet, start there and treat the later balls as a map of what is coming.

Why is the address java-cricket?

It began as Java only. Five more languages joined later; the address stayed so that links people had already shared keep working.

Does a wrong answer end the match?

No โ€” there are no wickets. Every ball is faced however often you are bowled; being bowled costs four runs off the chase, not your innings.

Is it free?

Yes. Every game on SULULU is free and there is nothing to buy.

The other games on SULULU