Skip to content

Instantly share code, notes, and snippets.

@cbarrett
Created December 6, 2015 18:39
Show Gist options
  • Save cbarrett/23b24a9fe76efdf006df to your computer and use it in GitHub Desktop.
Save cbarrett/23b24a9fe76efdf006df to your computer and use it in GitHub Desktop.
extension Planet {
var number: Int {
var num = 0
switch self {
case .Neptune:
num += 1; fallthrough
case .Uranus:
num +=1; fallthrough
case .Saturn:
// Etc...
}
return num
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment