Actual solution for day 16!
This commit is contained in:
@@ -3,23 +3,22 @@ package sixteen
|
||||
import "fmt"
|
||||
|
||||
type Sixteen struct {
|
||||
bits packet
|
||||
packet packet
|
||||
}
|
||||
|
||||
func Init(filepath string) *Sixteen {
|
||||
sixteen := &Sixteen{
|
||||
bits: packet{},
|
||||
packet: packet{},
|
||||
}
|
||||
|
||||
sixteen.bits = load(filepath)
|
||||
sixteen.packet = load(filepath)
|
||||
return sixteen
|
||||
}
|
||||
|
||||
func (d *Sixteen) Answer() string {
|
||||
return fmt.Sprintf("The sum of the version numbers is %d", d.bits.versionSum())
|
||||
return fmt.Sprintf("The sum of the version numbers is %d", d.packet.versionSum())
|
||||
}
|
||||
|
||||
func (d *Sixteen) FollowUp() string {
|
||||
return "sixteen part 2 answer for bits"
|
||||
return fmt.Sprintf("The output of the encoded input is %d", d.packet.value())
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user