/* sierpinski0.c - Don Yang (uguu.org) 01/07/07 */ #include #define WIDTH 79 #define CENTER 34 int main(void) { int cell[WIDTH]; int x, y, left, current; for(x = 0; x < WIDTH; x++) cell[x] = (int)(x == CENTER); for(y = 0; y < 32; y++) { for(x = left = 0; x < WIDTH - 1; x++) { current = cell[x]; cell[x] = left ^ cell[x + 1]; left = current; (void)putchar(" X"[current]); } (void)putchar('\n'); } return 0; }