Roman Numeral Calculator Post Mortem -------------------------------------------------------------------------------- Accepted | Artistic/Unorthodox | Rejected Golfer Score Submit Time Referee comments are in italics. Blue rows denote golfer's best solution. Red text denotes special characters. Accepted Score Golfer Submit Time Code 99.56 ton Mon Jan 1 08:56:17 2007 -pl s!.!y$IVCXL426(-:$XLMCDIVX$dfor$$_.=5x$&*8%29628;$$$_=$_!egfor-4e3..y/iul-}/-$+ /%s''$';*_=eval Just improving the tie a bit 99.57 ton Fri Dec 29 00:38:04 2006 -pl s!.!y$IVCXL426(-:$XLMCDIVX$dfor$$_.=5x$&*8%29628;$$$_=$_!egfor-4e3..y/iul-s/-$+ /%s''$';*_=eval (-: beautiful 100.55 ton Tue Dec 26 13:41:04 2006 -pl s!.!y$IVCXL426.-[$XLMCDIVX$dfor$$_.=5x$&*8%29628;$$$_=$_!egfor-4e3..s'^| '+$'gy/isl-{/-$+ /..4e3;$_=$;[eval] 114.53 szeryf Sun Dec 31 11:38:20 2006 -pl @;=map{$a=0;($a.=4x$_%1859^7)=~y!IVCXL91-80!XLMCDXVIII!dfor/./g;$$a=$_;$a}s''$'>y/sli-u/$+-/d..4e3;$_=$;[eval] 115.50 ton Mon Dec 25 20:55:21 2006 -pl s!\d!y$IVCXL426.-X$XLMCDIVX$dfor$$_.=5x$&*8%29628;$$$_=$_!egfor-3999..0;s/\w+/${$&}||$&&"="||"+"/eg;$_=${+eval} Use more globals 115.50 Juho Snellman Sun Dec 31 01:31:04 2006 -pl s!.!y$XLIVC91-80$CDXLMXVIII$d,$$_=$`.$&for$:[$_].=4x$&%1859^7!gefor//..4e3;y/il-~/-+/d;s!\w+!\$$&!g;$_=$:[eval] 115.50 jojo Sun Dec 31 04:18:10 2006 -pl for$p(-3999..0){$p=~s|.|y!CLXVI624.-;!MDCLXXVI!dfor$$p.=5x$&*8%29628;$&|ge;s|\b$$p|-^K$p|g}y!i-|!-^K!;$_=${-eval} 115.55 szeryf Sat Dec 30 21:10:08 2006 -pl @;=map{$a=0;map{y!IVCXL91-80!XLMCDXVIII!dfor$a.=4x$_%1859^7}/./g;$$a=$_;$a}s''$'>y/sli-u/$+-/d..4e3;$_=$;[eval] 115.56 TedYoung Sun Dec 31 09:42:22 2006 -lp map{my$Q;s/./y$IVCXL91-I0$XLMCDXVIII$dfor$Q.=4x$&%1859^7/eg,$_[$$Q=@_]=$Q}!s..s...4e3-y=si-z=$\-+=s;$_=$_[eval] 116.50 TedYoung Sat Dec 30 20:25:28 2006 -lp sub _{/\d/&&_(y,IVXLC,XLCDM,,s,,$&-9?$&-4?I x$&:IV:IX,e,s,I{5},V,)}map$$_=1.._,s..s...4E3;y=si-z=$\-+=s;_$_=eval 116.54 szeryf Sat Dec 30 19:35:01 2006 -pl @;=map{$a=0;map{y!IVCXL91-80!XLMCDXVIII!dfor$a.=4x$_%1859^7}/./g;$$a=$_;$a}!y/sli-u/$+-/d..4e3;$_=$;[eval"\$$_"] 118.42 jojo Sun Dec 31 01:46:45 2006 -pl for(y!i-|!-^K!;5>$.=~s|.|y!CLXVI624.-;!MDCLXXVI!dfor$^K[$.].=5x$&*8%29628;$&|ge;$.++){s|\b$^K[$.]\b|+$.|g}$_=$^K[eval] 118.53 pijll Mon Jan 1 19:14:26 2007 -pl y/i-z/-+/s;for$a(1..4e3){$a=~s#.#($n[$a].=4x$&%1859^7)=~y$IVCXL91-I0$XLMCDXVIII$d;s/\b$n[$a]\b/$a/g#ge}$_=$n[eval] 118.55 szeryf Fri Dec 29 20:56:50 2006 -pl @==map{$a=0;map{y!IVCXL91-80!XLMCDXVIII!dfor$a.=4x$_%1859^7}/./g;$$a=$_;$a}0..4e3;y/mpui-s/-+$/d;$_=$=[eval"\$$_"] 119.50 Sec Mon Jan 1 02:13:14 2007 -lp @%=map{my$a;s/./y!IVCXL91-80!XLMCDXVIII!dfor$a.=4x$&%1859^7/eg;$$a=$/--;$a}0..4e3;y/i/-/;s/\w+/${$&}/g;$_=$%[-eval] Optimize Tiebreak before giving up and going to bed. 119.53 Sec Mon Jan 1 00:09:52 2007 -lp @r=map{my$a;s/./y!IVCXL91-80!XLMCDXVIII!dfor$a.=4x$&%1859^7/eg;$$a=$v--;$a}0..4e3;y/i/-/;s/\w+/${$&}/g;$_=$r[-eval] Whoops. Totally forgot that eval defaults to $_. Gain 2 chars. Happy new year from germany 120.45 jojo Sat Dec 30 21:08:21 2006 -pl for(y!i-|!-^K!;++$*<4e3;s!\b$^K[$*]\b!+$*!g){$*=~s!.!y$IVCXL91-I0$XLMCDXVIII$dfor$^K[$*].=4x$&%1859^7;$&!ge}$_=$^K[eval] 120.47 TedYoung Fri Dec 29 14:22:59 2006 -lp sub _{/\d/&&_(y/IVXLC/XLCDM/,s//$&-9?$&-4?I x$&:IV:IX/e,s/I{5}/V/)}map$$_=1.._,1..4E3;y/i/-/;s/\w+/+${$&}/g;_$_=eval 121.51 TedYoung Fri Dec 29 02:16:39 2006 -lp sub _{y/IVXLC/XLCDM/,s//$&-9?$&-4?I x$&:IV:IX/e,s/I{5}/V/while/\d/}map$$_=1.._,1..4E3;y/pm/+-/;s/\w+/${$&}/g;_$_=eval 121.53 Sec Sun Dec 31 23:58:22 2006 -lp @r=map{my$a;s/./y!IVCXL91-80!XLMCDXVIII!dfor$a.=4x$&%1859^7/eg;$$a=$v--;$a}0..4e3;y/i/-/;s/\w+/${$&}/g;$_=$r[-eval$_] Some $$creativity for a few more chars. 122.54 Juho Snellman Sat Dec 30 21:25:09 2006 -pl sub T{$_=0;$_.=4x$&%1859^7,y$MDXLIVC91-80$A-DXLMXVIII$dwhile$?=~/./g}y/il-~/-+/d;s!\w+!T++$?until/^$&$/;$?!ge;T$?=eval The clever parts in the arabic -> roman conversion are from an earlier golf solution by Ton. 122.54 eyepopslikeamosquito Tue Jan 2 05:02:57 2007 -lp sub'_{$;=0;($;.=5x$_*8%29628)=~y$IVCXL426.-X$XLMCDIVX$dfor/./g;$;}y;mp;-+;;s>\w+>(grep$&eq&_,1..1e4)[0]>eg;$_=_$_=eval Standard golfing technique: Can't possibly work. Try it anyway! 122.56 pijll Mon Jan 1 18:31:53 2007 -pl y/il-z/-+/d;for$a(1..4e3){for($a=~/./g){y$IVCXL91-I0$XLMCDXVIII$dfor$n[$a].=4x$_%1859^7};s/\b$n[$a]\b/$a/g}$_=$n[eval] Obviously, I've found Ton's solution to the earlier golf... 124.48 ton Mon Dec 25 20:24:04 2006 -pl map${s!.!y$IVCXL426.-X$XLMCDIVX$dfor$f[$n].=5x$&*8%29628!eg,$f[$n]}=++$n,1..3999;s/\w+/${$&}||$&&"="||"+"/eg;$_=$f[eval] Still not thinking :-) 124.50 Sec Sun Dec 31 22:39:49 2006 -lp %%=map{my$a;s/./y!IVCXL91-80!XLMCDXVIII!dfor$a.=4x$&%1859^7/eg;$a,--$/,$/,$a}1..4e3;y/m/-/;s/\w+/$%{$&}/ge;$_=$%{eval$_} swap minus and plus, and gain 2 chars :) 124.55 szeryf Fri Dec 29 18:47:41 2006 -pl @a=map{$a=0;map{y!IVCXL91-80!XLMCDXVIII!dfor$a.=4x$_%1859^7}/./g;$$a=$_;$a}0..4e3;y/mpa-z/-+/d;s/\w+/${$&}/g;$_=$a[eval] 125.45 eyepopslikeamosquito Tue Jan 2 06:12:25 2007 -lp @}{@]=map{$;=0;($;.=5x$_*8%29628)=~y$IVCXL426.-X$XLMCDIVX$dfor/./g;$;}@>}=@>=0..3999;y;mp;-+;;s>\w+>$}{$&}>eg;$_=$][eval] Insurance just in case a lower one gets disqualified. Also, this one is 0.01 lower than Jasper. :-) 125.46 Jasper Sun Dec 31 20:16:51 2006 -lp map{y/IVXLC/XLCDM/,s!\d!$&^4?$&^9?V x($&>3).I x($&%5):IX:IV!ewhile//;$$_=$n++}@d=0..4e3;y/m/-/;s/\w+/+${$&}/g;$_=$d[eval] 126.48 ton Mon Dec 25 19:57:03 2006 -pl map${!s!.!y$IVCXL426.-X$XLMCDIVX$dfor$f[$n].=5x$&*8%29628!eg.$f[$n]}=$n=$_,1..3999;s/\w+/${$&}||$&&"="||"+"/eg;$_=$f[eval] Some trivial reaarrangement 126.50 Sec Sun Dec 31 21:55:08 2006 -lp %%=map{my$a;s/./y!IVCXL91-80!XLMCDXVIII!dfor$a.=4x$&%1859^7/eg;$a,++$/,$/,$a}1..4e3;y/pm/+-/;s/\w+/$%{$&}/ge;$_=$%{eval$_} Opitmize tiebreak. 126.53 eyepopslikeamosquito Sun Dec 31 11:56:06 2006 -lp sub'_{$;=0;($;.=5x$_*8%29628)=~y$IVCXL426.-X$XLMCDIVX$dfor/./g;$;}y;mp`-{;-+;d;s>\w+>(grep$&eq&_,1..1e4)[0]>eg;$_=_$_=eval Going round in circles. Need to find a new breakthrough idea but I'm lacking inspiration. :-( 126.54 Sec Sun Dec 31 21:49:00 2006 -lp %r=map{my$a;s/./y!IVCXL91-80!XLMCDXVIII!dfor$a.=4x$&%1859^7/eg;$a,++$b,$b,$a}1..4e3;y/pm/+-/;s/\w+/$r{$&}/ge;$_=$r{eval$_} One more char shaved. On a related note: The leaderboard shows more than one day remaining, yet on the rules page today is the final day? 127.45 Sec Sun Dec 31 21:13:05 2006 -pl %%=map{$"="";s/./y!IVCXL91-80!XLMCDXVIII!dfor$".=4x$&%1859^7/eg;$",++$/,$/,$"}1..4e3;y/pm/+-/;s/\w+/$%{$&}/ge;$_=$%{eval$_} Wait... optimize tiebreak :) 127.47 jojo Fri Dec 29 13:34:00 2006 -pl for$*(1..4e3){$#=0;$*=~s!.!y$IVCXL91-I0$XLMCDXVIII$dfor$#.=4x$&%1859^7;$&!ge;s!\b$#\b!+$*!g;$_[$*]=$#}y!i-u!- !;$_=$_[eval] 127.47 pijll Sun Dec 31 01:49:33 2006 -pl y/i-z/-+/s;for$a(1..4e3){($n[$a].=/4|9/?17+$_:($_>3).2x($_%5))=~y/VXLC1-I/LCDMVIX/for$a=~/./g;s/\b$n[$a]\b/$a/g}$_=$n[eval] 127.52 Sec Sun Dec 31 21:08:19 2006 -pl %r=map{$a="";s/./y!IVCXL91-80!XLMCDXVIII!dfor$a.=4x$&%1859^7/eg;$a,++$b,$b,$a}1..4e3;y/pm/+-/;s/\w+/$r{$&}/ge;$_=$r{eval$_} Squeeze a few more bytes... 128.45 Jasper Sat Dec 30 16:20:12 2006 -lp @d=map{y/IVXLC/XLCDM/,s!\d!$&^4?$&^9?V x($&>3).I x($&%5):IX:IV!ewhile//;$$_=$n++;$_}0..4e3;y/m/-/;s/\w+/+${$&}/g;$_=$d[eval] Finally fits in one of my screen widths! 128.48 pijll Sun Dec 31 01:27:38 2006 -pl y/il-z/-+/d;for$a(1..4e3){($n[$a].=/4|9/?17+$_:($_>3).2x($_%5))=~y/VXLC1-I/LCDMVIX/for$a=~/./g;s/\b$n[$a]\b/$a/g}$_=$n[eval] YES!!! 128.51 Juho Snellman Fri Dec 29 11:24:28 2006 -pl sub T{$_=pop;y!IVXLCDM!XLCDM~!,s!!$&-9?$&-4?I x$&:IV:IX!e,s!I{5}!V!while/\d/}y/il-~/-+/d;s!\w+!T++$?until/^$&$/;$?!ge;T+eval 128.52 eyepopslikeamosquito Sat Dec 30 12:29:13 2006 -lp sub'_{$#=0;s!.!y$IVCXL426.-X$XLMCDIVX$dfor$#.=5x$&*8%29628;5!eg;$#}y;mp`-{;-+;d;s>\w+>$-=0;$_=++$-while$&ne&_;$->eg;_$_=eval I'm hanging onto Juho like a leech! I feel ashamed and dirty stealing this bizarre and grotesque $# hack from the greatest golfer of all time (and I'm not talking about Jack Nicklaus or Tiger Woods here). The mind boggles contemplating exactly how ton uncovered such depracated depravity in the bowels of perl. :-) 129.44 eyepopslikeamosquito Mon Jan 1 06:22:50 2007 -lp @}{@]=map{$;=0;($;.=5x$_*8%29628)=~y$IVCXL426.-X$XLMCDIVX$dfor/./g;$;}@>}=@>=0..3999;y;mp`-{;-+;d;s>\w+>$}{$&}>eg;$_=$][eval] Golf is the only game I know where you wake up, peer at the leaderboard ... then find yourself cursing and swearing at total strangers for passing you on the leaderboard while you slept. :-) Though not my shortest, I thought I'd submit it in case it's of interest during the post mortem. I expect Jasper and (-ugene are using this approach, based on thier tiebreakers. Curiously, I tried this approach a few days ago and decided it was a dud, then came back to it in desperation today and promptly knocked 10 strokes off it. Still not the new approach I need, however. 129.49 ton Mon Dec 25 19:47:33 2006 -pl $n=$_,s!.!y$IVCXL426.-X$XLMCDIVX$dfor$f[$n].=5x$&*8%29628!eg,${$f[$n]}=$n for 1..3999;s/\w+/${$&}||$&&"="||"+"/eg;$_=$f[eval] A quick placeholder before actually starting to think 129.50 eyepopslikeamosquito Sun Dec 31 00:44:24 2006 -lp sub'_{$#=0;s!.!y$IVCXL426.-X$XLMCDIVX$dfor$#.=5x$&*8%29628;5!eg}y;mp`-{;-+;d;s>\w+>$-=0;{_$_=++$-;$&ne$#&&redo}$->eg;_$_=eval I've had to drop back from 128.52 to 129.50 because I just discovered my last entry fails the new test program I sent you (test case: II plus V). 129.50 Util Tue Jan 2 03:31:19 2007 -lp $==$_,s!.!y$IVCXL91-I0$XLMCDXVIII$dfor$_[$=].=4x$&%1859^7;5!egfor+0..3999;@&{@_}=0..@_;y/il-z/-+/d;s/\w+/$&{$&}/g;$_=$_[eval] Part of the code is taken from the Perl Golf book, section 9.3.2, Ton Hospel's post-mortem solution 129.52 eyepopslikeamosquito Fri Dec 29 10:18:08 2006 -lp sub'_{$;=0;s!.!y$IVCXL91-I0$XLMCDXVIII$dfor$;.=4x$&%1859^7!eg;$;}y;mp`-{;-+;d;s>\w+>$-=0;$_=++$-while$&ne&_;$->eg;$_=_$_=eval Ooops, forgot to delete a new line. 129.53 Juho Snellman Wed Dec 27 09:31:22 2006 -pl sub T{$_=pop;y!IVXLCDM!XLCDM_!,s!!$&-9?$&-4?I x$&:IV:IX!e,s!I{5}!V!while/\d/}y/mpa-z/-+/d;s!\w+!T++$?until/^$&$/;$?!ge;T eval Sorry, not any faster than the previous one. ;-) romancalc.pl: Running test 131 ... Ok (12 seconds) 129.53 eyepopslikeamosquito Fri Dec 29 06:37:14 2006 -lp sub'_{$;=0;s!.!y$IVCXL91-I0$XLMCDXVIII$dfor$;.=4x$&%1859^7!eg;$;}y;mpa-z;-+;d;s>\w+>$-=0;$_=++$-while$&ne&_;$->eg;$_=_$_=eval Desperate, I know, to submit just to improve the tiebreaker. I do find it a bit spooky that Juho and I now have identical tie-breaker. Surely we could not have independently found identical solutions? The odds against it must be astronomical. 129.54 Util Tue Jan 2 03:10:09 2007 -lp $i=$_,s!.!y$IVCXL91-I0$XLMCDXVIII$dfor$_[$i].=4x$&%1859^7;5!egfor 0..3999;@_{@_}=0..@_;y/il-z/-+/d;s/\w+/$_{$&}/g;$_=$_[eval] Part of the code is taken from the Perl Golf book, section 9.3.2, Ton Hospel's post-mortem solution 129.55 eyepopslikeamosquito Fri Dec 29 05:41:04 2006 -lp sub _{$;=0;s!.!y$IVCXL91-I0$XLMCDXVIII$dfor$;.=4x$&%1859^7!eg;$;}y;mpa-z;-+;d;s>\w+>$-=0;$_=++$-while$&ne _;$->eg;$_=_$_=eval I love that good ol' y/// operator. 130.46 jchsw Tue Jan 2 00:53:34 2007 map{y/IVXLC/XLCDM/,s//$&-9?$&-4?I x$&:IV:IX/e,s/I{5}/V/while/\d/;$$_=$i++}@n=0..4E3;$_=<>;y/pm/+-/;s/\w+/${$&}/g;print"$n[eval]\n" My code that scored 143.49 was entirely my own work. Subsequent code is partly based on sources found on the web, including the "Perlgolf history". In all submissions, I've restricted myself only to using code that I would be able to reproduce on my own. 130.47 Jasper Sat Dec 30 00:29:21 2006 -lp @d=map{my$a;$a=~y/IVXLC/XLCDM/,$a.=/4/?IV:/9/?IX:V x($_>3).I x($_%5)for/./g;$$a=$_;$a}0..4e3;y/m/-/;s/\w+/+${$&}/g;$_=$d[eval] 130.49 pijll Sun Dec 31 00:50:59 2006 -pl y/il-z/-+/d;for$a(1..4e3){($n[$a].=/4|9/?8+$_:2x($_>3).1x($_%5))=~y/12VXLC7I/IVLCDMX/for$a=~/./g;s/\b$n[$a]\b/$a/g}$_=$n[eval] Getting closer... I want to catch Andrew at least! 130.52 eyepopslikeamosquito Fri Dec 29 10:16:47 2006 -lp sub'_{$;=0;s!.!y$IVCXL91-I0$XLMCDXVIII$dfor$;.=4x$&%1859^7!eg;$;} y;mp`-{;-+;d;s>\w+>$-=0;$_=++$-while$&ne&_;$->eg;$_=_$_=eval Just another tie breaker hack (desperate to get ahead of Juno by 0.01). 131.53 Util Tue Jan 2 01:27:38 2007 -lp @_=map{$i=0;s!.!y$IVCXL91-I0$XLMCDXVIII$dfor$i.=4x$&%1859^7;5!eg;$i}0..3999;@_{@_}=0..@_;y/il-z/-+/d;s/\w+/$_{$&}/g;$_=$_[eval] Part of the code is taken from the Perl Golf book, section 9.3.2, Ton Hospel's post-mortem solution 131.56 eyepopslikeamosquito Fri Dec 29 02:01:43 2006 -lp sub _{$;=0;s!.!y$IVCXL91-I0$XLMCDXVIII$dfor$;.=4x$&%1859^7!eg;$;}y;mpislun;-+;d;s>\w+>$-=0;$_=++$-while$&ne _;$->eg;$_=_$_=eval 132.54 Util Tue Jan 2 01:07:43 2007 -lp @_=map{$i=0;s!.!y$IVCXL91-I0$XLMCDXVIII$dfor$i.=4x$&%1859^7;5!eg;$i}0..3999;@_{@_}=0..@_;y/mpa-z/-+/d;s/\w+/$_{$&}/g;$_=$_[eval] Part of the code is taken from the Perl Golf book, section 9.3.2, Ton Hospel's post-mortem solution 132.56 eyepopslikeamosquito Fri Dec 29 00:08:49 2006 -lp sub _{$;=!_;s!.!y$IVCXL91-I0$XLMCDXVIII$dfor$;.=4x$&%1859^7!eg;$;}y;mpislun;-+;d;s>\w+>$-=0;$_=++$-while$&ne _;$->eg;$_=_$_=eval Crikey, I'm within 40 strokes of ton! Out of my comfort zone now. :-) 133.52 Sec Sun Dec 31 20:41:20 2006 -pl %r=map{$a="";s/./y!IVCXL91-80!XLMCDXVIII!dfor$a.=4x$&%1859^7/eg;($a,++$b,$b,$a)}1..4e3; y/pm/+-/; s/\w+/$r{$&}/ge; $_=$r{eval$_}; Whoops. Forgot to remove some whitespace and comments in the last version 134.49 Jasper Fri Dec 29 23:33:37 2006 -lp @d=map{my$a;$a=~y/IVXLC/XLCDM/,$a.=('',I,II,III,IV,V,VI,VII,VIII,IX)[$_]for/./g;$$a=$_;$a}0..4e3;y/m/-/;s/\w+/+${$&}/g;$_=$d[eval] 134.49 pijll Sat Dec 30 19:53:21 2006 -pl y/il-z/-+/d;for$a(1..4e3){$n[$a]=~y/IVXLC/XLCDM/,$s=$n[$a].=/9/?IX:/4/?IV:V x($_>3).I x($_%5)for$a=~/./g;s/\b$s\b/$a/g}$_=$n[eval] 135.51 Daniel Tuijnman Tue Jan 2 02:05:18 2007 -pl s#\d#$@+=$.*$&*(2gt$'^$`=~/m[^p]*$/||-1),""#ge,$..=0while y/MDCLXVI/CLXVI51/;$@=~s!.! $_.=4x$&%1859^7;y$IVCXL91-z 0$XLMCDXVIII$d!eg 136.49 jchsw Mon Jan 1 04:34:05 2007 map{y/IVXLC/XLCDM/,s//("",I,II,III,IV,V,VI,VII,VIII,IX)[$&]/ewhile/\d/;$$_=$i++}@n=0..4E3;$_=<>;y/pm/+-/;s/\w+/${$&}/g;print"$n[eval]\n" 136.52 Daniel Tuijnman Tue Jan 2 02:03:22 2007 -pl s#\d#$@+=$.*$&*(2gt$'^$`=~/m[^p]*$/||-1),""#ge,$..=0while y/MDCLXVI/CLXVI51/;$@=~s!.!y$IVCXL91-z 0$XLMCDXVIII$dfor$_.=4x$&%1859^7!eg 136.53 szeryf Fri Dec 29 16:06:58 2006 -pl @r{plus,minus,@r=map{$a='';s/./y!IVCXL91-80!XLMCDXVIII!dfor$a.=4x$&%1859^7/eg;$a}0..4e3}=('+','-',0..4e3);s/\S+/$r{$&}/g;$_=@r[eval] 137.47 Jasper Fri Dec 29 22:41:23 2006 -lp map{$c='';$c=~y/IVXLC/XLCDM/,$c.=('',I,II,III,IV,V,VI,VII,VIII,IX)[$_]for/./g;$d[$$c=$_]=$c}1..3999;y/m/-/;s/\w+/+${$&}/g;$_=$d[eval] 137.56 ambrus Wed Dec 27 20:15:43 2006 -lp sub k{my$t;$t=~y/IVXLC/XLCDM/,$t.=("",I,II,III,IV,V,VI,VII,VIII,IX)[$_]for/./g;$$t=$_;$t}y/iul-z/-$+ /;k for 1..4e3;$_=k$_=eval"\$$_" 138.52 Daniel Tuijnman Tue Jan 2 00:46:51 2007 -pl s#\d#$@+=$.*$&*(2gt$'^$`=~/m[^p]*$/||-1),""#ge,$..=0while y/MDCLXVI/CLXVI51/;$@=~s!.!y$IVCXL91-z 0$XLMCDXVIII$dfor$_.=4x$&%1859^7;5!eg 139.46 Daniel Tuijnman Sun Dec 31 16:00:55 2006 -pl y/IVXLCDM/1-7/;s#\d#$@+=10**($&>>1)/(2-$&%2)*(1+$>$'^$`=~/i[^p]*$/||-1)#ge;$_=$@;s!.!y$IVCXL91-I0$XLMCDXVIII$dfor$#.=4x$&%1859^7;5!eg 139.50 Jasper Sun Dec 31 11:45:12 2006 -lp @d=map{ y/IVXLC/XLCDM/,s!\d!$&^4?$&^9?V x($&>3).I x($&%5):IX:IV!ewhile//; $$_=$n++;$_ }0..4e3; y/m/-/;s/\w+/+${$&}/g;$_=$d[eval] Finally fits in one of my screen widths! 139.51 pijll Sat Dec 30 16:48:43 2006 -lp y/pma-z/+-/d;for$a(1..4e3){$n[$a]=~y/IVXLC/XLCDM/,$s=$n[$a].=('',I,II,III,IV,V,VI,VII,VIII,IX)[$_]for$a=~/./g;s/\b$s\b/$a/g}$_=$n[eval] 140.46 Daniel Tuijnman Sun Dec 31 14:30:23 2006 -pl y/IVXLCDM/1-7/;s#\d#$@+=10**($&>>1)/(2-$&%2)*(1+$&le$'^$`=~/i[^p]*$/?-1:1)#ge;$_=$@;s!.!y$IVCXL91-I0$XLMCDXVIII$dfor$#.=4x$&%1859^7;5!eg 140.47 Jasper Fri Dec 29 16:24:42 2006 -lp map{$;='s/IIII/IV/;s/VIV/IX/;s/I(V|X)I/$1/;$;=~y/IVXLC/XLCDM/';eval$;for($c.=I)x3;$d[$$c=$_]=$c}1..4e3;y/m/-/;s/\w+/+${$&}/g;$_=$d[eval] 140.49 jchsw Mon Jan 1 03:39:35 2007 map{y/IVXLC/XLCDM/,s//("",I,II,III,IV,V,VI,VII,VIII,IX)[$&]/ewhile/\d/;$r{$_}=$i++}@n=0..4E3;$_=<>;y/pm/+-/;s/\w+/$r{$&}/g;print"$n[eval]\n" 141.45 Daniel Tuijnman Sun Dec 31 14:05:31 2006 -pl y/IVXLCDM/2-8/;s#\d#$@+=(10**(~-$&>>1)>>$&%2)*(1+$&le$'^$`=~/i[^p]*$/?-1:1)#ge;$_=$@;s!.!y$IVCXL91-I0$XLMCDXVIII$dfor$#.=4x$&%1859^7;5!eg 141.47 Juho Snellman Tue Dec 26 19:11:27 2006 -pl sub T{$_=$?;y!IVXLCDM!XLCDM_!,$_.=$&-9?$&-4?I x$&:IV:IX,s!I{5}!V!while s/\d//;$_}s!(m.*?)?([A-Z]+)!++$?until$2 eq T;$?=$r+=$1?-$?:$?!ge;T between 2 - 8 seconds per test on a dual xeon, that was fun! 142.53 Util Mon Jan 1 20:45:09 2007 -lp @_=map{$i=0;s!.!y$IVCXL91-I0$XLMCDXVIII$dfor$i.=4x$&%1859^7;5!eg;$i}0..3999;@_{@_,plus,minus}=(0..$#_,'+','-');s/\S+/$_{$&}/eg;$_=$_[eval] Part of the code is taken from the Perl Golf book, section 9.3.2, Ton Hospel's post-mortem solution 143.48 Jasper Fri Dec 29 15:21:10 2006 -lp %r=map{$;='s/IIII/IV/;s/VIV/IX/;s/I(V|X)I/$1/;$;=~y/IVXLC/XLCDM/';eval$;for($c.=I)x3;$d[$_]=$c,$_}1..4e3;y/m/-/;s/\w+/+$r{$&}/g;$_=$d[eval] 143.49 jchsw Sat Dec 30 08:01:54 2006 map{y/IVXLC/XLCDM/,s//("",I,II,III,IV,V,VI,VII,VIII,IX)[$&]/e while/\d/;$r{$_}=$i++}@n=(0..4E3);$_=<>;y/pm/+-/;s/\w+/$r{$&}/g;print"$n[eval]\n" 143.50 DWilson Mon Jan 1 21:11:25 2007 -alp sub r{$#='';s!.!y$IVCXL91-I0$XLMCDXVIII$dfor$#.=4x$&%1859^7;5!eg;$#}%%=map{$~=$_;r,$~}1..3999;y$mp^-~$-+$d||($_=$%{$_})for@F;$_=eval"@F";r Still using ton's a2r code as basis of conversion function. 143.51 DWilson Mon Jan 1 20:57:14 2007 -alp sub r{$#='';s!.!y$IVCXL91-I0$XLMCDXVIII$dfor$#.=4x$&%1859^7;5!eg;$#}%%=map{$~=$_;r,$~}1..3999;y/mpa-z/-+/d||($_=$%{$_})for@F;$_=eval"@F";r Still using ton's a2r code as basis for conversion function. 143.54 ambrus Wed Dec 27 13:54:44 2006 -lp sub k{my$t;$t=~y/IVXLC/XLCDM/,$t.=("",I,II,III,IV,V,VI,VII,VIII,IX)[$_]for$q=~/./g;s/\b$t\b/$q/g;$t}y/il-z/-+ /;for$q(1..4e3){k}$_=k$q=eval 144.53 ambrus Wed Dec 27 13:22:49 2006 -lp sub k{$t="";$t=~y/IVXLC/XLCDM/,$t.=("",I,II,III,IV,V,VI,VII,VIII,IX)[$_]for$q=~/./g;$t}for$q(1..4e3){k,s/\b$t\b/$q/g}y/il-z/-+ /;$_=k$q=eval 145.51 Daniel Tuijnman Sat Dec 30 14:08:11 2006 -pl y/mIVXLCDM-z/-1-7 /;s/\d+/+($&)/g;s#\d#qw/- +/[1+$>$'].10**($&>>1)/(2-$&%2)#ge;$_=eval;s!.!y$IVCXL91-I0$XLMCDXVIII$dfor$#.=4x$&%1859^7;5!eg 145.56 Shlomi Fish Sun Dec 31 20:51:55 2006 -lp sub f{split//;reverse map{(/./g)[map{vec'\xff\xfc\xf0\xc0\xf1\xfd\xf4\xd0@\xf2',$_++,2}(4*pop)x4]}qw(IVX XLC CDM M)}y/pm/+-/;s!\w+!(grep$&eq f,1..4x4)[0]!ge;$_=f$_=eval 146.49 Jasper Thu Dec 28 13:32:58 2006 -lp %r=map{$s='s/IIII/IV/;s/VIV/IX/;s/I(V|X)I/$1/';eval"$s;\$s=~y/IVXLC/XLCDM/"for($a.=I)x3;$d[$_]=$a,$_}1..4e3;y/m/-/;s/\w+/+$r{$&}/g;$_=$d[eval] 146.51 DWilson Mon Jan 1 20:50:06 2007 -alp sub r{$#='';s!.!y$IVCXL91-I0$XLMCDXVIII$dfor$#.=4x$&%1859^7;5!eg;$#}%%=map{$~=$_;r,$~}1..3999;y/mpa-z/-+/d||($_=$%{$_})for@F;$_=eval"@F";$_=r Using ton's a2r code (from web) as basis for conversion function. 147.33 mmultima Mon Jan 1 09:20:17 2007 -pa $_=${{map{$q+=$u{$t=$_}*$*;$*=5-/m/;s/./--$*x!($&%5-4).($*+4**($&<9))x($&>3).$*x($&%5&3)/ge;y/1-7/IXCMVLD/;$u{$_}=$t+0,$_}$|x4..4x4,@F}}{$q}.$/ Tried a reference. 147.54 ambrus Wed Dec 27 13:15:11 2006 -lp sub k{$t="";$t=~y/IVXLCD/XLCDMP/d,$t.=("",I,II,III,IV,V,VI,VII,VIII,IX)[$_]for$q=~/./g}for$q(1..4e3){k,s/\b$t\b/$q/g}y/il-z/-+ /;k$q=eval;$_=$t 147.56 Shlomi Fish Wed Dec 27 16:21:17 2006 -lp sub f{split//;reverse map{(/./g)[map{vec'\xff\xfc\xf0\xc0\xf1\xfd\xf4\xd0@\xf2',$_++,2}(4*pop)x4]}qw(IVX XLC CDM M)}tr/pm/+-/;s!\w+!(grep$&eq f,1..3999)[0]!ge;$_=f$_=eval 148.48 Daniel Tuijnman Sat Dec 30 13:53:00 2006 -pl y/mIVXLCDM-z/-1-7 /;s/\d+/+($&)/g;s#\d#qw/+ -/[("?"&$')>$&].10**($&>>1)/(2-$&%2)#ge;$_=eval;s!.!y$IVCXL91-I0$XLMCDXVIII$dfor$#.=4x$&%1859^7;5!eg 148.53 ambrus Wed Dec 27 11:58:32 2006 -lp sub k{$t="";$t=~y/IVXLCD/XLCDMP/d,$t.=("",I,II,III,IV,V,VI,VII,VIII,IX)[$_]for$q=~/./g}for$q(1..4e3){k,s/\b$t\b/$q/g}y/il-z/-+ /;$q=eval;k;$_=$t the 147 char version had a bug 148.59 Honza Pazdziora Mon Jan 1 19:32:57 2007 -lp ($c=F1000M900CM500D400CD100C90XC50L40XL10X9IX5V4IV1I)=~s/\d+(\D+)/${$$1=0 x$&}=$1,"|$$1|$1"/eg;sub p{s!$c!${$&}!g}p;1while s!\D+|(0+) m\D+\1!!;p 149.48 Daniel Tuijnman Sat Dec 30 05:05:15 2006 -pl y/mIVXLCDM-z/-1-7 /;s/\d+/+($&)/g;s#\d(?=(.))#qw/+ -/[$1>$&].10**($&>>1)/(2-$&%2)#ge;$_=eval;s!.!y$IVCXL91-I0$XLMCDXVIII$dfor$#.=4x$&%1859^7;5!eg 150.45 Juho Snellman Tue Dec 26 13:55:25 2006 -pl sub T{$_='';y!IVXLC!XLCDM!,$_.=I x$&,s!I{5}|(I)III!$1V!g,s!VIV!IX!while$?=~/./g;$_}s!(m.*?)?([A-Z]+)!$?=0;++$?until$2 eq T;$?=$r+=($1&"-").$?!ge;T 150.46 Daniel Tuijnman Fri Dec 29 18:51:58 2006 -pl y/mIVXLCDM-z/-1-7 /;s/\d+/+($&)/g;s#\d(?=(.))#($1>$&?"-":"+").10**($&>>1)/(2-$&%2)#ge;$_=eval;s!.!y$IVCXL91-I0$XLMCDXVIII$dfor$#.=4x$&%1859^7;5!eg 151.32 mmultima Mon Jan 1 00:46:15 2007 -pa %y=map{$q+=$u{$t=$_}*$*;$*=5-/m/;s/./(--$*.$*+(5&$&))x!($&%5-4)||($*+4)x($&>4).$*x($&%5)/ge;y/1-7/IXCMVLD/;$u{$_}=$t+0,$_}$|x4..4x4,@F;$_=$y{$q}.$/ And removed a pair of unnecessary parentheses. 151.46 Daniel Tuijnman Wed Dec 27 22:26:15 2006 -pl y/mIVXLCDMa-z/-1-7 /;s/\d+/+($&)/g;s#\d(?=(.))#($1>$&?"-":"+").10**($&>>1)/(2-$&%2)#ge;$_=eval;s!.!y$IVCXL91-I0$XLMCDXVIII$dfor$#.=4x$&%1859^7;5!eg 152.51 TedYoung Wed Dec 27 14:33:08 2006 -lp for$=(0..3){s/I[XV]/-$&/g,s/I|V/+$&E$=/g,y/MDCLXVIl-u/CLXVI51/d}s/i \S+/-($&)/g;$_=eval;y/IVXLC/XLCDM/,s//$&-9?$&-4?I x$&:IV:IX/e,s/I{5}/V/while/\d/ 152.55 Shlomi Fish Wed Dec 27 00:39:17 2006 -lp sub f{split//;reverse map{$k=4*pop;(/./g)[map{vec'\xff\xfc\xf0\xc0\xf1\xfd\xf4\xd0@\xf2',$k++,2}0..3]}qw(IVX XLC CDM M)}tr/pm/+-/;s!\w+!(grep$&eq f,1..3999)[0]!ge;$_=eval;$_=f 153.32 mmultima Mon Jan 1 00:40:34 2007 -pa %y=map{$q+=$u{$t=$_}*$*;$*=5-/m/;s/./(--$*.($*+(5&$&)))x!($&%5-4)||($*+4)x($&>4).$*x($&%5)/ge;y/1-7/IXCMVLD/;$u{$_}=$t+0,$_}$|x4..4x4,@F;$_=$y{$q}.$/ Back to position 14 for Amazon gift sertificate. Done with less obvious arithmetics. 153.53 TedYoung Tue Dec 26 19:58:37 2006 -lp for$i(0..3){s/I[XV]/-$&/g,s/I|V/+$&E$i/g,y/MDCLXVImp/CLXVI51+/}s/nus \S+/-($&)/g;$_=eval;y/IVXLC/XLCDM/,s//$&-9?$&-4?I x$&:IV:IX/e,s/I{5}/V/while/\d/ 155.32 tybalt89 Tue Dec 26 17:48:22 2006 -lp ++$I;$$_=$.*=$^F^=7for@@=VXLCDM=~/(.)/g;s//pm1=~$&?$-=$':$%+=$$1<${_&$'}^$-?-$$1:$$1/ge;$_=I x$%;$I+=2while+s/(.)\1{3}(\1{5})?(\1?)/$1x!$+.$@[$I^!$2]/ge 156.33 tybalt89 Sun Dec 24 15:26:26 2006 -lp ++$I;$$_=$.*=$^F^=7for@@=VXLCDM=~/(.)/g;s//$%+=$$1<${_&$'}^$-?-$$1:$$1;pm1!~$&or$-=$'/ge;$_=I x$%;$I+=2while+s/(.)\1{3}(\1{5})?(\1)?/$1x!$3.$@[$I^!$2]/ge 156.49 pijll Sat Dec 30 16:20:40 2006 -lp @r{@r=('',I,II,III,IV,V,VI,VII,VIII,IX)}=0..9;y/pma-z/+-/d;for$a(1..3999){$n[$a]=~y/IVXLC/XLCDM/,$n[$a].=$r[$_]for$a=~/./g;s/\b$n[$a]\b/$a/g}$_=$n[eval] The first real improvement! 157.55 Honza Pazdziora Mon Jan 1 16:22:50 2007 -p $c=F1000M900CM500D400CD100C90XC50L40XL10X9IX5V4IV1I;$c=~s/\d+(\D+)/$R{1x$&}=$1,"|$1|".($$1=1x$&)/eg;s!$c!${$&}!g;1while s! \D+|(1+) m\D+\1!!;s!$c!$R{$&}!g 158.34 tybalt89 Sun Dec 24 02:22:35 2006 -lp $I=1;$$_=$.*=$^F^=7for@@=VXLCDM=~/l|n|(.)/g;s//$%+=$$1<${_&$'}^$??-$$1:$$1;$+or$?=$&=~n/ge;$_=I x$%;$I+=2while+s/(.)\1{3}(\1{5})?(\1)?/$1x!$3.$@[$I^!$2]/ge 158.46 DWilson Mon Jan 1 15:47:23 2007 -alp sub r{$#='';s!.!y$IVCXL91-I0$XLMCDXVIII$dfor$#.=4x$&%1859^7;5!eg;$#}%%=map{$~=$_;r,$~}1..3999;s/p.*/)+(/||s/m.*/)-(/||($_=$%{$_})for@F;$_=eval"(@F)";$_=r aha. still using ton's a2r code. 159.53 Shlomi Fish Tue Dec 26 22:18:53 2006 -lp sub f{split//;reverse map{(/./g)[($k=pop)%5<4?((0)x($k%5),$k>4||()):(($k+1)/5,0)]}qw(IVX XLC CDM M)}tr/pm/+-/;s!\w+!(grep$&eq f,1..3999)[0]!ge;$_=eval;$_=f 160.55 Honza Pazdziora Mon Jan 1 15:33:58 2007 -p while(M1000CM900D500CD400C100XC90L50XL40X10IX9V5IV4I1=~/(\D+)(\d+)/g){$a.="|$1|".($$1=1x$2);$R{$$1}=$1}s!$a!${$&}!g;1while s! \D+|(1+) m\D+\1!!;s!$a!$R{$&}!g 163.31 mmultima Sun Dec 31 15:00:32 2006 -pa %y=map{$q+=$u{$_}*++$*;$*=4-/m/;$t=$_;s/./(--$*.($*+4**($&<9)))x!(($&+1)%5)||($*+4)x($&>4).$*x($&%5)/ge;y/0-6/IXCMVLD/;$u{$_}=$t+0,$_}$|x4..4x4,@F;$_=$y{$q}.$/ This is my first try at Perl Golf. I'm actually not a Perl programmer, so no wonder the pros beat me. 166.45 SubStack Mon Jan 1 01:23:29 2007 -lp @r{map@q{$_}=I x(10,9,5,4)[$@%4]x10**int 3-++$@/4,@s}=@s=MCMDCDCXCLXLXIXVIV=~/(.)(..)/g;1 while$"="|",s/@s|[^mpI]/$q{$&}/g+s/p|(I+)m(I+)/$1^$2/e;s/@q{@s}/$r{$&}/g 168.43 DWilson Mon Jan 1 00:35:37 2007 -alpF// @@{IVXLCDM=~/./g}=grep/^[15]0*$/,1..1e3;/m|p/&&($~=/m/),$^+=$@{$_}*($~^$@{$_}<$@{$F[++$*]}?-1:1)for@F;$_=$^;s!.!y$IVCXL91-I0$XLMCDXVIII$dfor$#.=4x$&%1859^7;5!eg Still using ton's Arabic to Roman conversion code for part of the solution. 168.44 SubStack Fri Dec 29 00:56:47 2006 -lp @r{map@q{$_}=I x(10,9,5,4)[$@%4]x(100,10,1)[$@++/4],@s}=@s=MCMDCDCXCLXLXIXVIV=~/(.)(..)/g;1 while$"="|",s/@s|[^mpI]/$q{$&}/g+s/p|(I+)m(I+)/$1^$2/e;s/@q{@s}/$r{$&}/g 168.48 DWilson Sun Dec 31 23:48:44 2006 -alpF// @r{IVXLCDM=~/./g}=grep/^[15]0*$/,1..1e3;/m|p/&&($c=/m/),$b+=$r{$_}*($c^$r{$_}<$r{$F[++$d]}?-1:1)for@F;$_=$b;s!.!y$IVCXL91-I0$XLMCDXVIII$dfor$#.=4x$&%1859^7;5!eg still using ton's published code for half of the solution. 169.36 tybalt89 Sat Dec 23 23:20:17 2006 -lp $@=.1;$$_=$@*=$^F^=7for-IVXLCDM=~/l|n|(.)/g;s//$%+=$$1<${_&$'}^$@eq+n?-$$1:$$1;$+or$@=$&/ge;sub'f{s/(.)\1{3}(\1{5})?(\1)?/$1x!$3.$_[!$2]/ge}$_=I x$%;f+X,V;f+C,L;f+M,D 169.40 Jasper Thu Dec 28 01:51:11 2006 -lp %r=@d=map{$a.=I;for(IVX,XLC,CDM){($i,$v,$x)=/./g;$a=~s/($v)?$i{4}/$i.($1?$x:$v)/e;$a=~s/$i($v|$x)$i/$1/}$a,"+$_"}1..3999;s/m\w+/-/g;s/\w+/$r{$&}/g;$_=$d[-2+2*eval$_] 169.49 DWilson Sun Dec 31 19:15:58 2006 -anlpF// @r{IVXLCDM=~/./g}=grep/^[15]0*$/,1..1e3;/m|p/&&($c=/m/),$b+=$r{$_}*($c^$r{$_}<$r{$F[++$d]}?-1:1)for@F;$_=$b;s!.!y$IVCXL91-I0$XLMCDXVIII$dfor$#.=4x$&%1859^7;5!eg Previous comment still applies (using ton's published arabic to roman code) 169.51 m.wrenn Tue Jan 2 06:55:20 2007 -lp @@{@@=map{$_,$_.0,$_*100}4,5,9,10}=qw(IV XL CD V L D IX XC CM X C M);for$~(@@){s/$@{$~}/"I "x$~/ge}s/I//while s/m\w* +I/m /;$~=y/I//cd;s/I{$~}/$@{$~}||$&/gewhile$~-- Last try for the T-Shirt! My eyes are popping too! 169.58 Honza Pazdziora Sun Dec 31 20:33:30 2006 -p while(M1000CM900D500CD400C100XC90L50XL40X10IX9V5IV4I1=~/(\D+)(\d+)/g){$a.='|'.($x=1x$2);$R{$x}=$m=$1;1while s!(\b|1)$m!$1$x!}1while s! \D+|(1+) m\D+\1!!;s!$a!$R{$&}!g 170.51 `/anick Tue Jan 2 02:00:41 2007 -lp040 $s=/m/ if/u/;($y=I1V5X10L50C100D500M1000IV4IX9XL40XC90CD400CM900)=~/$&/,$i=$t+=$s^"$;">($;=$')?-$;:$;while s/.$//}{1while$y=~/(\D+)$i/&&$t>=$i?($_.=$1,$t-=$i):$i-- 170.58 Honza Pazdziora Sun Dec 31 19:38:29 2006 -p while(M1000CM900D500CD400C100XC90L50XL40X10IX9V5IV4I1=~/(\D+)(\d+)/g){$a.='|'.($x=1x$2);$R{$x}=$m=$1;1while s!(\b|1)$m!$1$x!}1while s! p\D+|(1+) m\D+\1!!;s!$a!$R{$&}!g 171.50 m.wrenn Mon Jan 1 21:13:10 2007 -lp $^F**=@@{@@=map{$_,$_.0,$_*100}4,9,5,10}=qw(IV XL CD IX XC CM V L D X C M);for$~(@@){s/$@{$~}/"I "x$~/ge}s/I//while s/n\w* +I/n /;y/I//cd;s/I{$^F}/$@{$^F}||$&/gewhile$^F-- Using $^F! I hope it loads correctly 171.51 `/anick Tue Jan 2 01:55:30 2007 -lp040 $s=/m/ if/u/; ($y=I1V5X10L50C100D500M1000IV4IX9XL40XC90CD400CM900)=~/$&/,$i=$t+=$s^"$;">($;=$')?-$;:$;while s/.$//}{1while$y=~/(\D+)$i/&&$t>=$i?($_.=$1,$t-=$i):$i-- 172.33 tybalt89 Sat Dec 23 20:37:47 2006 -lp $@=.1;$$_=$@*=$^F^=7for-IVXLCDM=~/l|n|(.)/g;s//!$+?$.=(Z^$&)-5:$%+=$$1*($$1<${_&$'}?-$.:$.)/ge;sub'f{s/(.)\1{3}(\1{5})?(\1)?/$1x!$3.$_[!$2]/ge}$_=I x$%;f+X,V;f+C,L;f+M,D 172.48 DWilson Sun Dec 31 18:57:14 2006 -anlpF// @r{@r=IVXLCDM=~/./g}=grep/^[15]0*$/,1..1e3;/m|p/&&($c=/m/),$b+=$r{$_}*($c^$r{$_}<$r{$F[++$d]}?-1:1)for@F;$_=$b;s!.!y$IVCXL91-I0$XLMCDXVIII$dfor$#.=4x$&%1859^7;5!eg Up until now, it's been all my work as a general non-golfer. In this one, I used previously published Roman to Arabic code(Ton's) as part of the solution. 172.50 m.wrenn Mon Jan 1 16:51:34 2007 -lp @@{@@=map{$_,$_.0,$_*100}4,9,10,5}=qw(IV XL CD IX XC CM X C M V L D);for$~(@@){s/$@{$~}/"I "x$~/ge}s/I//while s/n\w* +I/n /;y/I//cd;$~=$$;s/I{$~}/$@{$~}||$&/gewhile--$~ Slow and uses $$, so I hope it still OK! 172.52 `/anick Tue Jan 2 01:47:22 2007 -lp040 $s=/m/ if/u/; ($y=I1V5X10L50C100D500M1000IV4IX9XL40XC90CD400CM900)=~/$&/,$i=$t+=$s^"$p">($p=$')?-$':$' while s/.$//}{1while$y=~/(\D+)$i/&&$t>=$i?($_.=$1,$t-=$i):$i-- 172.55 sf Sun Dec 31 20:30:16 2006 -pl %v=@a=M1000CM900D500CD400C100XC90L50XL40X10IX9V5IV4I1=~/\d+|\D+/g;$n+=/m/../p/?-$v{$_}:$v{$_}for/C[MD]|X[CL]|I[XV]|./g;$_<1?$s=$_:$n<$_||($r.=$s,$n-=$_,redo)for@a;$_=$r foo bar 2 172.60 Honza Pazdziora Sun Dec 31 19:31:20 2006 -p while(M1000CM900D500CD400C100XC90L50XL40X10IX9V5IV4I1=~/(\D+)(\d+)/g){$a.='|'.($x=1x$2);$R{$x}=$m=$1;1while s!(\b|1)$m!$1$x!}1while s! plus |(1+) m\D+ \1!!;s!$a!$R{$&}!g 173.51 m.wrenn Mon Jan 1 16:12:58 2007 -lp @@{@@=map{$_,$_.0,$_*100}4,9,10,5}=qw(IV XL CD IX XC CM X C M V L D);for$~(@@){s/$@{$~}/"I "x$~/ge}s/I//while s/n\w* +I/n /;y/I//cd;$~=2e3;s/I{$~}/$@{$~}||$&/gewhile--$~ I'm getting that cotton feeling! 173.52 eyepopslikeamosquito Thu Dec 28 11:45:44 2006 -lp y;mpislun;-+;d;s}\w+}$==1e3;$;=$_=$&;s>.>I1V5X10L50C100D500M1000!~/$&(.+)/;$;-=2*$=x($=<$1)-($==$1)>eg;$;}eg;$_=eval;s}.}y.IVCXL91-I0.XLMCDXVIII.dfor$#.=4x$&%1859^7;5}eg Sorry, it would not accept my Australian phone number, so I entered George Bush's phone number. The remarkable Ton Hospel strikes again! I wonder if he's generating all sorts of weird magical xor functions again. :-) I haven't played golf for four years now and am feeling very rusty. This first approach seems to be going nowhere, time for a new approach. I'm unhappy with this (dull) first attempt but thought I'd submit it anyway as a marker of my first approach. (I'm sure you'll recognize the last bit stolen from Mr Hospel's last Roman brilliancy). 173.53 `/anick Sun Dec 31 20:46:32 2006 -lp040 $s=/m/ if/u/; ($y=I1V5X10L50C100D500M1000IV4IX9XL40XC90CD400CM900) =~/$&/,$i=$t+=$s^"$p">($p=$')?-$':$' while s/.$//}{1while$y=~/(\D+)$i/&&$t>=$i?($_.=$1,$t-=$i):$i-- 174.46 SubStack Thu Dec 28 11:11:09 2006 -lp @r{map@q{$_}=I x(10,9,5,4)[$@%4]x(100,10,1)[$@++/4],@s}=@s=MCMDCDCXCLXLXIXVIV=~/(.)(..)/g;1 while$"="|",s/@s|[\0linus ]/$q{$&}/eg+s/p|(I+)m(I+)/$1^$2/e;s/@q{@s}/$r{$&}/eg 174.51 `/anick Sun Dec 31 18:01:55 2006 -lp040 $s=/m/ if/u/;($y=a1I5V10X50L100C500D1000M4IV9IX40XL90XC400CD900CM)=~/\d+$&/,$i=$t+=$s^"$p">($p=$&)?-$&:$&while s/.$//}{1while$y=~/$i(\D+)/&&$t>=$&?($_.=$1,$t-=$i):$i-- Yes, squeezing at 0.01 points before grizzley! 174.52 grizzley Fri Dec 29 13:36:40 2006 -pl sub f{s/[-+]\d/$&0/g;s/C(?=[MD])/-1/g;s/M/DD/g;s/D/+5/g;y/XCVLpIx/CMLDIX/}y/mpi-u/-+ /;s/\w+/($&)/g;f;f;f;s/M/+1/g;$_=eval;f,s/IIII/IV/,s/IVI/V/while s/\d/$&-9?p x$&:px/e No time to investigate it - bloody New Year's Eve... :P 175.33 tybalt89 Sat Dec 23 18:53:03 2006 -lp $@=.5;$$_=$@*=--$|?2:5for+IVXLCDM=~/l|n|(.)/g;s//!$+?$.=(Z^$&)-5:$%+=$$1*($$1<${_&$'}?-$.:$.)/ge;sub'f{s/(.)\1{3}(\1{5})?(\1)?/$1x!$3.$_[!$2]/ge}$_=I x$%;f+X,V;f+C,L;f+M,D A test to see if I have to get a 5.8.5, it runs on a 5.8.7 175.47 SubStack Thu Dec 28 04:32:33 2006 -lp $s{$q{$_}=I x(10,9,5,4)[$@%4]x(100,10,1)[$@++/4]}=$_ for@s=MCMDCDCXCLXLXIXVIV=~/(.)(..)/g;$"="|";1 while s/@s|[\0linus ]/$q{$&}/eg+s/p|(I+)m(I+)/$1^$2/e;s/@q{@s}/$s{$&}/eg better way of reversing a hash 175.51 `/anick Sun Dec 31 16:14:39 2006 -lp040 $y=a1I5V10X50L100C500D1000M4IV9IX40XL90XC400CD900CM;$s=/m/ if/u/;$y=~/\d+$&/,$i=$t+=$s^"$p">($p=$&)?-$&:$&while s/.$//}{1while$y=~/$i(\D+)/&&$t>=$&?($_.=$1,$t-=$i):$i-- 175.56 sf Sun Dec 31 20:28:36 2006 -pl %v=@a=M1000CM900D500CD400C100XC90L50XL40X10IX9V5IV4I1=~/\d+|\D+/g; $n+=/m/../p/?-$v{$_}:$v{$_}for/C[MD]|X[CL]|I[XV]|./g; $_<1?$s=$_:$n<$_||($r.=$s,$n-=$_,redo)for@a; $_=$r foo bar 176.45 carldr Tue Dec 26 05:27:04 2006 -p for($i=4e3;$j=--$i;){for$y(3,2,1,0){map{$e=$m[$i].=(M,CM,D,CD,C,XC,L,XL,X,IX,V,IV,I)[-3+$f++%16]x($j/($u=$_*10**$y));$j%=$u}(9,5,4,1)}s/\b$e/$i/g}y/pma-z/+-/d;$_="$m[eval] " 176.52 grizzley Thu Dec 28 22:47:16 2006 -pl sub f{s/[-+]\d/$&0/g;s/C(?=[MD])/-1/g;s/M/DD/g;s/D/+5/g;y/XCVLpIx/CMLDIX/} y/mpi-u/-+ /;s/\w+/($&)/g;f;f;f;s/M/+1/g;$_=eval; f,s/IIII/IV/,s/IVI/V/while s/\d/$&-9?p x$&:px/e little better - still leave some newlines 176.58 Honza Pazdziora Sun Dec 31 13:13:59 2006 -p while(M1000CM900D500CD400C100XC90L50XL40X10IX9V5IV4I1=~/(\D+)(\d+)/g){$a.='|'.($x=1x$2);$R{$x}=$m=$1;1while s!(\b|1)$m!$1$x!}1while s!^(1+) plus |(1+)\D+\2!$1!;s!$a!$R{$&}!g 176.59 m.wrenn Mon Jan 1 00:25:53 2007 -lp @A{@A=map{$_,$_.0,$_*100}4,9,10,5}=qw(IV XL CD IX XC CM X C M V L D);for$k(@A){s/$A{$k}/7x$k/ge}y/7/I/;s/I//while s/n\S* I/n /;y/I//cd;$m=2e3;s/I{$m}/$A{$m}||$&/gewhile--$m That T-shirt was quickly snatched from my grasp ... The champagne must wait! 178.45 carldr Tue Dec 26 04:59:41 2006 -p for($i=4e3;$j=--$i;){for$y(3,2,1,0){for$d(9,5,4,1){$e=$m[$i].=(M,CM,D,CD,C,XC,L,XL,X,IX,V,IV,I)[-3+$f++%16]x($j/($u=$d*10**$y));$j%=$u}}s/\b$e/$i/g}y/pma-z/+-/d;$_="$m[eval] " A 1-byte shorter, non-packed version. 178.51 `/anick Sun Dec 31 16:09:37 2006 -lp040 $y=a1I5V10X50L100C500D1000M4IV9IX40XL90XC400CD900CM;$s=/m/ if/u/;$y=~/\d+$&/,$i=$t+=$s^("$p">($p=$&))?-$&:$&while s/.$//}{1while$y=~/$i(\D+)/&&$t>=$&?($_.=$1,$t-=$i):$i-- 178.52 Lester/Krawczyk Tue Jan 2 06:47:06 2007 -lpa sub e{$z=I x$t;/\d+/,eval"\$z=~s/$`$`\{$&\}/$'/g"for I9X,X9C,C9M,C8CM,C4D,C3CD,X8XC,X4L,X3XL,I8IX,I4V,I3IV;$z}for$t(1..4e3,0){$x{&e}=$t}$t+=($.=/p/-/n/||$.)*$x{$_}for@F;$_=e Those pesky 10s are really just 9s that need to be incremented. 179.48 SubStack Thu Dec 28 01:35:39 2006 -lp @q{@s=MCMDCDCXCLXLXIXVIV=~/(.)(..)/g}=map{I x($_*(100,10,1)[$@++/4])}(10,9,5,4)x3;$"="|";1 while s/@s|[\0linus ]/$q{$&}/eg+s/p|(I+)m(I+)/$1^$2/e;s/@q{@s}/+{reverse%q}->{$&}/eg map! 180.51 carldr Sun Dec 24 13:03:46 2006 -p for($i=4e3;$j=--$i;){for$d(1000,900,500,400,100,90,50,40,10,9,5,4,1){$e=$m[$i].=(M,CM,D,CD,C,XC,L,XL,X,IX,V,IV,I)[$f++%13]x($j/$d);$j%=$d}s/\b$e/$i/g}y/pma-z/+-/d;$_="$m[eval] " 180.53 Lester/Krawczyk Mon Jan 1 20:24:29 2007 -lpa sub e{$z=I x$t;/\d+/,eval"\$z=~s/$`\{$&\}/$'/g"for I10X,X10C,C10M,C9CM,C5D,C4CD,X9XC,X5L,X4XL,I9IX,I5V,I4IV;$z}for$t(1..4e3,0){$x{&e}=$t} $t+=($.=/p/-/n/||$.)*$x{$_}for@F;$_=e Pete and I are putting our heads together, so you can knock out our previous entries. 180.57 m.wrenn Sat Dec 30 20:23:26 2006 -lp @A{@A=((map{$_,$_.0,$_*100}4,9,10,5),1)}=qw(IV XL CD IX XC CM X C M V L D I);for$k(@A){s/$A{$k}/7x$k/ge}s/7//while s/n\S* 7/n /;s/\D//g;for$k(sort{$b<=>$a}@A){s/7{$k}/$A{$k}/g} Just keep it moving ... 181.53 `/anick Sun Dec 31 06:06:19 2006 -lp040 $y=a1I5V10X50L100C500D1000M4IV9IX40XL90XC400CD900CM;$s=n gt$_ if/u/;$y=~/\d+$&/,$i=$t+=$s^("$p">($p=$&))?-$&:$&while s/.$//}{1while$y=~/$i(\D+)/&&$t>=$&?($_.=$1,$t-=$i):$i-- 181.55 m.wrenn Sat Dec 30 06:00:04 2006 -lp @A{@A=((map{$_,$_.0,$_*100}4,9,10,5),1)}=qw(IV XL CD IX XC CM X C M V L D I);y/ispmlun/-())+ /;for$k(@A){s/$A{$k}/+$k/g}$_=7x eval"($_)";for$k(sort{$b<=>$a}@A){s/7{$k}/$A{$k}/g} Just one stroke, but I need to protect my T-shirt! 181.57 Honza Pazdziora Sun Dec 31 11:52:33 2006 -p $"='|';while(M1000CM900D500CD400C100XC90L50XL40X10IX9V5IV4I1=~/(\D+)(\d+)/g){push@a,$r{$R{1x$2}=$1}=1x$2;push@l,$1;}s!@l!$r{$&}!g;1while s!^(1+) plus |(1+)\D+\2!$1!;s!@a!$R{$&}!g 182.38 Jasper Thu Dec 28 01:20:20 2006 -lp %r=@d=map{$a.=I;for$n(IVX,XLC,CDM){($i,$v,$x)=$n=~/./g;$a=~s/($v)?$i{4}/$i.($1?$x:$v)/e;$a=~s/$i($v|$x)$i/$1/g}$a,$_}1..3999;s/(m)?\w+/$1?'-':'+'.($r{$&}+0)/eg;$_=$d[-2+2*eval$_] 182.42 pengvado Mon Jan 1 07:32:13 2007 -alp use utf8;y/IVXLCDM/^A^E 2d\xc7\xb4\xcf\xa8/,$%=/s/?/m/:s/./$:+=("$&\xcf\xbf"lt$'^$%||-1)*ord$&/sgefor@F;$,=(($^=1+chop$:)%5?"":$_).($^>4&&int$_+$^/5).$_ x($^%5-1).$,for 0,2,4,6;$_=$,;y/0-6/IVXLCDM/ 182.50 carldr Sun Dec 24 13:00:50 2006 -p for($i=4e3;$j=--$i;){for$d(1000,900,500,400,100,90,50,40,10,9,5,4,1){$e=$m[$i].=(M,CM,D,CD,C,XC,L,XL,X,IX,V,IV,I)[$f++%13]x($j/$d);$j%=$d}s/\b$e\b/$i/g}y/pma-z/+-/d;$_="$m[eval] " 182.50 carldr Sun Dec 24 13:03:33 2006 -p for($i=4e3;$j=--$i;){for$d(1000,900,500,400,100,90,50,40,10,9,5,4,1){$e=$m[$i].=(M,CM,D,CD,C,XC,L,XL,X,IX,V,IV,I)[$f++%13]x($j/$d);$j%=$d}s/\b$e\b/$i/g}y/pma-z/+-/d;$_="$m[eval] " 182.52 `/anick Sun Dec 31 05:57:52 2006 -lp040 $y=a1I5V10X50L100C500D1000M4IV9IX40XL90XC400CD900CM;$s=n gt$&if/m|p/;$y=~/\d+$&/,$i=$t+=$s^("$p">($p=$&))?-$&:$&while s/.$//}{1while$y=~/$i(\D+)/&&$t>=$&?($_.=$1,$t-=$i):$i-- 182.55 m.wrenn Fri Dec 29 22:47:13 2006 -lp @A{@A=((map{$_,$_*10,$_*100}4,9,10,5),1)}=qw(IV XL CD IX XC CM X C M V L D I);for$k(@A){s/$A{$k}/+$k/g}y/ispmlun/-())+ /;$_=7x eval"($_)";for$k(sort{$b<=>$a}@A){s/7{$k}/$A{$k}/g} Still T-shirt capable ... 183.50 pijll Sat Dec 30 15:29:08 2006 -lp @r{@r=('',I,II,III,IV,V,VI,VII,VIII,IX)}=0..9;y/pma-z/+-/d;s#\w+#$_=$&;my$s;s/[VI].*|$//,$s=$r{$&}.$s,y/XLCDM/IVXLC/while$_;$s#ge;$g=~y/IVXLC/XLCDM/,$g.=$r[$_]for eval=~/./g;$_=$g 183.51 carldr Sun Dec 24 12:57:14 2006 -p for($i=4000;$j=--$i;){for$d(1000,900,500,400,100,90,50,40,10,9,5,4,1){$e=$m[$i].=(M,CM,D,CD,C,XC,L,XL,X,IX,V,IV,I)[$f++%13]x($j/$d);$j%=$d}s/\b$e\b/$i/g}y/pma-z/+-/d;$_="$m[eval] " 183.51 `/anick Sun Dec 31 05:54:24 2006 -lp040 $y=a1I5V10X50L100C500D1000M4IV9IX40XL90XC400CD900CM;$s=n gt$&if/m|p/;$y=~/\d+$&/,$i=$t+=$s^("$p">($p=$&))?-$&:$&while s/.$//}{$y=~/$i(\D+)/&&$t>=$&?($_.=$1,$t-=$i):$i--while$i 183.55 m.wrenn Fri Dec 29 15:50:31 2006 -lp @A{@A=((map{$_,$_*10,$_*100}4,9,10,5),1)}=qw(IV XL CD IX XC CM X C M V L D I);for$k(@A){s/$A{$k}/+$k/g}y/ispmlun/-())+ /;$_=I x eval"($_)";for$k(sort{$b<=>$a}@A){s/I{$k}/$A{$k}/g} Creeping into the money makes me wonder if the Fonality T-shirts are available on Amazon ... I'm sure the game will heat up and I will struggle on! 185.52 Shlomi Fish Tue Dec 26 16:35:10 2006 -lp sub f{split//;my$s;map{$s=join"",(/./g)[($k=pop)%5<4?($k>4||(),(0)x($k%5)):(0,($k+1)/5)],$s}qw(IVX XLC CDM M);$s}s!minus!-!g;s!plus!+!g;s!\w+!(grep$&eq f,1..3999)[0]!ge;$_=eval;$_=f 186.44 davidrw Fri Dec 29 04:55:17 2006 -lp @V{@I=(M,CM,D,CD,C,XC,L,XL,X,IX,V,IV,I)}=unpack w13,'\x87h\x87^D\x83t\x83^PdZ2( ^E^D^A';y/i-u/-+/s;s/\w+/($&)/g;s/C[MD]|X[CL]|I[VX]|\w/+$V{$&}/g;$d=$_=eval;for(@I){$#.=$_,$d-=$/while$d>=($/=$V{$_})} 186.48 Andy Lester Mon Jan 1 07:02:44 2007 -pla %n=I1V5X10L50C100D500M1000=~/(.)(\d+)/g;sub d{$#_-=$z*2*(@_&&$z<$_)-($z=$_)for@n{/./g};@_}$t+=($.=/p/-/n/||$.)*d for@F;map{$s.=$_ x($t/d),$t%=d}M,CM,D,CD,C,XC,L,XL,X,IX,V,IV,I;$_=$s Changed a for() to a map 187.43 Daniel Tuijnman Wed Dec 27 20:05:56 2006 -pl y/IVXLCDMpma-z/1-7+-/d;s/\d+/($&)/g;s#\d(?=(.))#($1>$&?"-":"+").10**($&>>1)/(2-$&%2)#ge;$_=eval;s#.#substr"IVIIIXLXXXCDCCCMMMMM",$&/5+2*($&<4)+3*($&>8)+5*length$',($&%4||$&/2)+$&/9#ge 187.49 Andy Lester Mon Jan 1 06:14:52 2007 -pla %n=I1V5X10L50C100D500M1000=~/(.)(\d+)/g;sub d{$#_-=$z*2*(@_&&$z<$_)-($z=$_)for@n{/./g};@_}$t+=($.=/p/-/n/||$.)*d for@F;$s.=$_ x($t/d),$t%=d for(M,CM,D,CD,C,XC,L,XL,X,IX,V,IV,I);$_=$s 188.55 Sec Sun Dec 31 20:37:30 2006 -l %r=map {$a="";s/./y!IVCXL91-80!XLMCDXVIII!d for $a.=4x$&%1859^7/eg; ($a,++$b,$b,$a) }1..4e3; #for (keys %r){ print "$_ => $r{$_}"; }; $_=<>; y/pm/+-/; s/\w+/$r{$&}/ge; print $r{eval$_}; First try at optimizing. 189.44 alankila Wed Dec 27 22:58:03 2006 -pliIV4IX9XL40XC90CD400CM900I1V5X10L50C100D500M1000 $^I=~s!\D+!$={$==+$'}=$&;s/$&/+$=/g!ge;y/ipul-s/-)(+)/d;$_=eval"($_)";$==10**y///c;s!.!$={$&*($=/=10)}||($&>5&&$={5*$=}).$={$=}x($&%5)!ge Beat Jasper & Substack for now! 189.50 carldr Sun Dec 24 12:55:46 2006 -p @r=(M,CM,D,CD,C,XC,L,XL,X,IX,V,IV,I);for($i=4000;$j=--$i;){for$d(1000,900,500,400,100,90,50,40,10,9,5,4,1){$e=$m[$i].=$r[$f++%13]x($j/$d);$j%=$d}s/\b$e\b/$i/g}y/pma-z/+-/d;$_="$m[eval] " 189.50 carldr Sun Dec 24 12:56:54 2006 -p @r=(M,CM,D,CD,C,XC,L,XL,X,IX,V,IV,I);for($i=4000;$j=--$i;){for$d(1000,900,500,400,100,90,50,40,10,9,5,4,1){$e=$m[$i].=$r[$f++%13]x($j/$d);$j%=$d}s/\b$e\b/$i/g}y/pma-z/+-/d;$_="$m[eval] " 189.50 Jasper Wed Dec 27 15:04:37 2006 -lp @r{@a=IVXLCDM=~/./g}=($m=1,5,10,50,100,500,1e3);$t+=($r{$a}<$m^/n[^p]+$/?-1:1)*($m=$r{$a})while$a=chop;s/^/('',1,11,111,13,3,31,311,3111,15)[chop$t]/e,eval"y/1-9/@a/",@a=@a[2..9]while$t 189.52 SubStack Wed Dec 27 10:16:04 2006 -lp $q{$_}=I x(1000,900,500,400,100,90,50,40,10,9,5,4)[$c++]for@s=MCMDCDCXCLXLXIXVIV=~/(.)(..)/g;$"="|";1 while s/@s|[\0linus ]/$q{$&}/g+s/p|(I+)m(I+)/$1^$2/e;s/@q{@s}/+{reverse%q}->{$&}/eg linus! 189.52 `/anick Sun Dec 31 05:50:34 2006 -ln040 $y=a1I5V10X50L100C500D1000M4IV9IX40XL90XC400CD900CM;$s=n gt$&if/m|p/;$y=~/\d+$&/,$i=$t+=$s^("$p">($p=$&))?-$&:$&while s/.$//}{$y=~/$i(\D+)/&&$t>=$&?($_.=$1,$t-=$i):$i--while$i;print 190.44 davidrw Thu Dec 28 17:43:46 2006 -lp @h{@A=(M,CM,D,CD,C,XC,L,XL,X,IX,V,IV,I)}=unpack w13,'\x87h\x87^D\x83t\x83^PdZ2( ^E^D^A';y/l-u//d;s/i.(\S+)/-($1)/g;s/C[MD]|X[CL]|I[VX]|\w/+$h{$&}/g;$d=$_=eval;for(@A){$#.=$_,$d=$!while($!=$d-$h{$_})>=0} 190.58 m.wrenn Fri Dec 29 05:12:52 2006 -lp @A{@A=(4,9,40,90,400,900,1,5,10,50,100,500,1e3)}=qw(IV IX XL XC CD CM I V X L C D M);for$k(@A){s/$A{$k}/+$k/g}y/ipmslun/-))(+ /;$_=I x eval"($_)";for$k(sort{$b<=>$a}@A){s/I{$k}/$A{$k}/g} So which logo looks better, Fonality or Trixbox? equal coolness on the logo. 191.49 pijll Sat Dec 30 15:12:06 2006 -lp @r{@r=('',I,II,III,IV,V,VI,VII,VIII,IX)}=0..9;y/pma-z/+-/d;s#\w+#$x=$&;my$s;$x=~s/[VI].*|$//,$s=$r{$&}.$s,$x=~y/XLCDM/IVXLC/while$x;$s#ge;$g=~y/IVXLC/XLCDM/,$g.=$r[$_]for eval=~/./g;$_=$g 192.50 Andy Lester Sat Dec 30 07:22:13 2006 -pla %n=I1V5X10L50C100D500M1000=~/(.)(\d+)/g;sub d{my$a;$a-=$z*2*($z<$_)-($z=$_)for@n{/./g};$a}$t+=($.=/p/-/n/||$.)*d for@F;map{while($t>=d){$t-=d;$s.=$_}}M,CM,D,CD,C,XC,L,XL,X,IX,V,IV,I;$_=$s Hooray for hash slices! 194.49 SubStack Tue Dec 26 04:17:55 2006 -lp $q{$_}=(1000,900,500,400,100,90,50,40,10,9,5,4)[$i++]for@r=MCMDCDCXCLXLXIXVIV=~/(.)(..)/g;$"="|";s/@r/I x$q{$&}/eg;1 while s/\0| p.{4}|(I+) m.{5}(I+)/$1^$2/e;for$@(@r){s/@{[I x$q{$@}]}/$@/g} combined hash and array creation for double plus goodness 195.49 Venky Iyer Sun Dec 31 23:35:54 2006 -pla @v=(M,CM,D,CD,C,XC,L,XL,X,IX,V,IV,I,10,9,5,4);sub R{$s=1x$_[0];map{$A=$v[13+$_%4]*10**(2-int$_/4);$s=~s/1{$A}/$v[$_]/g}0..12;$s}@s=map{/m/?'-':/p/?'+':grep{$' eq R$_}//..4e3}@F;$_=R eval"@s" 196.46 alankila Wed Dec 27 22:34:25 2006 -pliIV4IX9XL40XC90CD400CM900I1V5X10L50C100D500M1000 $^I=~s!(\D+)(\d+)!$={$==$2}=$1;s/$1/+$=/g!ge;y/implusn/-))+(/d;$_=eval"($_)";$==10**y///c;s!.!$={$&*($=/=10)}||($&>5&&$={5*$=}).$={$=}x($&%5)!ge Improved initial setup 196.49 Andy Lester Thu Dec 28 23:29:10 2006 -pla %n=I1V5X10L50C100D500M1000=~/(.)(\d+)/g;sub d{my$a;$a-=$z*2*($z<$n{$_})-($z=$n{$_})for/./g;$a}$t+=($.=/p/-/n/||$.)*d for@F;map{while($t>=d){$t-=d;$s.=$_}}M,CM,D,CD,C,XC,L,XL,X,IX,V,IV,I;$_=$s 196.49 Venky Iyer Sun Dec 31 13:27:37 2006 -pla @v=(M,CM,D,CD,C,XC,L,XL,X,IX,V,IV,I,10,9,5,4);sub r{$s=I x$_[0];map{$A=$v[13+$_%4]*10**(2-int$_/4),$s=~s/I{$A}/$v[$_]/g}0..12;$s}@s=map{/m/?'-':/p/?'+':grep{$' eq r$_}//..4e3}@F;$_=r eval"@s" 197.48 Andy Lester Thu Dec 28 20:20:18 2006 -pla %n=I1V5X10L50C100D500M1000=~/(.)(\d+)/g;sub d{$a=0;$a-=$z*2*($z<$n{$_})-($z=$n{$_})for/./g;$a}$t+=$.*d,$.=/p/-/n/||$. for@F;map{while($t>=d){$t-=d;$s.=$_}}M,CM,D,CD,C,XC,L,XL,X,IX,V,IV,I;$_=$s 197.49 carldr Sun Dec 24 12:42:29 2006 -p @n=(1000,900,500,400,100,90,50,40,10,9,5,4,1);@r=(M,CM,D,CD,C,XC,L,XL,X,IX,V,IV,I);for($i=4000;$j=--$i;){for$d(@n){$e=$m[$i].=$r[$f++%13]x($j/$d);$j%=$d}s/\b$e\b/$i/g}y/pma-z/+-/d;$_="$m[eval] " 198.49 carldr Sun Dec 24 12:40:46 2006 -p @n=(1000,900,500,400,100,90,50,40,10,9,5,4,1);@r=(M,CM,D,CD,C,XC,L,XL,X,IX,V,IV,I);for($i=4000;$j=--$i;){for$d(@n){$m[$i].=$r[$f++%13]x($j/$d);$j%=$d}s/\b$m[$i]\b/$i/g}y/pma-z/+-/d;$_="$m[eval] "