Solution of Proj3.Ants vs SomeBees of CS61A (2021-Fall)
Intro
I have finished the first two projects - Hog and Cats. The first two projects are relatively simple and uncomplicated. But today, the difficulty of the third project has indeed increased (you can see how complicated this is by looking at the rules of the game). It feels like Plants vs. Zombies
So I’m going to write a blog to sort out the ideas when writing code. 🤗
Phase 1: Basic gameplay
Problem 1 (1 pt)
Part A: Currently, there is no cost for placing any type of
Ant
, and so there is no challenge to the game. The base classAnt
has afood_cost
of zero. Override this class attribute forHarvesterAnt
andThrowerAnt
according to the “Food Cost” column in the table below.