Snakes are usually controlled by a bloke sitting crosslegged with a flute rather than using pascal. However, if I'm right in assuming that you mean a virtual snake in the game where a wiggly thing moves around on the (often text-based) screen, and dies if it bumps into itself, then there are various possibilities. e.g.
Moving:
control the head as though it were a pacman or any other similar thing.
maintain a list of "occupied squares"
each time the snake moves, add the new square occupied by the head to one end of the list, and delete the last square of the list (which is the end of the tail).
Depending on graphics you probably only need to draw the tail-square (to blank out where the snake has just been), the head square, and possibly the square behind the head if you have different graphics for the head.
Collisions:
either test the screen to see if the head square is now occupied by snake-tail (this can deal with collisions with walls and other snake, too. Test if head square is empty), or (probably slower, depending on graphics again) check through the snake square list to see if the head coordinates are already present.