FratmScript 🤌🏻

Lesson 5 / 14

facc and piglie

facc name(parameters) { … } creates a function (function).

piglie value is return: the function stops and gives that value back to its caller.

Exercise

Write a function doppio(n) that returns n * 2, and print doppio(21) below the greeting.

facc saluta(nome) {
    piglie "Uè " + nome + "!"
}

stamm a dì(saluta("Ciro"))

When you are done, the program prints

Uè Ciro!
42

Do this lesson in the playground