title: Prolog get squares of NxN matrix
body: <p>I have a list <code>L = [[5,6,7,8],[10,11,12,13],[1,2,3,4],[14,15,16,17]]</code> Ii. That represents my matrix. The size can change dynamic, so the blocksize can be different, 4x4 = 4 elements, 9x9= 9 elements </p>
  
  <p>I want to obtain the 4 squares that compose the List.(In this case it's a matrix 4 by 4). If I have that matrix:</p>
  
  <pre><code>5  6  7  8
  10 11 12 13
  1  2  3  4
  14 15 16 17 
  </code></pre>
  
  <p>The result should be:</p>
  
  <pre><code>R = [5,6,10,11],[7,8,12,13],[1,2,14,15],[3,4,16,17].
  </code></pre>
  
  <p>Any suggestions are welcomed. Thanks </p>