vary n variance &optional state [Function]

Returns a random value that varies from n by variance percent. If variance is 0 then no variance occurs. If variance is 1 (ie 100%) the value returned lies between 0 and 2n.

Example:

? (vary .5 0)
.5

? (loop for i below 20 collect (vary i (interpl i 0 1 15 0)))
(0.0 0.48 2.82 5.08 4.86 5.94 7.73 7.27 7.93 12.11  
 18.59 10.28 14.22 3.83 14.26 15.0 16.0 17.0 18.0 19.0)

See Also:

between, drunk, pick, pickl


Last Modified: 5-Mar-1998