Cells can have their values set when ranging over them
plus more replacement of y, x loops with cell ranges, adding static neighbor coords.
This commit is contained in:
@@ -40,7 +40,12 @@ func main() {
|
||||
|
||||
checksums := make([]string, 4)
|
||||
checksums[0], checksums[1], checksums[2], checksums[3] = "foo", "bar", "baz", "qwx"
|
||||
pushChecksum(game.Checksum(), checksums)
|
||||
ck, err := game.Checksum()
|
||||
if err != nil {
|
||||
fmt.Fprintf(os.Stderr, "NAY NAY: %v\n", err)
|
||||
os.Exit(3)
|
||||
}
|
||||
pushChecksum(ck, checksums)
|
||||
|
||||
ticks := time.Tick(time.Duration(*sleepMs) * time.Millisecond)
|
||||
generations := 0
|
||||
@@ -50,7 +55,11 @@ func main() {
|
||||
|
||||
game.EvaluateGeneration()
|
||||
|
||||
curChecksum := game.Checksum()
|
||||
curChecksum, err := game.Checksum()
|
||||
if err != nil {
|
||||
fmt.Fprintf(os.Stderr, "Failed to calculate current game checksum: %v\n", err)
|
||||
os.Exit(4)
|
||||
}
|
||||
|
||||
if checksums[0] == curChecksum || checksums[1] == curChecksum {
|
||||
fmt.Println("Stasis!")
|
||||
|
Reference in New Issue
Block a user