I have a function square which I would like to display a matrix like this:
XXX (newline) XXX (newline) XXX My result is false after first line is printed. Why? How are variables transmitted in Prolog and how are the lines executed(order)?
line(Rez,X) :- Rez>=1 , write(X) , line(Rez-1,X). square(N,X) :- Rez = N,line(Rez,X),nl,N>1,square(N-1,X).