Difference between revisions of "Rnd"

From WikiManual
Jump to: navigation, search
m
 
Line 1: Line 1:
 +
===[[Operators]]:===
 +
{{Basic Commands}}
 +
 
'''Overview'''
 
'''Overview'''
  
Line 22: Line 25:
  
 
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]]
 

Latest revision as of 22:46, 23 December 2005

Operators:

Basic Commands:

add & sub
mult & div
rnd
*
mod
sgn
abs

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.