Prolog e1 started
This commit is contained in:
parent
97b86f1d3f
commit
d6600f66bd
|
@ -0,0 +1,7 @@
|
||||||
|
range(End, End, []) .
|
||||||
|
range(Start, End, [Start| Acc]) :- Next is Start + 1, range(Next, End, Acc).
|
||||||
|
|
||||||
|
divisors_3_5([], []).
|
||||||
|
divisors_3_5([X|Xs], [X|Ys]) :- 0 is X rem 3, divisors_3_5(Xs, Ys).
|
||||||
|
divisors_3_5([X|Xs], [X|Ys]) :- 0 is X rem 5, divisors_3_5(Xs, Ys).
|
||||||
|
divisors_3_5([X|Xs], Ys]) :- divisors_3_5(Xs, Ys).
|
|
@ -0,0 +1,3 @@
|
||||||
|
swipl
|
||||||
|
[file].
|
||||||
|
fn.
|
Loading…
Reference in New Issue