G
Graeme
I am writing a simple windows matching game with cards and pictures
(ie "concentration"). In order to write something like this, I need
to be able to give each "card" a random position in the assortment,
and I need the assortment to be different each time the program is
run. (I think) This means I need to be able to generate as many
random numbers at once as the number of "cards" in the assortment when
the program is first loaded. I have tried seeding the rand() function
with GetTickCount() as well as time():
srand(GetTickCount());
but the loop that generates the numbers is executed too fast, and I
end up getting 36 identical numbers. Is there a way to generate many
random numbers at once, and have them be different each time I run the
program? Possibly using recursion in the rand or srand functions?
Any help is greatly appreciated!
Thanks
Graeme
(ie "concentration"). In order to write something like this, I need
to be able to give each "card" a random position in the assortment,
and I need the assortment to be different each time the program is
run. (I think) This means I need to be able to generate as many
random numbers at once as the number of "cards" in the assortment when
the program is first loaded. I have tried seeding the rand() function
with GetTickCount() as well as time():
srand(GetTickCount());
but the loop that generates the numbers is executed too fast, and I
end up getting 36 identical numbers. Is there a way to generate many
random numbers at once, and have them be different each time I run the
program? Possibly using recursion in the rand or srand functions?
Any help is greatly appreciated!
Thanks
Graeme