Skip to content

Instantly share code, notes, and snippets.

@thatswiftguy
Last active March 6, 2021 10:56
Show Gist options
  • Save thatswiftguy/c1774816c912d6bbaaa9382561d00960 to your computer and use it in GitHub Desktop.
Save thatswiftguy/c1774816c912d6bbaaa9382561d00960 to your computer and use it in GitHub Desktop.
import UIKit
enum Dice {
case one
case two
case three
case four
case five
case six
}
// Above enum could be like the below
// enum Dice {
// case one , two , three , four , five , six
// }
func checkLuck(dice : Dice) {
switch dice {
case .one:
print("That very less")
case .five:
print("Great Luck")
case .six:
print("WOOOOW")
default:
print("Try it again")
}
}
checkLuck(dice: .four)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment