start 2024, 2024-01
This commit is contained in:
22
2024/aoc.odin
Normal file
22
2024/aoc.odin
Normal file
@@ -0,0 +1,22 @@
|
||||
package aoc
|
||||
|
||||
import "core:log"
|
||||
import "core:os"
|
||||
import "core:strings"
|
||||
|
||||
Pair :: struct($T: typeid) {
|
||||
a: $T,
|
||||
b: $T,
|
||||
}
|
||||
|
||||
slurp_file :: proc(path: string) -> string {
|
||||
input, ok := os.read_entire_file(path)
|
||||
if !ok {
|
||||
log.fatal("Failed to read input")
|
||||
}
|
||||
return string(input)
|
||||
}
|
||||
|
||||
slurp_lines :: proc(path: string) -> []string {
|
||||
return strings.split_lines(slurp_file(path))
|
||||
}
|
||||
Reference in New Issue
Block a user