based on: Coding Challenge #115: Snake Game Redux