Page 1 of 1

Create Random numbers without doubles

PostPosted: Thu Jan 22, 2004 9:51 am
by cipolla
Hi all,

i needed to create an array of random numbers, lets say 100 numbers from 1 to 1000. If i use the random command i would get double numbers so i have to check if a number was generated before.

I wrote a small code as a subroutine to handle that. and of course i had so much fun to play with that i made a small demo pub.

If someone is interested it could be loaded here:

http://www.empics24.de/randomarray.pub

No additional graphics or plugins needed. It comes with an amazing sound system :-)

There is also a funny lotto demo with some more tricks and code inside.

I placed a lot of declarations inside the code, so it could be usefull for newbees and how knows maybe there is a trick here and there for the old stagers.

If someone has ideas for optimizing some code or find a bug it would be nice to post it.

BTW: Did you find the hidden (cheat) click?

Have fun

Greetings
Klaus

Create Random numbers without doubles

PostPosted: Thu Jan 22, 2004 10:56 am
by domino27
Excellent job Cipolla...  (much better than my efforts.. see Anagram Post)... I`m sure I`ll learn quite a bit from this.. even the hidden code perhaps :-)

Create Random numbers without doubles

PostPosted: Fri Jan 23, 2004 2:39 am
by cipolla
hmmm,

my topic should have been in another area. i wanted to post it in Sample Pubs.

i could swear i pushed the new topic button there.

greetings
klaus