AI Command Lab // Flight Simulator
1A: The Capacity Check
Initial AI Output (Fragile)
// AI-Generated Code
public string coinCount = "0";
void AddCoin() {
coinCount = coinCount + 1; // ERROR: Can't do math on text!
}
Initial AI Prompt
"You ask the AI: "Track how many gold coins the player has collected." The AI gives you this:"
Pilot Comm Link
Mission Objective: A skilled Pilot directs the AI to use an integer (int).
Optimized Protocol
// Corrected Code
public int coinCount = 0;
void AddCoin() {
coinCount++; // Simple, efficient, and mathematically correct.
}