O'Reilly logo

Raspberry Pi Projects for Kids by Daniel Bates

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Coding the game

Here's a quick recap on how this example game is going to work. The Raspberry Pi will choose a random button and ask the player to press it. Every time the player presses the right button, they get a point, and every time they press a wrong button, they lose a point. Once the right button has been pressed, the Raspberry Pi selects a new button as the target. The aim is to score as many points as possible in 30 seconds.

In IDLE, navigate to File | New Window. This will bring up a new empty window, which is where all our code will go. This window is better for editing existing code, and I will call it the Edit window. Whenever you want to test or run your code, navigate to Run | Run Module, or press F5 on your keyboard. This will ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required