missing-digit

by abjoshi
See Code Download Embed
Author: Abhay B. Joshi (abjoshi@yahoo.com)

Instructions:
1. Click on the “Green flag” to see two buttons.
2. If you select "Animation" you will see a simulation of the game played between two friends.
3. If you select "Interactive" the program will play with you.


Notes:
Leila (the cat) is a detective who can trace missing numbers. In interactive mode, she will play with you, and in animation mode she will play with her friend Sheila (the dog).

Leila asks Sheila to write down any string of numbers without showing you the result. (For example, Sheila writes 714329167.)
Next, Leila asks Sheila to add a zero to the right. 
(New number would be 7143291670)
Next, she asks Sheila to subtract her first number. 
(7143291670 - 714329167 = 6428962503)
Finally Leila tells Sheila to remove any digit except 0 from the number she is left with. (Sheila eliminates 4. Her remaining number will be 628962503.)


If you want to understand how I designed this program, please refer to my book:
"Adventures in Snap Programming" available on Amazon.com

Created January 20, 2020

Last updated October 19, 2020

Published January 20, 2020