Open kcruijss opened 1 year ago
I think this may already be fixed? I can't repro using the code from master, the TIO version isn't up to date.
echo "[1,3,4,2]" | osabie sort.abe
Current: [[3, 4, 2, 1], [4, 2, 1, 3], [2, 1, 3, 4], [1, 3, 4, 2], [1, 2, 4, 3], [3, 1, 2, 4], [4, 3, 1, 2], [2, 4, 3, 1]]
Expected: [[1, 2, 4, 3], [1, 3, 4, 2], [2, 1, 3, 4], [2, 4, 3, 1], [3, 1, 2, 4], [3, 4, 2, 1], [4, 2, 1, 3], [4, 3, 1, 2]]
Actual: [[1, 2, 4, 3], [1, 3, 4, 2], [2, 1, 3, 4], [2, 4, 3, 1], [3, 1, 2, 4], [3, 4, 2, 1], [4, 2, 1, 3], [4, 3, 1, 2]]
Ah. Maybe I should contact ATO to support (the latest version of) 05AB1E, since TIO isn't being updated anymore since Dennis left codegolf.stackexchange.com.
Not sure how to explain it, but
{
didn't sort a list of lists in expected lexicographical order in one of my programs, even with--no-lazy
compiler flag. And the weirdest part is thatΣ}
(sort-by builtin without implementation) does sort correctly as expected.Not sure if it's relevant (it probably is), but I've used
ā._Dí«
beforehand to get all rotations and reflections of the list.Try it online to reproduce.
Found in this 05AB1E answer of mine.