title: How do I get every possible UInt8 array combination up to a certain array size?
body: <p>I am trying to get every possible UInt8 array up to an array size of 100 in Swift. So far, I have the following code:</p>
  <pre><code>var arrays = [[UInt8]]()
  for size in 1...100 {
      let arr = Array(repeating: 255, count: size) as [UInt8]
      arrays.append(arr)
  }
  </code></pre>
  <p>The code so far just creates an array filled with <code>255</code> how many ever times specified by the for loop. Instead, I want the code to create an array for every array size that lists all possible combinations. For example, when <code>size</code> is one, the arrays should look like the following:</p>
  <pre><code>[0], [1], [2], [3], [4], so on until [255]
  </code></pre>
  <p>And when <code>size</code> is two, the arrays should look like this:</p>
  <pre><code>[0,0], [0,1], [0,2], [0,3], [0,4], so on until [0,255]
  [1,0], [1,1], [1,2], [1,3], [1,4], so on until [1,255]
  </code></pre>
  <p>This should continue up to where <code>size</code> is 100. Is there any way that I can accomplish this using Swift?</p>
  <p>Thanks in advance.</p>