title: Multidimensional array of zeros in Ruby
body: <p>To create a one-dimensional array, I can write:</p>
  
  <pre><code>arr = Array.new(10) { |z| 0 }
  #=&gt; [0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
  </code></pre>
  
  <p>But I want to know how to initialize an array in more dimensions, e.g.:</p>
  
  <pre><code>#=&gt; [[0, 0, 0], [0, 0, 0], [0, 0, 0]]
  </code></pre>
  
  <p>This is just an example. I am trying to understand the general case.</p>