Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
Strange roman math solution in Creative category for Roman Numerals by LukeSolo
from math import sqrt
alpha = "IVXLCDM"
one = lambda n, s: (n % 5 >> n % 5 // 4 * 2) * alpha[s]
two = lambda n, s: (3 < n) * alpha[s + (3 < n) + (8 < n)]
three = lambda n, s: sqrt(n) == int(sqrt(n)) and ''.join(reversed(s)) or s
go = lambda n, s: three(n, two(n, s) + one(n, s))
def checkio(data, s = 0, conc = ""):
d, m = divmod(data, 10)
text = go(m, s) + conc
return d and checkio(d, s + 2, text) or text
Sept. 22, 2014
Comments: