Fixed The apple bug, where the apple could appear at the tail. origiin in the print function