Previous years crap.

Signed-off-by: Ettore Dreucci <ettore.dreucci@gmail.com>
This commit is contained in:
2020-12-01 23:29:53 +01:00
parent 09d6b9f3ca
commit 3f5d566cae
11 changed files with 1301 additions and 0 deletions

33
2018/day_10/main.go Normal file
View File

@@ -0,0 +1,33 @@
package main
import (
"bufio"
"fmt"
"log"
"os"
)
type point struct {
x, y int
Vx, Vy int
}
func main() {
var points []*point
file, err := os.Open("./input")
if err != nil {
log.Fatal(err)
}
defer file.Close()
scan := bufio.NewScanner(file)
for scan.Scan() {
var p *point
line := scan.Text()
fmt.Sscanf(line, "position=<%d, %d> velocity=<%d, %d>", &p.x, &p.y, &p.Vx, &p.Vy)
points = append(points, p)
}
}