aoc21/d9/common.go

17 lines
316 B
Go
Raw Normal View History

2022-02-21 22:28:30 +02:00
package d9
import (
"fmt"
"strings"
)
2022-02-22 01:54:17 +02:00
const wall = '9'
2022-02-21 22:28:30 +02:00
func addWalls(lines []string) []string {
for i, line := range lines {
2022-02-22 01:54:17 +02:00
lines[i] = fmt.Sprintf("%v%v%v", string(wall), line, string(wall))
2022-02-21 22:28:30 +02:00
}
2022-02-22 01:54:17 +02:00
nines := strings.Repeat(string(wall), len(lines[0]))
2022-02-21 22:28:30 +02:00
return append([]string{nines}, append(lines, nines)...)
}