Skip to content

Instantly share code, notes, and snippets.

@TalkativeTree
Last active January 6, 2017 06:08
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 TalkativeTree/5863667 to your computer and use it in GitHub Desktop.
Save TalkativeTree/5863667 to your computer and use it in GitHub Desktop.
Javascript algorithm exercises: 1

Challenge 1:

99 bottles of beer on the wall

Write a function bottle_song which takes as its input a positive integer n representing the number of starting bottles in the song. Pick a reasonable format and print out all the lines to the song.

Challenge 2: Roman Numerals

Write a method that converts an integer to its Roman numeral equivalent, i.e., 476 => 'CDLXXVI'.

Arabic ==> Roman 4 ==> IV 9 ==> IX 14 ==> XIV 44 ==> XLIV 944 ==> CMXLIV

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