I am really struggling with finding the solutions to the following prolog questions....any help would be greatly appreciated:
1)street_address/2 takes the full name of an individual (arguments 1&2) and prints their street address to the screen. The rule should output a suitable message if the specified user does not exist...
i can get the first bit ok, but unsure of how to output the messgae if the user doesnt exist. the output is supposed to be similar to below:
22 york street
No such person
2) neighbours/4 finds a pair of names (arg 1&2) and the addresses (arg 3&4) of any individuals who live next door to one another (i.e. live on same street and their house numbers differ exactly by 2).... i can get the first bit again but have no idea how to compare the addresses to get something similar to the following output..
N1 = name(brown,jack)
N2 = name(black,jack)
S1 = street(9,castlerock,road)
S2 = street(11,castlerock,road)