-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMain.java
More file actions
27 lines (22 loc) · 831 Bytes
/
Main.java
File metadata and controls
27 lines (22 loc) · 831 Bytes
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
import javax.swing.*;
public class Main {
public static void main(String[] args) {
new Main().launch();
}
public void launch() {
SwingUtilities.invokeLater(() -> {
String[] options = {"Easy (3x4)", "Medium (4x4)", "Hard (6x6)"};
int choice = JOptionPane.showOptionDialog(null, "Select Difficulty Level", "Memory Game",
JOptionPane.DEFAULT_OPTION, JOptionPane.QUESTION_MESSAGE, null, options, options[1]);
int rows = 4;
int cols = 4;
switch (choice) {
case 0: rows = 3; cols = 4; break;
case 1: rows = 4; cols = 4; break;
case 2: rows = 6; cols = 6; break;
default: System.exit(0);
}
new GameBoard(rows, cols);
});
}
}