Rock-paper-scissors: Difference between revisions

no edit summary
No edit summary
No edit summary
Line 2,752:
my $ch;
my ( $prob, $rand ) = ( 0, rand );
$ch = ( first { $rand <= ( $prob += ( $human_choice{ $_ } / $turns ) ) } @keys )
if $turns > 0;
$ch //= $keys[0];
21

edits