2015 has been quite a year for elixir, and we wanted a way to celebrate the comming New Year. We are thrilled that this weeks puzzle was dreamed up by one of our contributors, @stoftis. So if you have any puzzle ideas let us know, through email or twitter https://twitter.com/elixirgolf.
The puzzle is to create a countdown timer that displays the number of
until the next New Year. This countdown timer will decrease every second until
$ elixir countdown.exs 013:05:49:08
- The code will be executed using the
elixir countdown.exsterminal command. We will manually copy all your solutions into this file, so please just submit your solutions as below.
- The timer will be in the following format
- The time should be represented as numbers, separated by colons:
- Every second the timer should decrease by 1 second, and all the other fields should adjust accordingly:
013:05:00:01 013:05:00:00 013:04:59:59 013:04:59:58 .. .. 000:00:00:03 000:00:00:02 000:00:00:01 000:00:00:00
- The timer should only display one timer at any time, i.e. it should have some mechanism to clear the screen or update itself every second. It should NOT display a long list of times, like the example above.
- The timer should countdown to the next New Year e.g. January 1st 2016.
As a bit of fun and a side project maybe consider the following flourishes:
- Colour the numbers
- Allow the countdown timer to dynamically adjust to the following New Year after this one
- Trigger some exciting output when the countdown reaches
Submit your solution
Please submit your solution as a comment on the Github issue below, along with your Twitter handle (we will use this to link back to you if your solution is successful).
--- your name here ---
- Wikipedia New Year https://en.wikipedia.org/wiki/New_Year
- Example web countdown timer: http://www.timeanddate.com/countdown/newyear