문제

Given:

fruitid('Apple', 'Granny Smith', 1).

How would I go about creating the clause:

print_fruit_details(FruitID) :-

Which would output 'Apple' and 'Granny Smith' given the input 1.

Thanks,

JAS

도움이 되었습니까?

해결책

Try this:

print_fruit_details(FruitID) :- fruitid(X, Y, FruitID), write(X), write(Y).

And welcome to StackOverflow :)

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top