Keep It Simple, Stupid PerlMonks

### Golf: Magic Formula for Roman Numerals

by eyepopslikeamosquito (Chancellor)
 on Feb 18, 2007 at 07:50 UTC Need Help??

```#     12345678901234567890123456789012345
sub r{1+4*y/VLD//.E.(3*/M/+2*/C|D/+/X|L/)}
```
```3*/M/+2*/C|D/+/X|L/
```
```for my \$m (1 .. 999) {
for my \$n (1 .. 99) {
...
}
}
}
```
```#include <stdio.h>
#define magic(v,m,n,p) ((v) % (m) % (n) % (p))
...
}
return 0;
}
```
```m=75 n=50 p=4: M=3 D=2 C=2 L=1 X=1 V=0 I=0
m=734 n=13 p=4: M=3 D=2 C=2 L=1 X=1 V=0 I=0
m=737 n=92 p=5: M=3 D=2 C=2 L=1 X=1 V=0 I=0
```
```ord()x3%75%50%4
```
```3*/M/+2*/C|D/+/X|L/
```
```sub m1{1+4*y/VLD//.E.ord()x3%75%50%4}
sub m2{1+4*y/VLD//.E.ord()*49/3%54%4}
...
sub d2{1 .E.ord()*38/9%62%4>>y/VLD//}
sub d3{1 .E.~-ord()*41%52%5>>y/VLD//}
sub d4{1 .E.(8^ord)*29%65%4>>y/VLD//}
```
```sub d5{1 .E.(72^ord)*5/7%5>>y/VLD//}
sub d6{1 .E.(6^ord)%72%7%4>>y/VLD//}
sub d7{1 .E.(76^2+ord)%7%5>>y/VLD//}
```
```sub d8{1 .E.(3^77%ord)%7>>y/VLD//}
sub m8{5**y/VLD//.E.(42^88*ord)%5}
```

Create A New User
Node Status?
node history
Node Type: perlmeditation [id://600665]
Approved by GrandFather
Front-paged by liverpole
help
Chatterbox?
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others romping around the Monastery: (3)
As of 2017-06-27 11:45 GMT
Sections?
Information?
Find Nodes?
Leftovers?
Voting Booth?
How many monitors do you use while coding?

Results (604 votes). Check out past polls.