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:
2012-12-11 22:30:34 -05:00
parent 078efbe057
commit 8ba87ccc81
3 changed files with 203 additions and 99 deletions

View File

@@ -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!")