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.159 tracks/nim/exercises/space-age/example.nim
trackler-2.2.1.158 tracks/nim/exercises/space-age/example.nim
trackler-2.2.1.157 tracks/nim/exercises/space-age/example.nim
trackler-2.2.1.156 tracks/nim/exercises/space-age/example.nim
trackler-2.2.1.155 tracks/nim/exercises/space-age/example.nim
trackler-2.2.1.154 tracks/nim/exercises/space-age/example.nim
trackler-2.2.1.153 tracks/nim/exercises/space-age/example.nim
trackler-2.2.1.152 tracks/nim/exercises/space-age/example.nim
trackler-2.2.1.151 tracks/nim/exercises/space-age/example.nim
trackler-2.2.1.150 tracks/nim/exercises/space-age/example.nim
trackler-2.2.1.149 tracks/nim/exercises/space-age/example.nim
trackler-2.2.1.148 tracks/nim/exercises/space-age/example.nim
trackler-2.2.1.147 tracks/nim/exercises/space-age/example.nim
trackler-2.2.1.146 tracks/nim/exercises/space-age/example.nim
trackler-2.2.1.145 tracks/nim/exercises/space-age/example.nim
trackler-2.2.1.144 tracks/nim/exercises/space-age/example.nim
trackler-2.2.1.143 tracks/nim/exercises/space-age/example.nim
trackler-2.2.1.142 tracks/nim/exercises/space-age/example.nim
trackler-2.2.1.141 tracks/nim/exercises/space-age/example.nim
trackler-2.2.1.140 tracks/nim/exercises/space-age/example.nim