in reply to Re:**3 a different tack: "Countdown" (golf)
in thread "Countdown" (golf)
So, a tested version of your code comes in at 69 chars....perl -le '$_ = "\n"; print /^$/' 1
Update: The following code illustrates the issue a bit better...# 1 2 3 4 5 6 #23456789012345678901234567890123456789012345678901234567890123456789 map{$n=$o=$_;for$c(@_){$n+=s/$c//}/^$/&&push@{$w[$n]},$o}<D>;@{pop@w}
#!/usr/bin/perl -wT use strict; my @arr = ("\n","dog\n","cat\n"); my $patternmatch = 0; my $underscorematch = 0; /^$/ && $patternmatch++ for @arr; $_ || $underscorematch++ for @arr; print "Patternmatch = $patternmatch\n"; # <== prints 1 print "Underscorematch = $underscorematch\n"; # <== prints 0
-Blake
|
|---|