I would like to write a small text-based adventure game using Prolog (this might be a dumb idea but I am not here to discuss that).
The only problem is that I can't manage to print text on screen without the "true" and "false" values to appear as well.
For instance if I try something like:
take(desk) :- write('This thing is way too heavy for me to carry!').
where take
is a one place predicate and desk
a name I get as an output:
?- take(desk).
This thing is way too heavy for me to carry!
true.
How can I get rid of this "true" or "false" outputs?
Just to mention that I also tried with the format/1
one place predicate for simple text output and also the format/2
two place predicate (when I want to output the name of a variable) but it gives exactly the same problem.
I have also seen this answer but first it is not detailed enough (at least not for someone like me) and second, I hope deep inside that there is a simpler manner to do it.
And finally, I am using SWI-Prolog.
Thank you.
--quiet
/-q
switch, does that work? source: swi-prolog.org/pldoc/… – Seaquakeprolog -q game.pl
, it doesn't work. – Negotiable