title: Prolog print out 2 dimension table
body: <p>i have  a square with start and finish points, also places where i can't go. And my program must find a way to reach finish:</p>
  
  <pre><code>ar_galima([], _, _):-!.
  ar_galima([Prad|Galas],Kelias, X) :- not(Prad == X), not(member(X, Kelias)), ar_galima(Galas, Kelias, X). 
  
  gener(Stac_M, Stac_K, k(A,B), k(Y,B)) :-  Y is A + 1, Y &gt; 0, Y =&lt; Stac_M, B =&lt; Stac_K.
  gener(Stac_M, Stac_K, k(A,B), k(Y,B)) :-  Y is A - 1, Y &gt; 0, Y =&lt; Stac_M, B =&lt; Stac_K.
  gener(Stac_M, Stac_K, k(A,B), k(A,Y)) :-  Y is B + 1, Y &gt; 0, Y =&lt; Stac_K, A =&lt; Stac_M.
  gener(Stac_M, Stac_K, k(A,B), k(A,Y)) :-  Y is B - 1, Y &gt; 0, Y =&lt; Stac_K, A =&lt; Stac_M.
  
  paieska(_, _,_,Tikslas,Tikslas,[], _):-!.
  paieska(Stac_M, Stac_K, Draudziama, Prad, Tikslas, [K|Kelias], Kelias2) :- 
        gener(Stac_M, Stac_K, Prad, K), ar_galima(Draudziama, Kelias2, K), 
        paieska(Stac_M, Stac_K, Draudziama, K, Tikslas, Kelias, [K|Kelias2]).
  
  trasa(Ilgis, Aukstis, Draudziama, k(X,Y), Tikslas, Kelias) :-
        paieska(Ilgis,Aukstis, Draudziama, k(X,Y), Tikslas,Kelias, []).
  </code></pre>
  
  <p>i find routes to finish and now i'm stuck outputing the route (a list) into 2 dimension table in terminal (well, a simple graphic show of the route).</p>
  
  <p>example of list to output:<code>X = [k(2, 1), k(3, 1), k(4, 1), k(4, 2), k(4, 3), k(4, 4)] ;</code>     </p>
  
  <p>Could someone suggesst me how should i output a 2 dimension table into terminal? </p>
  
  <p><strong>EDIT:</strong></p>
  
  <p><code>X</code> should be printed:</p>
  
  <pre><code> + + + *
   + + + *
   + + + *
   + * * *
  </code></pre>
  
  <p>print perdicate could look like this:</p>
  
  <blockquote>
    <p>printTable(N, M, X) :- ...</p>
  </blockquote>
  
  <p>where N is number of rows, M is number of columns and X is list of coordinates.</p>