The latter: some kind of algorithm or rather a transform of each weekday into a new name which is alphabetically sorted right (as per the %order or whatever calendar order). For example, transform each weekday by removing the 1st letter, then their cmp order is correct. OK this does not work. But I was looking for this kind of transform. Of course I can try exhaustively find such transform with random masks on the weekday bytes.

monday:011011010110111101101110011001000110000101111001 tuesday:01110100011101010110010101110011011001000110000101111001 wednesday:011101110110010101100100011011100110010101110011011001000110 +000101111001 thursday:0111010001101000011101010111001001110011011001000110000101111 +001 friday:011001100111001001101001011001000110000101111001 saturday:0111001101100001011101000111010101110010011001000110000101111 +001 sunday:011100110111010101101110011001000110000101111001

(with this:

for (qw/monday tuesday wednesday thursday friday saturday sunday/){ print $_ .':'. join('', map { sprintf "%08b", ord($_) } split(//, lc +$_))."\n"; }
)


In reply to Re^2: Challenge: sort weekdays in week-order (elegantly and efficiently) by bliako
in thread Challenge: sort weekdays in week-order (elegantly and efficiently) by bliako

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.