New Year Countdown in Elixir

elixirgolf bio photo By elixirgolf Comment


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

The puzzle is to create a countdown timer that displays the number of Days:Hours:Minutes:Seconds until the next New Year. This countdown timer will decrease every second until 000:00:00:00.

$ elixir countdown.exs


  • The code will be executed using the elixir countdown.exs terminal 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 Days:Hours:Minutes:Seconds
  • The time should be represented as numbers, separated by colons: 000:00:00:00
  • Every second the timer should decrease by 1 second, and all the other fields should adjust accordingly:
  • 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.

Bonus Credits

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 000:00:00:00.

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 ---

Honourable mentions


comments powered by Disqus