Sha256: 0dbeb0204a1bdabb54a5874b84287f8028e48af7db119604f07ed45c07ea5b88

Contents?: true

Size: 508 Bytes

Versions: 69

Compression:

Stored size: 508 Bytes

Contents

defmodule SpaceAge do
  def age_on(:earth, seconds), do: seconds / 31_557_600.0
  def age_on(planet, seconds), do: age_on(:earth, seconds) / planet_rel_years(planet)

  defp planet_rel_years(:mercury), do: 0.2408467
  defp planet_rel_years(:venus), do: 0.61519726
  defp planet_rel_years(:mars), do: 1.8808158
  defp planet_rel_years(:jupiter), do: 11.862615
  defp planet_rel_years(:saturn), do: 29.447498
  defp planet_rel_years(:uranus), do: 84.016846
  defp planet_rel_years(:neptune), do: 164.79132
end

Version data entries

69 entries across 69 versions & 1 rubygems

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