Sarah Dye

Posted on

# How to Write Out the Magic 8-Ball Instructions

Before we begin writing pseudocode, it is important to take a minute to write instructions for the magic 8 ball. Remember the recipe format we used earlier in phase one? These instructions will use the same format.

You will write the ingredients and instructions needed to make the magic 8 ball website work. Skillcrush provides students with a couple of hints to help students write these instructions.

### Solution

First, letβs tackle the ingredients. The ingredients will later become an object and properties in our pseudocode. In this project, you will need two ingredients.

All you will need are a magic 8 ball and a list of answers. We donβt need to go into detail about what answers we want to use in our magic 8 ball just yet. We will eventually put together our list later in this course.

``````Ingredients
* A magic 8-ball
``````

Now that the ingredients are done, we are ready to turn our attention to the instructions. There will be three steps the magic 8 ball needs to work. Underneath the ingredients, we will write down each of the three steps.

First, the magic 8 ball needs a question. So step one is where the computer will get the user to ask a question about something that might happen in the future. Once the user submits a question, it is time to figure out how to get the answer.

The next step is where the magic 8 ball will randomly decide what answer to pick. This is where the ball will shake as it figures out the answer. The last step is where the answer is displayed on the ball. So step three is where the magic 8 ball will respond and show the message.

### Finished Pseudocode

Thatβs a wrap for this challenge. Hereβs a look at the instructions we just created for this project. You can add more instructions if you like, but remember the abstraction principle and keep the instructions to the bare minimum.

``````Instructions