-
Notifications
You must be signed in to change notification settings - Fork 0
/
MineSweeper.java
43 lines (24 loc) · 932 Bytes
/
MineSweeper.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
/**
MineSweeper -- main class for a GUI minesweeper game.
Games use a 9 x 9 board with 10 randomly placed mines. For more details about this
game and how to play it, see the assignment description.
To run it from the command line:
java MineSweeper
DO NOT CHANGE THIS FILE
*/
import javax.swing.JFrame;
public class MineSweeper {
private static final int FRAME_WIDTH = 400;
private static final int FRAME_HEIGHT = 425;
private static int SIDE_LENGTH = 9;
private static int NUM_MINES = 15;
public static void main(String[] args) {
JFrame frame = new JFrame();
frame.setTitle("Minesweeper");
frame.setSize(FRAME_WIDTH, FRAME_HEIGHT);
GameBoardPanel gameBoard = new GameBoardPanel(20, SIDE_LENGTH, NUM_MINES);
frame.add(gameBoard);
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
frame.setVisible(true);
}
}