oneshotlm
Compare all models on this prompt →

L-system tree · gemini-3.1-flash-lite

Output generated Cost / run $0.0038 Runtime 11.5s

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

modelgemini-3.1-flash-lite
vendorGoogle
harnesspi-agent
generated2026-07-22

METRICS

runtime11.5s
tokens in6.5k
tokens out1.5k
cached0
cost / run$0.0038
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
**Generating Fractal Tree**

I'm currently focused on integrating a procedural L-system fractal tree directly into a single `index.html` file. The aim is to incorporate recursive branching and a swaying effect, all while relying solely on the provided `p5.min.js` and avoiding external dependencies.

**Refining Fractal Structure**

I'm now refining the L-system rules and the recursive drawing logic, focusing on precise angle calculations and using a stack for managing branches. The goal is to ensure a clean, self-contained implementation within a single HTML file using `p5.min.js`.

→ write index.html (1816 bytes)
toolResult

Successfully wrote 1816 bytes to index.html

assistant
→ bash {"command":"ls -l p5.min.js index.html"}
toolResult

-rw-r--r-- 1 node node 1816 Jul 22 17:50 index.html -rw-r--r-- 1 node node 1034532 Jul 22 17:50 p5.min.js

assistant

The procedural fractal tree is built and ready in `index.html`. It uses a recursive branching method (standard for L-system tree dynamics) and includes a wind sway effect generated by modulating branch angles using a sine wave synced to `frameCount`. To run, simply open `index.html` in your browser.