Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sort { acts weird in some cases (even though Σ} works fine) #198

Open
kcruijss opened this issue Nov 4, 2022 · 3 comments
Open

Sort { acts weird in some cases (even though Σ} works fine) #198

kcruijss opened this issue Nov 4, 2022 · 3 comments

Comments

@kcruijss
Copy link

kcruijss commented Nov 4, 2022

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.

@monkeygroover
Copy link
Contributor

I think this may already be fixed? I can't repro using the code from master, the TIO version isn't up to date.

@monkeygroover
Copy link
Contributor

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]]

@kcruijss
Copy link
Author

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants