VERSION 1.4 CHANGE: test Q9: ['suites'][1][0][0] """ ### Testing double damage back = ants.ThrowerAnt() thrower_damage = back.damage front = ants.FireAnt() fire_damage = front.damage side_back = ants.ThrowerAnt() side_front = ants.ThrowerAnt() armor, side_armor = 20, 10 bee, side_bee = ants.Bee(armor), ants.Bee(side_armor) colony.places['tunnel_0_0'].add_insect(back) colony.places['tunnel_0_2'].add_insect(queen) colony.places['tunnel_0_4'].add_insect(bee) colony.places['tunnel_1_1'].add_insect(side_back) colony.places['tunnel_1_3'].add_insect(side_front) colony.places['tunnel_1_4'].add_insect(side_bee) # Simulate a battle in Tunnel 0 (contains Queen) back.action(colony) armor -= thrower_damage # No doubling until queen's action $ bee.armor # if failed, damage doubled too early queen.action(colony) armor -= thrower_damage # Queen should always deal normal damage $ bee.armor # if failed, Queen damage incorrect bee.action(colony) # Bee moves forward colony.places['tunnel_0_3'].add_insect(front) # Fire ant added back.action(colony) armor -= 2 * thrower_damage # Damage doubled in back $ bee.armor # if failed, back damage incorrect queen.action(colony) armor -= thrower_damage # Queen should always deal normal damage $ bee.armor # If failed, Queen damage incorrect (2) back.action(colony) armor -= 2 * thrower_damage # Thrower damage still doubled $ bee.armor # Back damage incorrect bee.action(colony) armor -= 2 * fire_damage # Fire damage doubled $ bee.armor # if failed, Fire damage incorrect # Simulate a battle in Tunnel 1 (no Queen) $ side_bee.armor # if failed, side bee took damage when it shouldn't have side_back.action(colony) side_armor -= thrower_damage # Ant in another tunnel: normal damage $ side_bee.armor # If failed, side back damage is incorrect side_front.action(colony) side_armor -= thrower_damage # Ant in another tunnel: normal damage $ side_bee.armor # If failed, side front damage is incorrect """ VERSION 1.3 GRADER VERSION 1.2 GRADER VERSION 1.1 CHANGE: test Q9: ['suites'][3][0] [""" ### Testing bodyguard doubling bee = ants.Bee(3) guard = ants.BodyguardAnt() guard.damage, doubled = 5, 10 colony.places['tunnel_0_1'].add_insect(queen) colony.places['tunnel_0_1'].add_insect(guard) colony.places['tunnel_0_2'].add_insect(bee) queen.action(colony) $ guard.damage # Bodyguard should be buffed queen.action(colony) $ bee.armor # QueenAnt should not have been buffed $ guard.damage # Bodyguard should not be buffed twice $ len(colony.queen.bees) <= 0 # Game should not have ended bee.action(colony) $ len(colony.queen.bees) > 0 # Game should have ended """, ['doubled', '1', 'doubled', 'True', 'True'], 'unlocked']