Zelaron Gaming Forum  
Stats Arcade Portal Forum FAQ Community Calendar Today's Posts Search
Go Back   Zelaron Gaming Forum > The Zelaron Nexus > Science and Art > Tech Help

 
 
Thread Tools Display Modes

 
Random
Reply
Posted 2004-08-11, 04:09 AM
Alright im just hoping someone here knows Visual Basic, anyways.
I know how to generate a random number 1-anything I want. But I forget how to create a random number anything-anything. I.E. 45-100

Int(Rnd * 10)

That is the code to generate a number 1-10. And no

Int(Rnd 45 * 100)

Doesnt work..


Are you suggesting coconuts migrate?
Old
Profile PM WWW Search
Arbitus is neither ape nor machine; has so far settled for the in-betweenArbitus is neither ape nor machine; has so far settled for the in-between
 
 
Arbitus
 



 
Reply
Posted 2004-08-11, 05:35 AM in reply to Arbitus's post "Random"
blah = int(rnd(1)*x)+y

Y is the minimum number, and X is the maximum number minus Y.

===

So, for 45-100, the code is:

blah = int(rnd(1)*55)+45

You're basically just generating a number from 0 to 55, and adding 45 to it... make sure to RANDOMIZE TIMER before it though..
Old
Profile PM WWW Search
BlueCube enjoys the static noises of ten television sets simultaneously tuned to 412.84 MHzBlueCube enjoys the static noises of ten television sets simultaneously tuned to 412.84 MHz
 
 
BlueCube
 



 
Reply
Posted 2004-08-11, 03:45 PM in reply to BlueCube's post starting "blah = int(rnd(1)*x)+y Y is the..."
Thanks dude.


Are you suggesting coconuts migrate?
Old
Profile PM WWW Search
Arbitus is neither ape nor machine; has so far settled for the in-betweenArbitus is neither ape nor machine; has so far settled for the in-between
 
 
Arbitus
 
 

Bookmarks

« Previous Thread | Next Thread »

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 

Posting Rules [Forum Rules]
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -6. The time now is 05:51 PM.
'Synthesis 2' vBulletin 3.x styles and 'x79' derivative
by WetWired the Unbound and Chruser
Copyright ©2002-2008 zelaron.com
Powered by vBulletin® Version 3.8.2
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
This site is best seen with your eyes open.