31 lines
548 B
Go
31 lines
548 B
Go
package main
|
|
|
|
import (
|
|
"flag"
|
|
"fmt"
|
|
"os"
|
|
)
|
|
|
|
import (
|
|
. "github.com/meatballhat/box-o-sand/conway"
|
|
)
|
|
|
|
var (
|
|
height = flag.Int("height", 40, "Game height")
|
|
width = flag.Int("width", 80, "Game width")
|
|
mutate = flag.Bool("mutate", false, "Mutate every other generation")
|
|
sleepMs = flag.Int("sleep.ms", 200,
|
|
"Millisecond sleep interval per generation")
|
|
)
|
|
|
|
func main() {
|
|
flag.Parse()
|
|
|
|
retCode, err := RunConsoleGame(*height, *width, *sleepMs, *mutate)
|
|
if err != nil {
|
|
fmt.Fprintf(os.Stderr, "ERROR: %v\n", err)
|
|
}
|
|
|
|
os.Exit(retCode)
|
|
}
|