Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/usr/bin/perl
- use strict;
- use warnings;
- use List::AllUtils qw(indexes pairwise);
- my @Code = map { chomp; $_ } <>;
- my @Blocks = indexes { $_ =~ m#inp# } @Code;
- my @Fixed = @Code[0 .. 17];
- foreach my $bi (@Blocks) {
- foreach my $l (0 .. 17) {
- if ($Code[$bi + $l] ne $Fixed[$l]) {
- $Fixed[$l] = join( ' ', pairwise { ($a eq $b) ? $a : '???' }
- @{[split(/ /, $Fixed[$l])]},
- @{[split(/ /, $Code[$bi + $l])]});
- }
- }
- }
- print join( "\n", @Fixed );
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement