sol1.pl (242B) [raw]
1 #!/usr/bin/env perl 2 use strict; 3 use warnings; 4 5 open (my $fh, '<', 'input') or die "$!"; 6 7 my $n; 8 my $i = 0; 9 for my $l (<$fh>) { 10 chomp $l; 11 if (substr($l, (3 * $i) % length($l), 1) eq '#') { 12 $n++; 13 } 14 $i++; 15 } 16 print "$n\n";