All tutorials

Code Rock Paper Scissors on a micro:bit with Python

microbitpythonBeginner ⏱ 10 mins

Overview

Can you beat a micro:bit at rock, paper, scissors? In this project you're going to find out, by coding your very own game on a !

Give your micro:bit a shake and the inside it feels the movement. Your code then picks rock, paper or scissors at and shows it as a little picture on the (the grid of lights on the front), so you can see straight away whether you've won.

The best bit? When you're done you'll have a real game you can play against your micro:bit, or challenge a friend. Don't worry if something doesn't work first time, that's all part of coding. Let's give it a go!

🎯

What you'll learn

  • Bring in a ready-made library with
  • Use a to keep your game running
  • Make and use your own
  • Use the micro:bit's shake sensor to spot movement
  • Draw your own pictures on the grid of lights
  • Make decisions with s, plus elif and else
  • Compare two things with a
  • Let the micro:bit choose at