Snake with head
2016-08-23
0 0 0
no vote
Other
Earn points
A snake js implementation of AI, the basic idea: use to feed a snake impersonation, if after eating food (shortest path breadth-first search) snake in a safe state, let the real snakes to eat if not safe, then go with the Snake's tail (longest path breadth-first search), no step needs to be carried out once the above judgment. Note: If you can find the snake path of the head to the tail of a serpent, the snake secure.
The above algorithm may still cause the snake to enter an infinite loop, there is no safe path can eat food, this happens at a time when most food supplies had now didn't find a solution, if interested or have a better solution, please contact me.
javascript
Related Source Codes
WeChat mini program development
0
0
no vote
Image cropping and compression processing on mobil
0
0
no vote
Classic Interview Questions for Digital City Front
0
0
no vote
3D building large screen display
0
0
no vote
six million six hundred and sixty-six thousand six
0
0
no vote
No comment