Difference between revisions of "Choose"

From NexusWiki
Jump to: navigation, search
(Created page with '<big>'''Choose''' ''(weight1, command1, weight2, command2, …., weightN, commandN);''</big> :It chooses randomly from N pieces of possibilities, according to the weight (’wei...')
(No difference)

Revision as of 03:23, 12 June 2009

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.