コード例 #1
0
ファイル: Program.cs プロジェクト: CaidenKehrer/TBG-Unital
        static void fizzbuzz(int size)
        {
            ConsoleManager.writeLine("AH YOU FOUND THE FIZZBUZZ");

            for (int i = 1; i <= size; i++)
            {
                var output = "";
                if (i % 3 == 0)
                {
                    output = "Fizz";
                }
                if (i % 5 == 0)
                {
                    output += "Buzz";
                }
                if (output == "")
                {
                    output = i.ToString();
                }
                ConsoleManager.writeLine(output);
            }
        }
コード例 #2
0
        public bool Setup()
        {
            int steps = 3, stepsDone = 0;

            try
            {
                //setup folder
                ConsoleManager.writeLine($"step {stepsDone}/{steps}");
                stepsDone++;
                Directory.CreateDirectory(filebase + "/TBG_Unital");
                filebase = filebase + "/TBG_Unital";

                //load settings
                ConsoleManager.writeLine($"\b\b\b{stepsDone}/{steps}");
                stepsDone++;
                Directory.CreateDirectory(filebase + "/Settings");

                ConsoleManager.writeLine($"\b\b\b{stepsDone}/{steps}");
                stepsDone++;
                if (File.Exists(filebase + "/Settings/settings.TBU"))
                {
                    //DEBUG LINE
                    if (Program.debug)
                    {
                        Console.WriteLine("Found existing settings file loading it");
                    }
                    //load general settings
                    LoadSettings(filebase + "/Settings/settings.TBU");
                }
                else
                {
                    if (Program.debug)
                    {
                        Console.WriteLine("Didnt find existing settings file creating it");
                    }
                    //Setup settings file
                }
                //Load world
                stepsDone++;
                if (File.Exists(filebase + "/Settings/settings.TBU"))
                {
                    //DEBUG LINE
                    if (Program.debug)
                    {
                        Console.WriteLine("Found existing world file loading it");
                    }
                    //load general settings
                }
                else
                {
                    if (Program.debug)
                    {
                        Console.WriteLine("Didnt find existing world file creating it");
                    }
                    //Setup settings file
                }
            }
            catch {
                throw new Exception("Error setting up files!");
            }
            return(true);
        }