SWI-Prolog - show long list

后端 未结 5 977
猫巷女王i
猫巷女王i 2020-12-01 16:04

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|...] 
         


        
5条回答
  •  半阙折子戏
    2020-12-01 16:41

    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.

提交回复
热议问题