examples/robots.py
def check_game_end(self):
        '''Checks for the game's win/lose conditions and 'alters' the
        game state to reflect the condition found. If the game has not
        been won or lost then it just returns the game state
        unaltered.'''

        if self.player in self.crashes.union(self.robots):
            return self.end_game('You Died!')
        elif not self.robots:
            return self.end_game('You Win!')
        else:
            return self
def check_game_end(self):
        '''Checks for the game's win/lose conditions and 'alters' the
        game state to reflect the condition found. If the game has not
        been won or lost then it just returns the game state
        unaltered.'''

        if self.player in self.crashes.union(self.robots):
            return self.end_game('You Died!')
        elif not self.robots:
            return self.end_game('You Win!')
        else:
            return self
def check_game_end ( self ) : if self . player in self . crashes . union ( self . robots ) : return self . end_game ( 'You Died!' ) elif not self . robots : return self . end_game ( 'You Win!' ) else : return self
Checks for the game's win/lose conditions and 'alters' the
        game state to reflect the condition found. If the game has not
        been won or lost then it just returns the game state
        unaltered.
Checks for the game s win / lose conditions and alters the game state to reflect the condition found . If the game has not been won or lost then it just returns the game state unaltered .