Skip to content

Instantly share code, notes, and snippets.

@jeden
Created January 24, 2015 12:23
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jeden/f7f36fd49cf17bb0e6ab to your computer and use it in GitHub Desktop.
Save jeden/f7f36fd49cf17bb0e6ab to your computer and use it in GitHub Desktop.
Creating a multi dimensional array in swift
var matrix = [[[0, 1], [2, 3]], [[4, 5], [5, 6]]]
matrix[1][1][1]
var r = [Int](count: 3, repeatedValue: 0)
var c = [[Int]](count: 3, repeatedValue: r)
var m = [[[Int]]](count: 3, repeatedValue: c)
m[0][0][0]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment