views:

60

answers:

1

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

A: 

Try this:

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

And welcome to StackOverflow :)

anthares
Ah so simple, yet once so troubling.Thanks! I'm sure I'll be around here a lot.
anotherstat