Serving random state images, now need to tackle state transfer

This commit is contained in:
Dan Buch
2012-12-17 09:17:01 -05:00
parent 8b536de45c
commit 6818d0ee01
6 changed files with 2244 additions and 19 deletions

View File

@@ -11,10 +11,12 @@ import (
)
var (
height = flag.Int("height", 40, "Game height")
width = flag.Int("width", 80, "Game width")
mutate = flag.Bool("mutate", false, "Mutate every other generation")
web = flag.Bool("web", false, "Run server for web-based game")
height = flag.Int("height", 40, "Game height")
width = flag.Int("width", 80, "Game width")
mutate = flag.Bool("mutate", false, "Mutate every other generation")
web = flag.Bool("web", false, "Run a web-based game.")
addr = flag.String("addr", ":9775",
"Address for server of web-based game (ignored if running a console game.)")
sleepMs = flag.Int("sleep.ms", 200,
"Millisecond sleep interval per generation")
)
@@ -28,7 +30,7 @@ func main() {
)
if *web {
retCode, err = RunWebGame(*height, *width, *sleepMs, *mutate)
retCode, err = RunWebGame(*addr, *height, *width, *sleepMs, *mutate)
if err != nil {
fmt.Fprintf(os.Stderr, "ERROR: %v\n", err)
}