| 43 | # A list of chr() codes is at https://inventwithpython.com/chr |
| 44 | |
| 45 | class Zombie: |
| 46 | def __init__(self, color): |
| 47 | if color not in ('red', 'green', 'blue', 'yellow', 'cyan', 'purple', 'white', 'black'): |
| 48 | raise Exception('color arg must be one of: red green blue yellow cyan purple white black') |
| 49 | self.__class__.color = color |
| 50 | self.direction = random.choice([NORTH, SOUTH, EAST, WEST]) |
| 51 | self._x = None |
| 52 | self._y = None |
| 53 | |
| 54 | def getAction(self): |
| 55 | # Returns one of RIGHT, LEFT, FORWARD, STAY. |
| 56 | return STAY |
| 57 | |
| 58 | |
| 59 | class WanderingZombie(Zombie): |
nothing calls this directly
no outgoing calls
no test coverage detected