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

Order of wcaEvents is mangled by JS semantics #351

Open
lgarron opened this issue Jan 2, 2025 · 0 comments
Open

Order of wcaEvents is mangled by JS semantics #351

lgarron opened this issue Jan 2, 2025 · 0 comments
Labels
🐞 bug Something isn't working 📦 cubing/puzzles

Comments

@lgarron
Copy link
Member

lgarron commented Jan 2, 2025

The keys of

export const wcaEvents: Record<string, EventInfo> = {
"333": { puzzleID: "3x3x3", eventName: "3x3x3 Cube" },
"222": { puzzleID: "2x2x2", eventName: "2x2x2 Cube" },
"444": { puzzleID: "4x4x4", eventName: "4x4x4 Cube" },
"555": { puzzleID: "5x5x5", eventName: "5x5x5 Cube" },
"666": { puzzleID: "6x6x6", eventName: "6x6x6 Cube" },
"777": { puzzleID: "7x7x7", eventName: "7x7x7 Cube" },
"333bf": { puzzleID: "3x3x3", eventName: "3x3x3 Blindfolded" },
"333fm": { puzzleID: "3x3x3", eventName: "3x3x3 Fewest Moves" },
"333oh": { puzzleID: "3x3x3", eventName: "3x3x3 One-Handed" },
clock: { puzzleID: "clock", eventName: "Clock" },
minx: { puzzleID: "megaminx", eventName: "Megaminx" },
pyram: { puzzleID: "pyraminx", eventName: "Pyraminx" },
skewb: { puzzleID: "skewb", eventName: "Skewb" },
sq1: { puzzleID: "square1", eventName: "Square-1" },
"444bf": { puzzleID: "4x4x4", eventName: "4x4x4 Blindfolded" },
"555bf": { puzzleID: "5x5x5", eventName: "5x5x5 Blindfolded" },
"333mbf": { puzzleID: "3x3x3", eventName: "3x3x3 Multi-Blind" },
};
are sorted by event ID matching the WCA website (per the DB), but some event strings are valid indistinguishable from number keys (since all JS object keys are strings).

This almost almost almost keeps the events sorted, except JS runtimes are required to sort 222 ahead of 333 for iteration order. 😭

I think we need to export a separate list to provide a correct ordering. 😣

@lgarron lgarron added 📦 cubing/puzzles 🐞 bug Something isn't working labels Jan 2, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🐞 bug Something isn't working 📦 cubing/puzzles
Projects
None yet
Development

No branches or pull requests

1 participant