title: Ruby: Nested Array behaving strangley as an Instance Variable
body: <p>For our assignment, we were meant to create tic-tac-toe on a board of any size and accept an array as the input. I still am not fully grasping the attr_accessor module, and I'm pretty sure I used it incorrectly.</p>
  
  <pre><code>class Board
    attr_accessor :grid
  
    def initialize(grid = nil)
      if grid.nil?
        @grid = Array.new(3, Array.new(3, nil))
      else
        @grid = grid
      end
    end
  
    def place_mark(pos, mark)
      @grid[pos[0]][pos[1]] = mark
    end
  
   end
  </code></pre>
  
  <p>My main problem is even though it seems 'place_mark' should be placing the input in just one position. I get the following:</p>
  
  <pre><code>game.place_mark([0,0], :X) #=&gt; [[:X, nil, nil], [:X, nil, nil], [:X, nil, nil]]
  </code></pre>
  
  <p>When I recreated this outside of a class, it worked just as I thought it should. What did I mess up?</p>