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


Extension Task


Tweak the code to add more possible answers such as:

  • I don’t think so
  • Maybe
  • No doubt about it
  • Not sure
unlock-access

Solution...

The solution for this challenge is available to full members!
Find out how to become a member:
➤ Members' Area

Did you like this challenge?

Click on a star to rate it!

Average rating 3.1 / 5. Vote count: 43

No votes so far! Be the first to rate this post.

As you found this challenge interesting...

Follow us on social media!

Tagged with: