oneshotlm
Compare all models on this prompt →

L-system tree · qwen3.6-27b

Output generated Cost / run $0.0135 Runtime 76.5s

Prompt for this run

Using the pre-provided p5.min.js (global p5), grow a procedural L-system fractal tree that branches recursively and sways gently in the wind.

⛨ sandboxed Open in new tab ↗

TAKE IT TO CODE

A single self-contained HTML file — copy it and open in any browser, or reuse the prompt with your own pi-agent run.

RUN

modelqwen3.6-27b
vendorQwen
harnesspi-agent
generated2026-07-31

METRICS

runtime76.5s
tokens in11k
tokens out3.5k
cached2.9k
cost / run$0.0135
Transcript · 6 messages
user

Using the pre-provided p5.min.js (global p5), grow a procedural L-system fractal tree that branches recursively and sways gently in the wind.

assistant
thinking
The user wants me to create a single-page web app using p5.js (already provided as p5.min.js) that generates a procedural L-system fractal tree with wind animation. Let me plan this out:

1. **L-system**: I'll implement a classic L-system grammar for tree generation
2. **Fractal tree**: Use angle-based branching with recursive drawing
3. **Wind effect**: Apply a time-based sine wave rotation to branches to simulate swaying

Let me design the L-system:
- Axiom: "F"
- Rules: F → FF+[[F]-F]-F (or similar branching rule)
- Angle: ~ 25-30 degrees
- Depth: 5-7 levels

For wind:
- Each branch level gets a phase offset based on time and depth
- Higher branches sway more than lower ones
- Use sin(time + depth * phase) to create organic motion

Let me also make it visually appealing:
- Gradient background (sky colors)
- Trunk and branches with varying thickness
- Leaves or flowers at the tips
- Nice color palette

I'll write the complete index.html file.

I'll build a beautiful procedural L-system fractal tree with organic wind swaying. Let me create the complete file:

→ write /workspace/index.html (7711 bytes)
toolResult

Successfully wrote 7711 bytes to /workspace/index.html

assistant
thinking
Let me verify the file is present and correct.
→ bash {"command":"ls -la /workspace/index.html /workspace/p5.min.js"}
toolResult

-rw-r--r-- 1 node node 9173 Jul 31 03:03 /workspace/index.html -rw-r--r-- 1 node node 1034532 Jul 31 03:01 /workspace/p5.min.js

assistant
thinking
Both files are present. Let me verify the structure of index.html is correct by quickly checking it.

Both files are in place. Here's what the app does: ### L-System Fractal Tree with Wind **L-System grammar:** - **Axiom:** `X` - **Rules:** `X → F[+X][-X]FX`, `F → FF` - **8 iterations** producing a deeply branching fractal tree **Wind swaying:** - Each branch level gets a sinusoidal sway offset proportional to its depth (tip branches sway most) - A secondary micro-sway layer adds organic irregularity - Phase offsets shift by position so different branches move slightly out of sync **Visual features:** - 🌌 Night sky gradient background with **200 twinkling stars** - 🌳 Trunk and branches colored in browns, thinning with each level - 🍃 Leaves clustered at the tips (green palette, semi-transparent, drifting in the wind) - 🌸 Occasional flowers (petals + yellow centers) at branch ends - 🌱 Animated grass blades at the ground line, swaying in the wind - 🌧️ Subtle rain effect for atmosphere - 📐 Responsive — resizes with the window