Fortune Teller

Introduction

Have you ever used a Magic 8 Ball to help you with a tough decision or asked a fortune teller machine to help you see the future? Well now you can turn CodeBug into your very own customised fortune teller.

In this tutorial we will get CodeBug to generate a random number and use it to select from a bunch of possible responses, such as "Yes" and “No”.

You will need
CodeBug CodeBug
Micro USB cable
Computer

Writing your program

To create your fortune teller, you will use the random number block and scroll text to answer a question.

Follow the tutorial below to create your program.


What next

Customise the answers with weird words to make your fortune teller seem more mystic.

You can add more answers by increasing the second value of the random block and adding more if-else conditions to your if block.

Design a fortune teller costume for your CodeBug and follow this guide to make it.


Back to top