Return 0 // check whether you hit yourself or hit a wall Gotoxy (hout, X2, Y2) // eliminate '*' left by Snake Movement
If (I = length - 1) // print snake headĬout = 0 I -) // except for the snakehead, all nodes are equal to the coordinates of the previous node Void Snake:: display() // print snake body Void gotoxy (handle hout, int x, int y) // function of output position
HANDLE hOut = GetStdHandle(STD_ OUTPUT_ Handle) // get handle