Last active
March 6, 2021 10:56
-
-
Save thatswiftguy/c1774816c912d6bbaaa9382561d00960 to your computer and use it in GitHub Desktop.
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
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