Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot
 
PerlMonks  

comment on

( #3333=superdoc: print w/replies, xml ) Need Help??

As an aside, there are no other solutions of the form that Ton used (1x$&*XX where Ton's XX is 40). It seems that his solution truly is a one of a kind!
In addition to the one used in the 2006 Fonality golf challenge:
s!.!y$IVCXL426(-:$XLMCDIVX$dfor$$_.=5x$&*8%29628
don't forget about Ton's original one of equal length:
s!.!y$IVCXL91-80$XLMCDXVIII$dfor$$_.=4x$&%1859^7
used in the 2004 Polish golf tournament.

Update: Here is a test program to verify that all four magic formulae are correct:

use strict; use Roman; sub ton1 { my $t = shift; my $s; ($s.=4x$_%1859^7)=~y/IVCXL91-80/XLMCDXVIII/d for $t=~/./g; return $s } sub ton2 { my $t = shift; my $s; ($s.=5x$_*8%29628)=~y/IVCXL426(-:/XLMCDIVX/d for $t=~/./g; return $s } sub pmo1 { my $t = shift; my $s; ($s.="32e$_"%72726)=~y/CLXVI60-9/MDCLXVIX/d for $t=~/./g; return $s } sub pmo2 { my $t = shift; my $s; ($s.="57e$_"%474976)=~y/CLXVI0-9/MDCLXIXV/d for $t=~/./g; return $s } for my $i (1..3999) { my $r = uc roman($i); my $t1 = ton1($i); my $t2 = ton2($i); my $p1 = pmo1($i); my $p2 = pmo2($i); print "$i: $r\n"; $r eq $t1 or die "t1: expected '$r' got '$t1'\n"; $r eq $t2 or die "t2: expected '$r' got '$t2'\n"; $r eq $p1 or die "p1: expected '$r' got '$p1'\n"; $r eq $p2 or die "p2: expected '$r' got '$p2'\n"; } print "all tests successful\n";


In reply to Re^4: Dueling Flamingos: The Story of the Fonality Christmas Golf Challenge by eyepopslikeamosquito
in thread Dueling Flamingos: The Story of the Fonality Christmas Golf Challenge by eyepopslikeamosquito

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.
  • Log In?
    Username:
    Password:

    What's my password?
    Create A New User
    Chatterbox?
    and the web crawler heard nothing...

    How do I use this? | Other CB clients
    Other Users?
    Others making s'mores by the fire in the courtyard of the Monastery: (7)
    As of 2020-09-28 00:38 GMT
    Sections?
    Information?
    Find Nodes?
    Leftovers?
      Voting Booth?
      If at first I donít succeed, I Ö










      Results (143 votes). Check out past polls.

      Notices?