Doodle Kids Coding

Snap coding blocks together to send a white rabbit hopping from tile to tile until it has eaten every carrot, in six short levels.

The opening picture: press the big play button to start coding

The tutorial: one arrow block is in place, now press the orange button

An empty program: drag arrow blocks into the row next to the rabbit

The program is running: the rabbit hops along as the blocks play out

Like this game?

At a glance

Released
December 4, 2017 — for Computer Science Education Week
Also known as
Coding for Carrots
Made by
Google Doodles with Google Blockly and the MIT Scratch Team
Genre
Coding puzzle
Players
1
Inside
6 levels
Controls
Mouse or touch: drag blocks, press play
Based on
Logo, the first programming language made for children, and Scratch
Music
Silas Hite

What Coding for Carrots is

Celebrating 50 years of Kids Coding, which nearly everyone calls Coding for Carrots, was the Google Doodle of December 4, 2017. It opened Computer Science Education Week and marked fifty years since children first got a programming language of their own, Logo.

Google describes it as its first coding doodle. It is a puzzle game in which you never touch the hero. A white rabbit stands on a little island of tiles; you line up blocks that say what it should do, press play, and see whether your program takes it to all the carrots. Six levels lead from two steps in a straight line to winding paths that are much easier with a loop.

How to play

  • The blocks you can use lie in the tray at the bottom of the screen. Drag them with the mouse or a finger into the row that starts with the rabbit's face. They click together like jigsaw pieces.
  • The green arrow block moves the rabbit one tile forward. Turn blocks rotate it left or right on the spot. The loop block repeats whatever you put inside it, and you can set how many times.
  • Press the orange play button. The rabbit runs the program from left to right.
  • If the rabbit ends up short of a carrot, change the blocks and run it again. That is the whole idea: write, try, fix.
  • The level ends the moment the last carrot is eaten.

Every level can be solved the long way, block after block. The game also keeps a target number of blocks for each level and marks your result when you match it, so the real puzzle is doing more with less.

Who made it

Three teams built the game together: Google's Doodle team, the engineers of Google Blockly, and researchers from the Scratch Team at the MIT Media Lab. Google's page gives an unusually full list of credits; these are the leads and the partner teams.

RolePeople
Creative leadGerben Steenks
Lead engineersBrian Murray, David Lu
Google BlocklyErik Pasternak, Katelyn Mann, Rachel Fenichel
MIT Scratch TeamChampika Fernando, Mitch Resnick, Carl Bowman, Tim Mickel, Andrew Sliwinski
Music and soundSilas Hite

How it was made

Real Scratch blocks

The coding blocks are not a drawing of Scratch. MIT confirms that the doodle was built with Scratch Blocks, an open-source project that Google and MIT announced in 2016. It joins Google's Blockly technology to what the Scratch Team had learned about teaching children. One of its ideas was a horizontal row of blocks with pictures in place of words, made for younger children and small screens. That is exactly the row you fill in under the rabbit.

When Google later wrote about its part in Scratch 3.0, it named Coding for Carrots as one of two public projects that had shown the new blocks at work.

A story that came full circle

Google's announcement was written by Champika Fernando of the Scratch Team. She first met Logo at the age of nine, in a free after-school class in the 1980s, steering a green turtle that drew lines on a black screen. Her parents wondered what use it could possibly be. She went on to become an engineer at Google and then moved to MIT, and the doodle was her chance to hand the same first experience to a new generation.

The art

Gerben Steenks lists the game in his portfolio as vector art animated with the CreateJS tools.

Fifty years of kids coding

Logo was created in the 1960s by Seymour Papert, Wallace Feurzeig, Cynthia Solomon and Daniel Bobrow, and first tried out with schoolchildren in Massachusetts in 1967. Its best-known form came a little later: a turtle that a child moves around with simple commands such as forward, turn and repeat, drawing shapes as it goes.

The doodle keeps the commands and changes the animal. Forward, turn and repeat are all the rabbit understands, and they are enough for every level. Scratch, made at MIT four decades after Logo, carries the same idea on with coloured blocks.

Fun facts and small secrets

  1. The rabbit cannot fall off

    Tell the rabbit to walk forward where there is no tile and it simply stays put, then carries on with the next block. Players soon noticed that this makes sloppy programs work, and used it to find surprisingly short solutions.

  2. Players beat Google's own targets

    The game's target for the last level is six blocks. The site I Programmer showed in 2017 how to do better by leaning on the rabbit's refusal to step into the air, and players on Codeforces later posted a five-block answer.

  3. One program for all six levels

    The day after the doodle appeared, someone on the Code Golf site asked for the shortest single program that clears every level. The winning answer needs only six blocks: two loops, two steps and two turns. It assumes all block types are on hand from the start, which the first levels of the real game do not allow.

  4. You can finish without ever using a loop

    A design student at Carnegie Mellon University wrote in 2021 that she completed all six levels without the loop block, because nothing forced her to try it. The loop is the lesson, but the game lets you skip it.

  5. It came back in 2020

    On April 27, 2020 Google returned the game to its home page as the first of its "Stay and Play at Home" doodles, a run of popular old games that also included Magic Cat Academy.

Sources (11)
  1. Google Doodles — Celebrating 50 years of Kids Coding
  2. Google Doodles — Stay and Play at Home with Popular Past Google Doodles: Coding (2017)
  3. MIT Media Lab — Celebrate Hour of Code and CSEdWeek with Scratch
  4. Google Developers Blog — Scratch and Google introduce Scratch Blocks
  5. Google Developers Blog — Scratch 3.0's new programming blocks, built on Blockly
  6. Google blog — It's Computer Science Education Week
  7. Gerben Steenks — portfolio
  8. Logo Foundation — Logo history
  9. I Programmer — Google's kids coding doodle
  10. Code Golf Stack Exchange — shortest program solving all the levels
  11. Design for Educational Games (Medium) — Coding for Carrots Google Doodle

Comments

No comments yet — be the first!

More Educational Games

View All Educational Games