Nice and easy solution IO. Since --OutpostMir-- mentioned he was a beginner a bit of detail might help him understand your answer.
An array can take a non-integer subscript. It just uses the integer part. So you don't need to make it an integer. if you want to make it an integer for other reasons, you could use int() to make it an integer.
Also the rand @array is taking @array in a scalar context. An array in scalar context returns the number of elements. So that rand @array calls rand with the number of element.
In this case, replace $array and @array with the actual name of your array.
=Blue
...you might be eaten by a grue... |