Mai Yamane |
Monday, May 8, 2017
Friday, May 5, 2017
Thursday, May 4, 2017
Swift: Random Message Example
Command:
$ cat /Users/username/Desktop/macOS\ Swift\ Test/macOS\ Swift\ Test/main.swift
Result:
import Foundation
import Darwin
let goodmorning: Array<String> = ["おはよう!","おはようございます。","やあ!","ねむたそうだね","おっはー!","グッドモーニング!","モーニング!","今日もよろしく!"]
let randomIndex = Int(arc4random_uniform(UInt32(goodmorning.count)))
print("\(goodmorning[randomIndex])")
Command:
$ /Users/username/Library/Developer/Xcode/DerivedData/macOS_Swift_Test-arwavijyybnxpmctpfzeonufbnvy/Build/Products/Debug/macOS\ Swift\ Test ;
Result:
モーニング!
$ cat /Users/username/Desktop/macOS\ Swift\ Test/macOS\ Swift\ Test/main.swift
Result:
import Foundation
import Darwin
let goodmorning: Array<String> = ["おはよう!","おはようございます。","やあ!","ねむたそうだね","おっはー!","グッドモーニング!","モーニング!","今日もよろしく!"]
let randomIndex = Int(arc4random_uniform(UInt32(goodmorning.count)))
print("\(goodmorning[randomIndex])")
Command:
$ /Users/username/Library/Developer/Xcode/DerivedData/macOS_Swift_Test-arwavijyybnxpmctpfzeonufbnvy/Build/Products/Debug/macOS\ Swift\ Test ;
Result:
モーニング!
ラベル:
macOS Sierra,
Swift
Wednesday, May 3, 2017
Monday, May 1, 2017
Saturday, April 29, 2017
Subscribe to:
Posts (Atom)