I could be wrong but I think the issue is here:
Code:
// $numnew = new number
// $curnum = current number
// $max = upper limit (5 in this case)
if (rand(1,2) == 1) {
$numnew = ($curnum + rand(-1,1));
}
if ($numnew == 0) {
$numnew = $max;
}
if ($numnew > $max) {
$numnew = 1;
}
I think maybe setting it like this:
Code:
if (rand(0,4) == 1) {
That might rectify the issue.