Pregunta de entrevista de Humana

How to design a snake game

Respuesta de la entrevista

Anónimo

5 mar 2021

A snake game is really just a list of squares moving, the easiest way is to use HTML canvas and store each segment in a list of Tuples, then cycle through that list and move it to the correct location depending on where the user is moving. Only the head actually moves, while the rest of the segments just move to the last position of the segment before it.