Using the set macro to set variables
Mr Powell's Computer Science Channel Mr Powell's Computer Science Channel
2.77K subscribers
41 views
1

 Published On Feb 15, 2021

A variable is something we associate with a value.
For example:
(set: $turnsLeft to 100)
Once we have set up the association we can use it:
Your have $turnsLeft turns left until the end of the game
We can also use it with an if:
(if: $turnsLeft is 1)[This is your last turn]
We can also adjust it:
(set: $turnsLeft to $turnsLeft - 1)

This can be used to implement points, remember names, remember randomised values, control formatting. There really is no limit!

show more

Share/Embed