Skip to content

Instantly share code, notes, and snippets.

@Edudjr
Last active March 4, 2021 14:21
Show Gist options
  • Save Edudjr/78190a80ec1711a85e6f98fdfafaa36f to your computer and use it in GitHub Desktop.
Save Edudjr/78190a80ec1711a85e6f98fdfafaa36f to your computer and use it in GitHub Desktop.
hwnn_1
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