Add solution for Day 1
This commit is contained in:
14
one/main.go
14
one/main.go
@@ -1,16 +1,24 @@
|
||||
package one
|
||||
|
||||
import "fmt"
|
||||
|
||||
type One struct {
|
||||
radar radar
|
||||
}
|
||||
|
||||
func Init(filepath string) *One {
|
||||
return nil
|
||||
one := &One{
|
||||
radar: radar{},
|
||||
}
|
||||
|
||||
one.radar.scan(filepath)
|
||||
return one
|
||||
}
|
||||
|
||||
func (d *One) Answer() string {
|
||||
return "Hello"
|
||||
return fmt.Sprintf("There were %d increases in depth", d.radar.depthIncreases())
|
||||
}
|
||||
|
||||
func (d *One) FollowUp() string {
|
||||
return "World!"
|
||||
return fmt.Sprintf("There were %d increases in depth when sampling a window", d.radar.windowedDepthIncreases())
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user