Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- is_leading([],_).
- is_leading([X|Ost],[X|Ost1]):-is_leading(Ost,Ost1).
- podlista(L,L):-!.
- podlista([],_):-!.
- podlista([X|Ost],[X|Ost1]):-is_leading(Ost,Ost1),!.
- podlista([X|Ost],[_|Ost1]):-podlista([X|Ost],Ost1).
- e_list([]).
- e_list([_|_]).
- trgni_nivo([],[]):-!.
- trgni_nivo([[X|Ost1]|Ost],[X|OstR]):-trgni_nivo([Ost1|Ost],OstR),!.
- trgni_nivo([[]|Ost],R):-trgni_nivo(Ost,R),!.
- trgni_nivo([X|Ost],R):-not(e_list(X)),trgni_nivo(Ost,R).
- trgni_nadnivo([],[]):-!.
- trgni_nadnivo([X|Ost],[X|OstR]):-not(e_list(X)),trgni_nadnivo(Ost,OstR),!.
- trgni_nadnivo([X|Ost],R):-e_list(X),trgni_nadnivo(Ost,R).
- clenovi_nivo(1,L,R):-!,trgni_nadnivo(L,R).
- clenovi_nivo(N,L,R):-N1 is N-1,trgni_nivo(L,L1),clenovi_nivo(N1,L1,R).
- soberi_nivoa([],[]):-!.
- soberi_nivoa(L,[X|Ost]):-trgni_nadnivo(L,X),trgni_nivo(L,L1),soberi_nivoa(L1,Ost).
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement