*A recursive fractal tree generator built during New Year's Eve instead of celebrating* π
---
Instead of studying or popping champagne at midnight, I decided to create a mesmerizing recursive tree using Pythonβs turtle module. Because nothing says βHappy New Yearβ quite like recursion and fractal patterns! π
This project draws a beautiful branching tree structure with orange blossoms, reminiscent of dandelions swaying in the wind β hence the poetic name.
# Just Python! No external dependencies needed
python --version # Python 3.x
# Clone this repository
git clone https://github.com/willow788/Wishing-On-Dandelions.git
# Navigate to the directory
cd Wishing-On-Dandelions/Code
# Run the magic
python main.py
The heart of this project is a simple yet elegant recursive function:
def tree(i):
if i < 10:
return
else:
t.forward(i)
t.color("orange")
t.circle(2) # Draw a blossom
t.color("brown")
t.left(30)
tree(3 * i/4) # Left branch (recursion!)
t.right(60)
tree(3 * i/4) # Right branch (more recursion!)
t.left(30)
t.backward(i)
Each branch splits into two smaller branches, creating a beautiful fractal pattern that resembles natureβs own design!
Want to make it your own? Try tweaking these parameters:
t.speed(100) β Change drawing speed (1-100)tree(100) β Adjust initial branch length for bigger/smaller treest.left(30) & t.right(60) β Modify angles for different branch patterns3 * i/4 β Change the ratio for bushier or sparser treesDandelions symbolize wishes, dreams, and new beginnings. What better way to welcome the new year than by creating something beautiful instead of cramming for exams? Sometimes the best memories come from spontaneous acts of creativity! π
This project is open source and available under the MIT License. Feel free to fork, modify, and create your own procrastination masterpieces!