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:
Anna Rose Wiggins 2018-12-13 00:27:02 -05:00
parent fbd7c8fb00
commit 5d4757d4cb
No known key found for this signature in database
GPG key ID: 8D9ACA841015C59A
4 changed files with 102 additions and 0 deletions

View file

@ -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
}
}
}