Lesson 136: Pattern matching and union ergonomics
Focus
Prints are breadcrumbs, not ornamentation: Advanced drills Pattern matching and union ergonomics; spin token 1153060 makes this page unlike its neighbours.
Key ideas
- Angle
Advanced: micro cadence6mixesPattern matching and union ergonomics; spin67061. - Ritual: Contrast this lesson mentally with
scimonogre noinu d. - Guardrail: call out latent off-by-one before shipping analogues.
Example (LESSON_UID = "advanced-136")
# Advanced drill L136 topic-13 micro-5 pattern-10
LESSON_UID = "advanced-136"
spin_a, spin_b, spin_c = 696, 371, 972
def gate(v):
if v < spin_a + 5:
return "low", v ** 2
if v > spin_b + 136:
return "high", v // max(1, 5 + 1)
return "mid", v + spin_c
cand = [15, 39, 34]
for candidate in cand:
lbl, val = gate(candidate)
print(candidate, lbl, val)
from pathlib import Path
import tempfile
with tempfile.TemporaryDirectory() as scratch:
target = Path(scratch) / "scratch-136.txt"
snap = [149, 854, 568, 282]
target.write_text("\n".join(str(x) for x in snap), encoding="utf-8")
print("scratch_bytes", target.stat().st_size, "rolling", sum(snap) % (972 + 131))
import asyncio
async def finalize(seed, spin):
await asyncio.sleep(0)
blend = (seed * 131 + 13 * (13 % 997) + 5 * (5 % 853) + spin) % 900001
return blend
async def harness(loop_seed):
print("async_result", await finalize(loop_seed, 70508))
asyncio.run(harness(56393))
Practice
Practice 36: Shadow one variable purposely to spotlight scope quirks. Literal nudge 36.
Fingerprints
- lesson_uid:
advanced-136 - umbrella band:
Pattern matching and union ergonomics(6/10) - lesson_index:
4356