Skip to content

Instantly share code, notes, and snippets.

@ppworks
Created June 2, 2012 05:31
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save ppworks/2856772 to your computer and use it in GitHub Desktop.
minatork01 english numerals
#!/usr/bin/env ruby
num = ARGV.first.to_i
nums1 = ['zero', 'one', 'two', 'three', 'four', 'five', 'six', 'seven', 'eight', 'nine']
nums10 = ['ten', 'eleven', 'twelve', 'thirteen', 'fourteen', 'fifteen', 'sixteen', 'seventeen', 'eighteen', 'nineteen']
if num < 10
puts nums1[num]
elsif 10 <= num && num < 20
puts nums10[num-10]
else
puts 'unsupported'
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment