Esempio n. 1
0
        public static void Main(string[] args)
        {
            Game mathGame = new Game(1, 0);

            Console.WriteLine("This is a math game...");



            while (true)
            {
                mathGame.Display_Score_Bar();
                mathGame.Display_Exp_Bar(mathGame.Score);

                int first  = mathGame.Roll(mathGame.Level);
                int second = mathGame.Roll(mathGame.Level);
                int ope    = mathGame.Roll(0);

                Console.WriteLine("");
                Console.WriteLine($"  {first}");
                Console.WriteLine($"{mathGame.Get_Op(ope)} {second}");
                Console.WriteLine("-----");
                Console.Write(" ");
                int answer   = Convert.ToInt32(Console.ReadLine());
                int solution = mathGame.Generate_Solution(first, second, ope);


                if (answer == solution)
                {
                    Console.WriteLine("Your answer is Correct!\n");
                    mathGame.Score += 10;
                }
                else
                {
                    Console.WriteLine($"Wrong! The correct answer is {solution}");
                    mathGame.Score -= 1;
                }
            }

            //Console.WriteLine("Thank you for playing this game");
        }