Difference between revisions of "Rnd"

From WikiManual
Jump to: navigation, search
 
Line 19: Line 19:
 
'''Uses in Evolution'''
 
'''Uses in Evolution'''
 
Several bots have been observed using the rnd operator in evolution sims. Presumably this allows the bot access to more memory locations and therefore a wider range of behaviors with little additional code.
 
Several bots have been observed using the rnd operator in evolution sims. Presumably this allows the bot access to more memory locations and therefore a wider range of behaviors with little additional code.
 +
 +
===Operators===
 +
* [[store]]
 +
* [[rnd]]
 +
* [[add]]
 +
* [[sub]]
 +
* [[mult]]
 +
* [[div]]
 +
* [[inc/dec]]

Revision as of 20:09, 17 September 2005

Overview The operator generates a random number.

Use State the maximal desired number. The operator will generate a random number between 0 and the specified maximal desired number. The random number is placed on the top of the stack.

Example:

10 rnd 50 store

This stores a random number from 0 -10 in memory location 50.

This is most often used in combat sims to:

  • generate different actions per cycle (1 rnd)
  • randomize turning radius
  • randomize number stored into .tie

Uses in Evolution Several bots have been observed using the rnd operator in evolution sims. Presumably this allows the bot access to more memory locations and therefore a wider range of behaviors with little additional code.

Operators