random

Syntax: %random(i,j)

return a random integer >= I and <= J. If J is omitted, then I specifies the maximum value, and 0 is used as the minimum value.

Examples:

#VAR dirList {n|e|s|w|ne|se|sw|nw|u|d}

#20 {%item(@dirList,%random(5,8))}

sends 20 randomized diagonal directions to the mud.

#VAR dType 12

#VAR dNum 6

#VAR dOffset 22

#VAR sum @dOffset

#LOOP @dNUM {#ADD sum %random(1,@dType)}

#SAY @sum

displays the sum of 6 rolls with a 12-sided die plus an offset of 22

Note: The 'short version' of this example is

#SAY %dice(6d12+22)



Contents %quote %read