oneshotlm
Compare all models on this prompt →

L-system tree · kimi-k2-thinking

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 · 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 a single-page web app that:
1. Uses p5.min.js (already present in current dir)
2. Generates a procedural L-system fractal tree
3. The tree should branch recursively
4. The tree should sway gently in the wind
5. All code must be in one self-contained index.html file
6. CSS in <style> tag, JS in <script> tag
7. No external resources/CDNs

First, I should check if p5.min.js exists in the current directory, then create index.html with:
- HTML structure
- CSS styling
- p5.js setup
- L-system implementation
- Animation with wind swaying

Let me start by checking the current directory structure and if p5.min.js exists.

I'll create a procedural L-system fractal tree with gentle wind swaying animation using p5.js. Let me first check the current directory and then build the index.html file

bash {"command":"ls -la"}
toolResult

total 1012 drwxr-sr-x. 2 node node 23 Aug 1 20:14 . drwxrwsrwx. 3 root node 16 Aug 1 20:14 .. -rw-r--r--. 1 node node 1034532 Aug 1 20:14 p5.min.js

assistant
thinking
Good, p5.min.js is present. Now I'll create a comprehensive L-system fractal tree implementation with wind swaying. I'll need to:

1. Create the HTML structure with embedded CSS and JavaScript
2. Implement an L-system parser and renderer
3. Add wind animation using sine waves
4. Make it visually appealing with colors and details

Let me create a complete implementation with:
- HTML5 boilerplate
- CSS for styling
- p5.js sketch
- L-system grammar for trees
- Recursive branching
- Wind-based animation with multiple layers of movement
- Seasonal coloring (green in summer, autumn colors)
- Interactive elements (click to regrow tree)

The L-system will use:
- Axiom: "F"
- Rules: F → F[+F]F[-F]F (or similar for natural branching)
- Stack-based rendering with push/pop
- Angle controlled by wind and time for swaying effect

Now I'll create the index.html file with a procedural L-system fractal tree that sways in the wind:

write index.html (8655 bytes)
toolResult

Successfully wrote 8655 bytes to index.html

assistant
thinking
Great! I've created a comprehensive L-system fractal tree implementation. Let me verify the file was created correctly.

I've created a complete procedural L-system fractal tree with wind animation! Here's what the implementation includes: **Key Features:** 1. **L-System Grammar**: Uses rules `X → F[+X]F[-X]+X` and `F → FF` to generate realistic branching patterns 2. **Recursive Branching**: Multiple generations (5-7) create detailed fractal structures with proper tree-like geometry 3. **Dynamic Wind System**: - Primary wind force using sine waves for natural gusts - Gentle secondary swaying for organic movement - Wind intensity varies by branch depth (trunk moves less, leaves move more) 4. **Visual Details**: - Bark texture on branches with thickness variation - Animated leaves at branch tips - Swaying grass at ground level - Gradient sky background - Soft cloud effects 5. **Interactivity**: Click to generate a new tree with random parameters The tree uses a stack-based L-system renderer with push/pop operations for branching, and applies layered sine wave animations to different parts of the tree for realistic wind effects. Each click generates a unique tree with slightly different angles and wind responsiveness. Open `index.html` in a browser to see the animation!

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

modelkimi-k2-thinking
vendorMoonshot · Kimi
harnesspi-agent
generated2026-08-01

EVALUATION

3/5 working

L-system tree with leaves renders and sways slightly, but branch shape shows little variation across inputs.

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 motion2.0%
on click7.6%
on drag5.2%
on wheel4.7%
on enter + space5.8%
on arrow keys6.2%
on w/a/s/d3.6%
frame spread30.2 / 255
console errors0
js errors none

METRICS

runtime23.8s
tokens in6.9k
tokens out2.7k
cached4.1k
cost / run$0.0091