A ladder system, for those of you who don't know, is where objects sit on "rungs" which determine their "score". Example, #1 rung is the highest spot. A lower rung that beats a higher rung (in whatever is being ranked) takes the higher rung's place, and the higher rung moves down x% of the total rungs.

How would one implement this efficiently in Perl? I am planning on using mySQL for the data storage, and was considering having a "rung" field. After thinking about this, I came to the conclusion that I'd need to modify lots and lots of fields to decrement their rung number if another object moved ahead. I eventually decided that the most efficient way would be to have a plaintext file with a unique identifier for each object stored with lines as their respective rungs. (ie: first line would be the first rung, 5th line would be the fifth rung, etc.) Then changing every rung's number would not be so intensive.

After thinking on this flattext + mySQL method, I decided I might as well be shooting myself in the foot. What would you monks recommend doing to keep track of rungs, preferrably staying away from a flattext list?

Thanks;


In reply to Implementation of a Ladder System by Anonymous Monk

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, details, 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, summary, 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.