tangled
alpha
login
or
join now
eldridge.cam
/
advent-of-code
2
fork
atom
Advent of Code solutions
2
fork
atom
overview
issues
pulls
pipelines
fix
eldridge.cam
3 months ago
918819e3
066259d9
+3
-3
1 changed file
expand all
collapse all
unified
split
2023
1
p1.tri
+3
-3
2023/1/p1.tri
···
1
1
import "trilogy:io" use readlines, println
2
2
import "trilogy:string" use chars
3
3
-
import "trilogy:array" use filter, map, reduce, collect
3
3
+
import "trilogy:array" use filter, map, fold, collect
4
4
import "trilogy:parsec" use parse, integer
5
5
6
6
func is_digit '0' or '1' or '2' or '3' or '4' or '5' or '6' or '7' or '8' or '9' = true
···
17
17
>> combine
18
18
>> parse integer
19
19
)
20
20
-
|> reduce (+)
21
21
-
println!(total)
20
20
+
|> fold (+) 0
21
21
+
println!("${total}")
22
22
}