Advent of Code solutions
1import "trilogy:io" use readlines
2import "trilogy:debug" use dbg
3import "trilogy:parsec" use parse, sep_by, char, integer
4import "trilogy:array" use collect, length
5import "trilogy:number" use abs
6import "trilogy:compare" use max
7import "trilogy:iterator" use map
8
9func area [x1, y1] [x2, y2] = (abs (x1 - x2) + 1) * (abs (y1 - y2) + 1)
10
11proc main!() {
12 let points = readlines
13 |> map (parse (sep_by (char ',') integer))
14 |> collect
15
16 let mut best = 0
17 let mut i = 0
18 while i < length points {
19 let mut j = i + 1
20 while j < length points {
21 best max= (area (points.i) (points.j))
22 j += 1
23 }
24 i += 1
25 }
26 dbg!(best)
27}