예제 #1
0
 public static void Read(string page)
 {
     Page current = new Page(page);
     Page.Reader(current.Number);
     Page.Enter();
 }
예제 #2
0
        public static string Choice(string page, string choice1, string choice2)
        {
            bool clearToGo = false;
            Page current = new Page(page);
            Page.Reader(current.Number);
            string choice = "";

            while (clearToGo == false)
            {
                bool noErrorYet = true;
                string userValue = Page.Question();

                if (userValue == choice1)
                {
                    if (choice1 == "DREAM")
                    {
                        choice1 = "GO";
                        noErrorYet = true;
                        choice = choice1;
                        clearToGo = true;
                    }
                    else if ((choice1 == "ACCEPT" && choice2 == "NARROW") || (choice1 == "RAID" && choice2 == "VILLA"))
                    {
                        choice1 += "2";
                        noErrorYet = true;
                        choice = choice1;
                        clearToGo = true;
                    }
                    else if (choice1 == "STAY" && choice2 == "ACROSS THE DESERT")
                    {
                        choice1 += "3";
                        noErrorYet = true;
                        choice = choice1;
                        clearToGo = true;
                    }
                    else if (choice1 == "INSIST" && choice2 == "STAY")
                    {
                        choice1 += "4";
                        noErrorYet = true;
                        choice = choice1;
                        clearToGo = true;
                    }
                    else
                    {
                        noErrorYet = true;
                        choice = choice1;
                        clearToGo = true;
                    }
                }
                else if (userValue == choice2)
                {
                    if ((choice1 == "TIME" && choice2 == "ESCAPE") || (choice1 == "CONVINCE" && choice2 == "AGREE"))
                    {
                        choice2 += "2";
                        noErrorYet = true;
                        choice = choice2;
                        clearToGo = true;
                    }
                    else
                    {
                        noErrorYet = true;
                        choice = choice2;
                        clearToGo = true;
                    }
                }
                else
                {
                    if (noErrorYet == true)
                    {
                        Console.Clear();
                        Page.Reader(current.Number);
                        Page.Error("firstError");
                        noErrorYet = false;

                    }
                    else
                    {
                        Console.Clear();
                        Page.Reader(current.Number);
                        Page.Error("firstError");
                    }
                }
            }
            return choice;
        }