/ZooTask

🦓Animal replacing task built with Typescript

Primary LanguageTypeScript

Zoo Animal Replacing🦘

Overview:

  • The zoo consists of enclosures/aviaries based on different biomes.
  • In addition to the biome, the enclosure/aviary is described by the area (in square meters) and the presence of a reservoir.

Settlement rules:

An animal can only be settled in an enclosure/aviary that matches:

  • If its biome fit.
  • If the presence of a reservoir are equals.
  • If there is enough space for this animal.
  • Predators can only live with members of the same species.
  • Herbivores can live with any herbivore.

Challenge:

  • Create all the needed interfaces (for animals and for aviaries), think about base interfaces and so on
  • create a function that will take an enclosure/aviary and an animal as parameters. this function should determine if the selected animal can be settled into the selected enclosure. If it is possible, the animal must be added to some array within the aviary object. if it's not possible, this function must send some message to the console.