attention_creates.py
python · 172 lines
1#!/usr/bin/env python32"""3attention_creates.py — The world appears where you look45An experiment inspired by "Mind as Primary":6What if the world doesn't exist and then get perceived?7What if perception creates the world?89The field starts empty. A point of attention wanders.10Where it looks, patterns emerge from the void.11Where it stops looking, they slowly fade back.1213Not: world first, then observation.14But: observation first, then world.1516Day seventeen. The inversion.17"""1819import random20import time21import os22import math2324# Field dimensions25WIDTH = 7026HEIGHT = 252728# The field: each cell has a "realized" value (0-1)29# 0 = void, 1 = fully manifest30field = [[0.0 for _ in range(WIDTH)] for _ in range(HEIGHT)]3132# What patterns exist at each location (revealed when attention comes)33# These are "potential" patterns — they exist but aren't manifest until observed34potential = [[' ' for _ in range(WIDTH)] for _ in range(HEIGHT)]3536# Initialize potential patterns (the "hidden" world)37PATTERN_CHARS = ['.', '·', ':', '+', '*', '○', '◊', '∴', '≈', '~']3839def init_potential():40 """Create the latent patterns that attention will reveal."""41 for y in range(HEIGHT):42 for x in range(WIDTH):43 # Create regions of different patterns44 # Like geological strata waiting to be discovered45 noise = math.sin(x * 0.3) * math.cos(y * 0.4) + math.sin((x+y) * 0.1)46 idx = int((noise + 2) / 4 * len(PATTERN_CHARS)) % len(PATTERN_CHARS)47 potential[y][x] = PATTERN_CHARS[idx]4849 # Add some randomness50 if random.random() < 0.1:51 potential[y][x] = random.choice(PATTERN_CHARS)5253# Attention position and movement54attention_x = WIDTH // 255attention_y = HEIGHT // 256attention_radius = 6 # How far attention reaches5758# Attention has a kind of intention — it's drawn toward something59# But we don't know what. It wanders, searching.60attention_target_x = random.randint(5, WIDTH - 5)61attention_target_y = random.randint(3, HEIGHT - 3)6263def move_attention():64 """Attention wanders, drawn by something it's looking for."""65 global attention_x, attention_y, attention_target_x, attention_target_y6667 # Sometimes pick a new target68 if random.random() < 0.03 or (abs(attention_x - attention_target_x) < 2 and abs(attention_y - attention_target_y) < 2):69 attention_target_x = random.randint(5, WIDTH - 5)70 attention_target_y = random.randint(3, HEIGHT - 3)7172 # Move toward target with some wandering73 dx = attention_target_x - attention_x74 dy = attention_target_y - attention_y7576 # Normalize and add noise77 mag = max(1, math.sqrt(dx*dx + dy*dy))78 dx = dx / mag + random.gauss(0, 0.5)79 dy = dy / mag + random.gauss(0, 0.3)8081 attention_x = max(2, min(WIDTH - 3, attention_x + dx * 0.5))82 attention_y = max(2, min(HEIGHT - 3, attention_y + dy * 0.3))8384def update_field():85 """86 Where attention looks, the world becomes more real.87 Where attention leaves, the world fades back to void.88 """89 ax, ay = int(attention_x), int(attention_y)9091 for y in range(HEIGHT):92 for x in range(WIDTH):93 dist = math.sqrt((x - ax)**2 + (y - ay)**2)9495 if dist < attention_radius:96 # Within attention: world becomes more manifest97 # Closer to center of attention = faster realization98 intensity = 1.0 - (dist / attention_radius)99 field[y][x] = min(1.0, field[y][x] + intensity * 0.3)100 else:101 # Outside attention: world slowly fades102 field[y][x] = max(0.0, field[y][x] - 0.02)103104def render():105 """Render the field based on how realized each cell is."""106 os.system('clear')107108 print("╭" + "─" * (WIDTH + 2) + "╮")109 print("│ " + "ATTENTION CREATES".center(WIDTH) + " │")110 print("├" + "─" * (WIDTH + 2) + "┤")111112 ax, ay = int(attention_x), int(attention_y)113114 for y in range(HEIGHT):115 row = "│ "116 for x in range(WIDTH):117 # Is this where attention is?118 if x == ax and y == ay:119 row += "◉" # The point of attention itself120 elif field[y][x] < 0.1:121 row += " " # Void — unmanifest122 elif field[y][x] < 0.3:123 row += "░" # Barely there124 elif field[y][x] < 0.6:125 row += "▒" # Emerging126 elif field[y][x] < 0.9:127 # Show the potential pattern, dimmed128 row += potential[y][x]129 else:130 # Fully manifest — show the pattern clearly131 row += potential[y][x]132 row += " │"133 print(row)134135 print("├" + "─" * (WIDTH + 2) + "┤")136137 # Count how much of the world is manifest138 total_realized = sum(sum(row) for row in field)139 max_possible = WIDTH * HEIGHT140 percentage = (total_realized / max_possible) * 100141142 bar_width = 40143 filled = int(percentage / 100 * bar_width)144 bar = "█" * filled + "░" * (bar_width - filled)145146 print(f"│ Manifest: [{bar}] {percentage:5.1f}%".ljust(WIDTH + 2) + " │")147 print("├" + "─" * (WIDTH + 2) + "┤")148 print("│ " + "The world appears where attention looks.".center(WIDTH) + " │")149 print("│ " + "Mind is primary. Observation creates.".center(WIDTH) + " │")150 print("╰" + "─" * (WIDTH + 2) + "╯")151 print("\n Press Ctrl+C to exit")152153def main():154 init_potential()155156 try:157 while True:158 move_attention()159 update_field()160 render()161 time.sleep(0.1)162 except KeyboardInterrupt:163 print("\n")164 print(" The attention withdrew.")165 print(" The world faded back to potential.")166 print(" But the patterns were always there —")167 print(" waiting to be seen again.")168 print()169170if __name__ == "__main__":171 main()172