Skip to content

Repository files navigation

Esoteric Sorts Visualization

A Python-based visualization tool for various esoteric and joke sorting algorithms.

Features

  • 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).

Setup Instructions

Prerequisites

  • Python 3.x
  • Git (optional, for cloning)
  • A GPU with CUDA support is optional (recommended for faster inference, but CPU works for smaller demos)

1. Clone the Repository

git clone https://github.com/toxicbishop/Esoteric-Sorts-Visualization.git
cd Esoteric-Sorts-Visualization

2. Create the Virtual Environment and Install Dependencies

The project includes a setup script that:

  • Creates a .venv virtual 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.sh

3. Activate the Environment for Future Sessions

After the initial setup, you only need to activate the existing virtual environment:

chmod +x start.sh
./start.sh

This activates .venv without reinstalling dependencies.

Manual Setup (Optional)

If you prefer not to use the scripts:

Windows (Git Bash)

python -m venv .venv
source .venv/Scripts/activate
pip install -r requirements.txt

Windows (PowerShell)

python -m venv .venv
.\.venv\Scripts\Activate.ps1
pip install -r requirements.txt

Linux/macOS

python3 -m venv .venv
source .venv/bin/activate
pip install -r requirements.txt

Running the Visualizer

Start the main sorting visualizer:

python visualize-sorts.py

Follow the on-screen menu to select a sorting algorithm.

Custom Visualizers

ChatGPT Sort

To run the GPT-based sorting visualization:

python ChatGPT-Sort/visualize_chatgpt.py

Project Structure

Esoteric-Sorts-Visualization/
├── .venv/
├── setup.sh
├── start.sh
├── requirements.txt
├── visualize-sorts.py
├── ChatGPT-Sort/
└── ...

Notes

  • The .venv directory should not be committed to Git.
  • If requirements.txt changes, rerun:
./setup.sh

to install any new dependencies.

License

This project is licensed under the MIT License. See the LICENSE file for details.

About

A Python visualization tool for esoteric, joke, and impractical sorting algorithms, featuring animated visualizations from Bozo Sort to Quantum Bogo Sort and ChatGPT Sort.

Topics

Resources

Stars

3 stars

Watchers

0 watching

Forks

Used by

Contributors

Languages