2019-12-18 14:07:19 +00:00
|
|
|
package main
|
|
|
|
|
|
|
|
import (
|
|
|
|
"errors"
|
|
|
|
|
|
|
|
helpers "git.bullercodeworks.com/brian/adventofcode/helpers"
|
|
|
|
)
|
|
|
|
|
|
|
|
var maxX, maxY int
|
|
|
|
var vault map[helpers.Coordinate]byte
|
|
|
|
var keys map[helpers.Coordinate]byte
|
|
|
|
var doors map[helpers.Coordinate]byte
|
|
|
|
|
|
|
|
func main() {
|
|
|
|
file := "input"
|
|
|
|
if helpers.GetArgNumber(1) != "" {
|
|
|
|
file = helpers.GetArgNumber(1)
|
|
|
|
}
|
2019-12-18 14:59:20 +00:00
|
|
|
v := NewVault(file)
|
|
|
|
v.Print()
|
2019-12-18 14:07:19 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func isDoor(b byte) bool {
|
2019-12-18 14:59:20 +00:00
|
|
|
return 'A' <= b && b <= 'Z'
|
2019-12-18 14:07:19 +00:00
|
|
|
}
|
|
|
|
func isKey(b byte) bool {
|
2019-12-18 14:59:20 +00:00
|
|
|
return 'a' <= b && b <= 'z'
|
2019-12-18 14:07:19 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func keyToDoor(b byte) byte {
|
|
|
|
return (b - 'a') + 'A'
|
|
|
|
}
|
|
|
|
|
|
|
|
func doorToKey(b byte) byte {
|
|
|
|
return (b - 'A') + 'a'
|
|
|
|
}
|