- or download this
#!/usr/bin/perl -w
use strict;
...
}
}
print "You lost! Pattern was: $pattern\n";
- or download this
my $right_place =()= "$pattern$guess"=~/(.)(?=...\1)/g;
- or download this
$right_color += $pattern =~ s/([$guess])/$1/g;
$right_color -= $right_place;