diff --git a/day10/inputs b/day10/inputs new file mode 120000 index 0000000..a80bb2b --- /dev/null +++ b/day10/inputs @@ -0,0 +1 @@ +../inputs \ No newline at end of file diff --git a/day10/maze.go b/day10/maze.go new file mode 100644 index 0000000..11194e8 --- /dev/null +++ b/day10/maze.go @@ -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()) + } + +}