Writing a demo for a snake game

I wrote a snake game in Java. What I also want to do is create a demo for this (so the snake will play by itself). I wrote a simple demo, but the snake is dying quickly. So, are there any algorithms or something for this problem? I find this a bit like a chess game problem? I want the snake to be alive as long as possible . Thank.

+5
source share
3 answers

, , , , , , AI:

- " , ". , , , , , . , slinky, , , .

, AI: D

+2

, , - , , . " " , . , , , , , ​​ . , , , ( ) . , , - , , , - , , -.

+1
source

All Articles