So this is one of the first programs I've made, I have been using a guide but it was very vague and it ended before telling me how to create a second option.
My problem is when the play answers the first question in the game the second question appears, but the player can't type anything into the console anymore.
My code:
import java.util.Scanner;
public class Kynarthain {
public static void main(String[] args) {
Scanner s = new Scanner(System.in);
System.out.println("You awake in a burning forest and are presented with 3 items.");
System.out.println("A Key, A Map and A Sword.");
System.out.println("You only have time to choose which item, which item do you choose?\n\nOptions:\n1:The Key\n2:The Map\n3:The Sword");
int a = s.nextInt();
switch (a) {
case 1:
System.out.println("You grab the key and run as fast as you can away from the fire");
System.out.println("Sadly their is a locked gate in your way but your key manages to unlock it");
System.out.println("Eventually you end up at a fork in the road");
System.out.println("You can either choose the Path of Dismay, or the Road of Broken Dreams\nOptions\n4:Path of Dismay\n5:Road of Broken Dreams");
break;
case 2:
System.out.println("You grab the Map and run as fast as you can away from the fire");
System.out.println("Using your map you notice there's a locked gate ahead, so you use the shortcut shown on your map");
System.out.println("Eventually you end up at a fork in the road");
System.out.println("You can either choose the Path of Dismay, or the Road of Broken Dreams\nOptions\n6:Path of Dismay\n7:Road of Broken Dreams");
break;
case 3:
System.out.println("You grab the Sword and run as fast as you can away from the fire");
System.out.println("Eventually you reach a locked gate, you make a desperate attempt to look for another way.");
System.out.println("You find another gate but there's a demonic fiend guarding it.");
System.out.println("You pull out your sword and with a swift blow it's gone.");
System.out.println("You walk out of the burning forest unscathed.");
System.out.println("Eventually you end up at a fork in the road");
System.out.println("You can either choose the Path of Dismay, or the Road of Broken Dreams\nOptions\n8:Path of Dismay\n9:Road of Broken Dreams");
break;
}
switch (a) {
case 4:
System.out.println("1");
break;
case 5:
System.out.println("2");
break;
case 6:
System.out.println("3");
break;
case 7:
System.out.println("4");
break;
case 8:
System.out.println("5");
break;
case 9:
System.out.println("6");
break;
}
}
}
Please don't troll or hate.