Esempio n. 1
0
        public static void Start()
        {
            int answerNumber = new Random().Next(1, 100);

            for (int i = 0; i < 8; i++)
            {
                var answer = MessageBox.AskForInput("What is the number? (" + (i + 1) + ". try)");
                // What is the number? (1. try)

                // =     --> Érték adás
                // ==    --> Összehasonlítás

                if (answer == answerNumber)
                {
                    //               Play a bell --#2
                    MessageBox.ShowMessage("You won the game.");
                    return;
                }
                if (answer > answerNumber)
                {
                    MessageBox.ShowMessage("Answer is too high");
                }
                if (answer < answerNumber)
                {
                    MessageBox.ShowMessage("Answer is too low");
                }
            }

            MessageBox.ShowMessage("You lost");
        }
        private static String askAQuestion(String question)
        {
            //var anotherVariable = askAQuestion("aaaaaaaaaaa");

            String answer = MessageBox.AskForInput(question);

            return(answer);
        }
Esempio n. 3
0
        public static void Start()
        {
            var currentAdverb   = MessageBox.AskForInput("Enter an adverb!");
            var currentEdVerb   = MessageBox.AskForInput("Enter a verb ending in '-ed'.");
            var currentBodyPart = MessageBox.AskForInput("Enter your body part.");
            var currentStory    = "Today ";

            currentStory += "I woke " + currentAdverb + ". ";
            currentStory += "Then I " + currentEdVerb + " ";
            currentStory += "my " + currentBodyPart + ". ";
            MessageBox.ShowMessage(currentStory);
        }
Esempio n. 4
0
        private static void AskAQuestion(string question, string answer)
        {
            while (true)
            {
                var guess = MessageBox.AskForInput(question);

                if (guess.ToString().ToLower() == answer.ToLower())
                {
                    break;
                }

                MessageBox.ShowMessage("That was incorrect.");
            }
        }
Esempio n. 5
0
        private static void Feladat1()
        {
            var word = new Words();

            word.currentAdverb   = MessageBox.AskForInput("Enter an adverb.");
            word.currentEdVerb   = MessageBox.AskForInput("Enter a verb ending in '-ed'! ");
            word.currentBodyPart = MessageBox.AskForInput("Enter a body part! ");
            word.osszefuzve();
            //MessageBox.ShowMessage(word.currentAdverb + word.currentBodyPart + word.currentEdVerb);
            var currentStory = "...";

            var words2 = new Words();

            words2.osszefuzve();
        }
        private static void PourIntoBackyard()
        {
            MessageBox.ShowMessage("As you walk into the backyard a net scoops you up and a giant takes you to a boiling pot of water.");
            string reaction = MessageBox.AskForInput("As the man starts to prepare you as soup, do you...'Scream' or 'Faint'?");

            if (reaction == "Faint")
            {
                MessageBox.ShowMessage("You made a delicious soup! Yum! The end.");
            }
            else if (reaction == "Scream")
            {
                startStory();
            }
            else
            {
                EndStory();
            }
        }
        private static void ApproachOoze()
        {
            MessageBox.ShowMessage("You approach a glowing, green bucket of ooze. Worried that you will get in trouble, you pick up the bucket.");
            String answer = MessageBox.AskForInput("Do you want to pour the ooze into the 'backyard' or 'toilet'?");

            if (answer == "toilet")
            {
                PourIntoToilet();
            }
            else if (answer == "backyard")
            {
                PourIntoBackyard();
            }
            else
            {
                EndStory();
            }
        }
        private static void PourIntoToilet()
        {
            MessageBox.ShowMessage("As you pour the ooze into the toilet it backs up, gurgles, and explodes, covering you in radioactive waste.");
            string ninja = MessageBox.AskForInput("Do you want to train to be a NINJA?  'Yes' or 'HECK YES'?");

            bool isYes             = ninja == "Yes";
            bool isHeckYes         = ninja == "HECK YES";
            bool is_Yes_or_HeckYes = isYes || isHeckYes;

            if (is_Yes_or_HeckYes)
            //if (ninja == "Yes" || ninja == "HECK YES")
            {
                MessageBox.ShowMessage("Awesome dude!  You live out the rest of your life fighting crimes and eating pizza!");
            }
            else
            {
                EndStory();
            }
        }
Esempio n. 9
0
        public static void Main()
        {
            Tortoise.Show();
            Tortoise.SetSpeed(10);

            var sides = MessageBox.AskForInput("How many sides?");

            for (int spins = 1; spins < sides; spins++)
            {
                for (int i = 0; i < sides; i++)
                {
                    Tortoise.SetPenColor(Colors.GetRandomColor());
                    Tortoise.Move(100);
                    Tortoise.Turn((360.0 * spins) / sides);
                }

                System.Threading.Thread.Sleep(100);
                //ProgramWindow.Clear();
                Tortoise.Show();
            }
        }