SWI-Prolog - show long list

后端 未结 5 978
猫巷女王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:32

    I've found two ways.


    1.

    ?- set_prolog_flag(answer_write_options,[max_depth(0)]).
    true.
    

    Then do your command that is printing a truncated list.

    (set_prolog_flag documentation)


    2.

    ?- atom_chars(goodbye_prolog, X) ; true.
    

    (AllOutput documentation)

    Put ; true. at the end of the call that results in a long list. Then push the w key on your keyboard. The result is:

    ?- sudoku([_,_,2,3,_,_,_,_,_,_,_,_,3,4,_,_], Solution); true.
    Solution = [4, 1, 2, 3, 2, 3, 4, 1, 1|...] [write]
    Solution = [4, 1, 2, 3, 2, 3, 4, 1, 1, 2, 3, 4, 3, 4, 1, 2] ;
    true.
    

提交回复
热议问题