Advent of Code

Diff
Login

Diff

Differences From Artifact [2b60469d03]:

To Artifact [ff66d0a337]:


1
2
3




4
5
6
7
8
9
10
#include <stdio.h>
#include <stdlib.h>
#include "aocutils.h"





size_t text2array(unsigned **dst, const char *r) {
    unsigned *a = malloc(512 * sizeof *a);
    size_t na = 0, sa = 512;
    char *err;
    unsigned v;
    for (;;) {



>
>
>
>







1
2
3
4
5
6
7
8
9
10
11
12
13
14
#include <stdio.h>
#include <stdlib.h>
#include "aocutils.h"

size_t linearize2d(unsigned width, unsigned row, unsigned col) {
    return (row * width) + col;
}

size_t text2array(unsigned **dst, const char *r) {
    unsigned *a = malloc(512 * sizeof *a);
    size_t na = 0, sa = 512;
    char *err;
    unsigned v;
    for (;;) {