Choose

From NexusWiki
Revision as of 03:23, 12 June 2009 by Arparso (Talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

Choose (weight1, command1, weight2, command2, …., weightN, commandN);

It chooses randomly from N pieces of possibilities, according to the weight (’weight1’ .. ’weightN’). If every weight is 0, than it doesn’t do anything; implicitly, if only one weight is bigger than 0, than it will choose that line – with this you can virtually implement the SWITCH-CASE command that is known from C. ’Command’ here and everywhere else can contain several script commands that are separated by semicolons.