DEV Community

Discussion on: Daily Challenge #84 - Third Angle of a Triangle

Collapse
 
thepeoplesbourgeois profile image
Josh

This oughta do it for Elixir.

defmodule Triangle do
  def third_angle(a, b) when is_integer(a + b) # will not qualify if either isn't an integer
                         and a + b < 180 
                         and a > 0
                         and b > 0 do
    180 - a - b
  end
end