Browse Source

day10p2

master
mid-kid 6 years ago
parent
commit
156dca1e83
  1. 3
      day10p1/main.c
  2. 1
      day10p2

3
day10p1/main.c

@ -137,14 +137,15 @@ int main()
struct rect frame; struct rect frame;
unsigned frame_id = 0;
while (1) { while (1) {
frame = get_frame(lights, lights_len); frame = get_frame(lights, lights_len);
if (frame.h <= REASONABLE_HEIGHT) break; if (frame.h <= REASONABLE_HEIGHT) break;
advance_frame(lights, lights_len); advance_frame(lights, lights_len);
frame_id++;
} }
GString *fname = g_string_new(NULL); GString *fname = g_string_new(NULL);
unsigned frame_id = 0;
while (check_limit(frame, lights, lights_len) == 0) { while (check_limit(frame, lights, lights_len) == 0) {
g_string_printf(fname, "out/frame%03d.pbm", frame_id++); g_string_printf(fname, "out/frame%03d.pbm", frame_id++);
if (make_bitmap(fname->str, frame, lights, lights_len)) break; if (make_bitmap(fname->str, frame, lights, lights_len)) break;

1
day10p2

@ -0,0 +1 @@
day10p1
Loading…
Cancel
Save