Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

random number generator

Status
Not open for further replies.

funow48103

Technical User
Apr 2, 2003
1
US
hi all
i'm new to this forum :)
i'm trying to make a dice game ( 2 die), and i'm stuck in making a counter for it.
i suggested this to my instructor, and he did not accpet it, he told me look fo rsomethink else.

here what i did:

"have a synchronous counter without reset, which will count indefnitely.
when the user push the roll button it will copy the number to a register, and display the number generated, while the counter still counting non stop. the clock for the counter should be faster than the speed of the player push the roll button, and he won't be able to predict the next coming number and cheat."
he did no accept this one, and he asked me to look for something else!

anybody any sugestion?

thank you
:)





 
Hi !

Just one suggestion :

link your counter to a Look-Up-Table which contains a table of random number, and the value will be more unpredictable

For example :

Your counter counts 0-1-2-3-0-1-2-3....
Your table is 2-0-3-1
The output generated is 2-0-3-1-2-0-3-1....

So your counter doesn't count in natural order, and you can't expect a big number just after a small one

Good luck !
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top