This commit is contained in:
Ben Shiller 2021-06-06 08:06:55 -05:00
parent 1bda83d514
commit 8aa88925e5
No known key found for this signature in database
GPG Key ID: DC46F01400846797

View File

@ -4,45 +4,7 @@ import (
"fmt" "fmt"
) )
type Matrix struct {
arr []int
width int
}
func (m Matrix) GetIndex(row, col int) int {
return m.arr[m.width*row+col]
}
func (m *Matrix) SetIndex(row, col, val int) {
m.arr[m.width*row+col] = val
}
func (m Matrix) String() {
for row := 0; row < m.width; row++ {
fmt.Println(m.arr[row*m.width : row*m.width+m.width])
}
}
func Solve(_ []string) { func Solve(_ []string) {
/*
//width := 1001
width := 10
num_numbers := width * width
mat := Matrix{
arr: make([]int, num_numbers),
width: width,
}
i := num_numbers
cur_width
for i > 0; {
for y := width - 1; y >= 0; y-- {
mat.SetIndex(x, y, i)
i--
}
}
//fmt.Println(mat)
mat.String()
*/
max_width := 1001 max_width := 1001
sum := 1 sum := 1
for width := 1; width < max_width; width += 2 { for width := 1; width < max_width; width += 2 {