Consider this: random(5) returns one of 1, 2, 3, 4, 5 random(4) returns one of 1, 2, 3, 4 random(3) returns one of 1, 2, 3 random(2) returns one of 1, 2 random(1) returns one of 1
And adding the one you want,
random(0) returns one of 0
That looks like an anomaly to me.
Maybe, you want this:
random0up(5) returns one of 0, 1, 2, 3, 4, 5 random0up(4) returns one of 0, 1, 2, 3, 4 random0up(3) returns one of 0, 1, 2, 3 random0up(2) returns one of 0, 1, 2 random0up(1) returns one of 0, 1 random0up(0) returns one of 0
In that case, 0 fits right in.
You can use this function, if this is the behavior you want:
function random0up n return random(n+1)-1 end random0up
I hope this helps.
Dar Scott
_______________________________________________ metacard mailing list [EMAIL PROTECTED] http://lists.runrev.com/mailman/listinfo/metacard
