Difference between revisions of "Rnd"

From WikiManual
Jump to: navigation, search
 
m
 
(2 intermediate revisions by one other user not shown)
Line 1: Line 1:
 +
===[[Operators]]:===
 +
{{Basic Commands}}
 +
 
'''Overview'''
 
'''Overview'''
 +
 
The operator generates a random number.  
 
The operator generates a random number.  
  
 
'''Use'''
 
'''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.  
 
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.  
  
Line 18: Line 23:
  
 
'''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.

Latest revision as of 21: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.