Skip to content

Instantly share code, notes, and snippets.

Created June 2, 2012 05:31
What would you like to do?
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]
puts 'unsupported'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment