Created
March 19, 2020 07:16
-
-
Save xb4dc0d3/8aa141bd25cf541a43a38006346f13e5 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
''' | |
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