Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR SWIFT

swift switch

for i in 1 ... 100 {
    switch (i % 3, i % 5) {
    case (0, 0):
        print("FizzBuzz")
    case (0, _):
        print("Fizz")
    case (_, 0):
        print("Buzz")
    default:
        print(i)
    }
}
Source by www.hackingwithswift.com #
 
PREVIOUS NEXT
Tagged: #swift #switch
ADD COMMENT
Topic
Name
9+8 =