I don't code in perl at all, it's a bit like Latin, a long dead language used by academics
But 0 to 3 is a four element array in javascript.
Math.floor will round downwards to the nearest integer so 40 could be used but the random number can be in the range 0 to 1, so if it does return 1 the value would be 40 and therefore out of range for the array.
I'll put the code in a page and test for getting full ranges later.
__________________
Chris. ->> Links are advertising NOT optimising!! <<-
A foolish consistency is the hobgoblin of little minds
Thought for today:- I SEO the only industry where all the cowboys are Indians?
|