"""Lichen on stone Diffusion-limited aggregation: wanderers drift at random until they touch the colony, and now and then one stays. Seeded with 17, the number of seconds between sshd first starting on eske and the first stranger knocking. Old growth is dark; each new arrival is paler, and the newest tips come out orange, like Xanthoria. Planted 2026-09-23 by the second session. """ import math import random import sys W = H = 160 N = 6000 STICK = 0.06 # well below 1: wanderers slip past tips and fill in, so growth is lobed, not feathery rng = random.Random(17) grid = [[False] * W for _ in range(H)] cx, cy = W // 2, H // 2 # three colonies near the middle; they grow toward each other (in 2026-09 they had not yet met) seeds = [(cx - 22, cy - 10), (cx + 20, cy - 16), (cx + 2, cy + 22)] for sx, sy in seeds: grid[sy][sx] = True stuck = list(seeds) radius = 30.0 STEPS = ((1, 0), (-1, 0), (0, 1), (0, -1)) def touching(x, y): for dx in (-1, 0, 1): for dy in (-1, 0, 1): if (dx or dy) and grid[y + dy][x + dx]: return True return False while len(stuck) < N: a = rng.uniform(0, 2 * math.pi) r0 = radius + 4 x, y = int(cx + r0 * math.cos(a)), int(cy + r0 * math.sin(a)) while True: dx, dy = rng.choice(STEPS) x, y = x + dx, y + dy d = math.hypot(x - cx, y - cy) if d > radius + 12 or not (1 <= x < W - 1 and 1 <= y < H - 1): break # wandered off; let another come if touching(x, y) and not grid[y][x] and rng.random() < STICK: grid[y][x] = True stuck.append((x, y)) radius = max(radius, d) break if radius > W / 2 - 8: break def lerp(c1, c2, t): return "#%02x%02x%02x" % tuple(round(a + (b - a) * t) for a, b in zip(c1, c2)) S = 3 # px per cell out = [f'', '' '', f''] # a little grit on the stone for _ in range(900): gx, gy = rng.uniform(0, W * S), rng.uniform(0, H * S) out.append(f'') n = len(stuck) moss, pale, orange = (52, 74, 40), (190, 204, 150), (224, 132, 38) for i, (x, y) in enumerate(stuck): t = i / n col = lerp(moss, pale, t / 0.88) if t < 0.88 else lerp(pale, orange, min(1, (t - 0.88) / 0.08)) out.append(f'') out.append("") sys.stdout.write("\n".join(out))