repl.it
@kironroy/

numberguessgame

C#

No description

fork
loading
Files
  • main.cs
  • CorrectNumber.cs
  • EndGameScene.cs
  • Game.cs
  • main.exe
  • OpeningGameScene.cs
main.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
using System;
using System.Globalization;
using System.Collections.Generic;


namespace NumberGuessingGame
{
    class Program
    {
        static void Main()
        {
            OpeningGameScene.ArtTitle(); // art screen  

            Game.CharacterName();  // intro

            string myChoice;

            do
            {



                Console.WriteLine("S - Start Quiz");
                Console.WriteLine("Q - Quit\n");
                Console.WriteLine("Choose S or Q: ");
                // Retrieve the user's choice
                myChoice = Console.ReadLine().Trim().ToUpper();
                switch (myChoice)
                {
                    case "S":
                        Game.Play();
                        Console.Clear();
                        break;
                    case "Q":
                        EndingGameScene.EndTitle();
                        break;
                    default:
                        Console.WriteLine(); // breakline
                        Console.WriteLine(String.Format("{0} is not a valid choice", myChoice));
                        Console.Clear();
                        break;

                } // do's end bracket
            } while (myChoice != "Q"); // users quits

           

        }
    }
}