Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- potega(_, 0, 1).
- potega(Liczba, Potega, Wynik) :-
- NowaPotega is Potega - 1,
- potega(Liczba, NowaPotega, NowyWynik),
- Wynik is Liczba * NowyWynik.
- ryby(A, K, Ł, D) :-
- L = [1, 2, 3, 4],
- select(A, L, L1),
- select(K, L1, L2),
- select(Ł, L2, L3),
- select(D, L3, _),
- A > K,
- Ł + D =:= K + A,
- Ł + A < D + K.
- prepend(X, L, [X|L]).
- %prepend(X, L, W) :-
- % W = [X|L].
- append(X, [], [X]).
- append(X, [H|L1], [H|L2]):-
- append(X, L1, L2).
- symetria(X2, X1, X0, Y2, Y1, Y0) :-
- L = [0, 1, 2, 3, 4, 5, 6, 8, 9],
- select(X0, L, _),
- select(X1, L, _),
- select(Y0, L, _),
- select(Y1, L, _),
- X2 = 2,
- Y2 = 3,
- U0 is X0 * Y0,
- U1 is X1 * Y0 + U0 // 10,
- U2 is X2 * Y0 + U1 // 10,
- 5 =:= U2,
- V0 is X0 * Y1,
- V1 is X1 * Y1 + V0 // 10,
- 4 =:= V1 mod 10,
- W0 is X0 * Y2,
- 3 =:= W0 mod 10,
- Y1 < 4.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement