The Scrambles page (Documentation Index
Fetch the complete documentation index at: https://mintlify.com/SdazaP/ruTournament/llms.txt
Use this file to discover all available pages before exploring further.
/dashboard/tournament/:id/scrambles) is where you produce official WCA scramble sequences for every round of your competition. Rather than relying on an external service, ruTournament embeds the csTimer engine as a browser Web Worker so scrambles are generated entirely on-device — no internet connection required once the app is loaded.
How scramble generation works
On page load, the app spawns a dedicatedWorker pointed at /cstimer_module.js. The worker listens for messages that carry a sequential ID, a command (scramble or image), and parameters. Each call returns a promise resolved by a per-message callback stored in callbacksRef.
When you trigger generation, the app:
- Looks up the WCA event name in the
wcaEventMapto get the csTimer puzzle type and scramble length. - Iterates over each group (or a virtual single-group if the round has no groups configured).
- Calls
getScramble(scType, scLength)for every solve slot, thengetImage(text, scType)to render the puzzle-state SVG. - Strips the fixed
width/heightattributes from the SVG and replaces them with a responsiveviewBoxso the image scales correctly on all screens. - Assembles
ScrambleRecord[]objects and writes them back to the tournament record in IndexedDB viadb.tournaments.put().
Scramble count per round
| Format | Official solves | Extra solves | Total generated |
|---|---|---|---|
| ao5 | 5 | 2 | 7 |
| ao3 | 3 | 2 | 5 |
WCA event map
The following table shows how category names map to csTimer puzzle identifiers. Only categories whose name appears in this map support automatic scramble generation; custom categories display an informational message instead.0 tells csTimer to use its default optimal length for that puzzle type; larger values (e.g. 100 for 7x7) request longer move sequences.
ScrambleRecord structure
Each generated scramble is stored as aScrambleRecord object defined in src/common/db.ts:
round.scrambles array (for ungrouped rounds) or inside each group.scrambles array (for grouped rounds) within the tournament document in IndexedDB.
Generating scrambles
Select a category and round
Use the Categoría and Ronda dropdowns at the top of the page. The dropdowns are populated from all categories registered in the tournament. The round selector lists rounds with their format (ao3/ao5) and a 🏆 indicator for the final round.
Check group configuration
If the round has groups configured (via the Group Scheduler), each group receives its own set of scrambles. If no groups exist, a dialog offers two options: generate scrambles without groups (a single sequence for the whole round) or navigate to the Group Scheduler first.
Click Generate
Click Generar mezclas. A spinning icon and an inline progress bar (
0 % → 100 %) track completion. The percentage reflects how many individual scramble-plus-image pairs have been computed out of the total.Larger puzzles take longer to compute. 6x6 and 7x7 scrambles may take several seconds each because their random-state solvers require more computation. The progress bar advances solve-by-solve, so you will see incremental updates rather than a long pause.
Clearing scrambles
If you need to replace the current set of scrambles, click the Limpiar Todo button (red, with a trash icon) that replaces the Generate button once scrambles exist. A confirmation modal asks you to confirm before allscrambles arrays for every group in that round are set to [] and persisted to IndexedDB.
The Generate and Clear buttons are hidden when the tournament status is Finalizado. A lock badge is displayed instead, indicating that scramble data is permanently preserved.
