Random numbers

General discussion for players of Oolite.

Moderators: winston, another_commander

Post Reply
User avatar
Commander McLane
---- E L I T E ----
---- E L I T E ----
Posts: 9520
Joined: Thu Dec 14, 2006 9:08 am
Location: a Hacker Outpost in a moderately remote area
Contact:

Random numbers

Post by Commander McLane »

Are there alternative methods to create random numbers in a script?

I want to pick a random system in a galaxy. As there are 256 systems in each galaxy a d100_number won't do.

Is there a d256_number as well? Or which other methods could be used to pick one system out of all available systems?
User avatar
JensAyton
Grand Admiral Emeritus
Grand Admiral Emeritus
Posts: 6657
Joined: Sat Apr 02, 2005 2:43 pm
Location: Sweden
Contact:

Post by JensAyton »

Doesn’t look like it.

I’ve added d256_number and pseudoFixedD256_number for the next release, in the event that there is a next release.
User avatar
Commander McLane
---- E L I T E ----
---- E L I T E ----
Posts: 9520
Joined: Thu Dec 14, 2006 9:08 am
Location: a Hacker Outpost in a moderately remote area
Contact:

Post by Commander McLane »

Thanks, Ahruman.

For now I've found a sort of work-halfway-around by adding two d100_numbers. That gives a random choice of 200 planets, even if the chances are not equal.
Post Reply