โ ๐ Lua World
๐ Jump Power
You can practise without a player, but pick a player to score points!
๐ The mission
Today you unlock
Functions return answers
A function is a tiny machine: it receives inputs, works something out, then returns one answer for the tests to check.
๐ก Hint ladder
- Multiply with *
- return strength * 3
๐งช Coach checks
- โฏ strength 10
- โฏ strength 0
- โฏ strength 7
Live coach
Getting ready
โโโ
๐ฌ Multiply with * โ this one triples instead of your times-3... wait, yours IS times 3! Easy win.
function doubleCoins(coins) return coins * 2 end print(doubleCoins(5)) -- 10 print(doubleCoins(50)) -- 100
๐ It printed:
Nice โ you saw it work!
๐ Output
๐งฉ Gaps filled! Ready to write it all yourself?