Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Minor bug fix

  • Loading branch information...
commit 93bdc28b86a64bbb0b075bac10773c425d2f9956 1 parent 5db8271
@asweigart authored
Showing with 3 additions and 9 deletions.
  1. +2 −2 threadworms.py
  2. +1 −7 threadworms_nocomments.py
View
4 threadworms.py
@@ -217,7 +217,7 @@ def run(self):
# loop is time that could have been spent executing other thread's
# code.
# Of course, if ALL worms' threads are sleeping, then the computer
- # can knows it can use the CPU to run other programs besides the
+ # can know it can use the CPU to run other programs besides
# our Python Threadworms script.
pygame.time.wait(self.speed)
@@ -274,7 +274,7 @@ def getNewDirection(self):
if newDirection == []:
return None # None is returned when there are no possible ways for the worm to move.
- return random.choice(newDirection) #
+ return random.choice(newDirection)
def main():
global FPSCLOCK, DISPLAYSURF
View
8 threadworms_nocomments.py
@@ -180,7 +180,7 @@ def getNewDirection(self):
if newDirection == []:
return None # None is returned when there are no possible ways for the worm to move.
- return random.choice(newDirection) #
+ return random.choice(newDirection)
def main():
global FPSCLOCK, DISPLAYSURF
@@ -265,12 +265,6 @@ def drawGrid():
def setGridSquares(squares, color=(192, 192, 192)):
- # "squares" is a multiline string that has '.' to express "no change", a
- # ' ' space to set the cell to be empty, and any other character will
- # set the space with the value in "color"
- # Blank lines in squares are ignored for the first and last line, to make
- # typing the string easier.
- #
# squares is set to a value like:
# """
# ......
Please sign in to comment.
Something went wrong with that request. Please try again.