Sha256: b640119e8f637a51b08b27f45d7351be6e401c8ee9958d27e7c38a7d20633b71

Contents?: true

Size: 447 Bytes

Versions: 310

Compression:

Stored size: 447 Bytes

Contents

-module(example).

-export([kind/3, test_version/0]).

kind(A,B,C) when (A =< 0) or (B =< 0) or (C =< 0) ->
    {error, "all side lengths must be positive"};
kind(A,B,C) when not ((A < (B + C)) and (B < (A + C)) and (C < (A + B))) ->
    {error, "side lengths violate triangle inequality"};
kind(A,A,A) -> equilateral;
kind(A,_,A) -> isosceles;
kind(A,A,_) -> isosceles;
kind(_,B,B) -> isosceles;
kind(_,_,_) -> scalene.

test_version() ->
    1.

Version data entries

310 entries across 310 versions & 1 rubygems

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