Reversing Snake

I would have been working on this a while if not for some of the hints, thanks!