Sha256: 2bd55ac2f10806640e7662e373ad1737eededbbc6666139e012fd02c1cf223a8

Contents?: true

Size: 358 Bytes

Versions: 41

Compression:

Stored size: 358 Bytes

Contents

import
  math, tables

let
  times = {
    "Earth": 31558149.76,
    "Mercury": 7600530.24,
    "Venus": 19413907.2,
    "Mars": 59354294.4,
    "Jupiter": 374335776.0,
    "Saturn": 929596608.0,
    "Uranus": 2661041808.0,
    "Neptune": 5200418592.0
  }.toTable

proc age*(planet: string, seconds: int64): float =
  round(seconds.float / times[planet], 2)

Version data entries

41 entries across 41 versions & 1 rubygems

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