Install our extension to search inside any video instantly.

[CS 61A SU26] Ants Problem Getting Started

Added:
1,326 views10likes8:33cs61aOriginal Release: 2026-07-20

To implement fire ants in CS 61A, override the reduce_health method to first call the inherited method to reduce the fire ant's own health, then save the place before reducing health (since the ant may die and be removed), and finally iterate through all bees in that place to deal reflected damage: if the ant is dead, deal amount + damage attribute (default 3); if alive, deal only the amount.