Advertisement
kirbyfan64sos

Port of Lua program to MoonScript

Sep 16th, 2015
189
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.27 KB | None | 0 0
  1. r={}
  2. for s in *arg
  3. n=0
  4. s\gsub("%l",(a)->n+=a\byte!-96)\gsub("%u",(a)->n+=(a\byte!-64)*1.5)\gsub("%p",(a)->n-=1)\gsub "^R.- R.- ?R?",()->n=math.huge
  5. m=n/utf8.len s
  6. s\gsub "%d+",(a)->m-=a
  7. table.insert r,{s:s,n:m}
  8. table.sort r,(a,b)->a.n<b.n
  9. print v.s for v in *r
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement