title: Prolog - Getting element from a list of lists
body: <p>I am having trouble figuring out how to access a single character from a list of strings without using recursion, but instead backtracking. </p>
  
  <p>For example I have this list of Strings and I want to be able to return a single character from one of these strings ('.' 'o', '*'). The program I am working on is treating it as rows and columns. It is a fact in my database that looks like this:</p>
  
  <pre><code>matrix(["...o....",
          ".******.",
          "...o....",
          ".*...*..",
          "..o..*..",
          ".....*..",
          ".o...*..",
          "....o..o"].
  </code></pre>
  
  <p>I have the predicate:</p>
  
  <pre><code>get(Row,Col,TheChar) :- 
  </code></pre>
  
  <p>that takes a row and column number (with index starting at 1) and returns the entry (TheEntry)  at that specific row and column.</p>
  
  <p>I have a feeling my predicate head might not be build correctly but I'm really more focused on just how to go through each String in the list character by character without recursion and returning that.</p>
  
  <p>I am new to prolog and am having major difficulty with this. </p>
  
  <p>Any help at all would be greatly appreciated!</p>
  
  <p>Thank you!</p>