oneshotlm
Compare all models on this prompt →

L-system tree · minimax-m2

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 · 8 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 procedural L-system fractal tree using p5.js that:
1. Uses L-system rules for branching
2. Recursively generates the tree
3. Has a gentle wind swaying animation

Let me first check what's in the current directory to see the p5.min.js file.
bash {"command":"ls -la /tmp/ws"}
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, the p5.min.js file is present. Now I'll create an index.html file with:
1. An L-system fractal tree using p5.js
2. Recursive branching
3. Wind animation that makes the tree sway

An L-system works by:
- Starting with an axiom (initial string)
- Applying production rules iteratively
- Interpreting the string as drawing instructions (F = draw forward, + = turn right, - = turn left, [ = save position, ] = restore position)

I'll create a classic tree L-system and add wind animation.
write /tmp/ws/index.html (4805 bytes)
toolResult

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

assistant
thinking
I've created the index.html file with an L-system fractal tree that:
1. Uses L-system rules (axiom: X, rules for X and F)
2. Recursively branches using the bracket operators [ and ]
3. Sways gently in the wind with oscillating wind strength
4. Has a dark atmospheric background with stars
5. Draws the tree with branch color gradients from brown/tan at the trunk to green at the tips

Let me verify the file was created correctly.
bash {"command":"ls -la /tmp/ws/index.html"}
toolResult

-rw-r--r--. 1 node node 4809 Aug 1 20:14 /tmp/ws/index.html

assistant
thinking
The file has been created successfully. Let me give a quick summary to the user.

Created `/tmp/ws/index.html` with a procedural L-system fractal tree featuring: - **L-System Engine**: Uses axiom `X` with rules `X → F+[[X]-X]-F[-FX]+X` and `F → FF`, running 5 iterations - **Recursive Branching**: Uses `[` and `]` to save/restore state for branching - **Wind Animation**: The tree sways gently using layered sine waves that affect both branch angle and position - **Visual Polish**: - Dark gradient background with subtle stars - Branch color gradient from warm brown/tan (trunk) to green (leaves) - Varying branch thickness - Wind direction indicator The tree grows from the bottom-center of the canvas and the wind creates a natural, organic swaying motion.

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

modelminimax-m2
vendorMiniMax
harnesspi-agent
generated2026-08-01

EVALUATION

3/5 working

L-system fractal tree grows and sways gently in wind, but small, dark, and no branch leaves/thickness.

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 motion0.0%
on click1.5%
on drag1.6%
on wheel1.9%
on enter + space1.5%
on arrow keys1.3%
on w/a/s/d1.3%
frame spread5 / 255
console errors0
js errors none

METRICS

runtime22.5s
tokens in9.8k
tokens out1.9k
cached0
cost / run$0.0044