You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
28 lines
419 B
28 lines
419 B
package main
|
|
|
|
import (
|
|
"fmt"
|
|
"os"
|
|
"time"
|
|
)
|
|
|
|
import (
|
|
. "github.com/meatballhat/box-o-sand/conway/go"
|
|
)
|
|
|
|
func main() {
|
|
game := NewGameOfLife(40, 40)
|
|
err := game.ImportRandomState()
|
|
if err != nil {
|
|
fmt.Fprintf(os.Stderr, "WHAT IN FAIL?: %v\n", err)
|
|
os.Exit(2)
|
|
}
|
|
|
|
ticks := time.Tick(1 * time.Second)
|
|
for now := range ticks {
|
|
fmt.Printf("\n\n%v\n", now)
|
|
fmt.Println(game)
|
|
game.EvaluateGeneration()
|
|
}
|
|
}
|