diff options
Diffstat (limited to 'main.go')
| -rw-r--r-- | main.go | 6 |
1 files changed, 5 insertions, 1 deletions
@@ -12,6 +12,10 @@ func main() { numSecs := flag.Int("s", 1, "Number of seconds game should last") flag.Parse() + game(*numSecs) +} + +func game(numSecs int) { table := make(chan Ball) go player("ping", table) go player("pong", table) @@ -19,7 +23,7 @@ func main() { table <- Ball{} // Make the game last this long. - time.Sleep(time.Duration(*numSecs) * time.Second) + time.Sleep(time.Duration(numSecs) * time.Second) // Game over: grab the ball. <-table |
