c64-maze/maze.c
2024-12-13 12:33:48 -05:00

29 lines
570 B
C

#include <stdlib.h>
#include <stdio.h>
#include <time.h>
#define BUF_SIZE 8192
int main() {
srand(time(NULL));
char buf[BUF_SIZE];
for (;;) {
for (int i = 0; i < BUF_SIZE;) {
int bits = rand();
for (int bit_idx = 0; bit_idx < 32; bit_idx++) {
int bit = (bits >> bit_idx) & 1;
if (bit) {
buf[i++] = '/';
} else {
buf[i++] = '\\';
}
}
}
fwrite(buf, sizeof(char), BUF_SIZE, stdout);
}
}