aboutsummaryrefslogtreecommitdiff
path: root/2019/ten.go
blob: 562299a71a3fe5f96e3460bc124fa4a4464c669b (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
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
}