Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save sandropaganotti-zz/239815 to your computer and use it in GitHub Desktop.
Save sandropaganotti-zz/239815 to your computer and use it in GitHub Desktop.
Golf programming: Sono Pazzi Questi Romani
p (1...3999).map{|i|l="";"M1000DM900D500CD400C100XC90L50XL40X10IX9V5IV4I1".scan(/(\D+)(\d+)/).inject(i){|a,(n,k)|k=k.to_i;while(a>=k);a-=k;l<<n;end;a};l}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment