This shows you the differences between two versions of the page.
| Next revision | Previous revision | ||
| crpl:docs:else [2013/01/14 19:05] – created virgilw | crpl:docs:else [2025/02/14 14:57] (current) – external edit 127.0.0.1 | ||
|---|---|---|---|
| Line 1: | Line 1: | ||
| - | TODO | + | <- [[crpl: |
| + | ===== else ===== | ||
| + | |||
| + | ^Arguments^Result^Notation^ | ||
| + | | | |'' | ||
| + | |||
| + | |||
| + | === 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 | ||
| + | </ | ||