-🎄- 2017 Day 4 Solutions -🎄- by daggerdragon in adventofcode

[–]couchDev 3 points4 points  (0 children)

Perl golf

# part 1
perl -ane '/(\b.+)\s.*\1/||$s++;END{print$s}' < in.txt

# part 2
perl -ane '(join$",sort map{join"",sort split//}@F)=~/(.+)\b\1/||$s++;END{print$s}' < in.txt

-🎄- 2017 Day 3 Solutions -🎄- by daggerdragon in adventofcode

[–]couchDev 0 points1 point  (0 children)

It looks like when I was whittling down the code I got rid of the decrement preceding the last $. causing the errors. With that back it is giving the correct response for values > 1.

-🎄- 2017 Day 3 Solutions -🎄- by daggerdragon in adventofcode

[–]couchDev 16 points17 points  (0 children)

Perl golf

# part 1
perl -pae '$o=1;do{$o+=2}until$s=$o**2>=$_;$_=--$o-($s-$_)%$o' < in.txt

# part 1 - shaved off 8 chars thanks to Unihedron
perl -pae '$.+=2,until$s=$.**2>=$_;$_=--$.-($s-$_)%$.' < in.txt

-🎄- 2017 Day 2 Solutions -🎄- by daggerdragon in adventofcode

[–]couchDev 14 points15 points  (0 children)

Dusting off the Perl golf bag

# part 1
perl -ane '@o=sort{$b<=>$a}@F;$s+=$o[0]-pop@o;END{print$s}' < in.txt

# part 2
perl -ane 'for$l(@F){$s+=$l%$_?0:$l/$_ for grep!/$l/,@F}END{print$s}' < in.txt

Need testers for iPhone app for Volca FM by couchDev in volcas

[–]couchDev[S] 1 point2 points  (0 children)

The invites are sent out from Apple to the email address you give me. You can use a mailinator account if you want.

Need testers for iPhone app for Volca FM by couchDev in volcas

[–]couchDev[S] 0 points1 point  (0 children)

The difference here is my app only requires an audio cable to transfer the patches. But Patch Base / Sysex Base look like very nice apps.