This is even better, but still not fast enough.
This commit is contained in:
parent
5d4757d4cb
commit
bab5f879b0
3 changed files with 37 additions and 22 deletions
|
@ -12,13 +12,14 @@ const NumGenerations = 50000000000
|
|||
func main() {
|
||||
data := util.ReadInput()
|
||||
plants, rules := day12.FastParseInput(data)
|
||||
rootIndex := 0
|
||||
|
||||
runner := day12.FastGenerationRunner()
|
||||
rootIndex := 0
|
||||
for i := 0; i < NumGenerations; i++ {
|
||||
plants, rootIndex = day12.FastRunGeneration(plants, rules, rootIndex)
|
||||
plants, rootIndex = runner(plants, rules, rootIndex)
|
||||
|
||||
// debug
|
||||
if i%1000000 == 0 {
|
||||
if i%1000000000 == 0 {
|
||||
fmt.Println("DEBUG: Generation: ", i)
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue