-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMain.java
More file actions
36 lines (31 loc) · 1.25 KB
/
Main.java
File metadata and controls
36 lines (31 loc) · 1.25 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
package APCSA.APCSA_Code_Your_Own;
public class Main {
public static void main(String[] args) {
for (int i = 0; i < 5; i++) {
System.out.println();
}
boolean gameStarted = false;
System.out.println("Starting MS-DOS...");
System.out.println("MS-DOS Version 5.0");
String input = "";
System.out.println("Welcome to DOS! Type \"help\" for commands.");
while (!gameStarted) {
input = Utils.inputString("C:\\>");
switch (input) {
case "help":
System.out.println(
"commands:\n\tdir\t\t\tview the current directory\n\thelp\t\t\tlist available commands\n\tcd {dir}\t\tnavigate to directory \'dir\'\n\tstart {app.exe}\t\tstart executable \'app.exe\'");
break;
case "dir":
System.out.println("\t05/18/1986\t01:41 PM \t<DIR>\tadventuregame.exe");
break;
case "start adventuregame.exe":
gameStarted = true;
break;
default:
System.out.println("Invalid command. Type \"help\" for help.");
}
}
GameRunner.runGame();
}
}