Skip to content

Instantly share code, notes, and snippets.

@mewlist
Created April 25, 2012 12:46
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 mewlist/2489502 to your computer and use it in GitHub Desktop.
Save mewlist/2489502 to your computer and use it in GitHub Desktop.
roman
T=[%w(I V X),%w(X L C),%w(C D M), %w(M - -)]
D=[[],[0],[0,0],[0,0,0],[0,1],[1],[1,0],[1,0,0],[1,0,0,0],[0,2]]
(1..1999).each{|n|
s = n.to_s.split('').map{|v|v.to_i}
s.size.times{|i| D[s[i]].each{|j| print T[s.size-i-1][j] } }
puts
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment