:- include(mondial).
res(C) :- country(_,C,_,_,_,_), shouldICheck(C), hqInCap(C).
hqInCap(C) :- country(_,C,Cap,CapProv,_,_), write('CAP found ... '),
              isMember(C,Org,_), write('check Org: '), write(Org), nl,
              organization(Org,_,Cap,C,CapProv,_).
shouldICheck(X) :- write('Should I check '), write(X),
                   write(' ("y."/"n.")?'), read(Z), shouldI(Z,X).
shouldI(Z,X) :- write('test if yes ... '), nl,  Z = 'y'.
shouldI(Z,X) :- write('here ... country is still '), write(X), nl, fail.
shouldI(Z,X) :- Z \= 'y', write('OK, I will skip '), write(X), nl, fail.
