Created
January 21, 2019 15:28
-
-
Save tsh-code/615b1d8b98695afc6b60719b0a093a77 to your computer and use it in GitHub Desktop.
OO-LandCreatureHellCreature-redundancy.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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