Skip to content

Instantly share code, notes, and snippets.

@lyntco
Last active August 29, 2015 14:08
Show Gist options
  • Save lyntco/efc6b66c7a0d6c09810d to your computer and use it in GitHub Desktop.
Save lyntco/efc6b66c7a0d6c09810d to your computer and use it in GitHub Desktop.
Quiz - Birthday Candles

Quiz - Birthday Candles

Write a program to tell you how many birthday candles a person would have had on their cakes total if every year they had an accurate number of candles to birth years on their cakes.

Example method call:

candle_count('01-01-2014')
# => '0 candles have burned for you'
candle_count('01-01-2012')
# => '3 candles have burned for you'
candle_count('30-11-2012')
# => '1 candle has burned for you'
candle_count('26-07-1970') # 44 years old
# => '990 candles have burned for you'

Extension

If you did this in Ruby, do it again in javascript, and vice versa.

@epoch
Copy link

epoch commented Nov 5, 2014

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