Sha256: 199e0cfc81a68b307255c512e86f2dd2edbbaa03498ac591c2f5bf685a7b5b02

Contents?: true

Size: 284 Bytes

Versions: 133

Compression:

Stored size: 284 Bytes

Contents

-module(example).

-export([sieve/1, test_version/0]).

sieve(N) when N < 2 ->
    [];
sieve(N) ->
    sieve(lists:seq(2,N), []).

sieve([], P) ->
    lists:reverse(P);
sieve([N|S], P) ->
    R = lists:filter(fun(X) -> X rem N /= 0 end, S),
    sieve(R, [N|P]).

test_version() -> 1.

Version data entries

133 entries across 133 versions & 1 rubygems

Version Path
trackler-2.2.1.180 tracks/erlang/exercises/sieve/src/example.erl
trackler-2.2.1.179 tracks/erlang/exercises/sieve/src/example.erl
trackler-2.2.1.178 tracks/erlang/exercises/sieve/src/example.erl
trackler-2.2.1.177 tracks/erlang/exercises/sieve/src/example.erl
trackler-2.2.1.176 tracks/erlang/exercises/sieve/src/example.erl
trackler-2.2.1.175 tracks/erlang/exercises/sieve/src/example.erl
trackler-2.2.1.174 tracks/erlang/exercises/sieve/src/example.erl
trackler-2.2.1.173 tracks/erlang/exercises/sieve/src/example.erl
trackler-2.2.1.172 tracks/erlang/exercises/sieve/src/example.erl
trackler-2.2.1.171 tracks/erlang/exercises/sieve/src/example.erl
trackler-2.2.1.170 tracks/erlang/exercises/sieve/src/example.erl
trackler-2.2.1.169 tracks/erlang/exercises/sieve/src/example.erl
trackler-2.2.1.167 tracks/erlang/exercises/sieve/src/example.erl
trackler-2.2.1.166 tracks/erlang/exercises/sieve/src/example.erl
trackler-2.2.1.165 tracks/erlang/exercises/sieve/src/example.erl
trackler-2.2.1.164 tracks/erlang/exercises/sieve/src/example.erl
trackler-2.2.1.163 tracks/erlang/exercises/sieve/src/example.erl
trackler-2.2.1.162 tracks/erlang/exercises/sieve/src/example.erl
trackler-2.2.1.161 tracks/erlang/exercises/sieve/src/example.erl
trackler-2.2.1.160 tracks/erlang/exercises/sieve/src/example.erl