🧱 B PRECURSOR DIFFICULTY: Adept Structural

The Proxy

A shadowy stand-in guarding access to a resource of ancient power.

✧ GANG OF FOUR LINEAGE & ARCANUM ✧
GOF DESIGN PATTERN: Proxy
ARCANUM SCHOOL: Abjuration // Warding
SCRIBE / ARCHON: Joshua Edward McLaughlin Cox
CANONICAL REGISTRATION:
// B PATTERN //
/* The forbidden vault */
ancient_vault_access() {
    putchar('G'); putchar('O'); putchar('L'); putchar('D');
}

/* The Proxy */
ext is_authorized;

proxy_access() {
    if (is_authorized) {
        ancient_vault_access();
    } else {
        putchar('N'); putchar('O');
    }
}

seeker_attempt() {
    is_authorized = 0;
    proxy_access(); /* NO */

    is_authorized = 1;
    proxy_access(); /* GOLD */
}
Runic Tags: #b #design-pattern #precursor #bell-labs-magic #untyped