Вопрос

Possible Duplicate:
Using SWI-Prolog Interactively - Output Taken off

I have written a program to replace X occurrences of 1 by 8 in Prolog.

The program works correct as it gives correct output. But it abbreviates my output when I give it long input. How to prevent this?

Example:

X = [2, 8, 3, 8, 4, 8, 5, 1, 6|...] .

Is the output for

replace_first_k(3,[2,1,3,1,4,1,5,1,6,1],X).

How to display all the characters of X in output terminal?

Это было полезно?

Решение

Did you try using

Write(X)

You can use it at each step of your function so it keeps on printing the part of array it has passed through.

Лицензировано под: CC-BY-SA с атрибуция
Не связан с StackOverflow
scroll top