예제 #1
0
        public static void PathSelection()
        {
            Boolean Finished = false;

            do
            {
                String pathDecision = Console.ReadLine(); //Ask the user for input on which path should be taken
                switch (pathDecision.ToLowerInvariant())  //Sets the path based on the user response
                {
                case "plains":
                    Console.WriteLine("You have chosen to take the 'Plains' path.");
                    Plains.ThePlains();
                    Finished = true;
                    break;

                case "forest":
                    Console.WriteLine("You have chosen to take the 'Forest' path.");
                    break;

                case "cave":
                    Console.WriteLine("You have chosen to take the 'Cave' path.");
                    break;

                case "random":
                    RandomPath.pathOfRandom();
                    break;

                default:
                    Console.WriteLine("Try Again");     //Needs to be fixed where it doesn't go throughout the program
                    break;
                }
            } while (!Finished);
        }
예제 #2
0
        public static void pathOfRandom()
        {
            string[] pathSelectionArray = new string[3] {
                "Plains", "Forest", "Cave"
            };
            Random pathSelectionNumber = new Random();
            int    pathNum             = pathSelectionNumber.Next(pathSelectionArray.Length);

            Console.WriteLine("You have chosen " + pathSelectionArray[pathNum]);
            if (pathNum == 0)
            {
                Plains.ThePlains();
            }
            else if (pathNum == 1)
            {
                Forest.TheForest();
            }
            else if (pathNum == 2)
            {
                Cave.TheCave();
            }
            else
            {
                Console.WriteLine("Error");
            }
        }
예제 #3
0
        public static void PlainsOutcomeScenarioOne()
        {
            Random numGen    = new Random();
            int    numResult = numGen.Next(1, 1);

            switch (numResult)
            {
            case 1:
                Plains.plainsPrintTwoOutcomeOne();
                break;

            case 2:
                Plains.plainsPrintTwoOutcomeTwo();
                break;

            case 3:
                Plains.plainsPrintTwoOutcomeThree();
                break;

            default:
                Console.WriteLine(numResult);
                break;
            }
        }