Changeset 187:954cc2774637
Legend:
- Unmodified
- Added
- Removed
-
main.py
r186 r187 љ 101 101 if self.snake_dead_check() == False:љ 102 102 returnљ љ 103 if self.snake_move_check() == False:љ љ 104 returnљ 103 105 self.step_id = self.step_id+1љ 104 106 self.engine.step()љ ? ? љ 109 111 """Do the next game step"""љ 110 112 if self.snake_dead_check() == False:љ љ 113 returnљ љ 114 if self.snake_move_check() == False:љ 111 115 returnљ 112 116 if self.step_id == 0:љ ? ? љ 160 164 """Get possible movements of the snakes.љ 161 165 If all anakes cant move - return False."""љ 162 љ passљ љ 166 total_moves = 0љ љ 167 for snake in self.engine.snakes:љ љ 168 if snake != None:љ љ 169 legal_moves = self.engine.legal_moves(snake)љ љ 170 for move in legal_moves:љ љ 171 total_moves = total_moves+1љ љ 172 if total_moves == 0:љ љ 173 self.end()љ љ 174 return Falseљ љ 175 љ 163 176 љ 164 177 def restart(self, survived):љ
Note: See TracChangeset
for help on using the changeset viewer.