Esempio n. 1
0
        private static void RunSingleStrategyMentod()
        {
            var checker  = GenerateChecker.GenerateInitialChecker();
            var position = RunTheGame.FindStartCheck();

            Console.WriteLine("Generate:Order(1~200):");
            var input = Console.ReadLine();

            if (!string.IsNullOrEmpty(input))
            {
                var inputArr = input.Split(new char[] { ',' }, StringSplitOptions.RemoveEmptyEntries);

                foreach (var generation in inputArr)
                {
                    var pacmanArr = generation.Split(new char[] { ':' }, StringSplitOptions.RemoveEmptyEntries);
                    if (pacmanArr.Length != 2)
                    {
                        continue;
                    }

                    var generate     = pacmanArr[0];
                    var pacmanOrder  = pacmanArr[1];
                    var runAStrategy = new RunAStrategy(new RunTheGame(new RandomProvider()), new SqLiteConnection());
                    Console.WriteLine(runAStrategy.RunAStartegyToGetPoint(Convert.ToInt32(generate), Convert.ToInt32(pacmanOrder), position, checker));
                }
            }
            Console.ReadLine();
        }
Esempio n. 2
0
        public List <CheckerObject> GetInitialCherkers()
        {
            var checkerMaker = new GenerateChecker();
            var checker      = checkerMaker.GenerateInitialChecker();

            InitialChecker = checker.Checks.Keys.Select(checksKey => new CheckerObject
            {
                position  = checksKey.Position.JoinStrings(string.Empty),
                situation = checker.Checks[checksKey].JoinStrings(string.Empty)
            }).ToList();
            return(InitialChecker);
        }
Esempio n. 3
0
        private static void OutputRandomBeanChecker()
        {
            var list = SprinkleBeans.GetRandomSprinkleBeansPosition();
            var i    = 0;

            foreach (var l in list.OrderBy(x => x[0]).ThenBy(x => x[1]).ToArray())
            {
                Console.WriteLine($"{i}   {l[0]}:{l[1]}");
                i++;
            }
            var checker = GenerateChecker.GenerateInitialChecker();

            foreach (var key in checker.Checks.Keys)
            {
                Console.WriteLine($"{key.Position[0]}:{key.Position[1]}--[{checker.Checks[key][0]}][{checker.Checks[key][1]}][{checker.Checks[key][2]}][{checker.Checks[key][3]}][{checker.Checks[key][4]}]");
            }
        }