A Python-based visualization tool for various esoteric and joke sorting algorithms.
-
Visualizations: High-density white bars on a black background with red highlights for active elements.
-
Algorithms Included:
- Bozo Sort: Randomly swaps two elements.
- Bogo Sort: Randomly shuffles the array.
- Slow Sort: A recursive "multiply and surrender" algorithm.
- Stalin Sort: Sends elements to the gulag if they are not in order.
- Sleep Sort: Uses sleep timers (simulated) to sort.
- Schrodinger's Sort: Checks if the cat is alive (sorted).
- Quantum Bogo Sort: Simulates destroying universes until a sorted one is found.
- Miracle Sort: Waits for a cosmic ray bit flip.
- ChatGPT Sort: Uses GPT-2 to "sort" the list (separate visualizer).
- Python 3.x
- Git (optional, for cloning)
- A GPU with CUDA support is optional (recommended for faster inference, but CPU works for smaller demos)
git clone https://github.com/toxicbishop/Esoteric-Sorts-Visualization.git
cd Esoteric-Sorts-VisualizationThe project includes a setup script that:
- Creates a
.venvvirtual environment (if it does not already exist) - Activates the virtual environment
- Upgrades
pip - Installs all packages from
requirements.txt
Run:
chmod +x setup.sh
./setup.shAfter the initial setup, you only need to activate the existing virtual environment:
chmod +x start.sh
./start.shThis activates .venv without reinstalling dependencies.
If you prefer not to use the scripts:
Windows (Git Bash)
python -m venv .venv
source .venv/Scripts/activate
pip install -r requirements.txtWindows (PowerShell)
python -m venv .venv
.\.venv\Scripts\Activate.ps1
pip install -r requirements.txtLinux/macOS
python3 -m venv .venv
source .venv/bin/activate
pip install -r requirements.txtStart the main sorting visualizer:
python visualize-sorts.pyFollow the on-screen menu to select a sorting algorithm.
To run the GPT-based sorting visualization:
python ChatGPT-Sort/visualize_chatgpt.pyEsoteric-Sorts-Visualization/
├── .venv/
├── setup.sh
├── start.sh
├── requirements.txt
├── visualize-sorts.py
├── ChatGPT-Sort/
└── ...
- The
.venvdirectory should not be committed to Git. - If
requirements.txtchanges, rerun:
./setup.shto install any new dependencies.
This project is licensed under the MIT License. See the LICENSE file for details.