-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathTAMV2.java
More file actions
71 lines (55 loc) · 2.07 KB
/
Copy pathTAMV2.java
File metadata and controls
71 lines (55 loc) · 2.07 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
59
60
61
62
63
64
65
66
67
68
69
70
import java.util.Scanner;
public class TAMV2 {
public static void main(String[] args){
boolean playGame = true;
Scanner scan = new Scanner(System.in);
int a, b, c = 0;
while(playGame){
System.out.println("Welcome to Minesweeper!");
System.out.println("Input the width (0 - 100) of your board: ");
a = scan.nextInt();
System.out.println("Input the height of your board: ");
b = scan.nextInt();
System.out.println("Input the number of bombs (Optional, enter 0 to skip...): ");
c = scan.nextInt();
Board game = new Board(b, a, c);
game.displayGrid();
game.format(5);
game.displayNumGrid();
promptEnterKey();
System.out.println("Input x-coordinate: ");
a = scan.nextInt();
System.out.println("Input y-coordinate: ");
b = scan.nextInt();
game.adjZeroes(b, a, 0);
game.displayMarkedGrid();
}
// Board board = new Board(16, 16, 39);
// board.displayGrid();
// board.format(10);
// board.displayNumGrid();
// board.format(1);
// System.out.println("Input x-coordinate: ");
// a = scan.nextInt();
// System.out.println("Input y-coordinate: ");
// b = scan.nextInt();
// System.out.println(board.adjacentZeroes(new IntPair(b, a)));
}
public static void promptEnterKey(){
System.out.println("\nPress \"ENTER\" to continue...");
Scanner scanner = new Scanner(System.in);
scanner.nextLine();
}
}
/*
*
* for(int di = (i > 0 ? -1 : 0); di <= (i < length - 1 ? 1 : 0); ++di){
for(int dl = (l > 0 ? -1 : 0); dl <= (l < width - 1 ? 1 : 0); ++dl){
if(di != 0 || dl != 0){
if(grid[i + di][l + dl] == BOMB){
adjacent++;
}
}
}
}
*/