http://qs321.pair.com?node_id=11145638


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... ³

update

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.²

update

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

³) kind of golfing, isn't it?