Tier 4 Series 302

302G: The Architect's Exam

Capstone Exam
Pilot Record
Student Profile
"The colony ship's systems are failing. The input is hard-wired, the weapon switching is a monolith, and the drone fabrication is scattered. Identify the three critical architectural failures to certify your status as a Systems Navigator."

Target Asset for Audit

FRAGILE_CODE_DETECTED
using UnityEngine;

public class ShipController : MonoBehaviour {
    public GameObject rocketPrefab;
    public GameObject laserPrefab;
    public string weaponType;

    void Update() {
        // Audit Requirement: Lesson 302A (Command)
        if (Input.GetKeyDown(KeyCode.Space)) {
             Fire();
        }
    }

    void Fire() {
        // Audit Requirement: Lesson 302B (Strategy)
        // Error 2: The Monolith Switch
        if (weaponType == "Rocket") FireRocket();
        else if (weaponType == "Laser") FireLaser();
    }

    void FireRocket() {
        // Audit Requirement: Lesson 302C (Factory)
        // Error 3: Manual Instantiation Logic
        GameObject r = Instantiate(rocketPrefab);
        r.GetComponent<Rocket>().Initialize();
    }
}

Supervisor's Certification

Authenticated Pilot
pilot_84ad43047471c42b
Session Secure

Failure Point #1

Input Coupling Failure

The AI has hard-coded the Space key to the Fire logic. Command it to use the Command Pattern.

Failure Point #2

Strategy Monolith Failure

The AI is using strings and if-statements to handle weapon modes. Command it to use the Strategy Pattern.

Failure Point #3

Factory Decentralization

The AI is manually instantiating and setting up rockets. Command it to use a Projectile Factory.