Step 1: Lightbot

By Cody Sandahl
President of Code4Kids

This article is part of our “Get Coding” series.

The first step is always the hardest, and that’s why the first step should be a game!

I still remember the first computer game my parents let me pick out when I was a kid: Stickybear Numbers. It was my first inkling that you can actually learn from video games, and it also whet my appetite for making my own games. Shortly thereafter I was poking around in QBasic, a simple programming language that used to come already installed on computers back then. I started with games because games are fun. Whenever you want to learn something new, find a way to make it very fun in the beginning. Otherwise you’re more likely to give up.

I have had several parents ask me for advice on teaching their elementary-age kids to program computers. I always give the same starting point: have them try out Lightbot. It’s a simple game that you can play for free on your computer or phone, and it teaches you all the basic concepts of programming. Most importantly, it also introduces you to the “Huh?” factor. Computer programming has a lot of “Huh?” moments – times when you have to figure out what to do next because you’re stumped at the moment. If your kid is interested enough in the game to get past the “Huh?” moments, they have both the talent and the temperament to pursue computer programming further.

Here’s a screenshot of the first level. If you were going to verbally tell the robot what it needed to do to reach the blue square and turn on the light, what would you say? Probably something like…

  • Go forward two steps
  • Turn on the light

The challenge of Lightbot is to assemble the robot’s commands to make it follow those directions. In this case, you drag two “move forward” commands from the bottom to the box on the right. Then you drag a “turn on light” command at the end. Finally, you press “go” (the green button with the arrow) and watch the bot gracefully walk over to the blue square and turn on the light. Voila!

Things do get interesting in a hurry, though. This is a screenshot of the sixth level, along with the solution already assembled in the program box on the right. But before you get overwhelmed, go back to verbal instructions. You would tell the robot…

  • Jump up
  • Turn left
  • Go forward
  • Jump up
  • Turn on the light
  • Turn left
  • Go forward two steps
  • Turn right
  • Jump up
  • Go forward
  • Turn on the light

That’s all there is to it! Of course, it gets even MORE interesting from there – but that’s the fun! One note that may not be obvious at first – the instructions in the program box on the right start at the top-left, then go all the way to the right, then it comes back down to the second line far-left, then it reads all the way to second line far-right, then it returns to the third line far-left before reading all the way to the third line far-right. It’s just like reading – take each line left-to-right starting at the top.

One word of warning – the kids I’ve seen play this coding game often get confused by the “turn left” and “turn right” commands. It’s hard to have the visual-spatial memory to get those right on the first try, so you’ll often see kids just alternating left and right until it works. That’s OK – they still get the idea of putting commands in a particular order for the robot to follow.

Want to play Lightbot?

For the iOS and Android versions, you can play quite a few levels for free. If your kid is still excited and wants to move forward, a few dollars will get you all the rest of the levels.

Happy coding!

One Reply to “Step 1: Lightbot”

Comments are closed.