Day 13 solution

This commit is contained in:
2021-12-13 18:58:17 +00:00
parent be32018be9
commit 000e241684
8 changed files with 1367 additions and 0 deletions

26
thirteen/main.go Normal file
View File

@@ -0,0 +1,26 @@
package thirteen
import "fmt"
type Thirteen struct {
manual manual
}
func Init(filepath string) *Thirteen {
thirteen := &Thirteen{
manual: manual{},
}
thirteen.manual.load(filepath)
return thirteen
}
func (d *Thirteen) Answer() string {
_, dots := foldGrid(d.manual.folds[0], d.manual.dots)
return fmt.Sprintf("There are %d dots after 1 fold", dots)
}
func (d *Thirteen) FollowUp() string {
d.manual.fold()
return "This is the activation code"
}