top of page

The Game of Snakes

The contestants are required to implement in Java programming language their own AI agent, from now on referred to as bot. Each bot controls a snake to be the last standing snake or score the highest number of points by eating apples in 3 minutes. The rules are described as follows:

R1: A bot controls only the direction (going either north, south, east, or west) to be taken by its own snake.
R2: Snakes always move simultaneously and forward. They also increase one position (i.e. pixel) after taking an apple (Figure 4).
R3: A snake loses in any of these conditions: if it leaves the board (Figure 3); if it hits its own body (white snake in Figure 1); if it hits the other snake's body (Figure 5); if it takes more than one second to make a decision (i.e. which direction to take).
R4: If snakes collide head to head (Figure 2), the longest snake wins the game.
R5: Apples appear randomly at an unoccupied position of the board, and there is only one apple available at any time.

R6: An apple will disappear if it is not eaten by either snake in 10 seconds and reappear somewhere else on the map.

R7: At the end of the tournament, players are ranked according to the number of victories; then the number of draws; then the result of their matches. Lastly, they are considered as having the same position.

​

The game engine also saves game state information to a .json file every frame, so you may utilize it for Machine Learning to improve your agent.

 

Figure 1

Figure 2

Figure 3

Figure 4

Figure 5

Project Specifications

The contestants will be required to implement their own AI agent (snake) in Java programming language. The objective of each agent would be to remain the last snake alive on the map or score the biggest amount of points by eating apples in 3 minutes.

 

testing_uml.png

Implementation Guidelines

The contestants will be required to implement their own AI agent (snake) in Java programming language. The objective of each agent would be to remain the last snake alive on the map or score the biggest amount of points by eating apples in 3 minutes.

 

compass-rose-303605_1280.png
bottom of page