-
Notifications
You must be signed in to change notification settings - Fork 0
/
Game.java
26 lines (22 loc) · 833 Bytes
/
Game.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
import java.util.*;
public class Game{
static int number;
static ArrayList<Player> playerList = new ArrayList<Player>();
public static void main(String[] args) throws Exception{
Scanner scanner = new Scanner(System.in);
//uses cmd to input the right amount of players
System.out.print("Enter the number of players: \n > ");
number = scanner.nextInt();
scanner.nextLine();
//adds players names to game
for(int i = 1; i < number+1; i++){
System.out.print("Enter player number " + i + "'s name:\n > ");
String name = scanner.nextLine();
Player player = new Player(name);
playerList.add(player);
}
//creates the board
Board board = new Board(playerList);
Player.board = board;
}
}