Last active
August 29, 2015 14:16
-
-
Save el-hoshino/e672e112d648073713bb to your computer and use it in GitHub Desktop.
.map を利用して let でランダム数列を作る ref: http://qiita.com/lovee/items/f3515119883f05a8dac5
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
let randomIntArray = [Int](count: 10, repeatedValue: 0).map { (some: Int) -> Int in | |
let randomUInt = arc4random_uniform(100) // 0 ..< 100 の乱数を作る | |
return Int(randomUInt) - 50 | |
} |
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
[Int](0 ..< 10) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment