Ok! last Prolog question for a long time!!
I’m trying to pick a response that is picked at random but all I can seem to do is pick the first one out of my tables of responses (see code)
I’m sure it’s done with Prologs “findall” and “random” but how?
pick_response(Sent, R) :-
response(Sent, R), !.
pick_response(_,R) :-
punt(R),!.
One way to do it with
findall/3andrandom/3is:Usage: