Starting day10

This commit is contained in:
Davide Oddone 2023-12-12 19:17:01 +01:00
parent 5bebd71c4e
commit fb896a8d20

View File

@ -1,11 +1,17 @@
package main
import()
import (
"bufio"
"fmt"
"os"
"sync"
"time"
)
// Parallel code, global vars
type Nodes struct {
mu sync.Mutex
variable type
mu sync.Mutex
variable int
}
func check(e error) {
@ -18,6 +24,7 @@ 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() {
@ -31,12 +38,11 @@ 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())
lines = append(lines, scanner.Text())
}
}
}