SWI-Prolog - 显示长列表 [英] SWI-Prolog - show long list
本文介绍了SWI-Prolog - 显示长列表的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我正在使用 SWI-Prolog 并且我正在尝试打印一个列表,但是如果该列表有 9 个以上的项目 - 它看起来像那样 -
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?
推荐答案
看看:http://www.swi-prolog.org/FAQ/AllOutput.html
简单的解决方法是在给出答案后输入w,即:
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]
按下w"键后,最后会显示[write]",下一行显示完整的解决方案.
After you have pressed the "w"-key "[write]" is displayed at the end and the full solution appears in the next line.
这篇关于SWI-Prolog - 显示长列表的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文