title: How to do pattern /shape match / recognition on a board (20x20)?
body: <p>The board is <code>int[][]</code> and I would like to find this shape </p>
  
  <pre><code>  1
      1
      1
  </code></pre>
  
  <p>with all 4 of it's symmetric (rotational) variants from the board and log the positions.
  e.g.</p>
  
  <pre><code>      ...
        ...
    ... x x x x x x ...
    ... x x 1 1 x x ...
    ... x 1 x x x x ...
    ... x x x x x x ...
        ...
        ...
  </code></pre>
  
  <p>Is it better to use F# to deal with these kinds of problems?</p>
  
  <p>Below is my c# code for checking patterns vertically only (the code to check horizontally is simillar)</p>
  
  <pre><code>    List&lt;Position&gt; GetMatchVertical(int reelID)
      {
          List&lt;Position&gt; ret = new List&lt;Position&gt;();
  
          var myReel = board[reelID];
          var leftReel = reelID - 1 &gt;= 0 ? board[reelID - 1] : null;
          var rightReel = reelID + 1 &lt; boardSize ? board[reelID + 1] : null;
  
          int currentColor = myReel[0];
  
          for (int reelPosition = 1; reelPosition &lt; boardSize; reelPosition++)
          {
              int nextColor = myReel[reelPosition];
              if (currentColor == nextColor)
              {
                  if (leftReel!=null)
                  {
                      if (reelPosition + 1 &lt; boardSize &amp;&amp; leftReel[reelPosition + 1] == currentColor)
                      {
                          ret.Add(logPosition(...));
                      }
                  }
                  if (rightReel!=null)
                  {
                      if (reelPosition - 2 &gt;= 0 &amp;&amp; rightReel[reelPosition - 2] == currentColor)
                      {
                          ret.Add(logPosition(...));
                      }
                  }
              }
              else
              {
                  currentColor = nextColor;
              }
          }
  
          return ret;
      }
  </code></pre>