User Tools

Site Tools


crpl:docs:else

<- CRPL reference <- Flow Control

else

ArgumentsResultNotation

Description

When the if statement evaluates to False, then the statements following the else, up to the endif, are executed instead.

Examples

# Pick a random integer between 0(inclusive) and 100(exclusive).
# If the random number is less than 95 emit 10 Creeper,
# otherwise emit 100 Creeper.
0 100 RandInt 95 lt if 
		CurrentCoords 10 AddCreeper 
	else 
		CurrentCoords 100 AddCreeper 
	endif
crpl/docs/else.txt · Last modified: 2015/03/19 23:28 by Karsten75