top of page

Penny Flipping

Program a penny to land heads or tails with a 50-50 chance.

KittyCode Programming Challenge
Screen Shot 2019-03-14 at 11.28.37 AM.pn

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.

PennyFlipperInitial.png

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.

Control Panel Scratch.png

Look

in these sections for blocks!

Need Help_ Heres a Tip.png

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. 

Need Help_ Heres a Tip.png
Control Panel Scratch.png

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. 

Control Panel Scratch.png
Need Help_ Heres a Tip.png

5 - Create an "If...then..."

 

Control

When you press the spacebar, make the penny land on a heads or tails costume at a certain number. 

Control Panel Scratch.png
Need Help_ Heres a Tip.png

Hooray! You Did It!

Water Molecule.png

Do you still need help?  Click me to reveal the finished project.

bottom of page