summaryrefslogtreecommitdiff
path: root/main.go
diff options
context:
space:
mode:
Diffstat (limited to 'main.go')
-rw-r--r--main.go7
1 files changed, 3 insertions, 4 deletions
diff --git a/main.go b/main.go
index bdc4626..00087eb 100644
--- a/main.go
+++ b/main.go
@@ -12,16 +12,15 @@ type Ball struct{ hits int }
func main() {
numSecs := flag.Int("s", 1, "Number of seconds game should last")
+ numPlayers := flag.Int("p", 2, "Number of players")
flag.Parse()
- game(*numSecs)
+ game(*numSecs, *numPlayers)
}
-func game(numSecs int) {
+func game(numSecs, numPlayers int) {
var wg sync.WaitGroup
- // FIXME: make this a flag.
- const numPlayers = 7
players := make([]chan Ball, numPlayers+1)
players[0] = make(chan Ball)