day 20: working version for part 1
This commit is contained in:
@@ -12,6 +12,7 @@
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <unistd.h>
|
||||
#include <errno.h>
|
||||
|
||||
@@ -129,6 +130,16 @@ static int read_data(int steps)
|
||||
universe[0][i] = calloc(universe_size, sizeof(char));
|
||||
universe[1][i] = calloc(universe_size, sizeof(char));
|
||||
}
|
||||
/* they got me on this one ;-)
|
||||
*/
|
||||
if (*algo) {
|
||||
log(1, "init second array\n");
|
||||
for (i = 0; i < universe_size; ++i)
|
||||
memset(universe[1][i], 1, universe_size);
|
||||
current=1;
|
||||
print_data(-1);
|
||||
current=0;
|
||||
}
|
||||
do {
|
||||
for (int i = 0; i < buflen; ++i) {
|
||||
universe[0][cur + left][i + left] = buf[i] == '#';
|
||||
|
Reference in New Issue
Block a user