The McLeodGaming forums were permanently closed on April 30th, 2020. You are currently viewing a read-only archive.
View unanswered posts | View active topics It is currently Fri May 15, 2020 9:26 am



 [ 6 posts ] 
Visual Basic .NET Random # Loop 
Author Message
User avatar

Joined: Mon Aug 18, 2008 7:58 pm
Posts: 1093
Gender: Male
It's all in the name.

I just need a loop to make a few random numbers. Til Int(PlayerX) = 8 on my map.

_________________
ImageImage

Image
Current Demo: None! Go check it out!


Thu Jun 16, 2011 3:31 pm
User avatar

Joined: Sat Aug 16, 2008 8:38 am
Posts: 6670
Location: Darkest Antartica
Country: Pakistan (pk)
Gender: Male
Skype: Thaiberium
Currently Playing: The Game
I'm not sure how VB does it but if it were me it'd look something like.

Code:
for(int i=0;i<8;i++){ foo = Rand(); }

_________________
Image


Thu Jun 16, 2011 10:10 pm
User avatar

Joined: Mon Aug 18, 2008 7:58 pm
Posts: 1093
Gender: Male
SS wrote:
I'm not sure how VB does it but if it were me it'd look something like.

Code:
for(int i=0;i<8;i++){ foo = Rand(); }



:ko:

Ok.. lemme think..

For Int = 0 To I<B
Foo = Rand()
Next Int

ENGLISH:
Int and I and B help run the loop while Foo (Random # Integer) gets a random #?

_________________
ImageImage

Image
Current Demo: None! Go check it out!


Sat Jun 18, 2011 6:00 pm
User avatar

Joined: Fri Jan 02, 2009 6:02 pm
Posts: 7283
Location: Australia
Country: Australia (au)
Gender: Male
MGN Username: Tid
Currently Playing: Deep™ The™ Game™
That's an 8, not a B. B wouldn't make any sense.

_________________
ImageImageImageImage
Ask me anything!!!
Special thanks to Steven for my beautiful Deep avatar! <3


Sat Jun 18, 2011 7:21 pm
WWW
User avatar

Joined: Mon Aug 18, 2008 7:58 pm
Posts: 1093
Gender: Male
Tid wrote:
That's an 8, not a B. B wouldn't make any sense.


Ah, good point!

_________________
ImageImage

Image
Current Demo: None! Go check it out!


Sat Jun 18, 2011 7:33 pm
User avatar

Joined: Sat Aug 16, 2008 8:38 am
Posts: 6670
Location: Darkest Antartica
Country: Pakistan (pk)
Gender: Male
Skype: Thaiberium
Currently Playing: The Game
I'm surprised you didn't think of a for loop.

_________________
Image


Sun Jun 19, 2011 3:16 am
Display posts from previous:  Sort by  
 [ 6 posts ] 

Who is online

Users browsing this forum: No registered users and 1 guest


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

cron
Powered by phpBB® Forum Software © phpBB Group
Designed by ST Software for PTF.