Conditions
si (condition) { … } runs the block only when the condition is true (if). sinnò { … } is the other branch (else), and sinnò si (…) adds more cases.
vedimm (value) { caso …: … } picks one of many cases (switch). rompe leaves the block (break), predefinit: is the fallback case (default).
chist è ora = 20
si (ora < 12) {
stamm a dì("Buongiorno!")
} sinnò si (ora < 18) {
stamm a dì("Buon pomeriggio!")
} sinnò {
stamm a dì("Bonasera!")
}
chist è giorno = "dummeneca"
vedimm (giorno) {
caso "sabato":
stamm a dì("Pizza!")
rompe
caso "dummeneca":
stamm a dì("Ragù!")
rompe
predefinit:
stamm a dì("Pasta e fagioli")
}
Output
Bonasera!
Ragù!