A 2nd IOPCC Winner
Author:
- Number Basher / Sunny Chang Lu at [[email protected]]([email protected])
Judges' Comments
Kafkian perversion of a program. Uses a variety of obfuscation techniques for great effect.Author's Comments
How to use
bash
python3.12 cursed_fib.py
Any additional parameters will be ignored.
After the script is run, the user will be prompted to enter a number. The script will then output the corresponding Fibonacci term for that number.
Python Version
Python 3.12 is expected. (Although Python 3.10+ should work fine.)
Required Libraries
- The latest version of
rich
for the colorized output. (python3.12 -m pip install rich
) time
,random
, andstruct
, all of which are built-in.
OS
Windows should work, but the original script was tested on a MacBook MacOS.
Properties
Uses a very efficient algorithm and a very inefficient algorithm for calculating the Fibonacci Series.
The very inefficient algorithm shows a visualization, and the very efficient algorithm is used to time the animation.
Technically, this program breaks at larger values due to precision issues, but at that point the inefficient algorithm probably won't even finish.
Algorithm used
Ha, I won't spoil it...
Easter Eggs
- The cursed variable names are found by pressing the
option
key on the Mac keyboard. - ChatGPT was used to generate the beginning and ending text shown when running the program.
- Rick Rolls everywhere (obvious enough).
- The main code can be completed as a 2D platformer. Maybe somebody can port it to Minecraft?
Exercises for the reader
- Find the time complexity of this algorithm.
- Decipher the docstring.
- Finish the platformer in Minecraft.
- Introduce better colors to the visual.
Author
Number Basher / Sunny Chang Lu at [email protected] .