-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathTest.java
More file actions
58 lines (51 loc) · 1.21 KB
/
Copy pathTest.java
File metadata and controls
58 lines (51 loc) · 1.21 KB
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
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
import java.util.*;
class Test
{
public static void main(String[] args)
{
Scanner scan = new Scanner(System.in);
Die die = new Die();
Game game = new Game();
System.out.println("\n\n");
System.out.println("\t\t\t\t!Traps and Ladders!");
System.out.println("\t\t\t\t ...Press 1...");
int start = scan.nextInt();
scan.nextLine();
if(start == 1)
{
String name = null;
int select=0;
while(select!=3)
{
System.out.println("\n\t\t\t\t ...Select...");
System.out.println("\t\t\t [1]Start [2]Help [3]Exit");
select=scan.nextInt();
scan.nextLine();
switch(select)
{
case 1:
boolean gameOver=false;
Player[] players = {new Player(), new Player()};
Board board = new Board(players);
game.gameStart(players, name);
while(!gameOver)
{
game.gamePlay(players[0],board);
gameOver = game.checkWinner(gameOver,players,board);
game.gamePlay(players[1],board);
gameOver = game.checkWinner(gameOver,players,board);
}
break;
case 2:
game.howToPlay();
break;
case 3:
game.close();
break;
default:
System.out.println("Selection invalid.");
}
}
}
}
}