Answers for "prolog split list positive negative"

0

prolog split list positive negative

%% PROLOG Language

split([], [], []).

split([HP | TL], [HP | TP], N) :-
  HP >= 0,
  split(TL, TP, N).

split([HN | TL], P, [HN | TN]) :-
  HN < 0,
  split(TL, P, TN).
Posted by: Guest on April-16-2022

Code answers related to "prolog split list positive negative"

Browse Popular Code Answers by Language