title: Checking a series of binary states
body: <p>I suppose the easiest way to explain this is to use the analogy of tictactoe.
  A board of tictactoe can be expressed as a 2D array of binary states.</p>
  
  <p>So the board # can be shown as [[1,2,3],[1,2,3],[1,2,3]]
  And each index of this array has a binary value (X or O)
  So to check if a polayer has won, you check if all 3 squares in a winning pattern share the same state.</p>
  
  <p>Now, in this analogy you could hardcode the winning solutions and have the board checked against that independently, but in my circumstance I'd prefer not to hard code them as I need to (eventually) generate the arrays and the patterns during runtime. So currently I can just check manually or hardcode them but I need to find a way to check these patterns without hardcoded solutions.</p>
  
  <p>Here's the smallest array I have currently to give an example:</p>
  
  <pre><code>[[[1,a], [2,a], [3,a]],
   [[3,a], [1,a], [2,a]],
   [[1,a], [2,a], [3,a]]]
  </code></pre>
  
  <p>Now 'a' is the blank state, which will be replaced with either a 'b' or 'c' (or any two designations) and 1, 2 &amp; 3 designate 'lines'.</p>
  
  <p>A visual way of showing this can be seen as:
  <a href="https://i.stack.imgur.com/KCOhZ.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/KCOhZ.png" alt="Visual Description"></a></p>
  
  <p>See how the 'lines' cross over each other?
  Well the patterns in this array are:</p>
  
  <ul>
  <li>any 3 horizontally</li>
  <li>any 3 on a single 'line' (not straight up and
  down)</li>
  <li>and the specific patterns of row 1 line 1, r2l2, r3l3 &amp; r1l3,
  r2l2, r3l1</li>
  </ul>
  
  <p>In larger arrays there are more patterns but heres the simplest I can do.</p>
  
  <p>Can anyone help me figure out a solution to to finding the patterns generated so I can check their states?
  I'm testing this in python but I can also work with purely mathematical solutions</p>