aoc2023/day-13/image.go
2023-12-14 03:44:14 +00:00

34 lines
472 B
Go

package main
type imgs struct {
img []img
}
func newImages() imgs {
return imgs{img: make([]img, 0)}
}
type img struct {
raw []string
}
func newImg() img {
return img{raw: make([]string, 0)}
}
func (i img) transposed() []string {
transposed := []string{}
for x := 0; x < len(i.raw[0]); x++ {
buf := ""
for j := len(i.raw) - 1; j >= 0; j-- {
buf += string(i.raw[j][x])
}
transposed = append(transposed, buf)
}
return transposed
}
var images imgs