Sha256: aa614800468172d94e1340e24b725918acece22bdb7faef0d61792c45b6c66ef

Contents?: true

Size: 1.01 KB

Versions: 327

Compression:

Stored size: 1.01 KB

Contents

defmodule Triplet do

  @doc """
  Calculates sum of a given triplet of integers.
  """
  @spec sum([non_neg_integer]) :: non_neg_integer
  def sum(triplet) do

  end

  @doc """
  Calculates product of a given triplet of integers.
  """
  @spec product([non_neg_integer]) :: non_neg_integer
  def product(triplet) do

  end

  @doc """
  Determines if a given triplet is pythagorean. That is, do the squares of a and b add up to the square of c?
  """
  @spec pythagorean?([non_neg_integer]) :: boolean
  def pythagorean?([a, b, c]) do

  end

  @doc """
  Generates a list of pythagorean triplets from a given min (or 1 if no min) to a given max.
  """
  @spec generate(non_neg_integer, non_neg_integer) :: [list(non_neg_integer)]
  def generate(min, max) do

  end

  @doc """
  Generates a list of pythagorean triplets from a given min to a given max, whose values add up to a given sum.
  """
  @spec generate(non_neg_integer, non_neg_integer, non_neg_integer) :: [list(non_neg_integer)]
  def generate(min, max, sum) do
  end
end

Version data entries

327 entries across 327 versions & 1 rubygems

Version Path
trackler-2.0.6.31 tracks/elixir/exercises/pythagorean-triplet/pythagorean_triplet.exs
trackler-2.0.6.30 tracks/elixir/exercises/pythagorean-triplet/pythagorean_triplet.exs
trackler-2.0.6.29 tracks/elixir/exercises/pythagorean-triplet/pythagorean_triplet.exs
trackler-2.0.6.28 tracks/elixir/exercises/pythagorean-triplet/pythagorean_triplet.exs
trackler-2.0.6.27 tracks/elixir/exercises/pythagorean-triplet/pythagorean_triplet.exs
trackler-2.0.6.26 tracks/elixir/exercises/pythagorean-triplet/pythagorean_triplet.exs
trackler-2.0.6.25 tracks/elixir/exercises/pythagorean-triplet/pythagorean_triplet.exs
trackler-2.0.6.24 tracks/elixir/exercises/pythagorean-triplet/pythagorean_triplet.exs
trackler-2.0.6.23 tracks/elixir/exercises/pythagorean-triplet/pythagorean_triplet.exs
trackler-2.0.6.22 tracks/elixir/exercises/pythagorean-triplet/pythagorean_triplet.exs
trackler-2.0.6.21 tracks/elixir/exercises/pythagorean-triplet/pythagorean_triplet.exs
trackler-2.0.6.20 tracks/elixir/exercises/pythagorean-triplet/pythagorean_triplet.exs
trackler-2.0.6.19 tracks/elixir/exercises/pythagorean-triplet/pythagorean_triplet.exs
trackler-2.0.6.18 tracks/elixir/exercises/pythagorean-triplet/pythagorean_triplet.exs
trackler-2.0.6.17 tracks/elixir/exercises/pythagorean-triplet/pythagorean_triplet.exs
trackler-2.0.6.16 tracks/elixir/exercises/pythagorean-triplet/pythagorean_triplet.exs
trackler-2.0.6.15 tracks/elixir/exercises/pythagorean-triplet/pythagorean_triplet.exs
trackler-2.0.6.14 tracks/elixir/exercises/pythagorean-triplet/pythagorean_triplet.exs
trackler-2.0.6.13 tracks/elixir/exercises/pythagorean-triplet/pythagorean_triplet.exs
trackler-2.0.6.12 tracks/elixir/exercises/pythagorean-triplet/pythagorean_triplet.exs