Ejemplo n.º 1
0
        private void ManualTimer_Tick(object sender, EventArgs e)
        {
            gameList[0].GetBestSnake().TurnSnake(Keyboard.IsKeyDown(Key.Left), Keyboard.IsKeyDown(Key.Right));

            var values = Sensors.FindAppleDirectionaly(gameList[0].Apples, gameList[0].GetBestSnake());

            Debug.WriteLine(values[0] + " " + values[1] + " " + values[2] + " " + values[3]);
            DrawGame(gameList[0]);
        }
Ejemplo n.º 2
0
        public void UseBrainToTurn(List <Apple> apples, object locker)
        {
            List <double> inputs = Sensors.FindAppleDirectionaly(apples, this);

            inputs.AddRange(Sensors.FindSnakeOrientation(this));
            if (Settings.Default.Walls)
            {
                inputs.AddRange(Sensors.FindWallDirectionaly(this));
            }
            var moves = DecodeTurn(Brain.DoNeuralStuff(inputs));

            TurnSnake(moves[0], moves[1]);
        }