Ari Brown
6/26/2007 12:06:00 AM
On Jun 25, 2007, at 7:43 PM, dblack@wobblini.net wrote:
<snip>
>
> Let's say lines has 10 elements. rand(11) gives you a number between
> 0 and 10, inclusive. Adding 1 gives you a number between 1 and 11.
> Since the last index of lines is 9, that means that if you get 10 or
> 11, you're indexing nil (lines[10] or lines[11]).
>
> So... you probably want lines[rand(lines.size)].
Ahh! Okay! Thanks!
> (You probably also want to do something to update @valie :-)
Don't worry, I do. I didn't want to show my code for fear of
violating something.
~ Ari
English is like a pseudo-random number generator - there are a
bajillion rules to it, but nobody cares.