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

Incorrect sorting algorithm used #1183

Open
mark-b5 opened this issue Feb 4, 2025 · 0 comments
Open

Incorrect sorting algorithm used #1183

mark-b5 opened this issue Feb 4, 2025 · 0 comments

Comments

@mark-b5
Copy link
Contributor

mark-b5 commented Feb 4, 2025

this.sort((a, b) => {

The 04scape engine is using the typescript built-in Array.prototype.sort(), which goes without saying it not the sorting algorithm OSRS uses for heropoints

Here is a javascript implementation of a quicksort algorithm that matches the one used by OSRS. This implementation is by Keyboard, the player who figured out OSRS heropoints mechanics, including the qs algorithm and the 16-player limit

https://github.com/qwertypedia/qwertypedia.github.io/blob/dcea5dad6043bbbecbad60f7edda6e35fc5b2c63/killcreditcalc.js#L53

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

1 participant