rand(0 .. $total) #### rand($total+1) #### rand(0+@aob) #### while (1) { my $xda = int rand( 0+@aob ); if ( $aob[$xda][ $y - 1 ] ne "") { $aob[$x][$y] = $z + $aob[$xda][ $y - 1 ]; last; } }