Skip to main content
1 of 3
Value Ink
  • 12.6k
  • 1
  • 17
  • 42

#Ruby, 126.9 (141 - 10%)

Uses recursion to convert decimal into curly form. Incidentally, removing the check for ignoring characters outside of /[;{}]/ increases the score by exactly 0.1 at the moment.

f=->s{s=~/^\d+$/?(n=s.to_i
"{#{n<1?'':f[(n/4).to_s].gsub('{}','')}}#{?;*(n%4)}"):eval(s.tr("^{;}","").gsub(/./){|c|c<?A?"+1":c>?|?")*4":?(})}
Value Ink
  • 12.6k
  • 1
  • 17
  • 42