From a7ba598a54a8883c83cb9ef2b04d653eecd92e28 Mon Sep 17 00:00:00 2001 From: j-james Date: Sun, 11 Dec 2022 18:15:44 -0800 Subject: Reorganize 2019 solutions --- 2019/go/day10.go | 47 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 47 insertions(+) create mode 100644 2019/go/day10.go (limited to '2019/go/day10.go') diff --git a/2019/go/day10.go b/2019/go/day10.go new file mode 100644 index 0000000..562299a --- /dev/null +++ b/2019/go/day10.go @@ -0,0 +1,47 @@ +package main + +import ( + "fmt" + "io/ioutil" + "os" +) + +func main() { + var region [][]bool + x, y, size := 0, 0, 0 + if len(os.Args) < 2 { + panic("runtime error: missing operand") + } + file, err := ioutil.ReadFile(os.Args[1]) + if err != nil { + panic(err) + } + for i := 0; i < len(file); i++ { + if file[i] == '#' { + region[x][y] = true + x++ + } else if file[i] == '\n' { + x = 0 + y++ + } + } + max := 0 + fmt.Println("Maximum detectable asteroids:", detect(region, x, y)) +} + +func detect(region [][]bool, width, height int) int { + for i:= 0; i < width; i++ { + for j := 0; j < height; j++ { + if region[i][j] { + for k:= 0; k < width; k++ { + for l := 0; l < width; l++ { + + } + } + } + } + } + + slope := + return +} -- cgit v1.2.3-70-g09d2