{
"id": "033",
"prompt": "Scrolling starfield with NO state: a deterministic LCG hash of each star index seeds its x, base y, and speed (1..3); y adds t*speed and wraps by the screen height. 64 stars as single pixels, brighter for faster ones.",
"solution_rl": "fn hash(seed: i32) -> i32 {\n let mut h: i32 = seed * 747796405 + 2891336453;\n h = (h >> 16) ^ h;\n if h < 0 { h = 0 - h; }\n h\n}\n\nfn frame(t: i32) {\n let w: i32 = host::display::width();\n let h: i32 = host::display::height();\n host::display::clear(0x000000);\n let mut i: i32 = 0;\n while i < 64 {\n let x: i32 = hash(i * 2 + 1) % w;\n let speed: i32 = hash(i * 3 + 7) % 3 + 1;\n let y: i32 = (hash(i * 5 + 3) + t * speed) % h;\n let mut c: i32 = 0x606060;\n if speed == 2 { c = 0xa0a0a0; }\n if speed == 3 { c = 0xffffff; }\n host::display::set_pixel(x, y, c);\n i = i + 1;\n }\n host::display::present();\n}\n",
"tags": [
"prng",
"animation",
"loops"
]
}