Java Rule Engine Python Code For Snake Game