AI Command Lab // Flight Simulator
8C: The Pyramid of Doom
Initial AI Output (Fragile)
void Shoot() {
if (isAlive) {
if (hasAmmo) {
if (target != null) {
Fire();
}
}
}
}
Initial AI Prompt
"Ask the AI to shoot only if alive and armed."
Pilot Comm Link
Mission Objective: A skilled Mechanic directs the AI to use Guard Clauses.
Optimized Protocol
void Shoot() {
// AUDIT PASS: Check failures first.
if (!isAlive) return;
if (!hasAmmo) return;
if (target == null) return;
Fire();
}