EASy68K  
It is currently Sun Nov 17, 2019 5:58 am

All times are UTC




Post new topic Reply to topic  [ 8 posts ] 
Author Message
PostPosted: Tue Dec 05, 2006 9:42 pm 
Offline

Joined: Sun Dec 03, 2006 10:08 pm
Posts: 3
Can anyone give me any idea about how to write a M68000-based Lottery Luck-Dip Machine program?
It should generate 6 different random numbers from 1 to 49 on LSDs by pressing # button on the telephone keypad of application board.
Thanks a lot.


Top
 Profile  
 
 Post subject:
PostPosted: Thu Dec 07, 2006 2:35 am 
Offline

Joined: Mon Dec 27, 2004 11:40 pm
Posts: 318
Guess my email answer to you wasn't good enough. 8^)=

Lee.


Top
 Profile  
 
 Post subject:
PostPosted: Thu Dec 07, 2006 6:40 am 
Offline

Joined: Sun Dec 03, 2006 10:08 pm
Posts: 3
lee wrote:
Guess my email answer to you wasn't good enough. 8^)=

Lee.


Did you send me an e-mail? I did not receive it:( Can you please send it again to the address below? Many thanks
selimhuseyin@hotmail.com


Top
 Profile  
 
 Post subject:
PostPosted: Thu Dec 07, 2006 8:08 am 
Offline

Joined: Mon Dec 27, 2004 11:40 pm
Posts: 318
Ok. Sent again 08:08 GMT 07/12/2006 to selimhuseyin@hotmail.com

Lee.


Top
 Profile  
 
 Post subject:
PostPosted: Thu Dec 07, 2006 7:26 pm 
Offline

Joined: Sun Dec 03, 2006 10:08 pm
Posts: 3
lee wrote:
Ok. Sent again 08:08 GMT 07/12/2006 to selimhuseyin@hotmail.com

Lee.


I know it is annoying but again I haven't received your e-mail:((
I think there is a problem on hotmail, I don't know.
I'll give you another e-mail address, selimmh@yahoo.com
Would you last time try to send it to this address and I promise if it doesn't work, I won't disturb you again:)
thanks

Selim


Top
 Profile  
 
 Post subject:
PostPosted: Thu Dec 07, 2006 9:54 pm 
Offline

Joined: Mon Dec 27, 2004 11:40 pm
Posts: 318
Sent again. Twice. Both copies arrived at my other email address so you should have at least one.

Lee.


Top
 Profile  
 
 Post subject:
PostPosted: Sat Dec 30, 2006 8:09 am 
Offline

Joined: Sat Dec 30, 2006 8:01 am
Posts: 1
pls send for me as well

python_1@hotmail.com


Top
 Profile  
 
 Post subject:
PostPosted: Sat Dec 30, 2006 3:43 pm 
Offline

Joined: Mon Dec 27, 2004 11:40 pm
Posts: 318
I'll post it here.

There is some info on generating random numbers on the 68k here ..

http://www.themotionstore.com/leeedavis ... index.html

.. the second version is better, and you can follow links to the 6502 pages that explain how it works.

Selecting from 1 to 49 using this you'd need to mask the result to six bits and discard any result outside the 1 to 49 (or 0 to 48 - see next bit) range.

One method for selecting some unique numbers from a list is to do this ..

Set up in memory the list of n numbers to select from, these will be indexed from 0, the first in the list, to n-1, the last in the list.

Then
Code:
Make m = n
Repeat
  Decrement m
  Chose a random number, r, in the range 0 to m
  Swap element r with element m in the list
Until x numbers done

The x numbers you have selected will now be the last x numbers in the list.

If x = n-1 the whole list will be shuffled like a pack of cards.

There is no need to reset the list order to select another x numbers.

Lee.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 8 posts ] 

All times are UTC


Who is online

Users browsing this forum: No registered users and 5 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB® Forum Software © phpBB Group