Advent of Code

Check-in [72ebf0375e]
Login

Check-in [72ebf0375e]

Overview
Comment:inputs are now in their directory
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA3-256: 72ebf0375edc88726dfc7c39d0c6677c1e30b3be87e083ed6a025a160e08fc7c
User & Date: nnz on 2024-12-05 21:10:27
Other Links: manifest | tags
Context
2024-12-06
12:05
moved and renamed function to aocutils.c check-in: 682dabca63 user: nnz tags: trunk
2024-12-05
21:10
inputs are now in their directory check-in: 72ebf0375e user: nnz tags: trunk
20:38
prepare for tomorrow, start work on 201504 check-in: d415c28af8 user: nnz tags: trunk
Changes

Modified .fossil-settings/ignore-glob from [4a22d7c721] to [231683691f].

1
2
3
4

1
2
3
4
5




+
aoc
aocdbg
aocclang
aoctcc
inputs/*

Modified aoc.c from [66f06825e4] to [0723e06f03].

14
15
16
17
18
19
20
21

22
23
24
25
26
27
28

29
30
31
32
33
34
35
14
15
16
17
18
19
20

21
22
23
24
25
26
27

28
29
30
31
32
33
34
35







-
+






-
+







        y = strtoul(argv[1], &err, 10);
        if (*err || (y < 2015) || (y > MAX_YEAR)) y = 0;
        d = strtoul(argv[2], &err, 10);
        if (*err || (d < 1) || (d > 25)) d = 0;
        if (argc >= 4) {
            sprintf(dataname, "%.98s", argv[3]);
        } else {
            sprintf(dataname, ".%04u%02u.txt", y, d);
            sprintf(dataname, "inputs/%04u%02u.txt", y, d);
        }
    }
    if ((y == 0) || (d == 0)) {
        fprintf(stderr, "syntax: %s yyyy dd [input-file]\n", argv[0]);
        fprintf(stderr, "    where 2015 <= yyyy <= %d\n", MAX_YEAR);
        fprintf(stderr, "    and 1 <= dd <= 25\n");
        fprintf(stderr, "if no [input-file] is supplied loads the file .yyyydd.txt\n");
        fprintf(stderr, "if no [input-file] is supplied loads the file inputs/yyyydd.txt\n");
        exit(EXIT_FAILURE);
    }
    // read data from dataname into input
    char *input = NULL;
    size_t ilen = slurp(&input, dataname);

    // call the right function