c64-maze/maze.c

28 lines
569 B
C
Raw Normal View History

2024-12-12 14:46:54 -05:00
#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);
}
}