Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

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).
 
PREVIOUS NEXT
Tagged: #prolog #split #list #positive #negative
ADD COMMENT
Topic
Name
9+6 =