Thread: array.random()
View Single Post
  #6  
Old 03-21-2011, 03:38 PM
fowlplay4 fowlplay4 is offline
team canada
fowlplay4's Avatar
Join Date: Jul 2004
Location: Canada
Posts: 5,200
fowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond repute
Quote:
Originally Posted by MrOmega View Post
I thought random could never reach the limit so the last parameter would never be selected?
Arrays start at 0, so the last element is always Array.size() - 1. Which is why you can just pass the size to the maximum parameter in random.
__________________
Quote:
Reply With Quote