🎧 New: AI-Generated Podcasts Turn your study notes into engaging audio conversations. Learn more

Building a Zombie Factory in Programming
6 Questions
0 Views

Building a Zombie Factory in Programming

Created by
@ThrivingLiberty

Podcast Beta

Play an AI-generated podcast conversation about this lesson

Questions and Answers

What is the purpose of the Zombie Factory in Lesson 1?

  • To simulate zombie battles
  • To create a database of zombie traits
  • To create an army of humans
  • To create an army of zombies (correct)
  • What determines the zombie's appearance in the Zombie Factory?

  • Zombie Age
  • Zombie DNA (correct)
  • Zombie ID
  • Zombie Name
  • How many digits in the Zombie DNA map to the zombie's head type?

  • 1
  • 4
  • 2 (correct)
  • 8
  • What is the maximum number of head types possible with the current Zombie DNA system?

    <p>100</p> Signup and view all the answers

    How is the head type determined from the Zombie DNA?

    <p>By adding 1 to the result of the first 2 digits modulo 7</p> Signup and view all the answers

    What is the head type of the zombie with the DNA 8356281049284737?

    <p>7th head type</p> 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.

    Quiz Team

    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.

    Use Quizgecko on...
    Browser
    Browser