Roll two dice with random numbers and print them in the terminal.
This tutorial is part of the Nairda learning path. You can build it step by step inside the app, which checks every block you place before letting you move on.
The steps
- We add a While loop, which repeats forever.
- We create a text variable called terminal.
- We create two number variables, die1 and die2.
- Above the loop we clear the terminal with an empty Set.
- Behind it we join the title Dice simulator.
- Behind it we set die1 to a random number.
- That random goes from 1 to 6, like a die.
- And behind that we set die2 to another random.
- This one also goes from 1 to 6.
- Behind it we join the label die 1:
- And behind it the value of die1.
- Behind it we join the label die 2:
- And the value of die2 behind it.
- On the dashboard we draw a terminal and give it the variable terminal.
When you finish, the app takes you straight to the next tutorial in the path.