Skip to content

Instantly share code, notes, and snippets.

@cbarrett
Created December 6, 2015 18:39
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 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