Skip to content

Instantly share code, notes, and snippets.

@stoft
Last active December 5, 2015 10:46
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save stoft/12b961313a99bd054c8b to your computer and use it in GitHub Desktop.
Save stoft/12b961313a99bd054c8b to your computer and use it in GitHub Desktop.
Elixir Golf Christmas Tree Puzzle
iex(134)> m=String;for x<-0..10,y=x<1&&"*"||x>9&&"H"||"0",z=1<x&&x<10&& m.rjust("0",x-1,?0)||"",do: IO.puts m.rjust(z,8)<>y<>z
*
0
000
00000
0000000
000000000
00000000000
0000000000000
000000000000000
00000000000000000
H
[:ok, :ok, :ok, :ok, :ok, :ok, :ok, :ok, :ok, :ok, :ok]
@stoft
Copy link
Author

stoft commented Dec 5, 2015

See emson/elixirgolf#3 for more info.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment