aocc22

Advent of Code 2022
git clone git://www.tkruger.se/aocc22.git
Log | Files | Refs | README

uppga.c (246B)


      1 #include "common.h"
      2 
      3 int main(int argc, char **argv) {
      4   char **lines;
      5   size_t nlines = readlines(&lines, "input");
      6 
      7   gd *g = parse(lines, nlines, 0);
      8 
      9   int r;
     10   size_t c = 0;
     11   while ((r = sandfall(g)) == 0)
     12     c++;
     13 
     14   printf("%zu\n", c);
     15 }