![]() The Manhattan distance from the snake's head to the fruit in each of the four directions.This was accomplished through a neural network with two hidden layers, each with 10 nodes. I decided that the snake agent should make a decision for which direction it should turn (up, down, left, right), for every frame of the game. Once the game was created, I needed to develop a method for the snake to make intelligent decisions. ![]() The game can be played here by running the playSnakeGame.py module once Python and pygame are installed. This was accomplished through Python and the library pygame. The goal of this project was to create an autonomous snake agent that is quite good at the game, and it was successful insofar as it is usually much better than myself! How was this goal accomplished?įirst, I needed to code a version of the snake game myself so that it would be easier to develop intelligent agents for it. The head of the snake crashed into its own body.The player loses when one of two conditions occurs: ![]() Every time the snake eats a fruit, it grows in its size. The score increases whenever the snake eats a fruit, which appear on the screen one at a time in a random position. Snake is a popular computer game in which players control a snake within a grid on the screen and try to maximize their score. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |