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.11 tracks/elixir/exercises/pythagorean-triplet/pythagorean_triplet.exs
trackler-2.0.6.10 tracks/elixir/exercises/pythagorean-triplet/pythagorean_triplet.exs
trackler-2.0.6.9 tracks/elixir/exercises/pythagorean-triplet/pythagorean_triplet.exs
trackler-2.0.6.8 tracks/elixir/exercises/pythagorean-triplet/pythagorean_triplet.exs
trackler-2.0.6.7 tracks/elixir/exercises/pythagorean-triplet/pythagorean_triplet.exs
trackler-2.0.6.6 tracks/elixir/exercises/pythagorean-triplet/pythagorean_triplet.exs
trackler-2.0.6.5 tracks/elixir/exercises/pythagorean-triplet/pythagorean_triplet.exs
trackler-2.0.6.4 tracks/elixir/exercises/pythagorean-triplet/pythagorean_triplet.exs
trackler-2.0.6.3 tracks/elixir/exercises/pythagorean-triplet/pythagorean_triplet.exs
trackler-2.0.6.2 tracks/elixir/exercises/pythagorean-triplet/pythagorean_triplet.exs
trackler-2.0.6.1 tracks/elixir/exercises/pythagorean-triplet/pythagorean_triplet.exs
trackler-2.0.6.0 tracks/elixir/exercises/pythagorean-triplet/pythagorean_triplet.exs
trackler-2.0.5.18 tracks/elixir/exercises/pythagorean-triplet/pythagorean_triplet.exs
trackler-2.0.5.17 tracks/elixir/exercises/pythagorean-triplet/pythagorean_triplet.exs
trackler-2.0.5.16 tracks/elixir/exercises/pythagorean-triplet/pythagorean_triplet.exs
trackler-2.0.5.15 tracks/elixir/exercises/pythagorean-triplet/pythagorean_triplet.exs
trackler-2.0.5.14 tracks/elixir/exercises/pythagorean-triplet/pythagorean_triplet.exs
trackler-2.0.5.13 tracks/elixir/exercises/pythagorean-triplet/pythagorean_triplet.exs
trackler-2.0.5.12 tracks/elixir/exercises/pythagorean-triplet/pythagorean_triplet.exs
trackler-2.0.5.11 tracks/elixir/exercises/pythagorean-triplet/pythagorean_triplet.exs