Matrix Based Python Code For Snake