User Tools

Site Tools


about_expressions

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision Both sides next revision
about_expressions [2013/12/12 21:04]
l [Functions]
about_expressions [2013/12/12 21:10]
l [Functions]
Line 37: Line 37:
 You have found a pistol! You have found a pistol!
 It's got <<​print either(1,​2,​3,​4,​5,​6)>>​ bullets. It's got <<​print either(1,​2,​3,​4,​5,​6)>>​ bullets.
 +</​code>​
 +
 +You can also use either() with other macros, such as <<​[[set]]>>,​ to set variables to random values:
 +
 +<​code>​
 +<<set $playerMoxie to either(2, 4, 6)>>
 +<<set $playerAttire to either("​green",​ "​black",​ "​rainbow"​)>>​
 +You have <<​print $playerMoxie>>​ moxie points, and <<​print $playerAttire>>​ armour.
 </​code>​ </​code>​
  
 For a list of the most useful functions, see the [[function]] article. For a list of the most useful functions, see the [[function]] article.
  
about_expressions.txt ยท Last modified: 2017/10/09 20:39 (external edit)