diff --git a/src/day7/puzzle1.typ b/src/day7/puzzle1.typ index a6771fd..d5e62ca 100644 --- a/src/day7/puzzle1.typ +++ b/src/day7/puzzle1.typ @@ -1,7 +1,7 @@ #import "/src/utils.typ": * #import "@preview/cetz:0.3.1": canvas, draw -#let solveable(values, target) = { +#let solvable(values, target) = { if values.len() == 1 { return values.last() == target } @@ -9,7 +9,7 @@ let values = values let v = values.pop() if calc.rem(target, v) == 0 { - if solveable(values, target / v) { + if solvable(values, target / v) { return true } } @@ -17,7 +17,7 @@ return false } - return solveable(values, target - v) + return solvable(values, target - v) } #let solve(input) = { @@ -29,7 +29,7 @@ target = int(target) values = values.split(" ").map(int) - if solveable(values, target) { + if solvable(values, target) { total += target } } diff --git a/src/day7/puzzle2.typ b/src/day7/puzzle2.typ index 906246f..0757a51 100644 --- a/src/day7/puzzle2.typ +++ b/src/day7/puzzle2.typ @@ -5,7 +5,7 @@ return int(str(a) + str(b)) } -#let solveable(values, target) = { +#let solvable(values, target) = { if values.len() == 1 { return values.last() == target } @@ -13,7 +13,7 @@ let values = values let v = values.pop() if calc.rem(target, v) == 0 { - if solveable(values, target / v) { + if solvable(values, target / v) { return true } } @@ -27,7 +27,7 @@ 0, str-target.len() - str-v.len() ) - if solveable(values, int(target2)) { + if solvable(values, int(target2)) { return true } } @@ -35,7 +35,7 @@ return false } - return solveable(values, target - v) + return solvable(values, target - v) } #let solve(input) = { @@ -47,7 +47,7 @@ target = int(target) values = values.split(" ").map(int) - if solveable(values, target) { + if solvable(values, target) { total += target } } diff --git a/src/main.pdf b/src/main.pdf index b341142..22d7fcf 100644 Binary files a/src/main.pdf and b/src/main.pdf differ diff --git a/src/main.typ b/src/main.typ index 7b319d7..f988950 100644 --- a/src/main.typ +++ b/src/main.typ @@ -17,7 +17,6 @@ #v(2cm) -/* #align(center, canvas({ draw.merge-path( { @@ -50,7 +49,7 @@ fill: rgb("#63584B"), stroke: none ) -}))*/ +})) #v(1fr)