title: Transcribing ASCII maze into graph
body: <p>I have a maze such as the below:</p>
  
  <pre><code>XXXOOOOX
  OXXXOXOE
  OXXOOXXO
  OSXOXXXO
  XOOOXOOO
  
  //X = wall
  //O = path
  //S = startpoint
  //E = endpoint
  </code></pre>
  
  <p>I want to transcribe this to a graph (adjacency matrix) but am unsure in my attempt to do so. An adjacency matrix is a list of lists of booleans, with true representing a takeable path and false representing an impossible path (eg. <code>(0,-1)</code> in the maze cannot connect to <code>(7,-1)</code> (0,0 being the top-left most node)). I'm not sure how to transcribe this, my best guess would be to take each element in a list and then a sublist with connecting nodes. It's difficult to process given the size of this maze, so here's a smaller one:</p>
  
  <pre><code>X E || A B
  S O || C D
  </code></pre>
  
  <p>Would an adjacency matrix be below for the above maze (1 = true, 0 = false)?</p>
  
  <pre><code>  A B C D
  A 0 0 0 0
  B 0 0 0 1
  C 0 0 0 1
  D 0 1 1 0
  
  //C connects to D (start)
  //D connects to B (end)
  </code></pre>
  
  <p>It's just really confusing, I'm not sure how to map an x,y (sometimes z, too) co-ordinate to a graph.</p>