Solution for 12.1.
This commit is contained in:
parent
2d71871cf4
commit
fbd7c8fb00
4 changed files with 163 additions and 0 deletions
21
2018/day12-1.go
Normal file
21
2018/day12-1.go
Normal file
|
@ -0,0 +1,21 @@
|
|||
package main
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
|
||||
"internal/day12"
|
||||
"internal/util"
|
||||
)
|
||||
|
||||
const NumGenerations = 20
|
||||
|
||||
func main() {
|
||||
data := util.ReadInput()
|
||||
plants, rules := day12.ParseInput(data)
|
||||
|
||||
for i := 0; i < NumGenerations; i++ {
|
||||
plants = day12.RunGeneration(plants, rules)
|
||||
}
|
||||
|
||||
fmt.Println(day12.SumPlants(plants))
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue