Solution for Day 12
This commit is contained in:
24
twelve/main.go
Normal file
24
twelve/main.go
Normal 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()))
|
||||
}
|
Reference in New Issue
Block a user