Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ispis(0, _):- !.
- ispis(N, Char):- write(Char),
- write(Char),
- write(Char),
- N1 is N - 1,
- ispis(N1, Char).
- prog(0, 0, _, _, _):- !.
- prog(1, N, N, Full, Empty):-
- prog(0, N, N, Full, Empty),
- !.
- prog(1, K, N, Full, Empty):-
- isp(K, N, Full, Empty),
- K1 is K + 1,
- prog(1, K1, N, Full, Empty).
- prog(0, K, N, Full, Empty):-
- isp(K, N, Full, Empty),
- K1 is K - 1,
- prog(0, K1, N, Full, Empty).
- isp(1, N, Full, Empty):-
- M is N - 1,
- ispis(M, Empty),
- ispis(N, Full),
- ispis(M, Empty),
- nl,
- !.
- isp(N, N, Full, Empty):-
- M is N - 2,
- ispis(1, Full),
- ispis(M, Empty),
- ispis(N, Full),
- ispis(M, Empty),
- ispis(1, Full),
- nl,
- !.
- isp(K, N, Full, Empty):-
- M is N - K,
- L is N + 2 * (K - 2),
- ispis(M, Empty),
- ispis(1, Full),
- ispis(L, Empty),
- ispis(1, Full),
- ispis(M, Empty),
- nl.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement