Sums in a script
Try itKeeping count
A script can do sums and tell you the answers. This code box has no game in it, just a script and a log. The log is where a script writes notes for you.
Predict first
Work it out on paper before you run it.
| Line | The sum | What the box holds |
|---|---|---|
@coins is 12 | @coins is 12 | |
@coins goes up by 3 | 12 + 3 | @coins is ? |
@left is 30 - @coins | 30 − ? | @left is ? |
Run it
Press Run. The log, beside the script, shows the answers. Were you right?
Change the numbers
Press Stop, change a number in the script, and press Run again. Try these. Predict each answer first.
| Change | Predict: coins | Predict: left to find |
|---|---|---|
goes up by 3 to goes up by 8 | ? | ? |
@coins is 12 to @coins is 20 | ? | ? |
30 - @coins to 50 - @coins | ? | ? |
This section ticks itself when you press Run.

