Sha256: e45333584b4f521af63b51e503ca3b7eb96ef88d55fb89421c54415363da99da

Contents?: true

Size: 1.21 KB

Versions: 69

Compression:

Stored size: 1.21 KB

Contents

defmodule Poker do
  @doc """
  Given a list of poker hands, return a list containing the highest scoring hand.

  If two or more hands tie, return the list of tied hands in the order they were received.

  The basic rules and hand rankings for Poker can be found at:

  https://en.wikipedia.org/wiki/List_of_poker_hands

  For this exercise, we'll consider the game to be using no Jokers,
  so five-of-a-kind hands will not be tested. We will also consider
  the game to be using multiple decks, so it is possible for multiple
  players to have identical cards.

  Aces can be used in low (A 2 3 4 5) or high (10 J Q K A) straights, but do not count as
  a high card in the former case.

  For example, (A 2 3 4 5) will lose to (2 3 4 5 6).

  You can also assume all inputs will be valid, and do not need to perform error checking
  when parsing card values. All hands will be a list of 5 strings, containing a number
  (or letter) for the rank, followed by the suit.

  Ranks (lowest to highest): 2 3 4 5 6 7 8 9 10 J Q K A
  Suits (order doesn't matter): C D H S

  Example hand: ~w(4S 5H 4C 5D 4H) # Full house, 5s over 4s
  """
  @spec best_hand(list(list(String.t()))) :: list(list(String.t()))
  def best_hand(hands) do
  end
end

Version data entries

69 entries across 69 versions & 1 rubygems

Version Path
trackler-2.2.1.180 tracks/elixir/exercises/poker/poker.exs
trackler-2.2.1.179 tracks/elixir/exercises/poker/poker.exs
trackler-2.2.1.178 tracks/elixir/exercises/poker/poker.exs
trackler-2.2.1.177 tracks/elixir/exercises/poker/poker.exs
trackler-2.2.1.176 tracks/elixir/exercises/poker/poker.exs
trackler-2.2.1.175 tracks/elixir/exercises/poker/poker.exs
trackler-2.2.1.174 tracks/elixir/exercises/poker/poker.exs
trackler-2.2.1.173 tracks/elixir/exercises/poker/poker.exs
trackler-2.2.1.172 tracks/elixir/exercises/poker/poker.exs
trackler-2.2.1.171 tracks/elixir/exercises/poker/poker.exs
trackler-2.2.1.170 tracks/elixir/exercises/poker/poker.exs
trackler-2.2.1.169 tracks/elixir/exercises/poker/poker.exs
trackler-2.2.1.167 tracks/elixir/exercises/poker/poker.exs
trackler-2.2.1.166 tracks/elixir/exercises/poker/poker.exs
trackler-2.2.1.165 tracks/elixir/exercises/poker/poker.exs
trackler-2.2.1.164 tracks/elixir/exercises/poker/poker.exs
trackler-2.2.1.163 tracks/elixir/exercises/poker/poker.exs
trackler-2.2.1.162 tracks/elixir/exercises/poker/poker.exs
trackler-2.2.1.161 tracks/elixir/exercises/poker/poker.exs
trackler-2.2.1.160 tracks/elixir/exercises/poker/poker.exs