View Single Post
  #8  
Old 06-04-2010, 01:46 AM
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 DustyPorViva View Post
temp.fishtype[int(random(0, temp.fishtype.size())+.5)]
Pretty sure that would eventually lead to attempting to access an out-of-bounds element in the array. For whatever technical reason, random(a, b), should/will never return the value of b. So we can safely use int(random(0, arraysize)) to retrieve any member of an array since int will round it downward.
__________________
Quote:
Reply With Quote