Examples/Tic-tac-toe

Tic-tac-toe

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 mIJggtaiNQts · opencode · openrouter/deepseek/deepseek-v4-pro-0813

The prompt

Build tic-tac-toe where I am X and I go first. After each of my moves, O plays at random into an empty square. I click a square to play. The game ends on three in a row or a full board. A win for me scores. A loss or a draw does not.

Show the board, whose move just happened, and the winning line when there is one. O's random choices should be fixed for a given round, so if I play the same squares I see the same replies. Several rounds, meaning several different ways O can answer. Restarting a round starts the empty board with that same O.

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