2024-06-01 15:03:01 +02:00
|
|
|
%import textio
|
2024-08-23 19:33:20 +02:00
|
|
|
|
2024-07-16 00:25:29 +02:00
|
|
|
%zeropage basicsafe
|
2023-12-31 01:02:33 +01:00
|
|
|
|
2024-01-07 18:48:18 +01:00
|
|
|
main {
|
2024-08-24 14:34:23 +02:00
|
|
|
sub start() {
|
2024-09-06 01:46:22 +02:00
|
|
|
uword active_world = memory("world", 80*50, 0)
|
|
|
|
uword cell_off = 500
|
|
|
|
const uword STRIDE = 40
|
|
|
|
sys.memset(active_world, 80*50, 1)
|
|
|
|
txt.print_ub(count()) ; TODO prints 1, must be 8
|
|
|
|
|
|
|
|
sub count() -> ubyte {
|
|
|
|
return active_world[cell_off-STRIDE-1] + active_world[cell_off-STRIDE] + active_world[cell_off-STRIDE+1] +
|
|
|
|
active_world[cell_off-1] + active_world[cell_off+1] +
|
|
|
|
active_world[cell_off+STRIDE-1] + active_world[cell_off+STRIDE] + active_world[cell_off+STRIDE+1]
|
2024-09-05 21:23:17 +02:00
|
|
|
}
|
2024-07-21 13:35:28 +02:00
|
|
|
}
|
|
|
|
}
|