✨ ARCANUM RUNE DIFFICULTY: Adept Behavioral

The Mediator: The Nexus Algorithm

Govern interactions between disparate elements within parallel zipped arrays.

✧ GANG OF FOUR LINEAGE & ARCANUM ✧
GOF DESIGN PATTERN: Mediator
ARCANUM SCHOOL: Divination // Flow
SCRIBE / ARCHON: Joshua Edward McLaughlin Cox
CANONICAL REGISTRATION:
// CODEX INCANTATION //
let mediate_exchange [n] (agents_a: [n]i32) (agents_b: [n]i32) : ([n]i32, [n]i32) =
  let interact a b = if a > b then (a - b, b + b) else (a + a, b - a)
  in unzip (map2 interact agents_a agents_b)
Runic Tags: #futhark #mediator #zip