Rnd()?

Thalassicus

Bytes and Nibblers
Joined
Nov 9, 2005
Messages
11,057
Location
Texas
What's the python function for a random number? I've been searching through the documentation on python.org without locating it, and tried rnd() and random().
 
The following sets iRnd to a random number from 1-100 (or from 0-99, dont know if its ordinal or not). The "Bob" is some log name. Don't really know whats thats for so I always just use "Bob".

Code:
iRnd = CyGame().getSorenRandNum(100, "Bob")
 
the python default commands are:

random(), give a number between 0 and 1 (never 1)
randrange(start, stop, step), give a number between start and stop (never stop)

But I don't know if civ4 use these commands, since they are in module random. So try it!

For more info, go on idle and select (in menu) help->python docs (or press f1)
Than search random
 
Top Bottom