summaryrefslogtreecommitdiff
path: root/src/App.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/App.java')
-rw-r--r--src/App.java13
1 files changed, 11 insertions, 2 deletions
diff --git a/src/App.java b/src/App.java
index 16c2a41..6170187 100644
--- a/src/App.java
+++ b/src/App.java
@@ -6,17 +6,26 @@ import java.util.Scanner;
public class App {
public static void main(String[] args) {
Scanner in = new Scanner(System.in);
+ Integer selection = args.length > 0 ? Integer.parseInt(args[0]) : null;
+
while (true) {
- System.out.println("Choose exercise: (1-10)");
- switch (in.nextInt()) {
+ if (selection == null) {
+ System.out.println("Choose exercise: (1-10)");
+ selection = in.nextInt();
+ }
+ switch (selection) {
case 1:
Q1.ReversedSentence.main(args);
break;
+ case 2:
+ Q2.RockPaperScissorsLizardSpock.main(args);
+ break;
default:
System.out.println("Bye");
System.exit(0);
break;
}
+ selection = null;
}
}
}