Skip to content

Instantly share code, notes, and snippets.

@xb4dc0d3
Created March 19, 2020 07:16
Show Gist options
  • Save xb4dc0d3/8aa141bd25cf541a43a38006346f13e5 to your computer and use it in GitHub Desktop.
Save xb4dc0d3/8aa141bd25cf541a43a38006346f13e5 to your computer and use it in GitHub Desktop.
'''
Classic Mine Sweeper Game
'''
# Bad
def getThem():
lists = []
for i in theList:
if i[0] = 4:
lists.add(i)
return lists
# Good
def getFlaggedCells():
flagged_cells = []
for cell in gameBoard:
if cell.isFlagged:
flagged_cells.add(cell)
return flagged_celss
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment