Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR SWIFT

generate random bool swift

let flippedHeads = Bool.random()
if flippedHeads {
    print("Heads, you win!")
} else {
    print("Maybe another try?")
}
Source by developer.apple.com #
 
PREVIOUS NEXT
Tagged: #generate #random #bool #swift
ADD COMMENT
Topic
Name
9+7 =