kimstanely
Programmer
Hi,
I am a beginner in Prolog, i have
c-in(delhi,india).
c-in(prague,czechoslovakia).
c-in(bratislava,czechoslovakia).
c-in(berlin,germany).
c-in(leipzing,germany).
c-in(bonn,germany).
c-in(hamburg,germany).
c-in(belgrade,yugoslavia).
c-in(london,united_kingdom).
c-in(edinburgh,united_kingdom).
b-to(czechoslovakia,"COMECON").
b-to(germany,"EC").
b-to(united_kingdom,"EC").
and when i type
get-capital(Com, Cap) then i want to get a list of cities in the given Com, such as 'EC' */
I tried to do it i have:
get-capital(X,Y):- b-to(Z,X), c-in(Y,Z). this doesn;t give me list. Please help
I am a beginner in Prolog, i have
c-in(delhi,india).
c-in(prague,czechoslovakia).
c-in(bratislava,czechoslovakia).
c-in(berlin,germany).
c-in(leipzing,germany).
c-in(bonn,germany).
c-in(hamburg,germany).
c-in(belgrade,yugoslavia).
c-in(london,united_kingdom).
c-in(edinburgh,united_kingdom).
b-to(czechoslovakia,"COMECON").
b-to(germany,"EC").
b-to(united_kingdom,"EC").
and when i type
get-capital(Com, Cap) then i want to get a list of cities in the given Com, such as 'EC' */
I tried to do it i have:
get-capital(X,Y):- b-to(Z,X), c-in(Y,Z). this doesn;t give me list. Please help