Exemplo n.º 1
0
        public static void FirstFight()
        {
            System.Console.Clear();
            Design.GameUI();
            ViewStats.PlayerStats();
            System.Console.WriteLine("A Giant Rat is blocking the cell door opening...");
            System.Console.WriteLine("It's time for your first fight!");
            System.Console.WriteLine("Press enter to continue...");
            System.Console.ReadKey();
            System.Console.Clear();
            Design.GameUI();
            ViewStats.PlayerStats();
            System.Console.WriteLine("Would you like to know how fighting works in Toonax?");
            System.Console.WriteLine("Type 'Y' if you want to read them. Type 'N' if you already know what you are doing...");
            Program.yesOrNo = System.Console.ReadLine();
            if (Program.yesOrNo == "y" || Program.yesOrNo == "Y")
            {
                FightInstructions();
            }
            else
            {
                FirstEncounter();

                System.Console.Clear();
                Design.GameUI();
                ViewStats.PlayerStats();
                System.Console.WriteLine("Great job! " + Program.player.characterName + " You have proven you have what it takes to become a true Hero of Toonax!\nNow let us move onto the next chapter in your life!");
                System.Console.WriteLine("Press any key to continue onto CHAPTER 2...");
                System.Console.ReadKey();
                Chapter2.beginChapter2();
            }
        }
Exemplo n.º 2
0
        private void CallChapter2()
        {
            Console.WriteLine("----------CHAPTER 2----------");

            var chapter2 = new Chapter2();

            chapter2.Generics();
            chapter2.Nullables();
            chapter2.Delegates();
            chapter2.Yields();
        }
Exemplo n.º 3
0
 void Update()
 {
     if (PlayerController.Level1)
     {
         Chapter1.SetActive(true);
     }
     else
     {
         Chapter1.SetActive(false);
     }
     if (PlayerController.Level2)
     {
         Chapter2.SetActive(true);
     }
     else
     {
         Chapter2.SetActive(false);
     }
     if (PlayerController.Level3)
     {
         Chapter3.SetActive(true);
     }
     else
     {
         Chapter3.SetActive(false);
     }
     if (PlayerController.Level4)
     {
         Chapter4.SetActive(true);
     }
     else
     {
         Chapter4.SetActive(false);
     }
     if (PlayerController.Level5)
     {
         Chapter5.SetActive(true);
     }
     else
     {
         Chapter5.SetActive(false);
     }
     if (PlayerController.Level6)
     {
         Chapter6.SetActive(true);
     }
     else
     {
         Chapter6.SetActive(false);
     }
 }
Exemplo n.º 4
0
        public void ShouldLoadTheHomePageAndTheCheckButtonOnChapter2_FindButton()
        {
            Chapter2 ch2 = new Chapter2(driver).Load();

            Screenshot ss = ((ITakesScreenshot)driver).GetScreenshot();

            string screenshot = ss.AsBase64EncodedString;

            byte[] screenshotAsByteArray = ss.AsByteArray;
            ss.SaveAsFile("seleniumtest", ImageFormat.Png);
            ss.ToString();

            Assert.True(ch2.isButtonDisplayed("but2"));
        }
Exemplo n.º 5
0
 static void Chap2()
 {
     Chapter2 chapter2 = new Chapter2();
 }
Exemplo n.º 6
0
        static void Main(string[] args)
        {
            var cpt2 = new Chapter2();

            cpt2.TestTypeOf <int>();// type inference
        }
Exemplo n.º 7
0
 public Chapter2Tests()
 {
     _testHelper = new Chapter2();
 }
Exemplo n.º 8
0
        // Test cases
        static void Main(string[] args)
        {
            #region
            // var CH1 = new Chapter1();
            // Console.WriteLine($"IsUnique: {CH1.IsUnique("abcd")}");
            // Console.WriteLine($"IsUnique: {CH1.IsUnique("aacd")}");
            // Console.WriteLine($"IsUnique: {CH1.IsUnique1("abcd")}");
            // Console.WriteLine($"IsUnique: {CH1.IsUnique1("aacd")}");
            // Console.WriteLine($"IsUnique: {CH1.IsUnique2("abcd")}");
            // Console.WriteLine($"IsUnique: {CH1.IsUnique2("aacd")}");

            // Console.WriteLine($"CheckPermutation: {CH1.CheckPermutation("abc", "bca")}");
            // Console.WriteLine($"CheckPermutation1: {CH1.CheckPermulation2("abc", "bca")}");

            // Console.WriteLine($"CheckPermutation: {CH1.CheckPermutation("abcdeg", "bcaegd")}");
            // Console.WriteLine($"CheckPermutation1: {CH1.CheckPermulation2("abcdeg", "bcaegd")}");

            // Console.WriteLine($"CheckPermutation: {CH1.CheckPermutation("abc", "cbd")}");
            // Console.WriteLine($"CheckPermutation1: {CH1.CheckPermulation2("abcdeg", "bcaegp")}");

            // Console.WriteLine($"UrLify: {CH1.URLify("Mr John Smith    ",13)}");

            // Console.WriteLine($"Palindrome Permutation: {CH1.PalindomePermutation("atcctab")}");

            #endregion
            Chapter2 CH2 = new Chapter2();
            Node     ex1 = new Node(1);
            ex1.next                = new Node(2);
            ex1.next.next           = new Node(3);
            ex1.next.next.next      = new Node(4);
            ex1.next.next.next.next = new Node(5);

            Node ex2 = new Node(1);
            ex2.next                = new Node(2);
            ex2.next.next           = new Node(3);
            ex2.next.next.next      = new Node(3);
            ex2.next.next.next.next = new Node(4);

            Node ex3 = new Node(1);
            ex2.next                     = new Node(2);
            ex2.next.next                = new Node(2);
            ex2.next.next.next           = new Node(3);
            ex2.next.next.next.next      = new Node(3);
            ex2.next.next.next.next.next = new Node(4);

            // CH2.RemoveDups1(ex1);
            // CH2.RemoveDups1(ex2);
            // CH2.RemoveDups1(ex3);

            // CH2.RemoveDups2(ex1);
            // CH2.RemoveDups2(ex2);
            // CH2.RemoveDups2(ex3);

            // Console.WriteLine($"RemoveDups: ");
            // CH2.PrintLinkedList(ex1);
            // Console.WriteLine();
            // CH2.PrintLinkedList(ex1);
            // Console.WriteLine();
            // CH2.PrintLinkedList(ex1);
            // Console.WriteLine();

            Node ans1 = CH2.ReturnKthToLast(ex1, 3);
            Node ans2 = CH2.ReturnKthToLast(ex1, 2);
            Node ans3 = CH2.ReturnKthToLast(ex1, 3);

            Console.WriteLine($"ReturnKthToLast: ");
            CH2.PrintLinkedList(ans1);
        }
Exemplo n.º 9
0
        public void ShouldLoadTheHomePageAndTheCheckButtonOnChapter2_v2()
        {
            Chapter2 ch2 = new Chapter2(driver).Load();

            Assert.True(ch2.isButtonDisplayed("but1"));
        }