blob: 3ed632c3c0ae72b426e7929d4a4be9fff06aeb91 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
|
import adglent.{First, Second}
import gleam/io
import utilities/array2d.{type Posn, Posn}
type Direction {
North
South
East
West
}
fn turn_dirs(dir: Direction) {
case dir {
North | South -> [East, West]
East | West -> [North, South]
}
}
fn delta(dir: Direction) {
case dir {
North -> Posn(-1, 0)
South -> Posn(1, 0)
East -> Posn(0, 1)
West -> Posn(0, -1)
}
}
pub fn part1(input: String) {
todo as "Implement solution to part 1"
}
pub fn part2(input: String) {
todo as "Implement solution to part 2"
}
pub fn main() {
let assert Ok(part) = adglent.get_part()
let assert Ok(input) = adglent.get_input("17")
case part {
First ->
part1(input)
|> adglent.inspect
|> io.println
Second ->
part2(input)
|> adglent.inspect
|> io.println
}
}
|