Simplify snake game sample code