пролог findall распечатывает результаты - PullRequest
0 голосов
/ 02 декабря 2018

Я хочу просмотреть ответ на запрос findall/3 и выбрать тест (), равный номеру «Введено».Вот мой код:

test1:-
    %enter in number to be read
    writeln('Enter grid reference for where you would to place your X (1-9)'),

    %read in the number
    read(Entered),

    %find all in 'test()' where the entered number equals the correct test() instance
    findall(Entered,test([A,B,C,D,E,F,G,H,I],Entered = Entered),Y),

    %write out the results
    writeln(Y).


test(['1','_','_','_','_','_','_','_','_'],1).
test(['2','_','_','_','_','_','_','_','_'],2).
test(['3','_','_','_','_','_','_','_','_'],3).
test(['4','_','_','_','_','_','_','_','_'],4).
Добро пожаловать на сайт PullRequest, где вы можете задавать вопросы и получать ответы от других членов сообщества.
...