The One Prompt – AI Cellular Automaton

2 min read Original article ↗

Ctrl+Enter Step

Hints & Examples

Inspired by Conway's Game of Life, but instead of fixed birth/survival rules a single natural language prompt governs each cell's transformation using only its four cardinal neighbors.

  • Template (cellPrompt.md): The model receives a filled-in markdown template:

    Prompt: {{USER_PROMPT}} Neighbor values are: - top: (top cell text) - bottom: (bottom cell text) - left: (left cell text) - right: (right cell text) Return strictly JSON with shape { "resultValue": string }

    Your text goes into {{USER_PROMPT}}. The placeholders for neighbors/current are replaced before sending. The model MUST answer only JSON like {"resultValue":"next text"} which becomes the cell's new content.
  • Hex color shortcut: If your resultValue is a valid hex color (#RGB, #RGBA, #RRGGBB, or #RRGGBBAA) the cell is rendered as a solid color (alpha supported) and the text is not drawn. Any other string is rendered as laid-out text.

Prompt tips:

  • Be explicit about patterns, e.g. "If right neighbor starts with '#' treat it as color".
  • Return short strings to fit nicely; long text will wrap & shrink.
  • You can propagate values: "Return the right neighbor's value" simply copies it.

Minimal examples

Copy right neighbor: "Return the exact right neighbor value."

Make a gradient: "If right neighbor is a hex color #RRGGBB, darken it slightly; otherwise start with #3366ff."

Enter your own OpenAI API key below to enable the Step (full generation) button. Without a key you can still tap or click individual cells to update them one at a time.