Search the web
Sign In
New User? Sign Up
blassic · Blassic, the Classic Basic.
? Already a member? Sign in to Yahoo!

Yahoo! Groups Tips

Did you know...
Real people. Real stories. See how Yahoo! Groups impacts members worldwide.

Best of Y! Groups

   Check them out and nominate your group.
Having problems with message search? Fill out this form to ensure your group is one of the first to be migrated to the new message search system.

Messages

  Messages Help
Advanced
Random number question?   Message List  
Reply | Forward Message #52 of 233 |
Re: Random number question?

Hello.

> 1 CLEAR
> 5 CLS : PRINT "Random Number test"
> 10 FOR x = 1 TO 10
> 20 RANDOMIZE TIMER
> 30 i = INT(RND * 35) + 1
> 40 PRINT i
> 45 NEXT x
>
> Blassic users should change Line 20 to read:
>
> 20 RANDOMIZE

That is not the way randomize must be used. You must call randomize
once, at the beginnig of the program, and then use only RND.

RANDMOIZE initializes the seudo-random number generator, if you use
the same number you obtain the same sequence, and if you call timer
two
times in a short space of time it can give the same number. Using
RANDOMIZE without parameter in Blassic is the same thing, it uses
the computer clock internally.

Swapping the contents of lines 20 and 30 will give a more accurate
test.

Regards.





Tue Jun 29, 2004 8:55 pm

not_found_bl...
Offline Offline
Send Email Send Email

Forward
Message #52 of 233 |
Expand Messages Author Sort by Date

How does HLA's random number generator differ from traditional BASIC's version? I've long based much of my adventure gaming on random numbers, especially...
Paul
dunric
Offline Send Email
Jun 21, 2004
6:26 am

Hello. ... That is not the way randomize must be used. You must call randomize once, at the beginnig of the program, and then use only RND. RANDMOIZE...
not_found_blassic
not_found_bl...
Offline Send Email
Jun 29, 2004
8:55 pm
Advanced

Copyright © 2009 Yahoo! Inc. All rights reserved.
Privacy Policy - Terms of Service - Guidelines - Help