sub flip_coins { my ($low_end, $range) = @_; my $result = 0; $result += int(rand 2) for (2..$range); $low_end + $result; }