First attempt at a faster / more efficient implementation. This is orders of magnitude faster than the first, but still not nearly fast enough.
This commit is contained in:
parent
fbd7c8fb00
commit
5d4757d4cb
4 changed files with 102 additions and 0 deletions
|
@ -53,6 +53,7 @@ func RunGeneration(plants map[int]bool, rules []*Rule) map[int]bool {
|
|||
for _, rule := range rules {
|
||||
if checkRule(plants, rule, i) {
|
||||
newGen[i] = rule.Result
|
||||
break // only one rule will match a given slice
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue