Skip to content

shantanutyagi67/SnakeAI

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

39 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

SnakeAI

Steps:

  1. enter game board size
  2. enter difficulty
  3. board appears
  4. hit space to start the game
  5. while playing the game, if you wish to reset the game, press enter and to start playing again, hit spacebar again
  6. while playing the game, if you wish to pause the game, press P key to pause the game but the game timer will not stop, hit P again.
  7. you can pass through the walls
  8. score and time is displayed on the top and the game mode at the bottom
  9. if you die, the board reets and you need to hit spacebar again to restart the game. steps for AI:
  10. same as above but keyboard wont work.

for developers

for shortest path DFS AI Algo: (only for small board size) when snake length is 1, it disobeys direction rules so have to fix that or can initialize snake with length 2 this path is not necessarily the least distance valid path between the head and food but the shortest path DFS could find. crash report: AI would crash if it reached a new food before digesting the old food. the length of snake would not increace in sinngleplayer mode. that has been taken care of by instant digestion.

next release

shortest path BFS AI Algo: it will find the actual shortest distance valid path

Thankyou

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published