Program a penny to land heads or tails with a 50-50 chance.
KittyCode Programming Challenge
1 - Enter the template.
Look at the code that is there to help you. This code will make your sprite appear in the same spot every time you press the green flag as your explore and discover how to put your code together.
2 - Make Penny Flipping Animation.
When you press the space bar, try to make your penny rotate three times using the costumes provided in the sprite.
in these sections for blocks!
3 - Create a Variable called
"Heads or Tails".
Create variable to keep track of whether the penny is heads or tails when you press the green flag.
4 - Create Random Number Operator for Heads or Tails Variable.
Create an operator to assign random numbers to heads or tails when you press the spacebar.
Think about what random numbers will create a 50-50 chance of landing on heads or tails.
5 - Create an "If...then..."
When you press the spacebar, make the penny land on a heads or tails costume at a certain number.
Hooray! You Did It!
Do you still need help? Click me to reveal the finished project.