oneshotlm
Compare all models on this prompt →

L-system tree · glm-4.5

Output generated Cost / run $0.0053 Runtime 41.1s

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

modelglm-4.5
vendorZ.ai · GLM
harnesspi-agent
generated2026-08-01

METRICS

runtime41.1s
tokens in4.5k
tokens out1.8k
cached2.6k
cost / run$0.0053
Transcript · 4 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 with a procedural L-system fractal tree that branches recursively and sways gently in the wind. I need to:

1. Create an index.html file with CSS in a <style> tag and JS in a <script> tag
2. Use the pre-provided p5.min.js library (load it with <script src="p5.min.js"></script>)
3. Implement an L-system fractal tree with:
   - Recursive branching
   - Gentle wind swaying animation

Let me create this file with all the code inline.

I'll create a single-page web app with a procedural L-system fractal tree that sways gently in the wind using p5.js.

→ write /tmp/ws/index.html (4492 bytes)
toolResult

Successfully wrote 4492 bytes to /tmp/ws/index.html

assistant
thinking
I've created the index.html file with:
- A complete L-system fractal tree implementation
- Wind swaying animation using sine waves
- Gradient sky background with a moon
- Ground with subtle coloring
- Falling leaves animation
- All CSS and JS inline, no external resources except the provided p5.min.js

The tree uses the L-system grammar: F -> FF+[+F-F-F]-[-F+F+F] which creates a beautiful branching pattern. The wind effect is applied by rotating branches based on their length (shorter branches sway more) and using sine waves for smooth, natural motion.

I've created `index.html` with a procedural L-system fractal tree that sways gently in the wind. The app features: - **L-System Grammar**: Uses the rule `F → FF+[+F-F-F]-[-F+F+F]` to generate organic branching patterns - **Wind Animation**: Branches sway naturally using sine waves, with smaller branches moving more than larger ones - **Visual Polish**: - Gradient night sky background - Glowing moon - Ground plane - Falling autumn leaves with varied colors - **Dynamic Coloring**: Branches transition from brown trunk to green tips - **Responsive**: Resizes with the window The tree grows through 4 iterations of the L-system, creating a complex recursive structure that animates smoothly with the wind simulation.