Mate, fancy a proper challenge? This isn’t your nan’s sorting visualiser - it’s you vs. QuickSort in a full‑on race.
I got bored of just watching arrays get sorted - so I thought, why not jump in and have a go myself? In PivotPanic, you’re on the left panel, swapping bars with your mouse, trying to beat QuickSort running on the right.
You’ve got a timer, you’ve got swaps to count, and you’ve got bragging rights if you finish first. 🏆
| Key / Action | What It Does |
|---|---|
| 🖱 Click two bars | Swap ’em. Nice and simple. |
| R | Restart with a fresh shuffle (same for both sides) |
| 1 / 2 / 3 | Pick your poison: 12 / 24 / 36 bars |
| SPACE | Pause QuickSort if you need a cheeky breather |
| ESC / Q | Bail out |
✅ As soon as either side’s sorted, the clock stops — winner takes the glory.
Right, here’s what you do:
git clone https://github.com/Rayaan2009/PivotPanic.git
cd PivotPanic
python -m venv .venv && source .venv/bin/activate # optional but tidy
pip install pygame
python pivotpanic.pyRuns on Python 3.10+, no fuss.
- QuickSort’s running Lomuto partition under the hood, step‑by‑step.
- Each compare / swap / pivot is yielded for a smooth animation.
- Pygame’s doing all the graphics and input magic at 60 FPS.
- Tracks your time and swaps, then throws up a results screen when it’s all over.
- Add sound effects & flashy particles when you swap (make it feel spicy)
- Bigger arrays for absolute chaos
- Maybe throw in MergeSort, HeapSort, BubbleSort just for a laugh
- Global leaderboard? Let’s make this competitive 👀
MIT — go wild, just don’t nick the credit.
Made with ❤️ by Rayaan2009
Now get in there and show QuickSort who’s boss. And no sulking if it beats you, alright? 😉
