Wish-Driven Programming in Practice: Recreating a Racing Game with a Single LLM Prompt
This article introduces wish-driven programming, an approach where you express a goal in one highly condensed natural-language sentence and let a large language model handle technology selection, architecture, coding, and debugging. Using a browser-based 3D-style racing game as a worked example, it shows why a single-sentence "wish" typically yields a rough 60-point prototype, and how a structured prompt covering role, constraints, tech stack, feature list, visual standards, and acceptance criteria pushes the result toward 90 points. It also explains the performance–cost Pareto improvement trend in LLM iteration, why it matters for long-running agent workflows, and a reusable four-step loop from wish to acceptance, plus practical tips for controlling context length, isolating changes, and stabilizing output.
1. Wish-Driven Programming: Hand Your Requirements to the Model as a “Wish”
Wish-driven programming is, at its core, about expressing a goal in a single highly condensed natural-language sentence and letting a large language model take care of technology selection, architecture design, code implementation, and debugging on its own. What it lowers is the barrier to expression, not the barrier to thinking: the model can write the code for you, but whether the requirements are decomposed thoroughly and whether the acceptance criteria are clear still determine the quality of the final output.
This approach fits three kinds of scenarios:
- Rapid prototype validation: when the technical approach is not yet settled, see what kind of usable artifact the model can produce first;
- Small, complete applications: single-page games, utility scripts, data dashboards — anything with a closed feature loop and simple dependencies;
- Learning and teaching: observe how the model organizes code structure and learn engineering practices in reverse.
For complex systems, however, a one-sentence wish usually only gets you something that “runs but is rough” and needs multiple rounds of iteration. Below, we walk through the entire process using a racing game as the case study.
2. First, Understand a Key Metric: The Performance–Cost Pareto Improvement
Before diving in, it is worth understanding a current trend in LLM iteration: even if the per-token price stays the same, optimizing the reasoning process so that the total number of tokens needed to complete the same task drops can still deliver a real cost reduction. This is the performance–cost Pareto improvement — driving cost monotonically downward while performance does not regress.
This matters especially for agents. When an agent executes a long-horizon task, it usually does not work as “one request, one response,” but rather:
- Multiple rounds of planning and reflection;
- A large number of tool calls (reading and writing files, executing commands, calling external APIs);
- Repeated self-correction loops.
These stages hide a great deal of “wasted output”: re-reading context, lengthy self-explanation, and retries after failures. If the model is more concise at the process level, the same task can be completed with fewer tokens and in less time. For teams running hundreds or thousands of agent tasks every day, this is more valuable in practice than simply lowering the unit price.
So in our own practice we should follow the same principle: prompts should guide the model to take fewer detours, keep output concise, and get it right in one pass.
3. Recreating the Racing Game: Goal and Environment
Goal: build a 3D-style racing game that runs directly in the browser, with the following requirements:
- Drivable (keyboard control for acceleration, braking, and steering);
- Track boundaries and a lap/timing system;
- Switchable first-person (cockpit) and third-person (rear chase) views;
- A clean but complete visual style — asset-level polish is not required.
Environment: I used an agent harness with a large-model API to perform multi-round generation and self-checking. The core value of such a harness is that it writes the model’s output directly to files, runs build and execution commands, and feeds errors back to the model, forming a “generate → execute → fix” loop. You can reproduce the same workflow with any agent framework that supports tool calls.
4. The First Round: Wish Directly, Get a “Runs” Version
My prompt was a single sentence:
Build me a racing game — drivable, with a track and a timer, supporting a driver view and a rear view.
Analysis of the result:
- All basic features were implemented: driving, track, timing, and dual-view switching all worked;
- The landing page and controls alone already made it playable;
- But it fell short of the racing game in my mind: the track shape was simple, the car model was crude, speed feedback was missing (engine sound, camera shake, drift marks), and the UI layout was haphazard.
Conclusion: a one-sentence wish gets you a “60-point prototype,” because the model chooses the most conservative implementation path when left unconstrained. This is not a model capability problem but insufficient requirement signals — if it doesn’t know what you care about, it will uniformly settle for “good enough.”
5. The Second Round: A Structured Prompt That Translates the Wish into Engineering Requirements
In the second iteration, I broke the wish into six parts: role, constraints, tech stack, feature list, visual standards, and acceptance criteria. The core template is below:
You are a senior front-end game developer. Implement a single-file HTML5 racing game.[Technical Constraints]- Use only vanilla JavaScript + WebGL/Canvas; do not introduce any external dependencies;- Deliver as a single file that runs when opened directly in a browser;- Organize code into modules: scene, vehicle physics, track generation, camera, HUD, input.[Functional Requirements]1. Driving: W/Up to accelerate, S/Down to brake/reverse, A/D or Left/Right to steer, Space for handbrake;2. Vehicle physics: acceleration, friction, turning radius varying with speed, slowdown off-track;3. Track: a closed-loop track with clear boundaries and shoulders; going off-track pulls the car back;4. Timing: lap timing, best lap, lap count, with wall-hit/shortcut detection;5. Views: press C to switch between first-person (cockpit) and third-person (rear chase),with a smooth camera transition when switching;6. Visuals: the car body has detail and color; guardrails/trees and other environment elements line both sides of the track;the higher the speed, the larger the FOV, with slight camera shake to convey a sense of speed;7. HUD: speedometer, gear/lap, current lap time, best lap, laid out following racing-game conventions.[Acceptance Criteria]- Runs smoothly at 60 FPS;- All key bindings work with no console errors;- View switching has no clipping and no jumps;- After completing a lap, timing resets correctly and the best result is recorded.First output the implementation approach (no more than 10 lines), then output the complete code.
The improvement was very clear:
- Having the model state its implementation approach first forces a “self-checking design” pass, avoiding the structural mess that comes from thinking while writing;
- The modular requirement keeps the code maintainable, so later changes don’t require a full rewrite;
- Acceptance criteria turn a vague “good” into checkable items, and the model proactively handles edge cases (off-track pull-back, timing reset);
- Visual standards (FOV changes, camera shake, environment elements) markedly improved the “racing feel.”
6. Iteration Methodology: A Loop from Wish to Acceptance
Summarizing this practice, I distilled a reusable four-step process:
- One-sentence wish: quickly validate feasibility and obtain a baseline version;
- Gap analysis: list gaps across four dimensions — features, visuals, feel, and code quality — distinguishing “the model can’t do it” from “I didn’t state it clearly”;
- Structured restatement: use the template above to translate gaps into explicit requirements and acceptance criteria, numbered item by item;
- Targeted fixes: launch a new round only for the items that fall short, having the model make local changes on top of the existing code rather than starting over.
When working with an agent harness, there is one more practical trick: have the model run a self-check after each change (for example, build “startup self-check” logic into the code that verifies scene initialization, input binding, and timers), then feed the run results back into the context before fixing. This significantly reduces output that “looks right but won’t run.”
7. Cost and Stability Optimization Tips
- Control context length: in long sessions, have the model output a change summary rather than the entire code, and request the full file only when necessary;
- Change one thing at a time: mixing multiple changes in a single round makes it hard to attribute errors;
- State prohibitions explicitly: for example, “do not introduce external dependencies” and “do not use deprecated APIs” can avoid a great deal of wasted retries;
- Fix the acceptance checklist: reuse the same acceptance criteria every round to prevent the model from “fixing a new problem while breaking an old feature”;
- Use temperature and sampling parameters wisely: use a lower temperature for code-generation tasks and a slightly higher one for creative adjustments (such as visual design), balancing stability and diversity.
8. Conclusion
Wish-driven programming is not about “say one sentence and get a perfect product.” The right way to use it is to leverage a single sentence to unlock a 60-point prototype, then use structured requirements and acceptance criteria to push it to 90 points. At the same time, understanding how LLMs are evolving toward the performance–cost Pareto improvement helps us design agent workflows more intelligently — making every token count.
If you want to try it too, start with the small game you most want to recreate: make a wish first, then break it down item by item. You’ll find the model’s ceiling is far higher than a one-sentence prompt reveals.
