Advertisement
Guest User

Teste P6

a guest
Jan 29th, 2019
82
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Prolog 0.26 KB | None | 0 0
  1. tripDays([X],_,[],1) :- atomic(X).
  2. tripDays([P, P2 | Ps], Time, FlightTimes, Days) :-
  3. airport(_,Code,P),
  4. airport(_,Code2,P2),
  5. ight(_, Code, Code2,Tim,_,_),
  6. FlightTimes = [Tim|Ts],
  7. tripDays([P2|Ps], Time, Ts, DaysN),
  8. (P \= P2 -> Days is DaysN + 1;Days = DaysN)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement