Well, it's over, and the final results are in. About 6 beginners tried, but only one succeeded in surviving hole 1, and that person is therefore the clear winner: Dave Hoover human.pl: 276 strokes shuffle.pl: 36 strokes select.pl: 37 strokes ------------------------ total: 349 strokes
Among the experienced players, the winner is spiff (Karsten Sperling), even though there were some last minute attempts to dislodge him, especially from Autrijus Tang who went from last place to third in the last few hours. Spiff needed 131 strokes to solve the challenge and was (among) the best on every hole: Hole 1 64 strokes, Spiff Hole 2 32 strokes, Eugene van der Pijll, Spiff, Andrew Savige, Marcus Holland-Moritz, Rick Klement, Autrijus Tang Hole 3 35 strokes, Spiff, Eugene van der Pijll, Andrew Savige Final standing: Spiff 131 Marcus Holland-Moritz 133 Autrijus Tang 135 Andrew Savige 137 Eugene van der Pijll 138 Suo 138 Ian Phillipps 141 Piers Cawley 146 Rick Klement 150 Llasse 154 Andrew Savige was particularly unlucky because I recognized a problem in his solution on the last day when he was already out of time to play, and he got dropped back to his last working entry. In retrospect I made two big mistakes when setting up this challenge: 1) Doing it during this period of the year. It turns out that most people have a life, and have no time for golfing. 2) Hole 1 was too vague and too complicated. This led to endless refinements of the rules, and a lack of beginner entries. Fortunately there was some very interesting golfing on this hole, and I saw several tricks for the first time here. Particularly fun was playing "Bob". I get to see all solutions, so I can take the best elements from any of them, combine them and add my own ideas and come up with some stuff none of the players saw, having to play in isolation. In the beginning BoB did best on all holes, but in the end only kept the lead on hole 1. So, time for a hole be hole account. Hole 1, Human sort Most players decided to go for a method of encoding the length in the string in such a way that you can use "cmp" and do a normal sort with the transformed key in a sort function. There were two exceptions however: Llasse started with a regex apprach and remained true to it for the whole tournament. I however kept finding counterexamples to his attempts until finally he got one that looks fine. I thought he would be the only one to get this one working until Rick Klement came up with the same thing, correct from the first attempt on. Llasse 82 print sort{"$a$b"=~/^(.*)(\d+).*\n\1(\d+)/i&&length$2<=>length$3||lc$a cmp lc$b}<> Rick 81 print sort{($a.$b)=~/(.*)(\d+).*\n\1(\d+)/i&&length$2<=>length$3||uc$a cmp uc$b}<> (the difference is that rick used a hard newline. From here on whenever I write \n, it's really a hard newline) Even though both missed several further optimizations (using @+ and using - instead of <=>), I don't think the regexs method can be made into a winner. Suo is the only one who mangled his input lines, then did the sort and next recoverd the original values as follows: suo 69 print/(.*\n)$/for sort map{($x=lc)=~s#\d+|\n#pack'xN/a*',$&#eg;$x.$_}<> Again this entry could have been improved a bit, but not to a winner I think. Using inspiration from spiff and a few small transforms, Bob can write: BoB 65 print/.*\n$/gfor sort map{$x=$_;s#\d+|\n#9x9+$+[0].$&#eg;lc().$x}<> In suo's solution you see the pack "N/a*" which was the most normal approach to set up a string on which you can do a normal sort. The tricky thing however is that you need to put something in front so it sorts roughly like a number, because what you get from a pack N can be every valid character. Another thing many people missed (including me when judging the entries until Eugene pointed it out to me) is that applying uc/lc to the result of such a pack invalidates the solution because the pack "N" can give you letters among the four bytes it produces, and these will get converted. Here's a fairly typical example of this approach: Eugene van der Pijll 71 sub a{$_=lc pop;s#\d+#0 .pack'N/A*',$&#ge;$_}print sort{a($a)cmp a$b}<> Another way to encode the string length is to use something like A x length$&, but you have to watch out, since comparing such a thing to a normal strings with A's makes the order depend on how many A's are in the normal string, and the challenge stated that a digitstring had to sort as a special sort of single character. so it needs either something like a 0 put in front: Andrew Savige 71 sub Z{s/\d+/0 .(A x length$&).$&/eg;uc}print sort{Z($_=$a)cmp Z$_=$b}<> or (as Eugene pointed out to me), first do a lc() and only then set up the string of capital letters, but noone had a working entry based on this idea. Next people turned their attention to getting rid of that long length, and several came up with using @+ (the end offset of the match string) There were several attempts to use things like 'A'x$+[0], which on a string like 'a0'x100000 would lead to enormous long work strings (it's quadratic in memory usage), which I decided to reject. The rules state that inputfiles can be big enough to fill memory with "ample" play room left for tempory data, but this is a rather intense demand for "temporary" space. Still, it's one of these points where the rules are maybe not precise enough. Fortunately this point did not decide the contest, so I stuck to my guns. Spiff was the only one to realise that what he really wants is a fixed n-digit length in fron of the string, and that you can get this with an addition if you can cap the maximum string-length. His first attempt was: spiff 65 sub f{$_=pop;s;\d+;~0/3+$+[0].$&;eg;lc}print+sort{f($a)cmp+f$b}<> (rejected) The problem here is that on a 64-bit perl 5.6.1 ~0/3 is so big that the addition will loose precission and you are unable to distinguish "short" digit strings. However, he quickly recovered with sub f{$_=pop;s;\d+;9 x9+$+[0].$&;eg;lc}print+sort{f($a)cmp+f$b}<> soon followed by sub f{$_=pop;s|\d+|9x9+$+[0].$&|eg;lc}print+sort{f($a)cmp+f$b}<> Which won him the tournament. Several of the players would however directly recognize that this is not optimal. All of them had been thinking about how to get the argument to the sub into $_ and several realized that $_=pop is not optimal. The first one to see that was Autrijus Tang in one of her rejected entries: Autrijus Tang 73 sub _{s|\d+|0 x(2**07-length$&).$&|eg;lc}print+sort{_($_=$a)cmp _$_=$b}<> Here you see that assigning BEFORE the call and ignoring the sub argument gains one byte. Andrew Savige also recognized this point. However, Marcus Holland-Moritz was the one who did it best: Marcus Holland-Moritz 65 print sort{s!\d+!pack'AN/A*',0,$&!egfor$"=uc$a,$;=uc$b;$"cmp$;}<> which netted him the second place in the tournament. If only he had hit on spiff's addition trick, he could have been a winner: Bob 61 print sort{s!\d+!1e9+$+[0].$&!egfor$"=uc$a,$;=uc$b;$"cmp$;}<> And then one of the most interesting entries of the tornament arrived. Autrijus Tang came up with this conceptual blockbuster: Autrijus Tang 62 -pa s!|\d+!pack'AN/Z*',0,$&!eg;$;{lc,}.="@F\n"}for(@;{sort%;}){ (rejected) Which is utterly brilliant in so many ways. The use of sort on a hash, indexing the hash with this result, making sure values cannot be keys, using -a to save a copy... I was so stunned, I almost missed that it's wrong, because it collapses consecutive spaces and it has the "lowecase on the result of a pack N" problem. So she dropped back to: Autrijus Tang 66 -p ($*=lc)=~s!|\d+!pack'AN/A*',0,$&!eg;$;{$*}.=$_}for(@;{sort%;}){ which puts her behind spiff. However, this solution is eminently fixabele. First we use spiff's $+[0] to shorten the substitution body and fix the lc problem, next we add -F to make sure the @F is one unit and get: BoB 59 -paF s!|\d+!1e9+$+[0].$&!eg;$;{+uc}.="@F\n"}for(@;{sort%;}){ It's in fact possible to shave of yet another character assuming epoch time is now big enough on all systems (it has been since september on at least Mac, windows, unix and VMS. I don't know if there are other ports of perl that would invalidate this, which is why i did not refer to a 125 stroke solution in the challenge): BoB 58 -paF s!|\d+!$^T+$+[0].$&!eg;$;{+uc}.="@F\n"}for(@;{sort%;}){ (remember, ^T and \n are one character) It uses lots of work memory, but a purely linear amount. Hole 2, Shuffle The standard solution here is like this old entry by Suo: Suo 37 x=<>;print splice@x,rand@x,1 while@x Many people soon realised that the space near the end is useless, so you get: Ronald J Kimbal 36 @a=<>;print splice@a,rand@a,1while@a Then Autrijus Tang came up with an utterly original method again: Autrijus Tang 35 @_=<>;print+delete$_[rand@_]while@_ (notice how this depends on printing nothing if you hit an entry that was alread deleted and the array collapsing once the last entry is gone). The word "while" is pretty long, so people really wanted to use something like for. The first to succeed in this was spiff, using Spiff 34 print+splice@,,rand@,,1for@==@,=<> (the useless @= is to avoid that the splice modifies the list the for is handling) A number of other people also discovered this variant. However, if you can do for, quite often you can also use map, and here it turns out not to need the dummy array: Suo 33 print map{splice@x,rand@x,1}@x=<> There it stayed for a bit of time, until Eugene realise that instead of extracting the list randomly, you can build it randomly, and then use the free loop you get from -n/-p: Eugene van der Pijll 32 -p splice@a,rand$.,0,$_}for(@a){ an entry that i particularly like becuse of the use of the for(@a) at the end, which is a general way you can use to print a list, especially if the list cannot be put directly behind a print (where use of this trick saves one character). However, that is not the case here, so I also got solutions like: Spiff 32 -p splice@F,rand$.,0,$_}{print@F Andrew Savige 32 -n splice@x,rand$.,0,$_}{print@x A few people almost found this solution, but failed on a little detail: Piers Cawley 32 -p splice@a,rand@a,0,$_}for(@a){ (rejected) Because @a is one too low compared to $. and the array built in this way is not random (consider a two line input). There were however a number of interesting rejected entries. Very popular was using a sort where the sort function is random. I rejected these because in most sorts this does in fact not lead to a random result, and some versions of quicksort will even coredump on using a non-consistent sort function. But it WOULD give a number of very short entries and on most perls they do in fact give permutations that change from run to run: Autrijus Tang 28 print+sort{int(rand(3))-1}<> (rejected) Even more funky is this one where I'm not even sure why it varies at all: Gimbo 20 print sort{rand 2}<> (rejected) A very interesting entry came from a beginner: Jonathan E. Paton 33 -n $a{$..rand}=$_}{print values%a (rejected) This one only fails because in fact extracting keys from a hash built with random keys is not random. Try to run the following program: #! /usr/bin/perl -w use Data::Dumper; my $n=3; for (1..100000) { my %a; $a{+rand} = $_ for 1..$n; $count{(values%a)[-1]}++; } print Dumper(\%count); This is very bad luck for Jonathan, since it could have been a winner: BoB 30 -n $a{$..rand}=$_}for(@a{%a}){ (rejected) Or, if we ignore that rand can return the same value twice: BoB 28 -n $a{+rand}=$_}for(@a{%a}){ (rejected) The only other person to think of the hash approach was Andrew Savige. Hole 3, Select 2 For this hole most people quickly converged around this concept: suo 37 @x=<>;print splice@x,rand@x,1 for 1,1 Of course again it has a useless space, so we get: Ronald J Kimbal 36 @a=<>;print splice@a,rand@a,1for 1,2 Suo unfortunately never realised the space was pointless in his solutions (if he had, he would have ended up in fourth place instead of sixth). He did find a very cleaver trick to shave of another char though: suo 36 print splice@x,rand@x,1 for[@x=<>],1 Spiff didn't miss the space though, and ended up with: spiff 35 print+splice@,,rand@,,1for[@,=<>],f For a long time this was the lone winner of the hole, until both Eugene and Andrew came up with this funky entry: Eugene van der Pijll 35 -p splice@a,rand$.,0,$_}{($_,$\)=@a The rejected entry by Jonathan E. Paton was hash based again, and leads to the same kind of things as for Shuffle: Jonathan E. Paton 34 -n $a{$..rand}=$_}{print+(%a)[1,3] (rejected) BoB 33 -p $a{$..rand}=$_}for((%a)[1,3]){ (rejected) BoB 31 -p $a{+rand}=$_}for((%a)[1,3]){ (rejected) And finally for your consideration, here are most entries: (non-rejected entries with the same score are in the order they arrived) as=Andrew.Savige dh=Dave Hoover eugene=Eugene van der Pijll ip=Ian Phillips jep=Jonathan E. Paton kl=Kye Leslie mhm=Marcus Holland-Moritz pc=Piers Cawley rk=Rick Klement ronald=Ronald J Kimbal Assignment 1: human sort lasse 68 print sort{"$a$b"=~/^(.*)(\d+)(.*)\n\1(\d+)\3$/i?$2<=>$4:$a cmp$b}<> (rejected) llasse 69 print sort{"$a$b"=~/^(.*)(\d+).*\n\1(\d+)/?$2<=>$3:$a cmp$b}map lc,<> (rejected) eugene: 63 sub a{$_=lc pop;s#\d+#0 x$&.$/#ge;$_}print sort{a($a)cmp a$b}<> (rejected) suo: 72 print/(.*\n)$/for sort map{$x=$_;s#\d+|\n#pack'N/a*',$&#eg;"\U$_\E$x"}<> (rejected) llasse 70 print sort{"$a$b"=~/^(.*)(\d+).*\n\1(\d+)/i&&$2<=>$3||lc$a cmp lc$b}<> (rejected) BoB 68 print sort{"$a$b"=~/^(.*)(\d+).*\n\1(\d+)/i&&$2-$3||lc$a cmp lc$b}<> (rejected) as 71 sub Z{$_=pop;s/(\d+)/sprintf"%.99d",$1/eg;uc}print sort{Z($a)cmp Z$b}<> (rejected) aut 78 print+sort{s|\d+|0 x(2**07-length$&).$&|eg,for@_=map{lc}$a,$b;$_[0]cmp$_[1]}<> (rejected) aut 73 print+sort{s|\d+|0 x(2**07-length$&).$&|eg,for@_=($a,$b);$_[0]cmp$_[1]}<> (rejected) aut 73 sub _{s|\d+|0 x(2**07-length$&).$&|eg;lc}print+sort{_($_=$a)cmp _$_=$b}<> (rejected) aut 85 print+sort{@_=($a,$b);$*=length"@_";s/\d+/sprintf"%0$*s",$&/eg for@_;$_[0]cmp$_[1]}<> (rejected) aut 81 print+sort{s|\d+|0 x(length($a.$b)-length$&).$&|eg,for@_=($a,$b);$_[0]cmp$_[1]}<> (rejected) aut 59 sub _{$_=shift;s/\d+/chr$&/g;$_}print+sort{_($a)cmp _ $b}<> (rejected) aut 91 sub K($$){@a=@_;$*=length"@_";s/\d+/sprintf"%0$*s",$&/eg for@a;$a[0]cmp$a[1]}print+sort K<> (rejected) aut 125 sub K($$){@a=@_;$*=ord((sort+map{chr(length)}"@_"=~/\d+/g)[-1]);s/\d+/sprintf"%0$*s",$&/eg for@a;$a[0]cmp$a[1]}print+sort K<> (rejected) spifff 90 $;|=y===cfor@f=<>;sub f{$_=lc$_[0];s/\d+/sprintf"%$;s",$&/eg;$_}print+sort{f($a)cmp f$b}@f (rejected) BoB 85 sub f{$_=pop;s/\d+/$a=$&+0;pack("N",length$a)."-$a"/eg;$_}print sort{f($a)cmp f $b}<> (rejected) rk 87 ($a=uc)=~s/\d+/$|x($=-length$&).$&/eg,s/^/$a/for@l=<>;s/.*\n//,print for sort@l suo 77 print/(.*\n)$/for sort map{$x=$_;s#\d+#'0'.pack'w/a*',$&+0#eg;"\U$_\E\n$x"}<> (rejected) mhm 76 print sort{s/\d+/sprintf"%9d$&",length$&/egfor($",$;)=(uc$a,uc$b);$"cmp$;}<> pc 74 print map/\n(.+)/s,sort map{($a=lc)=~s/\d+/$[.chr(length$&).$&/eg;"$a$_"}<> (rejected) as 74 sub Z{$_=pop;s/\d+/0 .pack(N,length$&).$&/eg;uc}print sort{Z($a)cmp Z$b}<> (rejected) llasse 73 print sort{"$a$b"=~/^(.*\D)?(\d+).*\n\1(\d+)/i&&$2<=>$3||lc$a cmp lc$b}<> (rejected) suo 73 print/(.*\n)$/for sort map{$x=$_;s#\d+|\n#pack'xN/a*',$&#eg;"\U$_\E$x"}<> (rejected) llasse 72 print sort{"$a$b"=~/^(.*\D)?(\d+).*\n\1(\d+)/i;$2<=>$3||lc$a cmp lc$b}<> (rejected) eugene 70 sub a{$_=pop;s#\d+#0 .pack'N/A*',$&#ge;lc$_}print sort{a($a)cmp a$b}<> (rejected) eugene 68 sub a{$_=pop;s#\d+#0 .pack'N/A*',$&#ge;lc}print sort{a($a)cmp a$b}<> (rejected) BoB 67 print/.*\n$/gfor sort map{$x=$_;s#\d+|\n#pack'xN/a*',$&#eg;lc().$x}<> (rejected) aut 62 -pa s!|\d+!pack'AN/Z*',0,$&!eg;$;{lc,}.="@F\n"}for(@;{sort%;}){ (rejected) aut 64 -p $k=$_;s!|\d+!pack'AN/Z*',0,$&!eg;$;{lc,}.=$k}for(@;{sort%;}){ (rejected) spiff 65 sub f{$_=pop;s;\d+;~0/3+$+[0].$&;eg;lc}print+sort{f($a)cmp+f$b}<> (rejected) eugene 65 sub a{$_=pop;s#\d+#8x$+[0].$/.$&#ge;lc}print sort{a($a)cmp a$b}<> (rejected) as 65 sub Z{s/\d+/0 .A x$+[0].$&/eg;uc}print sort{Z($_=$a)cmp Z$_=$b}<> (rejected) dh 357 print sort{$r=0;$j=$a;$k=$b;$d=$j=~/\d/?1:0;until($r){$u=$v=1;$e=$d?'\d':'[a-z]';($p,$q)=map{s/^($e+)//i?lc$1:''}$j,$k;($x,$y)=map/\w/?0:1,$j,$k;if($p&&$q){if($d){($h,$i)=map{length}$p,$q;;if(!($r=($h<=>$i))){($u,$v)=map{s/(.)//?$1:''}$p,$q until($u==''||($r=$u<=>$v))}}$r=($p cmp$q)if!$d}else{$r=$p?1:-1;$r=!$r if$d}$r||($y&&$r++)||$x&&$r--;$d=$d?0:1}$r}<> dh 301 print sort{chop($j=$a);chop($k=$b);do{$e=($d=$j=~/^\d/)?'\d':'[a-z]';($p,$q)=map{s/^($e+)//i?lc$1:''}$j,$k;if($p&&$q){if($d&&!($r=length$p<=>length$q)){do{($u,$v)=map{s/(.)//?$1:''}$p,$q}until($u==''||($r=$u<=>$v))}$r=($p cmp$q)if!$d}else{$r=$p?1:-1;$r=!$r if$d}$r||(!$k&&$r++)||!$j&&$r--}until($r)}<> dh 277 $w='[a-z]';print sort{g($a,$b)}<>;sub g{my($j,$k,$z,$x)=@_;for($j,$k){my@c;{$e=/^\d/?'\d':$w;$p=$z?'':'+';s/($e$p)//i;push@c,lc$1;$1ne''&&redo}$_=+\@c}for(@$j){$v=$$k[$x++];last if$r=/\d/?$z?$_<=>$v:g($_,$v,1):$_ cmp$v}if($z){$r=($s=@$j<=>@$k)?$s:$r;$r=(grep/$w/,@$k)?-1:$r}$r} dh 276 $w='[a-z]';print sort{g($a,$b)}<>;sub g{my($j,$k,$z,$x)=@_;for($j,$k){my@c;{$e=/^\d/?'\d':$w;$p=$z?'':'+';s/($e$p)//i;push@c,lc$1;$1ne''&&redo}$_=\@c}for(@$j){$v=$$k[$x++];last if$r=/\d/?$z?$_<=>$v:g($_,$v,1):$_ cmp$v}if($z){$r=($s=@$j<=>@$k)?$s:$r;$r=(grep/$w/,@$k)?-1:$r}$r} aut 117 print+sort{my@z;($;=$a)=~s/\d+/push@z,$&;1/eg;$_=$b;s/\d+/1-(length($*=shift@z)<=>length$&||$*cmp$&)/eg;lc$;cmp+lc}<> llasse 87 print sort{"$a$b"=~/^((.*\D)?)(\d+).*\n\1(\d+)/i&&length$3<=>length$4||lc$a cmp lc$b}<> llasse 82 print sort{"$a$b"=~/^(.*)(\d+).*\n\1(\d+)/i&&length$2<=>length$3||lc$a cmp lc$b}<> rk 81 print sort{($a.$b)=~/(.*)(\d+).*\n\1(\d+)/i&&length$2<=>length$3||uc$a cmp uc$b}<> as 80 sub Z{$_=pop;s/\d+/sprintf("%010d",length$&).$&/eg;uc}print sort{Z($a)cmp Z$b}<> BoB 79 print+sort{s|\d+|sprintf"%".length("@_")."s",$&|egfor@_=($a,$b);$_[0]cmp$_[1]}<> eugene 77 sub a{$_=lc pop;s#\d+#0 .pack(N,length$&).$&#ge;$_}print sort{a($a)cmp a$b}<> mhm 76 print sort{s/\d+/sprintf"%9d$&",length$&/egfor($",$;)=(uc$a,uc$b);$"cmp$;}<> BoB 73 print+sort{s|\d+|0 x length("$@").$&|egfor@_=($a,lc$b);lc$_[0]cmp$_[1]}<> pc 73 print map/\n(.+)/s,sort map{($a=lc)=~s|\d+|0${\pack'N/a*',$&}$&|g;$a.$_}<> eugene 71 sub a{$_=lc pop;s#\d+#0 .pack'N/A*',$&#ge;$_}print sort{a($a)cmp a$b}<> as 71 sub Z{s/\d+/0 .(A x length$&).$&/eg;uc}print sort{Z($_=$a)cmp Z$_=$b}<> as 70 sub Z{s/\d+/0 .pack(N,$+[0]).$&/eg;uc}print sort{Z($_=$a)cmp Z$_=$b}<> suo 69 print/(.*\n)$/for sort map{($x=lc)=~s#\d+|\n#pack'xN/a*',$&#eg;$x.$_}<> ip 69 sub t{$_=pop;s/\d+/(1e9+length$&).$&/ge;lc}print sort{t($a)cmp t$b}<> aut 69 -p $k=$_;$_=lc;s!|\d+!pack'AN/Z*',0,$&!eg;$;{$_}.=$k}for(@;{sort%;}){ aut 66 -p ($*=lc)=~s!|\d+!pack'AN/A*',0,$&!eg;$;{$*}.=$_}for(@;{sort%;}){ spiff 65 sub f{$_=pop;s;\d+;9 x9+$+[0].$&;eg;lc}print+sort{f($a)cmp+f$b}<> mhm 65 print sort{s!\d+!pack'AN/A*',0,$&!egfor$"=uc$a,$;=uc$b;$"cmp$;}<> BoB 64 sub f{$_=pop;s;\d+;1e9+$+[0].$&;eg;uc}print+sort{f($a)cmp+f$b}<> spiff 64 sub f{$_=pop;s|\d+|9x9+$+[0].$&|eg;lc}print+sort{f($a)cmp+f$b}<> BoB 63 sub f{s;\d+;1e9+$+[0].$&;eg;uc}print+sort{f($_=$a)cmp+f$_=$b}<> BoB 62 sub f{s;\d+;$^T+$+[0].$&;eg;uc}print+sort{f($_=$a)cmp+f$_=$b}<> BoB 61 print sort{s!\d+!1e9+$+[0].$&!egfor$"=uc$a,$;=uc$b;$"cmp$;}<> BoB 60 print sort{s!\d+!$^T+$+[0].$&!egfor$"=uc$a,$;=uc$b;$"cmp$;}<> BoB 60 -p $k=$_;s!|\d+!1e9+$+[0].$&!eg;$;{+uc}.=$k}for(@;{sort%;}){ BoB 59 -p $k=$_;s!|\d+!$^T+$+[0].$&!eg;$;{+uc}.=$k}for(@;{sort%;}){ BoB 59 -paF s!|\d+!1e9+$+[0].$&!eg;$;{+uc}.="@F\n"}for(@;{sort%;}){ BoB 58 -paF s!|\d+!$^T+$+[0].$&!eg;$;{+uc}.="@F\n"}for(@;{sort%;}){ Assignment 2: fair shuffle jep: 33 -n $a{$..rand}=$_}{print values%a (rejected) aut: 32 -n splice@_,rand@_,0,$_}{print@_ (rejected) pc: 32 -p splice@a,rand@a,0,$_}for(@a){ (rejected) BoB: 30 -n $a{+rand}=$_}for(values%a){ (rejected) BoB: 30 -n $a{$..rand}=$_}for(@a{%a}){ (rejected) aut: 28 print+sort{int(rand(3))-1}<> (rejected) BoB: 28 -n $a{+rand}=$_}for(@a{%a}){ (rejected) BoB: 23 print+sort{rand(2)-1}<> (rejected) gimbo: 20 print sort{rand 2}<> (rejected) pg 44 @a=<>;print splice@a,int rand$#a+1,1 while@a BoB 40 @f=<>;print splice(@f,rand(@f),1)while@f kl 40 @a=<>;while(@a){print splice@a,rand@a,1} dh 40 a=<>;print splice@a,int rand@a,1while@a suo 37 @x=<>;print splice@x,rand@x,1 while@x ip 37 @x=<>;print splice @x,rand@x,1while@x Ion 36 @a=<>;print splice@a,rand@a,1while@a as 36 @a=<>;print splice@a,rand@a,1while@a ronald 36 @a=<>;print splice@a,rand@a,1while@a ip 36 @x=<>;print splice@x,rand@x,1while@x dh 36 @a=<>;print splice@a,rand@a,1while@a aut 35 @_=<>;print+delete$_[rand@_]while@_ llasse 35 print splice@a,rand@a,1 for@b=@a=<> aut 34 -n splice@_,rand@_+1,0,$_}{print@_ spiff 34 print+splice@,,rand@,,1for@==@,=<> jep 34 print splice@a,rand@a,1for@b=@a=<> pc: 34 -p splice@a,rand@a+1,0,$_}for(@a){ aut: 34 -p splice@F,rand@F+1,0,$_}for(@F){ suo 33 print map{splice@x,rand@x,1}@x=<> as 33 print map{splice@x,rand@x,1}@x=<> spiff 33 -n splice@,,rand$.,0,$_}print@,;{ eugene: 32 -p splice@a,rand$.,0,$_}for(@a){ spiff: 32 -p splice@F,rand$.,0,$_}{print@F as: 32 -n splice@x,rand$.,0,$_}{print@x mhm: 32 -n splice@_,rand$.,0,$_}{print@_ rk: 32 -n splice@a,rand$.,0,$_}{print@a aut: 32 -p splice@.,rand$.,0,$_}for(@.){ Assignment 3: select 2 aut: 37 -n splice@_,rand@_,0,$_}{print@_[0,1] (rejected) pc 37 -p splice@a,rand@a,0,$_}for(@a[0,1]){ (rejected) aut: 37 -nla0 print+splice@F,rand@F,1,for$,,1 (rejected) jep 34 -n $a{$..rand}=$_}{print+(%a)[1,3] (rejected) BoB 33 -p $a{$..rand}=$_}for((%a)[1,3]){ (rejected) BoB 31 -p $a{+rand}=$_}for((%a)[1,3]){ (rejected) kl: 47 @a=<>;$a=2;while($a--){print splice@a,rand@a,1} pg: 44 @a=<>;print splice@a,int rand$#a+1,1 for+1,2 eugene: 41 print splice(@a,rand(@a=<>),1),$a[rand@a] dh 41 @a=<>;map{print splice@a,int rand@a,1}0,0 pc 39 -p splice@a,rand@a+1,0,$_}for(@a[0,1]){ as: 38 @x=<>;eval'print splice@x,rand@x,1;'x2 aut: 37 @_=<>;map{print+splice@_,rand@_,1}1,2 suo: 37 @x=<>;print splice@x,rand@x,1 for 1,1 llasse: 37 @a=<>;print splice@a,rand@a,1 for 1,2 as: 37 @a=<>;print splice@a,rand@a,1for 1..2 ip: 37 @x=<>;print splice@x,rand@x,1for 1..2 aut: 37 @F=<>;print+splice@F,rand@F,1,for$,,1 rk: 37 -n splice@a,rand$.,0,$_}{print@a[0,1] dh: 37 @a=<>;map{print splice@a,rand@a,1}1,1 ronald 36 @a=<>;print splice@a,rand@a,1for 1,2 Ion: 36 @_=<>;print+splice@_,rand@_,1for+1,2 suo: 36 print splice@x,rand@x,1 for[@x=<>],1 eugene: 36 @a=<>;print splice@a,rand@a,1for a,b ip: 36 @x=<>;print splice@x,rand@x,1for 1,2 as: 36 @a=<>;print splice@a,rand@a,1for 1,2 mhm: 36 @_=<>;print splice@_,rand@_,1for 0,0 spiff 35 print+splice@,,rand@,,1for[@,=<>],f eugene 35 -p splice@a,rand$.,0,$_}{($_,$\)=@a as 35 -p splice@x,rand$.,0,$_}{($_,$\)=@x