Problem 6 (200pts): Wall Ant
We are going to add some protection to our glorious home base by implementing the WallAnt
, which is an ant that does nothing each turn.
A WallAnt
is useful because it has a large health
value.
Class | Food Cost | Health | |
---|---|---|---|
![]() | WallAnt | 4 | 4 |
Unlike with previous ants, we have not provided you with a class header.
Implement the WallAnt
class from scratch.
Give it a class attribute name
with the value 'Wall'
(so that the graphics work) and a class attribute implemented
with the value True
(so that you can use it in a game).
Hint 1: To start, take a look at how the previous problems' ants were implemented!
Hint 2: Make sure you implement the
__init__
method too so theWallAnt
starts off with the appropriate amount ofhealth
!
Before writing any code, unlock the tests to verify your understanding of the question:
$ python ok -q 06 -u
Once you are done unlocking, begin implementing your solution. You can check your correctness with:
$ python ok -q 06