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.159 tracks/erlang/exercises/sieve/src/example.erl
trackler-2.2.1.158 tracks/erlang/exercises/sieve/src/example.erl
trackler-2.2.1.157 tracks/erlang/exercises/sieve/src/example.erl
trackler-2.2.1.156 tracks/erlang/exercises/sieve/src/example.erl
trackler-2.2.1.155 tracks/erlang/exercises/sieve/src/example.erl
trackler-2.2.1.154 tracks/erlang/exercises/sieve/src/example.erl
trackler-2.2.1.153 tracks/erlang/exercises/sieve/src/example.erl
trackler-2.2.1.152 tracks/erlang/exercises/sieve/src/example.erl
trackler-2.2.1.151 tracks/erlang/exercises/sieve/src/example.erl
trackler-2.2.1.150 tracks/erlang/exercises/sieve/src/example.erl
trackler-2.2.1.149 tracks/erlang/exercises/sieve/src/example.erl
trackler-2.2.1.148 tracks/erlang/exercises/sieve/src/example.erl
trackler-2.2.1.147 tracks/erlang/exercises/sieve/src/example.erl
trackler-2.2.1.146 tracks/erlang/exercises/sieve/src/example.erl
trackler-2.2.1.145 tracks/erlang/exercises/sieve/src/example.erl
trackler-2.2.1.144 tracks/erlang/exercises/sieve/src/example.erl
trackler-2.2.1.143 tracks/erlang/exercises/sieve/src/example.erl
trackler-2.2.1.142 tracks/erlang/exercises/sieve/src/example.erl
trackler-2.2.1.141 tracks/erlang/exercises/sieve/src/example.erl
trackler-2.2.1.140 tracks/erlang/exercises/sieve/src/example.erl