oneshotlm
Compare all models on this prompt →

L-system tree · glm-4.5

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 ↗
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.

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

EVALUATION

3/5 working

Procedural L-system trees grow and sway with falling leaves/particles against a night sky with moons.

Vision grade · anthropic/claude-sonnet-5

MEASUREMENTS

Raw readings from the capture, not a verdict — the grade above is the only judgement. Percentages are how much of the screen changed; the measure under-reports sparse motion on a dark background.

idle motion1.0%
on click4.8%
on drag4.6%
on wheel4.7%
on enter + space5.1%
on arrow keys3.5%
on w/a/s/d4.8%
frame spread10.4 / 255
console errors0
js errors none

METRICS

runtime41.1s
tokens in4.5k
tokens out1.8k
cached2.6k
cost / run$0.0053