コード例 #1
0
ファイル: Program.cs プロジェクト: faebots/GreenhouseCalc
 static void Main(string[] args)
 {
     Console.WriteLine("Hello World!");
     var calc     = new SeedCalc();
     var seedList = calc.SeedList;
     var itemList = calc.ItemList;
     var tierList = calc.YieldTiers;
     //ValidateAndPrint();
 }
コード例 #2
0
ファイル: Program.cs プロジェクト: faebots/GreenhouseCalc
        static void Main(string[] args)
        {
            var calc = new SeedCalc();
            var seed = calc.SeedList[0].Name;

            //CalcTest();

            /*
             * string response;
             * int count;
             * do
             * {
             *  Console.WriteLine("How many items?");
             *  response = Console.ReadLine();
             * } while (!int.TryParse(response, out count));
             *
             * Console.WriteLine($"Type {count} characters.");
             * int slots;
             * var charlist = new List<char>();
             * for (int i = 0; i < count; i++)
             * {
             *  Console.WriteLine($"\n{i + 1}:");
             *  var key = Console.ReadKey();
             *  charlist.Add(key.KeyChar);
             *
             * }
             *
             * do
             * {
             *  Console.WriteLine("How many slots?");
             *  response = Console.ReadLine();
             * } while (!int.TryParse(response, out slots));
             */
            var startlist = new List <char>()
            {
                'a'
            };
            var charlist = new Stack <char>(new List <char>()
            {
                'a', 'b', 'c'
            });
            var slots = 4;

            Level = 0;

            var stuff = new List <Dictionary <char, int> >();

            for (int x = 1; x < 6; x++)
            {
                for (int y = 0; y < 6; y++)
                {
                    if (x + y > 5)
                    {
                        break;
                    }
                    for (int z = 0; z < 6; z++)
                    {
                        if (x + y + z > 5)
                        {
                            break;
                        }
                        var dic = new Dictionary <char, int>();
                        dic.Add('a', x);
                        dic.Add('b', y);
                        dic.Add('c', z);
                        stuff.Add(dic);
                    }
                }
            }

            foreach (var blrag in stuff)
            {
                var listy = new List <String>()
                {
                    $"'a':{blrag['a']}",
                    $"'b':{blrag['b']}",
                    $"'c':{blrag['c']}"
                };
                Console.WriteLine(PrintList(listy));
            }


            /*
             * foreach (var per in permutations)
             * {
             *  foreach (var chr in per)
             *      Console.Write($"{chr},");
             *  Console.Write('\n');
             * }
             *
             * /*
             * foreach (var per in permutations)
             * {
             *  var counts = new Dictionary<char, int>();
             *  foreach (var ch in charlist)
             *      counts.Add(ch, per.Count(x => x == ch));
             *  Console.WriteLine($"{{ {counts[charlist[2]]}, {counts[charlist[1]]}, {counts[charlist[0]]} }}");
             * }
             */

            Console.ReadKey();
        }