in reply to Re^3: Runs and Sequences
in thread Runs and Sequences
Thought the implementation didn't really work out.my $last; my $count; my $toss = headsortails(); # returns either 0 or 1 (H or T) if ($toss == $last) { $count++; } else { $last = $toss; $c{$count}++; } if you had a bunch of variables like $c1, $c2
|
|---|