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.0.6.40 tracks/erlang/exercises/triangle/src/example.erl
trackler-2.0.6.39 tracks/erlang/exercises/triangle/src/example.erl
trackler-2.0.6.38 tracks/erlang/exercises/triangle/src/example.erl
trackler-2.0.6.37 tracks/erlang/exercises/triangle/src/example.erl
trackler-2.0.6.36 tracks/erlang/exercises/triangle/src/example.erl
trackler-2.0.6.35 tracks/erlang/exercises/triangle/src/example.erl
trackler-2.0.6.34 tracks/erlang/exercises/triangle/src/example.erl
trackler-2.0.6.33 tracks/erlang/exercises/triangle/src/example.erl
trackler-2.0.6.32 tracks/erlang/exercises/triangle/src/example.erl
trackler-2.0.6.31 tracks/erlang/exercises/triangle/src/example.erl