SWI-Prolog - show long list

TamarG picture TamarG · Nov 22, 2011 · Viewed 20k times · Source

I'm using SWI-Prolog and I'm trying to print a list but if the list has more than 9 items - it look like that -

[1, 15, 8, 22, 5, 19, 12, 25, 3|...] 

is there a way to show the whole list?

Answer

philonous picture philonous · Jan 4, 2014

Have a look at: http://www.swi-prolog.org/FAQ/AllOutput.html

The simple solution is to type w after the answer is given, i.e.:

?- n_queens_problem(10,X).
X = [1, 3, 6, 8, 10, 5, 9, 2, 4|...] [write]
X = [1, 3, 6, 8, 10, 5, 9, 2, 4, 7] 

After you have pressed the "w"-key "[write]" is displayed at the end and the full solution appears in the next line.