Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tsh-code/615b1d8b98695afc6b60719b0a093a77 to your computer and use it in GitHub Desktop.
Save tsh-code/615b1d8b98695afc6b60719b0a093a77 to your computer and use it in GitHub Desktop.
OO-LandCreatureHellCreature-redundancy.swift
class Creature {
let name: String
init(name: String) {
self.name = name
}
func fight() {
print("πŸ‘Š")
}
}
class LandCreature: Creature {
func walk() {
print("πŸšΆπŸ»β€β™€οΈ")
}
func run() {
print("πŸƒπŸ»")
}
}
class HellCreature: Creature {
func walk() {
print("πŸšΆπŸ»β€β™€οΈ")
}
func run() {
print("πŸƒπŸ»")
}
func burn() {
print("πŸ”₯")
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment