跪拜 Guibai
← All articles
AI Programming · Agent · TRAE

A 3-Minute Card Game Compresses 10,000 Years of Civilization Into One File, Built Entirely in a Single AI Chat

By Eren7Y琳 ·
Read original on juejin.cn ↗ Google Translate ↗ Alt translation

The cost of rejecting a working design drops to a single chat turn, so developers can afford to throw away code that looks good but feels wrong. For anyone using AI coding agents, the practical boundary is the human's ability to state a goal and judge the outcome, not the tool's code generation.

Summary

TRAE turned a vague prompt into a complete, playable game in one shot: a single-file HTML with zero frameworks and no build step. The game casts the player as the decision maker for civilization. Four meters track energy, ecology, knowledge, and cooperation, and 35 cards present real historical dilemmas. Swiping left or right charges one meter while draining another; a meter at zero freezes civilization, one overloaded burns it. Survive all 35 cards to reach the threshold of a Type I civilization on the Kardashev scale.

The build itself is only part of the story. The author started with three conflicting constraints from a blind-box challenge: the theme of civilization, a power-meter as the core mechanic, and Nordic minimalist aesthetics. After TRAE produced two polished showcase pages, the author scrapped them for being unplayable and asked for a card-based game, which TRAE generated with working drag, animations, and state logic. Real-device testing caught a drag failure caused by setPointerCapture throwing in some browsers, a CSS background shorthand wiping out an animation, and a false bug report where synthetic browser events diverged from real touch input.

Deployment went through GitHub Pages, with one hiccup: a leftover global git config pointed github.com at a local proxy, sending pushes nowhere. The author's wrap-up: TRAE's real effect is lowering the cost of trial and error, not just typing speed. Agent mode executes any goal stated as a clear sentence, but judging whether the result is good stays human. The single-chat workflow avoids context-switch overhead that would have killed a small project.

Takeaways
— The game has 35 decision cards and four meters (energy, ecology, knowledge, cooperation); any meter reaching zero or overloading ends the game, with 8 death endings and a Kardashev scale rating for survival.
— TRAE produced a complete playable single-file HTML game with no frameworks and no build step in one shot, including drag interaction, animations, state logic, and era switching.
— A mobile drag bug was traced to setPointerCapture throwing in some browsers; the fix was attaching move/up events to window and wrapping capture in a try/catch.
— Synthetic browser events for drag testing gave a false bug report; the code was correct but automated tools didn't emulate real touch input.
— An intermittent shimmer animation was caused by the CSS background shorthand overriding backgroundImage; splitting the assignment fixed it.
— Deployment used GitHub Pages; a push failure was traced via `git config --list --show-origin` to a leftover domain-level github.com config pointing to a local proxy port.
— The author states the biggest impact of TRAE is lowering the cost of trial and error, not speed of writing code, and that Agent mode works when the goal is a clear sentence but quality judgment remains human.
— The project was completed in one evening partly because every step, from requirement breakdown to deployment, stayed in a single chat box, avoiding context switching between tools.
Conclusions

Scrapping two working pages after seeing them shows that AI-generated output can be aesthetically complete yet fail on interactivity; the bottleneck is product judgment, not code generation.

The false bug report from synthetic drag events reveals that AI's logical correctness can't substitute for real-device testing; verification still needs a human finger on the actual hardware.

Staying in one chat box across requirement, code, bug fixes, and deployment eliminates context-switching overhead that often kills small projects, making the toolchain's integration a feature in itself.

Concepts & terms
Kardashev scale
A method of measuring a civilization's level of technological advancement based on the amount of energy it can use. Type I extracts all energy available on its home planet; the game's success condition is reaching the doorstep of Type I.
TRAE Agent mode
A feature of the TRAE AI coding tool where the model works autonomously toward a user-stated goal, delivering an integrated set of files and logic rather than just completing individual lines of code.
Source: juejin.cn ↗ Google Translate ↗ Backup ↗