SlideShare uma empresa Scribd logo
1 de 1
Baixar para ler offline
For reference about ThrowerAnt class, look here:
https://github.com/yngz/cs61a/blob/master/projects/ants/ants.py Implement a final thrower ant
that does zero damage, but instead applies a temporary effect on the method of a Bee instance
that it calls on. We will be implementing this new ant, , which inherits from ThrowerAnt. throws
sticky syrup at a bee, slowing it for 5 turns. When a bee is slowed, it takes the regular Bee action
when is even, and takes no action (does not move or sting) otherwise. If a bee is hit by syrup
while it is already slowed, it is slowed for 5 turns starting from the most recent time it is hit by
syrup. That is, if a bee is hit by syrup, takes 2 turns, and is hit by syrup again, it will be slowed
for 5 turns after the second time it is hit by syrup. In order to complete the implementations of
this , you will need to set its class attributes appropriately and implement the method in
Important Restriction: You may not modify any code outside the class for this problem. That
means you may not modify the method directly. Our tests will check for this. Hint. Assign
target.action to a new function that sometimes calls Bee. action. You can create and use an
instance attribute to track how many more turns the bee will be slowed, and once the effect is
over, Bee.action should be called every turn.

Mais conteúdo relacionado

Mais de alokindustries1

SECCI�N A Lea el estudio de caso a continuaci�n y responda TODAS l.pdf
SECCI�N A Lea el estudio de caso a continuaci�n y responda TODAS l.pdfSECCI�N A Lea el estudio de caso a continuaci�n y responda TODAS l.pdf
SECCI�N A Lea el estudio de caso a continuaci�n y responda TODAS l.pdf
alokindustries1
 
Se sabe que ciertos macroinvertebrados (peque�os organismos acu�tico.pdf
Se sabe que ciertos macroinvertebrados (peque�os organismos acu�tico.pdfSe sabe que ciertos macroinvertebrados (peque�os organismos acu�tico.pdf
Se sabe que ciertos macroinvertebrados (peque�os organismos acu�tico.pdf
alokindustries1
 
Scenario of the Project Plan In the role of IT Head of Loyalist col.pdf
Scenario of the Project Plan In the role of IT Head of Loyalist col.pdfScenario of the Project Plan In the role of IT Head of Loyalist col.pdf
Scenario of the Project Plan In the role of IT Head of Loyalist col.pdf
alokindustries1
 
ScenarioXYZ Corp. is a parent corporation with 2 handbag stores l.pdf
ScenarioXYZ Corp. is a parent corporation with 2 handbag stores l.pdfScenarioXYZ Corp. is a parent corporation with 2 handbag stores l.pdf
ScenarioXYZ Corp. is a parent corporation with 2 handbag stores l.pdf
alokindustries1
 

Mais de alokindustries1 (20)

Select all that are true about plasmid DNA.a.The DNA in plasmids.pdf
Select all that are true about plasmid DNA.a.The DNA in plasmids.pdfSelect all that are true about plasmid DNA.a.The DNA in plasmids.pdf
Select all that are true about plasmid DNA.a.The DNA in plasmids.pdf
 
Select a current event (local or international) that is relevant to .pdf
Select a current event (local or international) that is relevant to .pdfSelect a current event (local or international) that is relevant to .pdf
Select a current event (local or international) that is relevant to .pdf
 
Seleccione SOLO UNO de los siguientes Objetivos de Desarrollo Sosten.pdf
Seleccione SOLO UNO de los siguientes Objetivos de Desarrollo Sosten.pdfSeleccione SOLO UNO de los siguientes Objetivos de Desarrollo Sosten.pdf
Seleccione SOLO UNO de los siguientes Objetivos de Desarrollo Sosten.pdf
 
Seleccione todas las cualidades que pertenecen a los sistemas parlam.pdf
Seleccione todas las cualidades que pertenecen a los sistemas parlam.pdfSeleccione todas las cualidades que pertenecen a los sistemas parlam.pdf
Seleccione todas las cualidades que pertenecen a los sistemas parlam.pdf
 
Seleccione la declaraci�n FALSA de las siguientes A. Trabajar con o.pdf
Seleccione la declaraci�n FALSA de las siguientes A. Trabajar con o.pdfSeleccione la declaraci�n FALSA de las siguientes A. Trabajar con o.pdf
Seleccione la declaraci�n FALSA de las siguientes A. Trabajar con o.pdf
 
Seismic waves travel faster when the rock is less stiff.A) TrueB.pdf
Seismic waves travel faster when the rock is less stiff.A) TrueB.pdfSeismic waves travel faster when the rock is less stiff.A) TrueB.pdf
Seismic waves travel faster when the rock is less stiff.A) TrueB.pdf
 
