replace the horrible error system with multiple returns

This commit is contained in:
2026-05-28 17:28:57 +02:00
parent 0b16cc4513
commit f181cfe675
18 changed files with 138 additions and 199 deletions

View File

@@ -54,7 +54,11 @@ func part2[ranges: Array] : void
io.println_i64(sum)
func main[] : i64
ranges := must(io.read_text_file?("input.txt")) |> str.split(",")
~input, ok := io.read_text_file("input.txt")
if !ok
panic("failed to open input.txt")
ranges := str.split(input, ",")
part1(ranges)
part2(ranges)