Darwinbots Forum

Bots and Simulations => DNA - General => Topic started by: Boris of Quirm on November 25, 2005, 05:41:58 PM

Title: RND Question
Post by: Boris of Quirm on November 25, 2005, 05:41:58 PM
Sorry to sound a thickie, but can someone confirm the following:-

If I use 3 RND, I should expect a result of 1, 2 or 3.
A decimal isn't returned, nor is 0.

The reason I ask is because some languages can include 0 as an option.
Title: RND Question
Post by: Boris of Quirm on November 25, 2005, 05:54:48 PM
Don't worry problem solved.

An integer is returned and the value can include 0.
So 3 RND will produce 0, 1, 2 and 3.
Title: RND Question
Post by: Numsgil on November 25, 2005, 05:56:50 PM
I believe value rnd will produce a value in the interval [0, value]

This may also work for negative values, but I haven't tried it yet.