Esempio n. 1
0
        public static void Start(string[] menu)
        {
            if (menu.Length == 0)
            {
                new Program(new PirateConsole());
            }
            else if (ProgramUtil.TryParseInt(menu[0]).didParse)
            {
                int choice = ProgramUtil.ParseInt(menu[0]);
                switch (choice)
                {
                case 1:
                    new Program(new PirateConsole());
                    break;

                case 2:
                    new Program(new PrettyConsole());
                    break;

                case 3:
                    new Program(new AngryConsole());
                    break;

                default:
                    new Program(new PirateConsole());
                    break;
                }
            }
            else
            {
                new Program(new PirateConsole());
            }
            Program.Run();
        }
Esempio n. 2
0
        public static void Main(string[] args)
        {
            Console.WriteLine(ProgramUtil.Factorial(5));
            Console.WriteLine(ProgramUtil.ParseInt("-23"));
            Console.WriteLine(ProgramUtil.TryParseInt("-50"));
            Console.WriteLine(ProgramUtil.ReadFile(@"C:\Users\Tyler\Desktop\Games\Crying.txt"));
            string input = "I'm crying because I don't remember why I created this txt file.";

            ProgramUtil.WriteToFile(@"C:\Users\Tyler\Desktop\Games\Crying.txt", input);
        }