Day 11 solution

This commit is contained in:
2021-12-11 16:32:12 +00:00
parent 8950ee2e3e
commit b0c161669e
7 changed files with 255 additions and 0 deletions

24
eleven/main.go Normal file
View File

@@ -0,0 +1,24 @@
package eleven
import "fmt"
type Eleven struct {
cavern cavern
}
func Init(filepath string) *Eleven {
eleven := &Eleven{
cavern: cavern{},
}
eleven.cavern.load(filepath)
return eleven
}
func (d *Eleven) Answer() string {
return fmt.Sprintf("There were %d flashes after 100 steps", d.cavern.totalFlashes(100))
}
func (d *Eleven) FollowUp() string {
return fmt.Sprintf("They all flash on step %d", d.cavern.stepsToSynchronousFlash())
}