コード例 #1
0
ファイル: Program.cs プロジェクト: Julia1249/NET_BC_2019
        static void Main(string[] args)
        {
            Game game = new Game();

            while (true)
            {
                game.StartNewGame();
                game.Loop();

                if (!ConsoleInput.GetBool("Play again? y/n"))
                {
                    Environment.Exit(0); //iziet no loga
                    break;
                }
                Console.ReadLine();
            }
        }
コード例 #2
0
        static void Main(string[] args)
        {
            // Create a new game, start it and call game loop
            // Ask if user would like to play another round

            Game game = new Game();

            //new game
            while (true)
            {
                game.StartNewGame();
                game.Loop();
                Console.Write("Another round?");
                string answer = Console.ReadLine().ToLower();
                if (answer != "y" && answer != "yes")
                {
                    break;
                }
            }
        }
コード例 #3
0
        static void Main(string[] args)
        {
            //create new game, start it and call game loop
            //ask if user would like to play another round

            Game Game = new Game();

            while (true)
            {
                Game.StartNewGame();
                Game.Loop();

                if (!ConsoleInput.GetBool("Would you like to play another game? "))
                {
                    break;
                }
            }

            Console.Read();
        }