Sha256: d488e56c0ec178da26fa2a08394afccd32d230d0f86e92500ff3e3762f5843c5

Contents?: true

Size: 767 Bytes

Versions: 39

Compression:

Stored size: 767 Bytes

Contents

import Darwin

struct SpaceAge {
    var seconds: Float = 0

    var onMercury: Float { return round((seconds / 7_600_530.24) * 100) / 100 }
    var onVenus: Float { return round((seconds / 19_413_907.2) * 100) / 100 }
    var onEarth: Float { return round((seconds / 31_558_149.76) * 100) / 100 }
    var onMars: Float { return round((seconds / 59_354_294.4) * 100) / 100 }
    var onJupiter: Float { return round((seconds / 374_335_776.0) * 100) / 100 }
    var onSaturn: Float { return round((seconds / 929_596_608.0) * 100) / 100 }
    var onUranus: Float { return round((seconds / 2_661_041_808.0) * 100) / 100 }
    var onNeptune: Float { return round((seconds / 5_200_418_592.0) * 100) / 100 }

    init(_ input: Float) {
        self.seconds = input
    }

}

Version data entries

39 entries across 39 versions & 1 rubygems

Version Path
trackler-2.0.6.15 tracks/swift/exercises/space-age/SpaceAgeExample.swift
trackler-2.0.6.14 tracks/swift/exercises/space-age/SpaceAgeExample.swift
trackler-2.0.6.13 tracks/swift/exercises/space-age/SpaceAgeExample.swift
trackler-2.0.6.12 tracks/swift/exercises/space-age/SpaceAgeExample.swift
trackler-2.0.6.11 tracks/swift/exercises/space-age/SpaceAgeExample.swift
trackler-2.0.6.10 tracks/swift/exercises/space-age/SpaceAgeExample.swift
trackler-2.0.6.9 tracks/swift/exercises/space-age/SpaceAgeExample.swift
trackler-2.0.6.8 tracks/swift/exercises/space-age/SpaceAgeExample.swift
trackler-2.0.6.7 tracks/swift/exercises/space-age/SpaceAgeExample.swift
trackler-2.0.6.6 tracks/swift/exercises/space-age/SpaceAgeExample.swift
trackler-2.0.6.5 tracks/swift/exercises/space-age/SpaceAgeExample.swift
trackler-2.0.6.4 tracks/swift/exercises/space-age/SpaceAgeExample.swift
trackler-2.0.6.3 tracks/swift/exercises/space-age/SpaceAgeExample.swift
trackler-2.0.6.2 tracks/swift/exercises/space-age/SpaceAgeExample.swift
trackler-2.0.6.1 tracks/swift/exercises/space-age/SpaceAgeExample.swift
trackler-2.0.6.0 tracks/swift/exercises/space-age/SpaceAgeExample.swift
trackler-2.0.5.18 tracks/swift/exercises/space-age/SpaceAgeExample.swift
trackler-2.0.5.17 tracks/swift/exercises/space-age/SpaceAgeExample.swift
trackler-2.0.5.16 tracks/swift/exercises/space-age/SpaceAgeExample.swift
trackler-2.0.5.15 tracks/swift/exercises/space-age/SpaceAgeExample.swift