title: Prolog saying if something in a list (in this case grid/1) is white. Prolog
body: <p>I am new to prolog and wanted to know if you have a maze with certain ''pixels''. How could you implement a predicate white/1, which says if the pixel is a white one or a black one. The problem that I have is that I want to make a predicate, that if I query ?- white(3/3). it should return true. This is my database:</p>
  <pre><code>grid([ [w, w, w, b, w],
  [b ,b, w, w, w],
  [w, w, w, b, w],
  [w, b, b, b, b],
  [w, w, w, w, w] ]).
  </code></pre>
  <p>Thanks for the answer, I implemented this program:</p>
  <pre><code>white(X/Y) :-
      nth1(X/Y, grid, _).
  </code></pre>
  <p>But after implementing this program I still get a false.</p>