leftHand(empty).
rightHand(empty).
inHands :-
write("Left hand:"),
nl,
leftHand(X),
tab(2),
write(X),
nl,
nl,
write("Right hand:"),
rightHand(Y),
tab(2),
write(Y),
nl.
我希望inHands.
返回类似这样的内容:
Left hand:
empty
Right hand:
empty
然而,这就是我所看到的:
24 ?- inHands.
[76, 101, 102, 116, 32, 104, 97, 110, 100, 58]
empty
[82, 105, 103, 104, 116, 32, 104, 97, 110, 100, 58] empty
true.
我在这里做错了什么?
答案 0 :(得分:0)
原来我必须使用这样的单引号:
write('My text').