I'm new to Prolog, and I'm trying to write an if/else statement with an "or" condition. So to demonstrate, I want something like:
gothrough([H|T], B, C):-
( T == [] or H == 'then' %if either the tail is an empty list or if H == "then", do the following%
-> append(H,B,B), outputs(B,C)
; append(H,B,B), gothrough(T, B, C) %else%
).
This implementation doesn't work however; is there an obvious way to do this that I'm not getting?
Thanks!