From a Wish to a Runnable Racing Game: A Practical Guide to Wish-Driven AI Programming

    This article explains how AI programming systems are moving from code completion to long-horizon task execution. Using a browser-based racing game as an example, it covers wish-driven programming, staged requirement refinement, self-checking and repair, the task execution loop, cost implications, prompt design, and the engineering practices needed to move from a prototype to a maintainable application.

    1. From Writing Code to Completing Tasks

    In recent years, the capabilities of AI programming systems have moved beyond completing functions, generating individual components, or explaining error messages. With tools for file reading and writing, terminal execution, browser preview, automated testing, and multi-round repair, these systems can work continuously toward a goal and complete an entire workflow from project initialization to feature delivery.

    This working mode is clearly different from traditional “one question, one answer” interaction. Traditional Q&A usually focuses on whether a piece of code is correct, while a long-horizon development task is closer to a small software project. The system needs to complete the following work in sequence:

    1. Understand the user’s description of the product.
    2. Break a vague goal into pages, interactions, and data structures.
    3. Choose an appropriate technical implementation path.
    4. Create or modify multiple files.
    5. Start the project and observe the running result.
    6. Continue fixing issues based on error messages and visual feedback.
    7. Verify and organize the final feature.

    Therefore, evaluating an AI programming system cannot rely only on the length of generated code or a static test score. More important is whether it can turn an incomplete wish into an application that runs, can be experienced, and can be iterated with limited human intervention.

    2. What Wish-Driven Programming Really Means

    Wish-driven programming does not mean that no technical knowledge is required. It means that the user first describes the desired outcome in natural language and then lets the AI system handle a large amount of intermediate engineering work.

    For example, a user might say only:

    Create a driving racing game with a track and a timer, and support switching between a driver’s view and a rear view.

    This sentence does not specify a framework, file structure, rendering method, vehicle physics model, or collision algorithm, but it already contains a set of verifiable goals:

    • A race car and a track exist on the page.
    • The user can control the vehicle’s movement.
    • The game can record completion time.
    • At least two camera views are available.
    • The application can start and support basic operation.

    The AI system’s task is to convert these outcome goals into executable engineering steps. It may need to create a project directory, write an entry page, design a game loop, handle keyboard events, draw a track, implement a timer, and adjust the implementation after running it based on actual behavior.

    It is important to note that “wish-driven” does not mean “casually described.” The vaguer the wish, the more likely the system is to follow its own default interpretation. The final result may have the requested features but differ significantly from expectations in visual style, controls, and detail quality.

    A more accurate understanding of wish-driven programming is:

    The user expresses goals and judges results, while the AI system takes on a large amount of implementation and iteration work.

    3. A Complete Breakdown of a Racing Game Case

    A racing game is a typical case for testing AI programming capabilities because it combines visual presentation, real-time interaction, state management, and continuous runtime logic.

    3.1 Phase 1: Provide Only the Core Wish

    In the first round, you can describe only the core gameplay without rushing to specify technical details:

    Create a browser-based racing game where the player can drive a vehicle along a track. The interface should show timing information and support switching between a driver’s view and a rear view.

    This approach has a low startup cost and can quickly reveal whether the AI system has basic task execution ability. Ideally, the system will generate a runnable prototype that includes:

    • A main game interface.
    • Vehicle control logic.
    • A simple track.
    • Start or reset buttons.
    • A time display.
    • A view-switching entry point.

    However, the first version often has obvious shortcomings. For example, the vehicle may be only a geometric shape, the track may lack depth, the interface layout may be rough, the difference between the driver’s view and the rear view may not be obvious, and collision and boundary detection may be simple.

    This does not mean the first round failed. For complex tasks, the main goal of the first round is not to deliver the final version, but to establish a runnable baseline loop as quickly as possible.

    3.2 Phase 2: Add Visual and Interaction Requirements

    Once the first version runs, the next step should not be simply asking for it to “make it better.” Instead, abstract evaluations should be turned into executable descriptions. For example:

    • Use an arcade racing style with a sense of speed.
    • Use clear road boundaries, shoulders, and distant scenery.
    • The vehicle needs a body, wheels, shadow, and directional changes.
    • The driver’s view should show the road ahead of the vehicle.
    • The rear view should show the back of the vehicle and the surrounding track.
    • The interface should display the current time, best time, and control hints.
    • The start, pause, and reset states should be clearly distinguished.
    • When the vehicle leaves the track, its speed or direction should be restricted.

    These requirements are easier to execute and verify than “add more detail” because they describe specific objects, observable behavior, and expected differences.

    For visual applications, prompts should ideally cover four dimensions:

    Scene style: for example, arcade, racing, nighttime, desert, or city road.
    Visual layers: for example, foreground vehicle, midground track, background environment, and dynamic effects.
    Interaction feedback: for example, vehicle attitude changes when steering and stronger speed lines when accelerating.
    UI states: for example, how start, pause, complete, and failure states are presented.

    3.3 Phase 3: Let the System Check and Repair Proactively

    Once the application runs, the AI system should be asked to perform a check on its own rather than relying only on human visual inspection. Checks can include:

    • Whether the page has console errors.
    • Whether keyboard events are bound repeatedly.
    • Whether the timer continues after the game is paused.
    • Whether reset clears the old state.
    • Whether the camera position is correct after switching views.
    • Whether the screen overflows after the browser window changes.
    • Whether the vehicle can become permanently stuck at the track boundary.
    • Whether the game loop starts multiple times.
    • Whether there is a fallback when resource loading fails.

    This step demonstrates the engineering ability of an AI programming system. If the system can only generate initial code but cannot find problems through runtime results, it is more like a code generator than a development agent capable of completing tasks.

    4. The Task Execution Mechanism Behind AI Programming Systems

    To understand why these systems can complete complex work, a task can be abstracted into the following loop:

    1. Read requirements
    2. ↓
    3. Inspect current project state
    4. ↓
    5. Decide the next action
    6. ↓
    7. Modify files or execute commands
    8. ↓
    9. Start the program and observe results
    10. ↓
    11. Analyze errors and deviations
    12. ↓
    13. Continue fixing or optimizing

    This loop usually requires an “execution orchestration layer,” meaning a runtime environment responsible for managing context, tool calls, task state, and result feedback. It should have at least the following capabilities:

    4.1 File Operations

    The system needs to view directory structures, create files, read existing content, and make partial modifications. For multi-file projects, simply outputting an entire block of code is not reliable. The ability to precisely modify project files is more important.

    4.2 Terminal Execution

    Starting development services, installing dependencies, running build commands, and executing tests are all essential parts of real development. Only by actually performing these operations can the system know whether the code runs.

    4.3 Result Observation

    For games and interface applications, static code inspection is far from enough. The system needs to observe page behavior through browser preview, screenshots, or runtime logs and judge whether layout, interaction, and visual presentation meet requirements.

    4.4 Context Management

    Long tasks generate a large amount of historical information. If the system cannot distinguish between “work already completed” and “issues still pending,” it may make repeated modifications, overwrite correct code, or even deviate from the original goal.

    4.5 Interruption and Recovery

    Tool execution failures, dependency installation exceptions, and page startup timeouts are common. A mature task execution mechanism should allow the system to analyze the cause of failure and continue from the interruption point rather than starting over.

    5. Why Task Cost Can Drop Even When Unit Price Stays the Same

    In agent scenarios, cost is not determined only by the price per request. It is also affected by the total number of task rounds, context length, number of tool calls, and proportion of invalid output.

    The actual consumption of a task can be roughly represented as:

    1. Total consumption =
    2. input context consumption
    3. + output content consumption
    4. + tool call-related consumption
    5. + additional consumption from repeated repairs

    If the system outputs a large amount of explanation each time but makes only a small number of effective modifications, the entire task remains expensive even if the per-call price is unchanged. Conversely, if the system can:

    • Locate relevant files faster.
    • Reduce repeated reads.
    • Use shorter but more accurate operation instructions.
    • Solve multiple related issues in one modification.
    • Avoid invalid loops through testing.
    • Stop promptly when the goal is reached.

    Then the total resources required for a single task will decrease.

    This is an overall performance-cost optimization. It may not appear as a change in the price of a specific interface, but as fewer total steps, shorter time, and less rework required to complete the same goal.

    For long-horizon development tasks, this optimization is especially important. A small application may go through dozens or even more model interactions, and any invalid loop can be amplified.

    6. How to Design Higher-Quality Prompts

    A high-quality prompt is not necessarily long, but it should have clear acceptance criteria. The following structure is recommended:

    6.1 Goal

    State what application is to be built and how end users will use it.

    6.2 Core Features

    List the interactions, states, and data that must be implemented. For example: vehicle control, view switching, timing, and reset.

    6.3 Visual Direction

    Describe colors, layout, layers, style, and key elements. Avoid using only unverifiable adjectives such as “advanced” or “beautiful.”

    6.4 Technical Boundaries

    State the application runtime environment, whether offline operation is required, whether external resources are allowed, and basic requirements for performance and compatibility.

    6.5 Acceptance Criteria

    Use checkable sentences, for example:

    • The game can start directly after the page loads.
    • The vehicle can be controlled with specified keys.
    • The screen composition changes noticeably after switching views.
    • The vehicle and timer stop at the same time when paused.
    • The game state returns to its initial values after reset.
    • The interface does not become severely distorted when the browser window is resized.

    6.6 Iteration Requirements

    Ask the system to first complete a runnable version, then start it, check it, and fix it on its own, and finally summarize what has been completed and what limitations remain.

    7. From Prototype to Maintainable Version

    Wish-driven programming is well suited for rapid prototyping, but if a project needs long-term maintenance, engineering constraints still need to be added.

    First, module boundaries should be clarified. For example, input handling, game state, physics calculations, rendering logic, camera control, and interface components should be separated to avoid piling all code into a single entry file.

    Second, a stable state model should be established:

    1. GameState
    2. ├── running
    3. ├── paused
    4. ├── elapsedTime
    5. ├── bestTime
    6. ├── playerPosition
    7. ├── playerVelocity
    8. └── cameraMode

    This can reduce problems such as “the interface appears updated, but the internal state is not synchronized.”

    Third, basic tests should be added. Even for a game prototype, it is possible to test whether the timer stops when paused, whether reset clears the state, whether view switching changes the current mode, and whether vehicle position is constrained by boundaries.

    Finally, human acceptance should be retained. An AI system can help complete most of the implementation, but visual aesthetics, control feel, and product tradeoffs still require developer judgment. The ideal collaboration model is not to give up control entirely, but to shift effort from repetitive coding to requirement definition, result evaluation, and key decisions.

    8. Conclusion

    The real value of generating a runnable racing game from a simple wish is not just faster code generation. It is that the development approach changes: users can first express a goal and then continuously calibrate requirements through runtime results, while the AI system connects requirements, code, tools, and verification workflows.

    However, wish-driven programming is not a universal solution. It is suitable for quickly validating ideas, building interactive prototypes, and completing small to medium-sized applications. To reach stable, maintainable, and scalable production quality, clear requirements, reasonable architecture, continuous testing, and human review are still necessary.

    A more mature practice path can be summarized as:

    1. Start with a wish and quickly obtain a prototype;
    2. then decompose it and define features and acceptance criteria;
    3. then verify it by running the system and finding issues;
    4. continue iterating to gradually improve experience and engineering quality.

    When AI programming systems have reliable tool execution, context management, and self-verification capabilities, a developer’s core competitiveness will no longer be simply how much syntax they remember. It will be whether they can propose clear goals, identify real problems, and continuously push a vague idea into a usable software product.