Sha256: cad9fe4c1dc99a54792f0cc00fa7cdad843d26259247ff75da827dd31d4071f5

Contents?: true

Size: 479 Bytes

Versions: 265

Compression:

Stored size: 479 Bytes

Contents

defmodule Pangram do
  @doc """
  Determines if a word or sentence is a pangram.
  A pangram is a sentence using every letter of the alphabet at least once.

  Returns a boolean.

    ## Examples

      iex> Pangram.pangram?("the quick brown fox jumps over the lazy dog")
      true

  """

  @spec pangram?(String.t) :: boolean
  def pangram?(sentence) do
    chars =
      sentence
      |> String.downcase
      |> to_char_list

    Enum.all? ?a..?z, &(&1 in chars)
  end
end

Version data entries

265 entries across 265 versions & 1 rubygems

Version Path
trackler-2.2.1.7 tracks/elixir/exercises/pangram/example.exs
trackler-2.2.1.6 tracks/elixir/exercises/pangram/example.exs
trackler-2.2.1.5 tracks/elixir/exercises/pangram/example.exs
trackler-2.2.1.4 tracks/elixir/exercises/pangram/example.exs
trackler-2.2.1.3 tracks/elixir/exercises/pangram/example.exs
trackler-2.2.1.2 tracks/elixir/exercises/pangram/example.exs
trackler-2.2.1.1 tracks/elixir/exercises/pangram/example.exs
trackler-2.2.1.0 tracks/elixir/exercises/pangram/example.exs
trackler-2.2.0.6 tracks/elixir/exercises/pangram/example.exs
trackler-2.2.0.5 tracks/elixir/exercises/pangram/example.exs
trackler-2.2.0.4 tracks/elixir/exercises/pangram/example.exs
trackler-2.2.0.3 tracks/elixir/exercises/pangram/example.exs
trackler-2.2.0.2 tracks/elixir/exercises/pangram/example.exs
trackler-2.2.0.1 tracks/elixir/exercises/pangram/example.exs
trackler-2.2.0.0 tracks/elixir/exercises/pangram/example.exs
trackler-2.1.0.55 tracks/elixir/exercises/pangram/example.exs
trackler-2.1.0.54 tracks/elixir/exercises/pangram/example.exs
trackler-2.1.0.53 tracks/elixir/exercises/pangram/example.exs
trackler-2.1.0.52 tracks/elixir/exercises/pangram/example.exs
trackler-2.1.0.51 tracks/elixir/exercises/pangram/example.exs