Conditionals - o2bblockbusting/cs421_project GitHub Wiki
The 'I' and 'E' control characters can be used to create if-else statements used for conditional logic. All conditionals start with 'I', followed by an expression that evaluates to a boolean and determines if the inner block will run or not. The block starts after the boolean expression with a 'Y', has many statements inside, and is then ended with a 'Z'. If an 'E' is place right after the 'Z' of an if block, it will act as an else and run the code inside its block if the if conditional fails. The else can also function as an else-if provided that an 'I' and a condition are placed directly after the 'E'.
Examples:
I5+2=10Y
P("Math isn't real\n")
Z
I15%5=0Y
P("Divisible\n")
ZEY
P("Not divisible\n")
Z
I20%3=0Y
P("Divisible by 3\n")
ZEI20%2=0Y
P("Divisible by 2\n")
ZEY
P("Not divisible\n")
Z