Shop
OBEX
P1 Docs
P2 Docs
Learn
Events
another random question — Parallax Forums
toggle menu
Categories
Discussions
Sign In
·
Register
Sign In
·
Register
Categories
Discussions
Sign In
·
Register
×
Home
›
BASIC Stamp
another random question
ERM
Posts:
34
2006-03-31 07:24
edited 2006-03-31 09:07
in
BASIC Stamp
How do I randomly select numbers from 1 through 20. Spent hours trying different methods. Any thoughts? Please.
Thanks,
Tony
Comments
Adrian Schneider
Posts:
92
2006-03-31 09:07
edited 2006-03-31 09:07
what about something like (didn't try it, just an idea):
X VAR WORD
X = 12345 'random seed value
RANDOM X
X = X // 20 + 1 'x mod 20 gives 0..19, that +1 gives 1..20
regards
adrian
Sign In
or
Register
to comment.
Comments
X VAR WORD
X = 12345 'random seed value
RANDOM X
X = X // 20 + 1 'x mod 20 gives 0..19, that +1 gives 1..20
regards
adrian