Solution for Day 12

This commit is contained in:
2021-12-12 23:26:23 +00:00
parent b0c161669e
commit be32018be9
9 changed files with 412 additions and 0 deletions

24
twelve/main.go Normal file
View File

@@ -0,0 +1,24 @@
package twelve
import "fmt"
type Twelve struct {
navigation navigation
}
func Init(filepath string) *Twelve {
twelve := &Twelve{
navigation: navigation{},
}
twelve.navigation.load(filepath)
return twelve
}
func (d *Twelve) Answer() string {
return fmt.Sprintf("Found %d paths through the cave system", len(d.navigation.findPaths()))
}
func (d *Twelve) FollowUp() string {
return fmt.Sprintf("Found %d paths through the cave system", len(d.navigation.findPaths2()))
}