snake game algorithm in python