Last active
December 5, 2015 10:46
-
-
Save stoft/12b961313a99bd054c8b to your computer and use it in GitHub Desktop.
Elixir Golf Christmas Tree Puzzle
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
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] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
See emson/elixirgolf#3 for more info.