Raised This Month: $ Target: $400
 0% 

Reading random line.


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
XxAvalanchexX
Veteran Member
Join Date: Oct 2004
Location: abort73.com
Old 10-05-2006 , 16:48   Re: Reading random line.
Reply With Quote #6

Quote:
Originally Posted by stigma View Post
Why is it random(0,3) - When there's 4 in the "const"
Because array indexes start at 0. So if you have 4 elements in an array, valid indexes are: 0, 1, 2, and 3. If you used random_num(0,4) and 4 came up, it would be out of bounds, because you are trying to reference the 5th element which doesn't exist.
__________________
No longer around. Thanks your support, everyone! As always:
THIS ONES FOR YOU
3000 PTS
XxAvalanchexX is offline
 



Posting 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 -4. The time now is 04:56.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode