alexdantas / nSnake

The classic snake game with textual interface
http://nsnake.alexdantas.net
GNU General Public License v3.0
199 stars 57 forks source link

nSnake hangs when eating the last fruit #23

Open Edahro opened 6 years ago

Edahro commented 6 years ago

I just wanted to see what happens, when the whole field is full of snake. So I cranked up the number fruits to 99, set starting speed to 2, switched on teleport and chose maze size small with no random walls. Then I started arcade mode and ate up all fruits, until the snake took up nearly the whole field. But when trying to eat the last fruit, the game just froze and started using up one CPU core (100%).

End position:

''''''''''''''''''''''''''''''''''''''''
'oooooooooooooooooooooooooooooooooooooo'
'ooooooooooooooooooooooooooooo@$ooooooo'
'oooooooooooooooooooooooooooooooooooooo'
'oooooooooooooooooooooooooooooooooooooo'
'oooooooooooooooooooooooooooooooooooooo'
'oooooooooooooooooooooooooooooooooooooo'
'oooooooooooooooooooooooooooooooooooooo'
'oooooooooooooooooooooooooooooooooooooo'
''''''''''''''''''''''''''''''''''''''''

(Score: 2604)

ViLXDRYAD commented 6 years ago

happened to me too, i actually think is an unhandled game logic situation where the fruit must be teleported somewhere before advancing but either the fruit can't be teleported above the snake, or it teleports somewhere on the snake body making the snake "eat" it once more without being able to place it anywhere nor keeping with the game loop (sometimes i receive a lot of points when eating one fruit doing exactly as the OP)

fedorovenskiy commented 5 years ago

I have the same issue image