Are there alternative ways to display a list other than by using loop?

Posted by joshua on Stack Overflow See other posts from Stack Overflow or by joshua
Published on 2010-04-11T08:05:12Z Indexed on 2010/04/11 14:33 UTC
Read the original article Hit count: 295

Filed under:

Hi everyone,

I know on how to display a list by using loop. For example,

choice(a):-write('This is the top 15 countries list:'),nl,
loop(X).

loop(X):-country(X),write(X),nl,fail.

Unfortunately, I don't know on how to display list by using list. Anyone can guide me?

© Stack Overflow or respective owner

Related posts about prolog