NAME

spray_init - initialize a random integer spray can


SYNOPSIS

spray_init(spray_table_number, spray_table_size, random_seed)


DESCRIPTION

Call spray_init from a script to set up a random integer spray can. The idea is that you create a table of integers and then use get_spray to retrieve them. The table contains integers from zero to one less than the table size. (Another way to look at it is that each element takes its index as its value.) Repeatedly calling get_spray reads the table randomly, but in such a way that no number appears twice before all the other numbers have appeared once.

spray_table_number
The numeric ID for the spray table. Note that these are distinct from the tables you create with makegen. You can have as many as 32 tables, numbered from 0 to 31.

spray_table_size
The table can have as many as 512 values.

random_seed
An integer to seed the random number generator. Note that this re-seeds the same random number generator used by rand, random, irand, etc.


EXAMPLES

See get_spray for an example.


SEE ALSO

get_spray, srand, rand, random, irand, pickrand, pickwrand, gen20