Last active
March 13, 2016 21:15
-
-
Save gvaughn/fb89c65e01207f1d281d to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
p=fn 0,_->;i,p->spawn fn->w=" on the wall.";b=&" #{&1} bottle#{&1==1&&""||"s"} of Elixir" | |
IO.puts [inspect(self),b.(i),w,b.(i),".\n",i==1&&"Go get some more,"<>b.(99)||"Take one down pass it around,"<>b.(i-1),w,10] | |
p.(i-1,p)end end;p.(99,p);:timer.sleep 999 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Nice solution! Here are a few ideas for improvement:
".\n"
with a plain newline (1 char less)i==1
withi<2
ori>1
and flip the branches (two occurrences, so 2 chars less)sleep 999
withsleep ?ϧ
(1 char less) I learned this technique from @henrik's solution to the last elixir golf. Basically you can find the appropriate unicode character by runningto_string [999]
in iex.