I’m using:
SWI-Prolog version online https://swish.swi-prolog.org/p/NBA.pl
I want the code to:
So I am doing a foreach
and then I got an if inside it, so when my condition is true it will print something, but when its false it stops iterating the foreach
How do I do a pass condition whenever it returns false so I can move on iterating the rest
My code looks like this:
jogosPerdidos(Equipa):-
format('Perdeu com:\n'),
format('Fora:'),
foreach(jogo(_,X,Equipa,CA,FA,CB,FB,CC,FC,CD,FD),
((CA+CB+CC+CD)<(FA+FB+FC+FD) -> (format('\n'),write(X)))),
format('\nEm casa: '),
foreach(jogo(_,Equipa,X,CA,FA,CB,FB,CC,FC,CD,FD),
((CA+CB+CC+CD) < (FA+FB+FC+FD) -> (format('\n'),write(X)))).