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.

No problems detected

Predict first

Work it out on paper before you run it.

LineThe sumWhat the box holds
@coins is 12@coins is 12
@coins goes up by 312 + 3@coins is ?
@left is 30 - @coins30 − ?@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.

ChangePredict: coinsPredict: 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.

Press Play in the code box to finish this section.