Seg�n TCPS 2, �qu� es la investigaci�n de riesgo m�nimo (seleccione .pdf
Seg�n TCPS 2, �qu� es la investigaci�n de riesgo m�nimo (seleccione .pdfSeg�n TCPS 2, �qu� es la investigaci�n de riesgo m�nimo (seleccione .pdf
Seg�n TCPS 2, �qu� es la investigaci�n de riesgo m�nimo (seleccione .pdf
 
Seg�n Juan Linz (1990), �c�mo los sistemas presidenciales crean disc.pdf
Seg�n Juan Linz (1990), �c�mo los sistemas presidenciales crean disc.pdfSeg�n Juan Linz (1990), �c�mo los sistemas presidenciales crean disc.pdf
Seg�n Juan Linz (1990), �c�mo los sistemas presidenciales crean disc.pdf
 
Seg�n Holton en la fuente 1, �cu�les fueron los motivos de los padre.pdf
Seg�n Holton en la fuente 1, �cu�les fueron los motivos de los padre.pdfSeg�n Holton en la fuente 1, �cu�les fueron los motivos de los padre.pdf
Seg�n Holton en la fuente 1, �cu�les fueron los motivos de los padre.pdf
 
Seg�n el texto, �qu� es un factor Persona a la que se le da autori.pdf
Seg�n el texto, �qu� es un factor  Persona a la que se le da autori.pdfSeg�n el texto, �qu� es un factor  Persona a la que se le da autori.pdf
Seg�n el texto, �qu� es un factor Persona a la que se le da autori.pdf
 
Security X has an actual rate of return of 11.8 and a beta of 0.72..pdf
Security X has an actual rate of return of 11.8 and a beta of 0.72..pdfSecurity X has an actual rate of return of 11.8 and a beta of 0.72..pdf
Security X has an actual rate of return of 11.8 and a beta of 0.72..pdf
 
Seg�n el C�digo y las Normas, �cu�l de las siguientes afirmaciones c.pdf
Seg�n el C�digo y las Normas, �cu�l de las siguientes afirmaciones c.pdfSeg�n el C�digo y las Normas, �cu�l de las siguientes afirmaciones c.pdf
Seg�n el C�digo y las Normas, �cu�l de las siguientes afirmaciones c.pdf
 
SECCI�N A Lea el estudio de caso a continuaci�n y responda TODAS l.pdf
SECCI�N A Lea el estudio de caso a continuaci�n y responda TODAS l.pdfSECCI�N A Lea el estudio de caso a continuaci�n y responda TODAS l.pdf
SECCI�N A Lea el estudio de caso a continuaci�n y responda TODAS l.pdf
 
Sec5.1 Ebony James 032323 922 AM () The area of the shaded reglon .pdf
Sec5.1 Ebony James 032323 922 AM () The area of the shaded reglon .pdfSec5.1 Ebony James 032323 922 AM () The area of the shaded reglon .pdf
Sec5.1 Ebony James 032323 922 AM () The area of the shaded reglon .pdf
 
Se sabe que ciertos macroinvertebrados (peque�os organismos acu�tico.pdf
Se sabe que ciertos macroinvertebrados (peque�os organismos acu�tico.pdfSe sabe que ciertos macroinvertebrados (peque�os organismos acu�tico.pdf
Se sabe que ciertos macroinvertebrados (peque�os organismos acu�tico.pdf
 
Sarah sets her alarm for 630 AM to make sure she gets to class on t.pdf
Sarah sets her alarm for 630 AM to make sure she gets to class on t.pdfSarah sets her alarm for 630 AM to make sure she gets to class on t.pdf
Sarah sets her alarm for 630 AM to make sure she gets to class on t.pdf
 
Se descubri� que existen tres alelos diferentes en el locus R. El al.pdf
Se descubri� que existen tres alelos diferentes en el locus R. El al.pdfSe descubri� que existen tres alelos diferentes en el locus R. El al.pdf
Se descubri� que existen tres alelos diferentes en el locus R. El al.pdf
 
Scientists discover more than ten thousand new species of living org.pdf
Scientists discover more than ten thousand new species of living org.pdfScientists discover more than ten thousand new species of living org.pdf
Scientists discover more than ten thousand new species of living org.pdf
 
Scenario of the Project Plan In the role of IT Head of Loyalist col.pdf
Scenario of the Project Plan In the role of IT Head of Loyalist col.pdfScenario of the Project Plan In the role of IT Head of Loyalist col.pdf
Scenario of the Project Plan In the role of IT Head of Loyalist col.pdf
 
ScenarioXYZ Corp. is a parent corporation with 2 handbag stores l.pdf
ScenarioXYZ Corp. is a parent corporation with 2 handbag stores l.pdfScenarioXYZ Corp. is a parent corporation with 2 handbag stores l.pdf
ScenarioXYZ Corp. is a parent corporation with 2 handbag stores l.pdf
 

Último

1029 - Danh muc Sach Giao Khoa 10 . pdf
1029 -  Danh muc Sach Giao Khoa 10 . pdf1029 -  Danh muc Sach Giao Khoa 10 . pdf
1029 - Danh muc Sach Giao Khoa 10 . pdf
QucHHunhnh
 
An Overview of Mutual Funds Bcom Project.pdf
An Overview of Mutual Funds Bcom Project.pdfAn Overview of Mutual Funds Bcom Project.pdf
An Overview of Mutual Funds Bcom Project.pdf
SanaAli374401
 

Último (20)

Basic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptxBasic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptx
 
Web & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdfWeb & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdf
 
Unit-IV; Professional Sales Representative (PSR).pptx
Unit-IV; Professional Sales Representative (PSR).pptxUnit-IV; Professional Sales Representative (PSR).pptx
Unit-IV; Professional Sales Representative (PSR).pptx
 
psychiatric nursing HISTORY COLLECTION .docx
psychiatric  nursing HISTORY  COLLECTION  .docxpsychiatric  nursing HISTORY  COLLECTION  .docx
psychiatric nursing HISTORY COLLECTION .docx
 
Sports & Fitness Value Added Course FY..
Sports & Fitness Value Added Course FY..Sports & Fitness Value Added Course FY..
Sports & Fitness Value Added Course FY..
 
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptxINDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
 
Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104
 
SECOND SEMESTER TOPIC COVERAGE SY 2023-2024 Trends, Networks, and Critical Th...
SECOND SEMESTER TOPIC COVERAGE SY 2023-2024 Trends, Networks, and Critical Th...SECOND SEMESTER TOPIC COVERAGE SY 2023-2024 Trends, Networks, and Critical Th...
SECOND SEMESTER TOPIC COVERAGE SY 2023-2024 Trends, Networks, and Critical Th...
 
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
 
Accessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactAccessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impact
 
Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17
 
Mattingly "AI & Prompt Design: Structured Data, Assistants, & RAG"
Mattingly "AI & Prompt Design: Structured Data, Assistants, & RAG"Mattingly "AI & Prompt Design: Structured Data, Assistants, & RAG"
Mattingly "AI & Prompt Design: Structured Data, Assistants, & RAG"
 
How to Give a Domain for a Field in Odoo 17
How to Give a Domain for a Field in Odoo 17How to Give a Domain for a Field in Odoo 17
How to Give a Domain for a Field in Odoo 17
 
1029 - Danh muc Sach Giao Khoa 10 . pdf
1029 -  Danh muc Sach Giao Khoa 10 . pdf1029 -  Danh muc Sach Giao Khoa 10 . pdf
1029 - Danh muc Sach Giao Khoa 10 . pdf
 
PROCESS RECORDING FORMAT.docx
PROCESS      RECORDING        FORMAT.docxPROCESS      RECORDING        FORMAT.docx
PROCESS RECORDING FORMAT.docx
 
Class 11th Physics NEET formula sheet pdf
Class 11th Physics NEET formula sheet pdfClass 11th Physics NEET formula sheet pdf
Class 11th Physics NEET formula sheet pdf
 
Código Creativo y Arte de Software | Unidad 1
Código Creativo y Arte de Software | Unidad 1Código Creativo y Arte de Software | Unidad 1
Código Creativo y Arte de Software | Unidad 1
 
fourth grading exam for kindergarten in writing
fourth grading exam for kindergarten in writingfourth grading exam for kindergarten in writing
fourth grading exam for kindergarten in writing
 
Mattingly "AI & Prompt Design: The Basics of Prompt Design"
Mattingly "AI & Prompt Design: The Basics of Prompt Design"Mattingly "AI & Prompt Design: The Basics of Prompt Design"
Mattingly "AI & Prompt Design: The Basics of Prompt Design"
 
An Overview of Mutual Funds Bcom Project.pdf
An Overview of Mutual Funds Bcom Project.pdfAn Overview of Mutual Funds Bcom Project.pdf
An Overview of Mutual Funds Bcom Project.pdf
 

For reference about ThrowerAnt class, look herehttpsgithub.com.pdf

  • 1. For reference about ThrowerAnt class, look here: https://github.com/yngz/cs61a/blob/master/projects/ants/ants.py Implement a final thrower ant that does zero damage, but instead applies a temporary effect on the method of a Bee instance that it calls on. We will be implementing this new ant, , which inherits from ThrowerAnt. throws sticky syrup at a bee, slowing it for 5 turns. When a bee is slowed, it takes the regular Bee action when is even, and takes no action (does not move or sting) otherwise. If a bee is hit by syrup while it is already slowed, it is slowed for 5 turns starting from the most recent time it is hit by syrup. That is, if a bee is hit by syrup, takes 2 turns, and is hit by syrup again, it will be slowed for 5 turns after the second time it is hit by syrup. In order to complete the implementations of this , you will need to set its class attributes appropriately and implement the method in Important Restriction: You may not modify any code outside the class for this problem. That means you may not modify the method directly. Our tests will check for this. Hint. Assign target.action to a new function that sometimes calls Bee. action. You can create and use an instance attribute to track how many more turns the bee will be slowed, and once the effect is over, Bee.action should be called every turn.