6

More than 5 years have passed since last update.

# [[[[[[[[[[String]]]]]]]]]] Swiftで1〜10次元配列まで宣言して初期化

Last updated at Posted at 2015-11-14

Swiftで多次元配列の宣言方法を学ぶため、１０次元配列まで宣言と初期化を行いました。
※下まで長いです

``````/* 1次元配列 */
let array1: [String] = ["a","a"]

/* 2次元配列 */
let array2: [[String]] = [["a","a"] ,["a","a"]]

/* 3次元配列 */
let array3: [[[String]]] = [[["a","a"],["a","a"]], [["a","a"],["a","a"]]]

/* 4次元配列 */
let array4: [[[[String]]]] = [[[["a","a"],["a","a"]],[["a","a"],["a","a"]]], [[["a","a"],["a","a"]],[["a","a"],["a","a"]]]]

/* 5次元配列 */
let array5: [[[[[String]]]]] = [[[[["a","a"],["a","a"]],[["a","a"],["a","a"]]],[[["a","a"],["a","a"]],[["a","a"],["a","a"]]]], [[[["a","a"],["a","a"]],[["a","a"],["a","a"]]],[[["a","a"] ,["a","a"]],[["a","a"],["a","a"]]]]]

/* 6次元配列 */
let array6: [[[[[[String]]]]]] = [[[[[["a","a"],["a","a"]],[["a","a"],["a","a"]]],[[["a","a"],["a","a"]],[["a","a"],["a","a"]]]],[[[["a","a"],["a","a"]],[["a","a"],["a","a"]]],[[["a","a"] ,["a","a"]],[["a","a"],["a","a"]]]]],[[[[["a","a"],["a","a"]],[["a","a"],["a","a"]]],[[["a","a"],["a","a"]],[["a","a"],["a","a"]]]],[[[["a","a"],["a","a"]],[["a","a"],["a","a"]]],[[["a","a"],["a","a"]],[["a","a"],["a","a"]]]]]]

/* 7次元配列 */
let array7: [[[[[[[String]]]]]]] = [[[[[[["a","a"],["a","a"]],[["a","a"],["a","a"]]],[[["a","a"],["a","a"]],[["a","a"],["a","a"]]]],[[[["a","a"],["a","a"]],[["a","a"],["a","a"]]],[[["a","a"],["a","a"]],[["a","a"],["a","a"]]]]],[[[[["a","a"],["a","a"]],[["a","a"],["a","a"]]],[[["a","a"],["a","a"]],[["a","a"],["a","a"]]]],[[[["a","a"],["a","a"]],[["a","a"],["a","a"]]],[[["a","a"],["a","a"]],[["a","a"],["a","a"]]]]]],  [[[[[["a","a"],["a","a"]],[["a","a"],["a","a"]]],[[["a","a"],["a","a"]],[["a","a"],["a","a"]]]],[[[["a","a"],["a","a"]],[["a","a"],["a","a"]]],[[["a","a"],["a","a"]],[["a","a"],["a","a"]]]]],[[[[["a","a"],["a","a"]],[["a","a"],["a","a"]]],[[["a","a"],["a","a"]],[["a","a"],["a","a"]]]],[[[["a","a"],["a","a"]],[["a","a"],["a","a"]]],[[["a","a"],["a","a"]],[["a","a"],["a","a"]]]]]]]

