-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathStratego.java
62 lines (57 loc) · 1.81 KB
/
Stratego.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
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
59
60
61
62
/**
* Stratego!
*
* @author Chuck Garcia
* @version Version-1 Apr-26-21
*/
import java.util.*;
import java.util.HashMap;
public class Stratego
{
public Stratego()
{
Scanner sc = new Scanner(System.in);
Board board = new Board();
Boolean game = false;
board.addPiece(1,2,"B");
while(game.equals(false))
{
System.out.println("Please sellect a piece to move");
String pos = sc.nextLine();
System.out.println("pos is "+pos);
if(board.getPiece(pos)!= null)
{
System.out.println("Pick a direction to move in"+
"\n 1 : Up "+
"\n 2 : Downward"+
"\n 3 : Left"+
"\n 4 : Right");
String move = sc.nextLine();
switch (move)
{
case "1":
//board.getPiece(pos) +"\n");
board.moveUp(pos);
break;
case "2":
System.out.println("case 2");
game = true;
break;
}
}else
{
System.out.println(board.returnMap().keySet());
System.out.println("pos is "+pos);
System.out.println("Piece at " + pos + " does not exist \n");
}
pos = "";
}
}
}
/*
Piece piece = new Piece(1,1,"B", pieces);
UI UI = new UI();
UI.print(pieces);
piece.moveUp();
UI.print(pieces);
*/