Day10 skeleton

This commit is contained in:
Davide Oddone 2023-12-11 22:32:49 +01:00
parent 6d24500c69
commit 5bebd71c4e
2 changed files with 43 additions and 0 deletions

1
day10/inputs Symbolic link
View File

@ -0,0 +1 @@
../inputs

42
day10/maze.go Normal file
View File

@ -0,0 +1,42 @@
package main
import()
// Parallel code, global vars
type Nodes struct {
mu sync.Mutex
variable type
}
func check(e error) {
if e != nil {
panic(e)
}
}
func PrintAndWait(x ...any) {
fmt.Print(x...)
fmt.Scanln()
}
// use defer timer("funcname")() when the function you want to
// test starts
func timer(name string) func() {
start := time.Now()
return func() {
fmt.Printf("%s took %v\n", name, time.Since(start))
}
}
func main() {
file, err := os.Open("./inputs")
check(err)
defer file.Close()
lines := make([]string, 0)
scanner := bufio.NewScanner(file)
for scanner.Scan() {
lines = append(lines, scanner.Text())
}
}