Skip to content

Commit

Permalink
Check for invalid team count
Browse files Browse the repository at this point in the history
  • Loading branch information
Foulest committed Dec 5, 2024
1 parent 32496bd commit d669287
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/main/java/net/foulest/swiss/Main.java
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,12 @@ public static void main(String[] args) {
System.out.print("Enter the amount of brackets to simulate: ");
int bracketsToSimulate = scanner.nextInt();

// Check how many teams are in the list
if (teams.size() != 16) {
System.out.println("Invalid team count. Please make sure there are 16 teams in the list.");
return;
}

// Validate the input
if (bracketsToSimulate < 0 || bracketsToSimulate > 60000000) {
System.out.println("Invalid input. Please enter a number between 1 and 50,000,000.");
Expand Down

0 comments on commit d669287

Please sign in to comment.