replace the horrible error system with multiple returns
This commit is contained in:
@@ -45,7 +45,11 @@ func part2[lines: Array] : void
|
||||
io.println_i64(sum)
|
||||
|
||||
func main[] : i64
|
||||
lines := 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")
|
||||
|
||||
part1(lines)
|
||||
part2(lines)
|
||||
|
||||
Reference in New Issue
Block a user