Roll the Dice (feat. Aria from 7-2)

This creation worked thanks to Aria. (Thank you very much)

The thing we created.

I wanted to create something where you can “roll” a dice and it gives me a number. I had the basic idea and Aria helped with the code for the harder parts I didn’t know how to do.

You can access it here: https://repl.it/join/ziiwslkd-ashleyqiu

Here is a snippet of my super long code.

The first thing we tackled was the random integer and what it does. First I put the outline of the dice which is a square. In the code you can see the first two ifs of many many more. If the random integer is one then it put one dot in the middle like a normal dice. It goes all the way to 6. At the bottom (which you can’t see) there’s another if statement. If a is pressed the code stops and it any other key is pressed, than it keeps going. In the beginning you can see that if r is pressed, the dice is “rolled.”

We didn’t have many problems, just a couple minor errors. I learned about conditional statements, random integers, true’s and false’s, and holders.

Leave a Reply

Your email address will not be published. Required fields are marked *