joseleonweb

Untitled

Dec 10th, 2021
1,048
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.27 KB | None | 0 0
  1. final byte MIN_NUMPLAYERS = 2;
  2. final byte MAX_NUMPLAYERS = 8;
  3. int numPlayers;
  4. do {
  5.     System.out.printf("How many players? (%d-%d) ", MIN_NUMPLAYERS, MAX_NUMPLAYERS);
  6.     numPlayers = keyboard.nextInt();
  7. }while(numPlayers < MIN_NUMPLAYERS || numPlayers > MAX_NUMPLAYERS);
Advertisement
Add Comment
Please, Sign In to add comment