Javascript Loop Array Elements Python Snake Logo