Sha256: 5ad500f56fe17b1dce8b13552c1c824ed1521749a80d4cae0c3908f6ad0b9c4e

Contents?: true

Size: 378 Bytes

Versions: 69

Compression:

Stored size: 378 Bytes

Contents

defmodule RNATranscription do
  @doc """
  Transcribes a character list representing RNATranscription nucleotides to RNA

  ## Examples

  iex> RNATranscription.to_rna('ACTG')
  'UGAC'
  """
  def to_rna(dna) do
    Enum.map(dna, &transcribe(&1))
  end

  defp transcribe(?C), do: ?G
  defp transcribe(?G), do: ?C
  defp transcribe(?A), do: ?U
  defp transcribe(?T), do: ?A
end

Version data entries

69 entries across 69 versions & 1 rubygems

Version Path
trackler-2.2.1.159 tracks/elixir/exercises/rna-transcription/example.exs
trackler-2.2.1.158 tracks/elixir/exercises/rna-transcription/example.exs
trackler-2.2.1.157 tracks/elixir/exercises/rna-transcription/example.exs
trackler-2.2.1.156 tracks/elixir/exercises/rna-transcription/example.exs
trackler-2.2.1.155 tracks/elixir/exercises/rna-transcription/example.exs
trackler-2.2.1.154 tracks/elixir/exercises/rna-transcription/example.exs
trackler-2.2.1.153 tracks/elixir/exercises/rna-transcription/example.exs
trackler-2.2.1.152 tracks/elixir/exercises/rna-transcription/example.exs
trackler-2.2.1.151 tracks/elixir/exercises/rna-transcription/example.exs
trackler-2.2.1.150 tracks/elixir/exercises/rna-transcription/example.exs
trackler-2.2.1.149 tracks/elixir/exercises/rna-transcription/example.exs
trackler-2.2.1.148 tracks/elixir/exercises/rna-transcription/example.exs
trackler-2.2.1.147 tracks/elixir/exercises/rna-transcription/example.exs
trackler-2.2.1.146 tracks/elixir/exercises/rna-transcription/example.exs
trackler-2.2.1.145 tracks/elixir/exercises/rna-transcription/example.exs
trackler-2.2.1.144 tracks/elixir/exercises/rna-transcription/example.exs
trackler-2.2.1.143 tracks/elixir/exercises/rna-transcription/example.exs
trackler-2.2.1.142 tracks/elixir/exercises/rna-transcription/example.exs
trackler-2.2.1.141 tracks/elixir/exercises/rna-transcription/example.exs
trackler-2.2.1.140 tracks/elixir/exercises/rna-transcription/example.exs