Exemple #1
0
        static void Main()
        {
            var fullscreen = false;

            Console.WriteLine("Which assignment shall run next? (1, 2, 3, 4, or q for quit)");
            var level = Console.ReadLine();

            if (level == "1")
            {
                var game = VirtualCity.RunAssignment1(SortSpecialBuildingsByDistance, fullscreen);
                game.Run();
            }
            else if (level == "2")
            {
                var game = VirtualCity.RunAssignment2(FindSpecialBuildingsWithinDistanceFromHouse, fullscreen);
                game.Run();
            }
            else if (level == "3")
            {
                var game = VirtualCity.RunAssignment3(FindRoute, fullscreen);
                game.Run();
            }
            else if (level == "4")
            {
                var game = VirtualCity.RunAssignment4(FindRoutesToAll, fullscreen);
                game.Run();
            }
        }
        static void Main()
        {
            var fullscreen = false;

read_input:
            switch (Microsoft.VisualBasic.Interaction.InputBox("Which assignment shall run next? (1, 2, 3, 4, or q for quit)", "Choose assignment", VirtualCity.GetInitialValue()))
            {
            case "1":
                using (var game = VirtualCity.RunAssignment1(SortSpecialBuildingsByDistance, fullscreen))
                    game.Run();
                break;

            case "2":
                using (var game = VirtualCity.RunAssignment2(FindSpecialBuildingsWithinDistanceFromHouse, fullscreen))
                    game.Run();
                break;

            case "3":
                using (var game = VirtualCity.RunAssignment3(FindRoute, fullscreen))
                    game.Run();
                break;

            case "4":
                using (var game = VirtualCity.RunAssignment4(FindRoutesToAll, fullscreen))
                    game.Run();
                break;

            case "q":
                return;
            }
            goto read_input;
        }
Exemple #3
0
        static void Main()
        {
            var fullscreen = false;

            Console.WriteLine("Enter number of simulation to run - [1 - 4, q]");

            while (true)
            {
                switch (Console.ReadLine())
                {
                case "1":
                    using (var game = VirtualCity.RunAssignment1(SortSpecialBuildingsByDistance,
                                                                 fullscreen))
                        game.Run();
                    break;

                case "2":
                    using (var game = VirtualCity.RunAssignment2(FindSpecialBuildingsWithinDistanceFromHouse,
                                                                 fullscreen))
                        game.Run();
                    break;

                case "3":
                    using (var game = VirtualCity.RunAssignment3(FindRoute, fullscreen))
                        game.Run();
                    break;

                case "4":
                    using (var game = VirtualCity.RunAssignment4(FindRoutesToAll, fullscreen))
                        game.Run();
                    break;

                case "q":
                    return;

                default:
                    Console.WriteLine("Invalid input! Try again! - [1 - 4, q]");
                    break;
                }
            }
        }