summaryrefslogtreecommitdiff
path: root/main.go
diff options
context:
space:
mode:
Diffstat (limited to 'main.go')
-rw-r--r--main.go8
1 files changed, 8 insertions, 0 deletions
diff --git a/main.go b/main.go
index c2f007f..686981b 100644
--- a/main.go
+++ b/main.go
@@ -16,6 +16,14 @@ func main() {
numPlayers := flag.Int("p", 2, "Number of players")
flag.Parse()
+ // Believe it or not, one player still makes for a valid game,
+ // since that player simply checks in with the main goroutine,
+ // who simply sends the ball back to it.
+ if *numPlayers < 1 {
+ log.Fatalf("Invalid number of players: %d", *numPlayers)
+ }
+
+ // Launch the game!
game(*numSecs, *numPlayers)
}