Beefy Boxes and Bandwidth Generously Provided by pair Networks
Welcome to the Monastery

Re^3: Challenge: sort weekdays in week-order (magical formula)

by LanX (Sage)
on Jul 21, 2022 at 15:44 UTC ( #11145638=note: print w/replies, xml ) Need Help??

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

Honestly, I find those magical formulas░ always too voodoo.

From a maintenance point of view they are horrible, because they don't scale well with new requirements.

Even Doomsday fails if you go back before Gregorian calendar

Cheers Rolf
(addicted to the Perl Programming Language :)
Wikisyntax for the Monastery

░) don't know the correct term here... │


there is only a limited number of orders 7!

so you could try a brute force search composing formulas based on inputs like substrings or word-length.

I'm still not sure if the solution will be shorter than just a clever list.▓


▓) tybaldt's solution with "motuwethfrsasu" is just an example of such a clever list.

│) kind of golfing, isn't it?

Log In?

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://11145638]
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others exploiting the Monastery: (7)
As of 2022-12-09 16:42 GMT
Find Nodes?
    Voting Booth?

    No recent polls found