mmm.. bacon..
#!perl -lp0
@e{@a=split}=1;$o=join$\,keys%e;1/!eval'grep/ /&$o=~s#^(\Q$\'\E)$((.|
)*
)(\Q$`\E)$#$4$2$1#m,/.*/g;'x@a;$_=$o
|
passes on 1.8 for me, anyway. Of course, this does not assure that the solution is valid :)
#!perl -lp0
@e{/\S+/g}=1;$o=join"
",keys%e;1/!eval'grep/(\S+) (\S+)/&$o=~s/^(\Q$2\E)$((.|
)*)^(\Q$1\E)$/$4$2$1/m,/.*/g;'x99;$_=$o
|
Although a baconiser does sound like a good idea.
#!perl -lp0
@e{@a=split}=1;$o=join$\,keys%e;1/!eval'grep/(\S+) (\S+)/&$o=~s/^(\Q$2\E)$((.|
)*)^(\Q$1\E)$/$4$2$1/m,/.*/g;'x@a;$_=$o
|
hurrah! I join the ranks of those whose score is less than twice Ton's!
#!perl -lp0
@e{/\S+/g}=1;$o=join"
",keys%e;$_=eval'grep/(\S+) (\S+)/&$o=~s/^(\Q$2\E)$((.|
)*)^(\Q$1\E)$/$4$2$1/m,/.*/g;'x99?die:$o
|
curse you referees, and your insane love of non-hard-coded limits! p.s. I am not convinced that 'baconise' is a word.
#!perl -lp0
@e{/\S+/g}=1;$o=join$\,@l=keys%e;1/!eval'grep/(\S+) (\S+)/&$o=~s/^(\Q$2\E)$((.|
)*)^(\Q$1\E)$/$4$2$1/m,/.*/g;'x@l;$_=$o
|
I have another solution in the pipeline, but those damn metacharacters are a right royal pain!!
#!perl -ln0
@e{/\S+/g}=1;@a=keys%e;eval'$s=0;for$i(0..@a){for$j($i+1..@a){$s=@a[$i,$j]=@a[$j,$i]if/^\Q$a[$j] $a[$i]
/m}}'x@a;$s?die:print for@a
|
ref: my 140 passed 1.5 on my machine, and so does this. If this fails, can you let me know where?
#!perl -ln0
@e{/\S+/g}=1;@a=keys%e;eval'$s=0;for$i(0..@a){for$j($i+1..@a){$s=@a[$i,$j]=@a[$j,$i]if/^\Q$a[$j] $a[$i]\E$/m}}'x9;$s?die:print for@a
|
sorry 'bout that.
#!perl -ln0
@e{/\S+/g}=1;@a=keys%e;eval'$s=0;for$i(0..@a){for$j($i+1..@a){$s=@a[$i,$j]=@a[$j,$i]if/^\Q$a[$j] $a[$i]\E$/m}}'x@a;$s?die:print for@a
|
I don't remember changing anything, but this is two shorter
#!perl -ln0
@e{/\S+/g}=1;@a=keys%e;eval'$s=0;for$i(0..@a){for$j($i+1..@a){map{$s=@a[$i,$j]=@a[$j,$i]if"@a[$j,$i]"eq$_}/.*/g}}'x9;$s?die:print for@a
|
86! Does not compute! Bzzzt! Does not compute!
#!perl -p0
@e{/\S+/g}=1;@a=keys%e;eval'$s=0;for$i(0..@a){for$j($i+1..@a){$s=@a[$i,$j]=($1,$2)if/^($a[$j]) ($a[$i])$/m}};'x9;$s&¨$"="
";$_="@a
"
|
hopefully this will get me out of the sand trap.
#!perl -ln0
@e{/\S+/g}=1;@a=keys%e;eval'$s=0;for$i(0..@a){for$j($i+1..@a){$s=@a[$i,$j]=@a[$j,$i]if grep"@a[$j,$i]"eq$_,/.*/g}};'x9;$s?die:print for@a
|