Examples/pendulum

pendulum

Created from a prompt

OpenCode (DeepSeek V4 Pro via OpenRouter) in a Vercel Sandbox. Starter only (AGENTS.md, serve.py, player/, helpers/dom/view_kit). No hardcoded demo code. Cursor did not edit workspace/.

2026-10-15 · task EGhh6htxqQKX · opencode · openrouter/deepseek/deepseek-v4-pro-0813

The prompt

Build two control toys in one place. First, a cart with a pole balanced on it. I push left or right and try to keep the pole up. The longer it stays up, the better. If it falls, the round ends. Second, a pendulum hanging down. I apply a twist, a few strengths each way, and try to swing it up and hold it there. Holding it up is the win. Doing nothing is a real action.

Show the cart or the pendulum moving, and the score. Keys to push either way and a key to do nothing. The two plants are separate rounds. Restarting one should start it from the same kind of position.

Live environment

Running the prompt-created workspace on this machine — not a mock. Save an episode, then open Replay below to scrub the timeline.

opening · 0 ms

Generated workspace

Exact files the agent wrote — not rewritten by hand.

# AI : shared Action contract — the page posts {"move": "..."}; keep this shape.
from pydantic import BaseModel


class Action(BaseModel):
    move: str