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

@@ -15,7 +15,11 @@ func part2[l1: Array, l2: Array] : void
io.println_i64(out)
func main[] : i64
lines : Array = must(io.read_text_file?("input.txt")) |> str.split("\n")
~input, ok := io.read_text_file("input.txt")
if !ok
panic("failed to open input.txt")
lines := str.split(input, "\n")
l1 := []
l2 := []