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.139 tracks/erlang/exercises/triangle/src/example.erl
trackler-2.2.1.138 tracks/erlang/exercises/triangle/src/example.erl
trackler-2.2.1.137 tracks/erlang/exercises/triangle/src/example.erl
trackler-2.2.1.136 tracks/erlang/exercises/triangle/src/example.erl
trackler-2.2.1.135 tracks/erlang/exercises/triangle/src/example.erl
trackler-2.2.1.134 tracks/erlang/exercises/triangle/src/example.erl
trackler-2.2.1.133 tracks/erlang/exercises/triangle/src/example.erl
trackler-2.2.1.132 tracks/erlang/exercises/triangle/src/example.erl
trackler-2.2.1.131 tracks/erlang/exercises/triangle/src/example.erl
trackler-2.2.1.130 tracks/erlang/exercises/triangle/src/example.erl
trackler-2.2.1.129 tracks/erlang/exercises/triangle/src/example.erl
trackler-2.2.1.128 tracks/erlang/exercises/triangle/src/example.erl
trackler-2.2.1.127 tracks/erlang/exercises/triangle/src/example.erl
trackler-2.2.1.126 tracks/erlang/exercises/triangle/src/example.erl
trackler-2.2.1.125 tracks/erlang/exercises/triangle/src/example.erl
trackler-2.2.1.124 tracks/erlang/exercises/triangle/src/example.erl
trackler-2.2.1.123 tracks/erlang/exercises/triangle/src/example.erl
trackler-2.2.1.122 tracks/erlang/exercises/triangle/src/example.erl
trackler-2.2.1.121 tracks/erlang/exercises/triangle/src/example.erl
trackler-2.2.1.120 tracks/erlang/exercises/triangle/src/example.erl