3 ms·
Should have just done it in Common Lisp. Roman numeral formatting is built-in. ? (format nil "~@r" 3989) "MMMCMLXXXIX"
by lisper 11y ago
Should have just done it in Common Lisp. Roman numeral formatting is built-in.
? (format nil "~@r" 3989)
"MMMCMLXXXIX"
- melloclello 11y agoI'd imagine it's not easy to render the text out into Times without UIKit or equivalent? Pretty cool that it has that built in, though.
- akkartik 11y agoBut would the font make any difference to the answer?
- deleted 11y ago[deleted]
- astrange 11y agoIt asks for the widest string in pixels in a proportional font, so the different letters matter.
- gpvos 11y agoSince most proportional fonts have somewhat similar widths, probably not. But if you just look at the longest string (or use a non-proportional font) there will be four roman numbers of equal length/width.
- lisper 11y agoActually, that's pretty easy too in CCL. It has a very nice ObjC bridge.
- tosseraccount 11y ago20 bits would do it.
- _sg 11y agoCL-USER> (format nil "~:@r" 3989) "MMMDCCCCLXXXVIIII"