-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMain.java
More file actions
23 lines (20 loc) · 765 Bytes
/
Main.java
File metadata and controls
23 lines (20 loc) · 765 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
package byow.Core;
/** This is the main entry point for the program. This class simply parses
* the command line inputs, and lets the byow.Core.Engine class take over
* in either keyboard or input string mode.
*/
public class Main {
public static void main(String[] args) {
if (args.length > 2) {
System.out.println("Can only have two arguments - the flag and input string");
System.exit(0);
} else if (args.length == 2 && args[0].equals("-s")) {
Engine engine = new Engine();
engine.interactWithInputString(args[1]);
System.out.println(engine.toString());
} else {
Engine engine = new Engine();
engine.interactWithKeyboard();
}
}
}