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