Skip to content

Instantly share code, notes, and snippets.

@joooyzee
Created July 19, 2021 03:51
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save joooyzee/ba0d21dc7090ebefab6a0d4e45d5effe to your computer and use it in GitHub Desktop.
Save joooyzee/ba0d21dc7090ebefab6a0d4e45d5effe to your computer and use it in GitHub Desktop.
# given a list of tiles, return only those that are empty/free
def get_empty_tiles(self, tiles):
empty_tiles = []
for tile in tiles:
if not self.game_state.is_occupied(tile):
# add empty tiles to list
empty_tiles.append(tile)
return empty_tiles
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment