Last active
March 4, 2021 14:21
-
-
Save Edudjr/78190a80ec1711a85e6f98fdfafaa36f to your computer and use it in GitHub Desktop.
hwnn_1
This file contains hidden or 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
protocol Animal { | |
var name: String { get } | |
var age: Int { get } | |
func makeNoise() | |
} | |
struct Dog: Animal { | |
let name: String | |
let age: Int | |
func makeNoise() { | |
print("woof woof!") | |
} | |
} | |
struct Horse: Animal { | |
let name: String | |
let age: Int | |
func makeNoise() { | |
print("neigh!") | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment