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.2.1.29 tracks/elixir/exercises/pythagorean-triplet/pythagorean_triplet.exs
trackler-2.2.1.28 tracks/elixir/exercises/pythagorean-triplet/pythagorean_triplet.exs
trackler-2.2.1.27 tracks/elixir/exercises/pythagorean-triplet/pythagorean_triplet.exs
trackler-2.2.1.26 tracks/elixir/exercises/pythagorean-triplet/pythagorean_triplet.exs
trackler-2.2.1.25 tracks/elixir/exercises/pythagorean-triplet/pythagorean_triplet.exs
trackler-2.2.1.24 tracks/elixir/exercises/pythagorean-triplet/pythagorean_triplet.exs
trackler-2.2.1.23 tracks/elixir/exercises/pythagorean-triplet/pythagorean_triplet.exs
trackler-2.2.1.22 tracks/elixir/exercises/pythagorean-triplet/pythagorean_triplet.exs
trackler-2.2.1.21 tracks/elixir/exercises/pythagorean-triplet/pythagorean_triplet.exs
trackler-2.2.1.20 tracks/elixir/exercises/pythagorean-triplet/pythagorean_triplet.exs
trackler-2.2.1.19 tracks/elixir/exercises/pythagorean-triplet/pythagorean_triplet.exs
trackler-2.2.1.18 tracks/elixir/exercises/pythagorean-triplet/pythagorean_triplet.exs
trackler-2.2.1.17 tracks/elixir/exercises/pythagorean-triplet/pythagorean_triplet.exs
trackler-2.2.1.16 tracks/elixir/exercises/pythagorean-triplet/pythagorean_triplet.exs
trackler-2.2.1.15 tracks/elixir/exercises/pythagorean-triplet/pythagorean_triplet.exs
trackler-2.2.1.14 tracks/elixir/exercises/pythagorean-triplet/pythagorean_triplet.exs
trackler-2.2.1.13 tracks/elixir/exercises/pythagorean-triplet/pythagorean_triplet.exs
trackler-2.2.1.12 tracks/elixir/exercises/pythagorean-triplet/pythagorean_triplet.exs
trackler-2.2.1.11 tracks/elixir/exercises/pythagorean-triplet/pythagorean_triplet.exs
trackler-2.2.1.10 tracks/elixir/exercises/pythagorean-triplet/pythagorean_triplet.exs