Files
curlywas/random.cwa

13 lines
292 B
Plaintext

import "env.memory" memory(4);
import "env.random" fn random() -> i32;
import "env.randomSeed" fn seed(i32);
export fn tic(time: i32) {
let i: i32;
loop pixels {
seed(i + (time / 100) * 320);
i?120 = random();
branch_if (i := i + 1) < 320*256: pixels
}
}