diff options
| author | demo <demo@antix1> | 2026-05-24 23:30:19 -0400 |
|---|---|---|
| committer | demo <demo@antix1> | 2026-05-24 23:30:19 -0400 |
| commit | 700e47bc42b77375658b22fb5efae67a7aeeda83 (patch) | |
| tree | dedef02603ea1e32d480bdce5a4faf69d738f004 | |
| parent | 5d714273d9caa303ae2d6f01c541afe562d4d240 (diff) | |
feat: vet the number of players
| -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) } |
