diff options
| -rw-r--r-- | main.go | 8 |
1 files changed, 8 insertions, 0 deletions
@@ -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) } |
