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
In reply to Re^4: Runs and Sequences
by twofish
in thread Runs and Sequences
by twofish
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |