BBC micro:bit – Magic 8 Ball

For this project we are going to code our micro:bit to act as a magic 8 ball:
magic-eight-ball

The user will think of a question such as:

  • Will it be snowing tomorrow?
  • Will I be a rock star one day?
  • Will my program work?

Then they will shake the micro-bit. The micro-bit will than randomly pick one of the following four answers:

  • No way!
  • Probably!
  • Unlikely!
  • Definitely!

Have a go at completing the task by yourself and if you get stuck or don’t know how to get started check our solution below.

Access BBC micro:bit website:
micro-bit-logo

Solution

micro-bit-magic-8-ball

Extension Task


Tweak the code to add more possible answers such as:

  • I don’t think so
  • Maybe
  • No doubt about it
  • Not sure
Share Button
Posted in BBC micro:bit, Computer Science Tagged with:

Our Latest Book

Follow this blog