Silver Challenge

Create another subclass of the Monster type. Call this one Vampire. Override the terrorizeTown() function so that every time an instance of the Vampire type terrorizes a town, it adds a new vampire thrall to an array of vampires on the Vampire type. This array of vampire thralls should be empty by default. Terrorizing a town should also decrement the town’s population by one. Last, exercise this Vampire type in main.swift.

Get Swift Programming: The Big Nerd Ranch Guide now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.