SWI-Prolog 如何显示整个答案(列表)? [英] SWI-Prolog how to show entire answer (list)?

查看:41
本文介绍了SWI-Prolog 如何显示整个答案(列表)?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试将字符串转换为 ascii 代码列表,如下所示:

I'm trying to convert a string to a list of ascii-codes like so:

7 ?- string_to_list("I'm a big blue banana in space!", C).
C = [73, 39, 109, 32, 97, 32, 98, 105, 103|...].

8 ?- 

这并没有给我你看到的完整列表,但我需要它.

This doesn't give me the entire list as you can see, but I need it.

此解决方案不起作用:我不能按 w 因为它给出我的答案,并做一个句号.这都不行:我可以调用函数, 并返回 true,但列表仍未完全显示.

This solution does not work: I can't press w since it gives me the answer and does a full stop. Neither does this: I can call the function alright, and it returns true, but the list still isn't fully displayed.

11 ?- set_prolog_flag(toplevel_print_options,[quoted(true), portray(true), max_depth(0), spacing(next_argument)]).
true.

12 ?- string_to_list("I'm a big blue banana in space!", C).
C = [73, 39, 109, 32, 97, 32, 98, 105, 103|...].

13 ?- 

感谢任何帮助!

推荐答案

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

?- string_to_list("I'm a big blue banana in space!", C).
C = [73,39,109,32,97,32,98,105,103,32,98,108,117,101,32,98,97,110,97,110,97,32,105,110,32,115,112,97,99,101,33].

这里应该有相同的答案......我正在使用最新的 SWI-prolog 版本,刚刚编译......

there should be somewhere here on SO the same answer... I'm using the last SWI-prolog release, just compiled...

这篇关于SWI-Prolog 如何显示整个答案(列表)?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