{
"id": "220",
"prompt": "A patchwork quilt of half-square triangles: 64px cells each fill_triangle one of the four corner orientations picked by an LCG hash, over alternating cream and tan cell backgrounds with brick-red and teal patches by checkerboard parity. Restitch the whole quilt every 120 frames by folding t/120 into the hash.",
"solution_rl": "fn frame(t: i32) {\n let w: i32 = host::display::width();\n let h: i32 = host::display::height();\n let cell: i32 = 64;\n let cols: i32 = w / cell;\n let rows: i32 = h / cell;\n let gen: i32 = t / 120;\n let mut r: i32 = 0;\n while r < rows {\n let mut c: i32 = 0;\n while c < cols {\n let mut hsh: i32 = gen * 7 + r * 7919 + c * 104729;\n hsh = hsh * 1103515245 + 12345;\n let o: i32 = (hsh >> 16) & 3;\n let x: i32 = c * cell;\n let y: i32 = r * cell;\n let bg: i32 = if ((r + c) & 1) == 0 { 0xf2e8da } else { 0xe8d8c3 };\n let fg: i32 = if ((r + c) & 1) == 0 { 0x9a3b3b } else { 0x2f5d62 };\n host::display::fill_rect(x, y, cell, cell, bg);\n if o == 0 {\n host::display::fill_triangle(x, y, x + cell - 1, y, x, y + cell - 1, fg);\n } else if o == 1 {\n host::display::fill_triangle(x, y, x + cell - 1, y, x + cell - 1, y + cell - 1, fg);\n } else if o == 2 {\n host::display::fill_triangle(x + cell - 1, y, x + cell - 1, y + cell - 1, x, y + cell - 1, fg);\n } else {\n host::display::fill_triangle(x, y, x + cell - 1, y + cell - 1, x, y + cell - 1, fg);\n }\n c = c + 1;\n }\n r = r + 1;\n }\n host::display::present();\n}\n",
"tags": [
"generative",
"tiling",
"fill_triangle",
"prng"
]
}