oneshotlm
Compare all models on this prompt →

L-system tree · minimax-m2.1

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 · 10 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 the pre-provided p5.min.js file
2. Branches recursively (L-system fractal)
3. Sways gently in the wind

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:13 . drwxrwsrwx. 3 root node 16 Aug 1 20:13 .. -rw-r--r--. 1 node node 1034532 Aug 1 20:13 p5.min.js

assistant
thinking
Good, the p5.min.js file is present. Now I'll create an index.html file with:
1. A fractal tree using L-system approach
2. Recursive branching
3. Wind animation that makes the tree sway gently

Let me create a nice L-system fractal tree with:
- L-system rules for branching
- Recursive drawing
- Wind effect that varies over time using sine waves
- Beautiful styling

I'll use a classic L-system approach:
- Axiom: "X"
- Rules: F -> FF, X -> F[+X][-X]FX (or variations)
- Or a simpler approach with recursive branching that mimics L-system behavior

Let me create an engaging visual with the tree swaying in the wind.
write /tmp/ws/index.html (9347 bytes)
toolResult

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

assistant
thinking
I've created the index.html file with:
1. A recursive L-system fractal tree using p5.js
2. Wind animation that makes the tree sway gently
3. Beautiful visual styling with gradient background
4. Color gradients from brown (trunk) to green (branches/tips)
5. Leaf clusters at branch tips
6. Multiple wind gusts for more natural movement

Let me verify the file is there and looks correct.
bash {"command":"ls -la /tmp/ws/index.html"}
toolResult

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

assistant
thinking
The file is created. Let me verify the structure is correct by checking a portion of it.
read {"path":"/tmp/ws/index.html","limit":30}
toolResult

<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>L-System Fractal Tree</title> <style> * { margin: 0; padding: 0; box-sizing: border-box; } body { overflow: hidden; background: linear-gradient(to bottom, #0a0a1a 0%, #1a1a2e 50%, #16213e 100%); min-height: 100vh; display: flex; justify-content: center; align-items: center; } canvas { display: block; } </style> </head> <body> <script src="p5.min.js"></script> <script> // L-System Fractal Tree with Wind Animation [261 more lines in file. Use offset=31 to continue.]

assistant
thinking
The file looks good. It has:
1. p5.min.js loaded properly with `<script src="p5.min.js"></script>`
2. The L-system fractal tree code
3. Wind animation with multiple gusts
4. Recursive branching
5. No external dependencies

The task is complete. The index.html file is ready with a procedural L-system fractal tree that:
- Uses L-system rules for branching
- Recursively branches (simulates L-system behavior)
- Sways gently in the wind using sine wave animations with multiple wind gusts

Done! I've created `index.html` with a procedural L-system fractal tree featuring: **L-System Implementation:** - L-system string generator with rules (`X → F[+X][-X]FX`, `F → FF`) - Recursive branching that mimics L-system behavior with main branches and side branches - Additional random extra branches for a more organic look **Wind Animation:** - Multiple wind gusts with varying offsets, strengths, and speeds - Wind effect increases toward branch tips (more sway at the top) - Sine-wave based oscillation for smooth, natural movement - Wind indicator displayed in corner **Visual Features:** - Gradient background (dark night sky) - Color gradient from brown trunk → green branches → leaf clusters - Leaf clusters at branch tips - Ground grass/foliage at the base - Responsive canvas that fills the window The tree recursively branches 12 levels deep, with each branch having a 67% length decay and 25° branching angles, all animated with wind sway.

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.1
vendorMiniMax
harnesspi-agent
generated2026-08-01

EVALUATION

3/5 working

Procedural tree with green leaves sways gently over time; no visible interactive response to 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 motion1.6%
on click2.5%
on drag2.9%
on wheel2.7%
on enter + space2.4%
on arrow keys2.0%
on w/a/s/d2.6%
frame spread17.4 / 255
console errors0
js errors none

METRICS

runtime40.4s
tokens in2.5k
tokens out3.5k
cached15k
cost / run$0.0054