At 11:44 06/07/04 +0200, Christian Maeder wrote:
Christian Maeder wrote:
George Russell wrote (snipped):

Now 145.
roman=(0#);a#n|n<1=""|n>=t!!a=s!!a:a#(n-t!!a)|n+t!!b>=t!!a=s!!b:a#(n+t!!b)|1>0=(a+1)#n where b=2*div a 2+2;s="mdclxvi";t=[1000,500,100,50,10,5,1]

138
roman=(!6);n!a|n<1=""|n>=t=s!!a:(n-t)!a|n+c>=t=s!!(2*e):(n+c)!a|1>0=n!(a-1)where(d,m)=a`divMod`2;e=d+m-1;s="ivxlcdm";c=10^e;t=10^d*(1+4*m)


now 134
roman=(!6);n!a|n<1=""|n>=t=s!!a:(n-t)!a|c>=t=s!!(2*e):c!a|1>0=n!(a-1)where(d,m)=a`divMod`2;e=d+m-1;s="ivxlcdm";c=10^e+n;t=10^d*(1+4*m)

Doesn't that need "import Array"?

#g


------------ Graham Klyne For email: http://www.ninebynine.org/#Contact

_______________________________________________
Haskell-Cafe mailing list
[EMAIL PROTECTED]
http://www.haskell.org/mailman/listinfo/haskell-cafe

Reply via email to