Podcast
Questions and Answers
What is the purpose of the Zombie Factory in Lesson 1?
What is the purpose of the Zombie Factory in Lesson 1?
What determines the zombie's appearance in the Zombie Factory?
What determines the zombie's appearance in the Zombie Factory?
How many digits in the Zombie DNA map to the zombie's head type?
How many digits in the Zombie DNA map to the zombie's head type?
What is the maximum number of head types possible with the current Zombie DNA system?
What is the maximum number of head types possible with the current Zombie DNA system?
Signup and view all the answers
How is the head type determined from the Zombie DNA?
How is the head type determined from the Zombie DNA?
Signup and view all the answers
What is the head type of the zombie with the DNA 8356281049284737?
What is the head type of the zombie with the DNA 8356281049284737?
Signup and view all the answers
Study Notes
Zombie Factory Overview
- The Zombie Factory is a project that builds an army of zombies, maintaining a database of all created zombies.
- The factory has a function for creating new zombies.
Zombie Characteristics
- Each zombie has a random and unique appearance.
- A zombie's appearance is based on its "Zombie DNA", a 16-digit integer.
Zombie DNA Structure
- The first 2 digits of the Zombie DNA map to the zombie's head type.
- The second 2 digits map to the zombie's eyes.
- Different parts of the Zombie DNA number correspond to different traits.
Head Type Mapping
- The zombie's head type is determined by the first 2 digits of the Zombie DNA using the formula: (2-digit value) % 7 + 1.
- The result of the formula corresponds to one of the 7 possible head types.
- In the example, the first 2 digits "83" map to the 7th head type (the Santa hat).
Studying That Suits You
Use AI to generate personalized quizzes and flashcards to suit your learning preferences.
Description
Create a database of zombies with unique appearances. Learn to add functionality to create new zombies and set the stage for future attacks. Understand how Zombie DNA works in this programming lesson.