Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ucinanie([], POZOSTALA, POZOSTALA).
- ucinanie([G|O], RESZTA, WYNIK) :-
- ucinanie(O, [G|RESZTA], WYNIK).
- ucinanie([G1, G2|O], PUSTA, WYNIK) :-
- G is G1 + G2,
- ucinanie([G|O], PUSTA, WYNIK).
- ucinanie(JEDYNKI, WYNKON) :-
- ucinanie(JEDYNKI, [], WYNKON).
- max_tablica_jedynek(0, []).
- max_tablica_jedynek(N, [1|NPOW]) :-
- N > 0,
- K is N - 1,
- max_tablica_jedynek(K, NPOW).
- kombinacja(N, WYNIK) :-
- max_tablica_jedynek(N, JEDYNKI),
- findall(Y, ucinanie(JEDYNKI, Y), WYNIK).
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement