Question: logical problem_ city

Whassup homies?

http://www.mathsisfun.com/puzzles/who-lives-in-the-city--solution.html

tried to solve this using C.Loves program, but didn't quite get their solution...

Who_Lives_in_the_Cit.mw

Vars:= [PN,Name, TV, Dest,Ages,Hair,Lives]:
PN:=[$1..5]:
Name:= [Bob, Keeley, Rachael, Eilish, Amy]:
TV:=[Simpsons, Coronation, Eastenders, Desperate, Neighbours]:
Dest:= [Fra, Aus, Eng, Afr,Ita]:
Ages:= [14, 21, 46, 52, 81]:
Hair:=[afro, long, straight, curly , bald]:
Lives:= [town, city, village, farm, youth]:
Con1:= Desperate=3: Con2:= Bob=1: Con3:= NextTo(Simpsons,youth,PN): Con4:= Succ(Afr,Rachael,PN): Con5:= village=52: Con6:= Aus=straight: Con7:= Afr=Desperate: Con8:= 14=5: Con9:= Amy=Eastenders: Con10:= Ita=long: Con11:= Keeley=village: Con12:= bald=46: Con13:= Eng=4: Con14:= NextTo(Desperate,Neighbours,PN): Con15:= NextTo(Coronation,afro,PN): Con16:= NextTo(Rachael,afro,PN): Con17:= 21=youth: Con18:= Coronation=long: Con19:= 81=farm: Con20:= Fra=town: Con21:= Eilish<>straight:

read "LogicProblem.mpl"; City:= LogicProblem(Vars): with(City);

 

Please Wait...