I see all the errors now and what the G_ result means... thanks!!!
I guess I would get some help from a debugger. SWI-Prolog says it has one, but I don't manage to get it to work.
Hi prologers,
I don't know if this is kind of a basic question, but I cannot figure it out myself...
The following program:
%% 1.23 (**) Extract a given number of randomly selected elements from a list.
%% Signature:
%% - select(Output, HowMany, Input).
select(Output, HowMany,Input) :-...
Thanks, joel76 :)
And sorry for my bad explanation. Compressifpossible calls compress, but compressifpossible is called by:
encode2([],[]).
encode2([X|Xs], [Y|Ys]) :- compressifpossible(X, [Y|Ys], Zs), encode2(Xs, Zs).
So actually I meant that I call it by asking encode2(..) and not...
Hi Prologers!
I am quite new to prolog, learning just for fun. I kind of get how it works, but I just found an issue I cannot figure out myself.
The following program runs without problem (based on compress that also runs ok).
compressifpossible(X, [X|Xs], Zs) :- compress([1,X], [X|Xs], Zs)...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.