Ok this is game name Envelope but i dont know how does it work.??please i need a hand.
/** * Draw envelope without lifting your pen. * * @author (your name) * @version (a version number or a date) */ import java.util.Scanner; // to read input public class envelope { public static void main (String [] args) { //1. Display Instruction System.out.println("In this game player must choose path to draw an envelope"); System.out.println("Whithout lifting a pen"); System.out.println(" E"); System.out.println(" /\\"); System.out.println(" / \\"); System.out.println(" ___"); System.out.println("D C"); System.out.println(" | X |"); System.out.println(" ___"); System.out.println("A B"); //2. Reset the game environment // Possible choice for node A = {B,C,D} char [] nodeA = {'B','C','D'}; char [] nodeB={'A','C','D'}; char [] nodeC={'A','B','D','E'}; char [] nodeD={'A','B','C','D'}; char [] nodeE={'C','D'}; // path chosen by user char [] path = {'\0','\0','\0','\0','\0','\0','\0','\0','\0'}; // object Scanner to read input from keyboard Scanner in = new Scanner (System.in); //3. Start the game // 3.1 User choose node System.out.println(" Please select node to start: A, B, C, D or E"); String userInputStr = in.next(); char currentNode = userInputStr.charAt(0); // 3.2 Display possible node Boolean gameover = false; while (!gameover) { switch (currentNode) { case 'A' : System.out.println("Choices"); for (int i=0; i < nodeA.length; i++) System.out.print(nodeA[i]+" "); System.out.println(); break; case 'B' : System.out.println("Choices"); for (int i=0; i < nodeB.length; i++) System.out.print(nodeB[i]+" "); System.out.println(); break; case 'C' : System.out.println("Choices"); for (int i=0; i < nodeC.length; i++) System.out.print(nodeC[i]+" "); System.out.println(); break; case 'D' : System.out.println("Choices"); for (int i=0; i < nodeD.length; i++) System.out.print(nodeD[i]+" "); System.out.println(); break; case 'E' : System.out.println("Choices"); for (int i=0; i < nodeE.length; i++) System.out.print(nodeE[i]+" "); System.out.println(); break; default: System.out.println("Node NOT in the list"); } // 3.3 User choose next node char nextNode; do { System.out.println(" Please select next node"); userInputStr = in.next(); nextNode = userInputStr.charAt(0); // 3.4 Check valid choice if (nextNode == currentNode){ System.out.println("Invalid path- repeat path"); } } while (nextNode == currentNode); // 3.5 if game not over // 3.5.1 Store choice in path // 3.5.2 Repeat 3.2 currentNode = nextNode; } // gameover }// main } // envelope