fix indentation
This commit is contained in:
parent
bb8dbf7b5c
commit
f707e08fa1
@ -6,8 +6,8 @@
|
||||
#include "lfinput.h"
|
||||
#include "lflinkedlist.h"
|
||||
|
||||
static int cmp(const void* a, const void* b) {
|
||||
return (*(int*)a - *(int*)b);
|
||||
static int cmp(const void *a, const void *b) {
|
||||
return (*(int *) a - *(int *) b);
|
||||
}
|
||||
|
||||
void advent2022day01(void) {
|
||||
@ -15,24 +15,24 @@ void advent2022day01(void) {
|
||||
const char *errstr;
|
||||
int t = 0;
|
||||
|
||||
List* totals = malloc(sizeof(List));
|
||||
List *totals = malloc(sizeof(List));
|
||||
ll_init(totals, free);
|
||||
|
||||
while ((found = strsep(&input, "\n")) != NULL) {
|
||||
if (strcmp(found, "") == 0) {
|
||||
int *i = malloc(sizeof(int));
|
||||
*i = t;
|
||||
ll_ins_next(totals, totals->tail, (void*)i);
|
||||
ll_ins_next(totals, totals->tail, (void *) i);
|
||||
t = 0;
|
||||
} else {
|
||||
t += (int)(strtonum(found, 0, INT_MAX, &errstr));
|
||||
t += (int) (strtonum(found, 0, INT_MAX, &errstr));
|
||||
}
|
||||
}
|
||||
|
||||
int elves[totals->size];
|
||||
int i = 0;
|
||||
LL_ITER(totals) {
|
||||
elves[i++] = *(int*)(node->data);
|
||||
elves[i++] = *(int *) (node->data);
|
||||
}
|
||||
|
||||
qsort(elves, totals->size, sizeof(int), cmp);
|
||||
|
@ -4,7 +4,9 @@
|
||||
#include "lfinput.h"
|
||||
|
||||
void advent2022day03(void) {
|
||||
char *input = get_input("input/2022/03");
|
||||
printf("Solution for Day 03 of 2022 is not completed yet\n");
|
||||
free(input);
|
||||
size_t sz = 0;
|
||||
char **input = get_lines("input/2022/03", &sz);
|
||||
|
||||
|
||||
del_lines(input);
|
||||
}
|
||||
|
@ -4,7 +4,7 @@
|
||||
#include "lfinput.h"
|
||||
|
||||
void advent2022day04(void) {
|
||||
char *input = get_input("input/2022/04");
|
||||
printf("Solution for Day 04 of 2022 is not completed yet\n");
|
||||
free(input);
|
||||
char *input = get_input("input/2022/04");
|
||||
printf("Solution for Day 04 of 2022 is not completed yet\n");
|
||||
free(input);
|
||||
}
|
||||
|
@ -4,7 +4,7 @@
|
||||
#include "lfinput.h"
|
||||
|
||||
void advent2022day05(void) {
|
||||
char *input = get_input("input/2022/05");
|
||||
printf("Solution for Day 05 of 2022 is not completed yet\n");
|
||||
free(input);
|
||||
char *input = get_input("input/2022/05");
|
||||
printf("Solution for Day 05 of 2022 is not completed yet\n");
|
||||
free(input);
|
||||
}
|
||||
|
@ -4,7 +4,7 @@
|
||||
#include "lfinput.h"
|
||||
|
||||
void advent2022day06(void) {
|
||||
char *input = get_input("input/2022/06");
|
||||
printf("Solution for Day 06 of 2022 is not completed yet\n");
|
||||
free(input);
|
||||
char *input = get_input("input/2022/06");
|
||||
printf("Solution for Day 06 of 2022 is not completed yet\n");
|
||||
free(input);
|
||||
}
|
||||
|
@ -4,7 +4,7 @@
|
||||
#include "lfinput.h"
|
||||
|
||||
void advent2022day07(void) {
|
||||
char *input = get_input("input/2022/07");
|
||||
printf("Solution for Day 07 of 2022 is not completed yet\n");
|
||||
free(input);
|
||||
char *input = get_input("input/2022/07");
|
||||
printf("Solution for Day 07 of 2022 is not completed yet\n");
|
||||
free(input);
|
||||
}
|
||||
|
@ -4,7 +4,7 @@
|
||||
#include "lfinput.h"
|
||||
|
||||
void advent2022day08(void) {
|
||||
char *input = get_input("input/2022/08");
|
||||
printf("Solution for Day 08 of 2022 is not completed yet\n");
|
||||
free(input);
|
||||
char *input = get_input("input/2022/08");
|
||||
printf("Solution for Day 08 of 2022 is not completed yet\n");
|
||||
free(input);
|
||||
}
|
||||
|
@ -4,7 +4,7 @@
|
||||
#include "lfinput.h"
|
||||
|
||||
void advent2022day09(void) {
|
||||
char *input = get_input("input/2022/09");
|
||||
printf("Solution for Day 09 of 2022 is not completed yet\n");
|
||||
free(input);
|
||||
char *input = get_input("input/2022/09");
|
||||
printf("Solution for Day 09 of 2022 is not completed yet\n");
|
||||
free(input);
|
||||
}
|
||||
|
@ -4,7 +4,7 @@
|
||||
#include "lfinput.h"
|
||||
|
||||
void advent2022day10(void) {
|
||||
char *input = get_input("input/2022/10");
|
||||
printf("Solution for Day 10 of 2022 is not completed yet\n");
|
||||
free(input);
|
||||
char *input = get_input("input/2022/10");
|
||||
printf("Solution for Day 10 of 2022 is not completed yet\n");
|
||||
free(input);
|
||||
}
|
||||
|
@ -4,7 +4,7 @@
|
||||
#include "lfinput.h"
|
||||
|
||||
void advent2022day11(void) {
|
||||
char *input = get_input("input/2022/11");
|
||||
printf("Solution for Day 11 of 2022 is not completed yet\n");
|
||||
free(input);
|
||||
char *input = get_input("input/2022/11");
|
||||
printf("Solution for Day 11 of 2022 is not completed yet\n");
|
||||
free(input);
|
||||
}
|
||||
|
@ -4,7 +4,7 @@
|
||||
#include "lfinput.h"
|
||||
|
||||
void advent2022day12(void) {
|
||||
char *input = get_input("input/2022/12");
|
||||
printf("Solution for Day 12 of 2022 is not completed yet\n");
|
||||
free(input);
|
||||
char *input = get_input("input/2022/12");
|
||||
printf("Solution for Day 12 of 2022 is not completed yet\n");
|
||||
free(input);
|
||||
}
|
||||
|
@ -4,7 +4,7 @@
|
||||
#include "lfinput.h"
|
||||
|
||||
void advent2022day13(void) {
|
||||
char *input = get_input("input/2022/13");
|
||||
printf("Solution for Day 13 of 2022 is not completed yet\n");
|
||||
free(input);
|
||||
char *input = get_input("input/2022/13");
|
||||
printf("Solution for Day 13 of 2022 is not completed yet\n");
|
||||
free(input);
|
||||
}
|
||||
|
@ -4,7 +4,7 @@
|
||||
#include "lfinput.h"
|
||||
|
||||
void advent2022day14(void) {
|
||||
char *input = get_input("input/2022/14");
|
||||
printf("Solution for Day 14 of 2022 is not completed yet\n");
|
||||
free(input);
|
||||
char *input = get_input("input/2022/14");
|
||||
printf("Solution for Day 14 of 2022 is not completed yet\n");
|
||||
free(input);
|
||||
}
|
||||
|
@ -4,7 +4,7 @@
|
||||
#include "lfinput.h"
|
||||
|
||||
void advent2022day15(void) {
|
||||
char *input = get_input("input/2022/15");
|
||||
printf("Solution for Day 15 of 2022 is not completed yet\n");
|
||||
free(input);
|
||||
char *input = get_input("input/2022/15");
|
||||
printf("Solution for Day 15 of 2022 is not completed yet\n");
|
||||
free(input);
|
||||
}
|
||||
|
@ -4,7 +4,7 @@
|
||||
#include "lfinput.h"
|
||||
|
||||
void advent2022day16(void) {
|
||||
char *input = get_input("input/2022/16");
|
||||
printf("Solution for Day 16 of 2022 is not completed yet\n");
|
||||
free(input);
|
||||
char *input = get_input("input/2022/16");
|
||||
printf("Solution for Day 16 of 2022 is not completed yet\n");
|
||||
free(input);
|
||||
}
|
||||
|
@ -4,7 +4,7 @@
|
||||
#include "lfinput.h"
|
||||
|
||||
void advent2022day17(void) {
|
||||
char *input = get_input("input/2022/17");
|
||||
printf("Solution for Day 17 of 2022 is not completed yet\n");
|
||||
free(input);
|
||||
char *input = get_input("input/2022/17");
|
||||
printf("Solution for Day 17 of 2022 is not completed yet\n");
|
||||
free(input);
|
||||
}
|
||||
|
@ -4,7 +4,7 @@
|
||||
#include "lfinput.h"
|
||||
|
||||
void advent2022day18(void) {
|
||||
char *input = get_input("input/2022/18");
|
||||
printf("Solution for Day 18 of 2022 is not completed yet\n");
|
||||
free(input);
|
||||
char *input = get_input("input/2022/18");
|
||||
printf("Solution for Day 18 of 2022 is not completed yet\n");
|
||||
free(input);
|
||||
}
|
||||
|
@ -4,7 +4,7 @@
|
||||
#include "lfinput.h"
|
||||
|
||||
void advent2022day19(void) {
|
||||
char *input = get_input("input/2022/19");
|
||||
printf("Solution for Day 19 of 2022 is not completed yet\n");
|
||||
free(input);
|
||||
char *input = get_input("input/2022/19");
|
||||
printf("Solution for Day 19 of 2022 is not completed yet\n");
|
||||
free(input);
|
||||
}
|
||||
|
@ -4,7 +4,7 @@
|
||||
#include "lfinput.h"
|
||||
|
||||
void advent2022day20(void) {
|
||||
char *input = get_input("input/2022/20");
|
||||
printf("Solution for Day 20 of 2022 is not completed yet\n");
|
||||
free(input);
|
||||
char *input = get_input("input/2022/20");
|
||||
printf("Solution for Day 20 of 2022 is not completed yet\n");
|
||||
free(input);
|
||||
}
|
||||
|
@ -4,7 +4,7 @@
|
||||
#include "lfinput.h"
|
||||
|
||||
void advent2022day21(void) {
|
||||
char *input = get_input("input/2022/21");
|
||||
printf("Solution for Day 21 of 2022 is not completed yet\n");
|
||||
free(input);
|
||||
char *input = get_input("input/2022/21");
|
||||
printf("Solution for Day 21 of 2022 is not completed yet\n");
|
||||
free(input);
|
||||
}
|
||||
|
@ -4,7 +4,7 @@
|
||||
#include "lfinput.h"
|
||||
|
||||
void advent2022day22(void) {
|
||||
char *input = get_input("input/2022/22");
|
||||
printf("Solution for Day 22 of 2022 is not completed yet\n");
|
||||
free(input);
|
||||
char *input = get_input("input/2022/22");
|
||||
printf("Solution for Day 22 of 2022 is not completed yet\n");
|
||||
free(input);
|
||||
}
|
||||
|
@ -4,7 +4,7 @@
|
||||
#include "lfinput.h"
|
||||
|
||||
void advent2022day23(void) {
|
||||
char *input = get_input("input/2022/23");
|
||||
printf("Solution for Day 23 of 2022 is not completed yet\n");
|
||||
free(input);
|
||||
char *input = get_input("input/2022/23");
|
||||
printf("Solution for Day 23 of 2022 is not completed yet\n");
|
||||
free(input);
|
||||
}
|
||||
|
@ -4,7 +4,7 @@
|
||||
#include "lfinput.h"
|
||||
|
||||
void advent2022day24(void) {
|
||||
char *input = get_input("input/2022/24");
|
||||
printf("Solution for Day 24 of 2022 is not completed yet\n");
|
||||
free(input);
|
||||
char *input = get_input("input/2022/24");
|
||||
printf("Solution for Day 24 of 2022 is not completed yet\n");
|
||||
free(input);
|
||||
}
|
||||
|
@ -4,7 +4,7 @@
|
||||
#include "lfinput.h"
|
||||
|
||||
void advent2022day25(void) {
|
||||
char *input = get_input("input/2022/25");
|
||||
printf("Solution for Day 25 of 2022 is not completed yet\n");
|
||||
free(input);
|
||||
char *input = get_input("input/2022/25");
|
||||
printf("Solution for Day 25 of 2022 is not completed yet\n");
|
||||
free(input);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user