Saltar al contenido principal

Conditions

What is a condition

A condition is a block of code that only runs if a certain requirment is met

Usage Example

func main()={

sum = 4+1

if (sum == 5)
{
printLine("Correct! 4+1 = 5")
}
else
{
printLine("Incorrect!")
}
}

OUTPUT:

Correct! 4+1 = 5

While Loop

While loops create a loop that run as many times as instructed.

func foo() = {
var x = 1;
while (x<=4)
{
x++;
print(x);
}
}

OUTPUT:

2
3