/* 8次元配列 */
let array8: [[[[[[[[String]]]]]]]] = [[[[[[[["a","a"],["a","a"]],[["a","a"],["a","a"]]],[[["a","a"],["a","a"]],[["a","a"],["a","a"]]]],[[[["a","a"],["a","a"]],[["a","a"],["a","a"]]],[[["a","a"],["a","a"]],[["a","a"],["a","a"]]]]],[[[[["a","a"],["a","a"]],[["a","a"],["a","a"]]],[[["a","a"],["a","a"]],[["a","a"],["a","a"]]]],[[[["a","a"],["a","a"]],[["a","a"],["a","a"]]],[[["a","a"],["a","a"]],[["a","a"],["a","a"]]]]]],[[[[[["a","a"],["a","a"]],[["a","a"],["a","a"]]],[[["a","a"],["a","a"]],[["a","a"],["a","a"]]]],[[[["a","a"],["a","a"]],[["a","a"],["a","a"]]],[[["a","a"],["a","a"]],[["a","a"],["a","a"]]]]],[[[[["a","a"],["a","a"]],[["a","a"],["a","a"]]],[[["a","a"],["a","a"]],[["a","a"],["a","a"]]]],[[[["a","a"],["a","a"]],[["a","a"],["a","a"]]],[[["a","a"],["a","a"]],[["a","a"],["a","a"]]]]]]], [[[[[[["a","a"],["a","a"]],[["a","a"],["a","a"]]],[[["a","a"],["a","a"]],[["a","a"],["a","a"]]]],[[[["a","a"],["a","a"]],[["a","a"],["a","a"]]],[[["a","a"],["a","a"]],[["a","a"],["a","a"]]]]],[[[[["a","a"],["a","a"]],[["a","a"],["a","a"]]],[[["a","a"],["a","a"]],[["a","a"],["a","a"]]]],[[[["a","a"],["a","a"]],[["a","a"],["a","a"]]],[[["a","a"],["a","a"]],[["a","a"],["a","a"]]]]]],[[[[[["a","a"],["a","a"]],[["a","a"],["a","a"]]],[[["a","a"],["a","a"]],[["a","a"],["a","a"]]]],[[[["a","a"],["a","a"]],[["a","a"],["a","a"]]],[[["a","a"],["a","a"]],[["a","a"],["a","a"]]]]],[[[[["a","a"],["a","a"]],[["a","a"],["a","a"]]],[[["a","a"],["a","a"]],[["a","a"],["a","a"]]]],[[[["a","a"],["a","a"]],[["a","a"],["a","a"]]],[[["a","a"],["a","a"]],[["a","a"],["a","a"]]]]]]]]

/* 9次元配列 */
let array9: [[[[[[[[[String]]]]]]]]] = [[[[[[[[["a","a"],["a","a"]],[["a","a"],["a","a"]]],[[["a","a"],["a","a"]],[["a","a"],["a","a"]]]],[[[["a","a"],["a","a"]],[["a","a"],["a","a"]]],[[["a","a"],["a","a"]],[["a","a"],["a","a"]]]]],[[[[["a","a"],["a","a"]],[["a","a"],["a","a"]]],[[["a","a"],["a","a"]],[["a","a"],["a","a"]]]],[[[["a","a"],["a","a"]],[["a","a"],["a","a"]]],[[["a","a"],["a","a"]],[["a","a"],["a","a"]]]]]],[[[[[["a","a"],["a","a"]],[["a","a"],["a","a"]]],[[["a","a"],["a","a"]],[["a","a"],["a","a"]]]],[[[["a","a"],["a","a"]],[["a","a"],["a","a"]]],[[["a","a"],["a","a"]],[["a","a"],["a","a"]]]]],[[[[["a","a"],["a","a"]],[["a","a"],["a","a"]]],[[["a","a"],["a","a"]],[["a","a"],["a","a"]]]],[[[["a","a"],["a","a"]],[["a","a"],["a","a"]]],[[["a","a"],["a","a"]],[["a","a"],["a","a"]]]]]]],[[[[[[["a","a"],["a","a"]],[["a","a"],["a","a"]]],[[["a","a"],["a","a"]],[["a","a"],["a","a"]]]],[[[["a","a"],["a","a"]],[["a","a"],["a","a"]]],[[["a","a"],["a","a"]],[["a","a"],["a","a"]]]]],[[[[["a","a"],["a","a"]],[["a","a"],["a","a"]]],[[["a","a"],["a","a"]],[["a","a"],["a","a"]]]],[[[["a","a"],["a","a"]],[["a","a"],["a","a"]]],[[["a","a"],["a","a"]],[["a","a"],["a","a"]]]]]],[[[[[["a","a"],["a","a"]],[["a","a"],["a","a"]]],[[["a","a"],["a","a"]],[["a","a"],["a","a"]]]],[[[["a","a"],["a","a"]],[["a","a"],["a","a"]]],[[["a","a"],["a","a"]],[["a","a"],["a","a"]]]]],[[[[["a","a"],["a","a"]],[["a","a"],["a","a"]]],[[["a","a"],["a","a"]],[["a","a"],["a","a"]]]],[[[["a","a"],["a","a"]],[["a","a"],["a","a"]]],[[["a","a"],["a","a"]],[["a","a"],["a","a"]]]]]]]], [[[[[[[["a","a"],["a","a"]],[["a","a"],["a","a"]]],[[["a","a"],["a","a"]],[["a","a"],["a","a"]]]],[[[["a","a"],["a","a"]],[["a","a"],["a","a"]]],[[["a","a"],["a","a"]],[["a","a"],["a","a"]]]]],[[[[["a","a"],["a","a"]],[["a","a"],["a","a"]]],[[["a","a"],["a","a"]],[["a","a"],["a","a"]]]],[[[["a","a"],["a","a"]],[["a","a"],["a","a"]]],[[["a","a"],["a","a"]],[["a","a"],["a","a"]]]]]],[[[[[["a","a"],["a","a"]],[["a","a"],["a","a"]]],[[["a","a"],["a","a"]],[["a","a"],["a","a"]]]],[[[["a","a"],["a","a"]],[["a","a"],["a","a"]]],[[["a","a"],["a","a"]],[["a","a"],["a","a"]]]]],[[[[["a","a"],["a","a"]],[["a","a"],["a","a"]]],[[["a","a"],["a","a"]],[["a","a"],["a","a"]]]],[[[["a","a"],["a","a"]],[["a","a"],["a","a"]]],[[["a","a"],["a","a"]],[["a","a"],["a","a"]]]]]]],[[[[[[["a","a"],["a","a"]],[["a","a"],["a","a"]]],[[["a","a"],["a","a"]],[["a","a"],["a","a"]]]],[[[["a","a"],["a","a"]],[["a","a"],["a","a"]]],[[["a","a"],["a","a"]],[["a","a"],["a","a"]]]]],[[[[["a","a"],["a","a"]],[["a","a"],["a","a"]]],[[["a","a"],["a","a"]],[["a","a"],["a","a"]]]],[[[["a","a"],["a","a"]],[["a","a"],["a","a"]]],[[["a","a"],["a","a"]],[["a","a"],["a","a"]]]]]],[[[[[["a","a"],["a","a"]],[["a","a"],["a","a"]]],[[["a","a"],["a","a"]],[["a","a"],["a","a"]]]],[[[["a","a"],["a","a"]],[["a","a"],["a","a"]]],[[["a","a"],["a","a"]],[["a","a"],["a","a"]]]]],[[[[["a","a"],["a","a"]],[["a","a"],["a","a"]]],[[["a","a"],["a","a"]],[["a","a"],["a","a"]]]],[[[["a","a"],["a","a"]],[["a","a"],["a","a"]]],[[["a","a"],["a","a"]],[["a","a"],["a","a"]]]]]]]]]

