https://github.com/rastr1sr/pydonut
A one line implementation of donut.c (by a1k0n) using a custom obfuscated python format.
https://github.com/rastr1sr/pydonut
ascii-art donut python
Last synced: 7 months ago
JSON representation
A one line implementation of donut.c (by a1k0n) using a custom obfuscated python format.
- Host: GitHub
- URL: https://github.com/rastr1sr/pydonut
- Owner: rastr1sr
- License: gpl-3.0
- Created: 2024-11-24T02:53:58.000Z (11 months ago)
- Default Branch: main
- Last Pushed: 2024-11-24T04:35:29.000Z (11 months ago)
- Last Synced: 2025-01-08T02:35:34.054Z (9 months ago)
- Topics: ascii-art, donut, python
- Language: Python
- Homepage:
- Size: 1.45 MB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# pydonut 🍩
A one-line implementation of [donut.c](https://www.a1k0n.net/2011/07/20/donut-math.html) (by a1k0n) using an obfuscated Python format, along with a standard Python implementation.
![]()
## Overview
`pydonut` includes two versions of the classic ASCII donut animation:
1. **`donut.py`**: A straightforward Python implementation of the donut animation.
2. **`odonut.opy`**: An obfuscated version written in `.opy` format for fun and experimentation.The `.opy` format uses:
- Block markers (`{` and `}`) for indentation.
- A capital letter `S` as a line delimiter.This unique structure condenses the entire script into a single line. While the obfuscated version could be formatted into a torus shape for thematic flair, it was created simply as a lighthearted boredom project.
## How It Works
### Running the Obfuscated Version
1. Use the `opyparser.py` script to parse and execute the `odonut.opy` file.
2. The parser automatically runs the code after parsing.```bash
python opyparser.py odonut.opy
```### Running the Standard Version
You can run the standard Python implementation directly:```bash
python donut.py
```
### File Structure
- **`donut.py`**: The standard Python implementation of the donut animation.
- **`odonut.opy`**: The obfuscated `.opy` version of the donut implementation, where each line ends with `S` as a delimiter, and indentation is marked by `{` at the start and `}` at the end.
- **`opyparser.py`**: The script to parse and execute `.opy` files.### Why? 🤷
This project was created purely for fun and experimentation. The obfuscated version demonstrates alternative Python formatting, while the standard version provides a more accessible reference for the donut animation. Feel free to explore, modify, or improve both versions!### Credits
- Inspired by [a1k0n's donut.c](https://www.a1k0n.net/2011/07/20/donut-math.html).
- Original idea and Python adaptation by Rastrisr.### Better Implementations
For more polished and readable implementations of the same donut animation in Python:
- A standard Python implementation: [Julius-Syvis/DonutPy](https://github.com/Julius-Syvis/DonutPy)
- A torus-shaped formatted implementation: [EvanZhouDev/donut-py](https://github.com/EvanZhouDev/donut-py)
*(Do check them out !)*---
*(You could format the script into a torus shape, but honestly, who has the time?)*