/* 10次元配列 */
let array10: [[[[[[[[[[String]]]]]]]]]] = [[[[[[[[[["a","a"],["a","a"]],[["a","a"],["a","a"]]],[[["a","a"],["a","a"]],[["a","a"],["a","a"]]]],[[[["a","a"],["a","a"]],[["a","a"],["a","a"]]],[[["a","a"],["a","a"]],[["a","a"],["a","a"]]]]],[[[[["a","a"],["a","a"]],[["a","a"],["a","a"]]],[[["a","a"],["a","a"]],[["a","a"],["a","a"]]]],[[[["a","a"],["a","a"]],[["a","a"],["a","a"]]],[[["a","a"],["a","a"]],[["a","a"],["a","a"]]]]]],[[[[[["a","a"],["a","a"]],[["a","a"],["a","a"]]],[[["a","a"],["a","a"]],[["a","a"],["a","a"]]]],[[[["a","a"],["a","a"]],[["a","a"],["a","a"]]],[[["a","a"],["a","a"]],[["a","a"],["a","a"]]]]],[[[[["a","a"],["a","a"]],[["a","a"],["a","a"]]],[[["a","a"],["a","a"]],[["a","a"],["a","a"]]]],[[[["a","a"],["a","a"]],[["a","a"],["a","a"]]],[[["a","a"],["a","a"]],[["a","a"],["a","a"]]]]]]],[[[[[[["a","a"],["a","a"]],[["a","a"],["a","a"]]],[[["a","a"],["a","a"]],[["a","a"],["a","a"]]]],[[[["a","a"],["a","a"]],[["a","a"],["a","a"]]],[[["a","a"],["a","a"]],[["a","a"],["a","a"]]]]],[[[[["a","a"],["a","a"]],[["a","a"],["a","a"]]],[[["a","a"],["a","a"]],[["a","a"],["a","a"]]]],[[[["a","a"],["a","a"]],[["a","a"],["a","a"]]],[[["a","a"],["a","a"]],[["a","a"],["a","a"]]]]]],[[[[[["a","a"],["a","a"]],[["a","a"],["a","a"]]],[[["a","a"],["a","a"]],[["a","a"],["a","a"]]]],[[[["a","a"],["a","a"]],[["a","a"],["a","a"]]],[[["a","a"],["a","a"]],[["a","a"],["a","a"]]]]],[[[[["a","a"],["a","a"]],[["a","a"],["a","a"]]],[[["a","a"],["a","a"]],[["a","a"],["a","a"]]]],[[[["a","a"],["a","a"]],[["a","a"],["a","a"]]],[[["a","a"],["a","a"]],[["a","a"],["a","a"]]]]]]]],[[[[[[[["a","a"],["a","a"]],[["a","a"],["a","a"]]],[[["a","a"],["a","a"]],[["a","a"],["a","a"]]]],[[[["a","a"],["a","a"]],[["a","a"],["a","a"]]],[[["a","a"],["a","a"]],[["a","a"],["a","a"]]]]],[[[[["a","a"],["a","a"]],[["a","a"],["a","a"]]],[[["a","a"],["a","a"]],[["a","a"],["a","a"]]]],[[[["a","a"],["a","a"]],[["a","a"],["a","a"]]],[[["a","a"],["a","a"]],[["a","a"],["a","a"]]]]]],[[[[[["a","a"],["a","a"]],[["a","a"],["a","a"]]],[[["a","a"],["a","a"]],[["a","a"],["a","a"]]]],[[[["a","a"],["a","a"]],[["a","a"],["a","a"]]],[[["a","a"],["a","a"]],[["a","a"],["a","a"]]]]],[[[[["a","a"],["a","a"]],[["a","a"],["a","a"]]],[[["a","a"],["a","a"]],[["a","a"],["a","a"]]]],[[[["a","a"],["a","a"]],[["a","a"],["a","a"]]],[[["a","a"],["a","a"]],[["a","a"],["a","a"]]]]]]],[[[[[[["a","a"],["a","a"]],[["a","a"],["a","a"]]],[[["a","a"],["a","a"]],[["a","a"],["a","a"]]]],[[[["a","a"],["a","a"]],[["a","a"],["a","a"]]],[[["a","a"],["a","a"]],[["a","a"],["a","a"]]]]],[[[[["a","a"],["a","a"]],[["a","a"],["a","a"]]],[[["a","a"],["a","a"]],[["a","a"],["a","a"]]]],[[[["a","a"],["a","a"]],[["a","a"],["a","a"]]],[[["a","a"],["a","a"]],[["a","a"],["a","a"]]]]]],[[[[[["a","a"],["a","a"]],[["a","a"],["a","a"]]],[[["a","a"],["a","a"]],[["a","a"],["a","a"]]]],[[[["a","a"],["a","a"]],[["a","a"],["a","a"]]],[[["a","a"],["a","a"]],[["a","a"],["a","a"]]]]],[[[[["a","a"],["a","a"]],[["a","a"],["a","a"]]],[[["a","a"],["a","a"]],[["a","a"],["a","a"]]]],[[[["a","a"],["a","a"]],[["a","a"],["a","a"]]],[[["a","a"],["a","a"]],[["a","a"],["a","a"]]]]]]]]], [[[[[[[[["a","a"],["a","a"]],[["a","a"],["a","a"]]],[[["a","a"],["a","a"]],[["a","a"],["a","a"]]]],[[[["a","a"],["a","a"]],[["a","a"],["a","a"]]],[[["a","a"],["a","a"]],[["a","a"],["a","a"]]]]],[[[[["a","a"],["a","a"]],[["a","a"],["a","a"]]],[[["a","a"],["a","a"]],[["a","a"],["a","a"]]]],[[[["a","a"],["a","a"]],[["a","a"],["a","a"]]],[[["a","a"],["a","a"]],[["a","a"],["a","a"]]]]]],[[[[[["a","a"],["a","a"]],[["a","a"],["a","a"]]],[[["a","a"],["a","a"]],[["a","a"],["a","a"]]]],[[[["a","a"],["a","a"]],[["a","a"],["a","a"]]],[[["a","a"],["a","a"]],[["a","a"],["a","a"]]]]],[[[[["a","a"],["a","a"]],[["a","a"],["a","a"]]],[[["a","a"],["a","a"]],[["a","a"],["a","a"]]]],[[[["a","a"],["a","a"]],[["a","a"],["a","a"]]],[[["a","a"],["a","a"]],[["a","a"],["a","a"]]]]]]],[[[[[[["a","a"],["a","a"]],[["a","a"],["a","a"]]],[[["a","a"],["a","a"]],[["a","a"],["a","a"]]]],[[[["a","a"],["a","a"]],[["a","a"],["a","a"]]],[[["a","a"],["a","a"]],[["a","a"],["a","a"]]]]],[[[[["a","a"],["a","a"]],[["a","a"],["a","a"]]],[[["a","a"],["a","a"]],[["a","a"],["a","a"]]]],[[[["a","a"],["a","a"]],[["a","a"],["a","a"]]],[[["a","a"],["a","a"]],[["a","a"],["a","a"]]]]]],[[[[[["a","a"],["a","a"]],[["a","a"],["a","a"]]],[[["a","a"],["a","a"]],[["a","a"],["a","a"]]]],[[[["a","a"],["a","a"]],[["a","a"],["a","a"]]],[[["a","a"],["a","a"]],[["a","a"],["a","a"]]]]],[[[[["a","a"],["a","a"]],[["a","a"],["a","a"]]],[[["a","a"],["a","a"]],[["a","a"],["a","a"]]]],[[[["a","a"],["a","a"]],[["a","a"],["a","a"]]],[[["a","a"],["a","a"]],[["a","a"],["a","a"]]]]]]]],[[[[[[[["a","a"],["a","a"]],[["a","a"],["a","a"]]],[[["a","a"],["a","a"]],[["a","a"],["a","a"]]]],[[[["a","a"],["a","a"]],[["a","a"],["a","a"]]],[[["a","a"],["a","a"]],[["a","a"],["a","a"]]]]],[[[[["a","a"],["a","a"]],[["a","a"],["a","a"]]],[[["a","a"],["a","a"]],[["a","a"],["a","a"]]]],[[[["a","a"],["a","a"]],[["a","a"],["a","a"]]],[[["a","a"],["a","a"]],[["a","a"],["a","a"]]]]]],[[[[[["a","a"],["a","a"]],[["a","a"],["a","a"]]],[[["a","a"],["a","a"]],[["a","a"],["a","a"]]]],[[[["a","a"],["a","a"]],[["a","a"],["a","a"]]],[[["a","a"],["a","a"]],[["a","a"],["a","a"]]]]],[[[[["a","a"],["a","a"]],[["a","a"],["a","a"]]],[[["a","a"],["a","a"]],[["a","a"],["a","a"]]]],[[[["a","a"],["a","a"]],[["a","a"],["a","a"]]],[[["a","a"],["a","a"]],[["a","a"],["a","a"]]]]]]],[[[[[[["a","a"],["a","a"]],[["a","a"],["a","a"]]],[[["a","a"],["a","a"]],[["a","a"],["a","a"]]]],[[[["a","a"],["a","a"]],[["a","a"],["a","a"]]],[[["a","a"],["a","a"]],[["a","a"],["a","a"]]]]],[[[[["a","a"],["a","a"]],[["a","a"],["a","a"]]],[[["a","a"],["a","a"]],[["a","a"],["a","a"]]]],[[[["a","a"],["a","a"]],[["a","a"],["a","a"]]],[[["a","a"],["a","a"]],[["a","a"],["a","a"]]]]]],[[[[[["a","a"],["a","a"]],[["a","a"],["a","a"]]],[[["a","a"],["a","a"]],[["a","a"],["a","a"]]]],[[[["a","a"],["a","a"]],[["a","a"],["a","a"]]],[[["a","a"],["a","a"]],[["a","a"],["a","a"]]]]],[[[[["a","a"],["a","a"]],[["a","a"],["a","a"]]],[[["a","a"],["a","a"]],[["a","a"],["a","a"]]]],[[[["a","a"],["a","a"]],[["a","a"],["a","a"]]],[[["a","a"],["a","a"]],[["a","a"],["a","a"]]]]]]]]]]
``````

Register as a new user and use Qiita more conveniently

1. You get articles that match your needs
2. You can efficiently read back useful information
3. You can use dark theme
What you can do with signing up
6