Sha256: fca1fb99dd014bc1cbf14b39bcb7ab16dc3e3a869ff4ba2c225cdc7fd92f1b23

Contents?: true

Size: 629 Bytes

Versions: 23

Compression:

Stored size: 629 Bytes

Contents

;redcode
;name Celsius
;strategy   cels = (fahr - 32) * 5 / 9

fahr    DAT #80             ; input temperature
cels    DAT #0              ; store result here
ftmp    DAT #0              ; save fahr-32 here
start   MOV fahr, ftmp      ; (1) subtract 32
        SUB #32, ftmp
mult    ADD ftmp, acc       ; (2) multiply by 5
        SUB #1, count
        JMN mult, count
div     SUB #9, acc         ; (3) divide by 9
        SLT #0, acc
        DAT #0              ; stop here when division done
        ADD #1, cels
        JMP div
acc     DAT #0              ; accumulator
count   DAT #5              ; counter
        end start

Version data entries

23 entries across 23 versions & 1 rubygems

Version Path
rubylabs-1.0.2 data/mars/test_celsius.txt
rubylabs-1.0.1 data/mars/test_celsius.txt
rubylabs-1.0.0 data/mars/test_celsius.txt
rubylabs-0.9.8 data/mars/test_celsius.txt
rubylabs-0.9.7 data/mars/test_celsius.txt
rubylabs-0.9.6 data/mars/test_celsius.txt
rubylabs-0.9.5 data/mars/test_celsius.txt
rubylabs-0.9.4 data/mars/test_celsius.txt
rubylabs-0.9.3 data/mars/test_celsius.txt
rubylabs-0.9.2 data/mars/test_celsius.txt
rubylabs-0.9.1 data/mars/test_celsius.txt
rubylabs-0.9.0 data/mars/test_celsius.txt
rubylabs-0.8.3 data/mars/test_celsius.txt
rubylabs-0.8.2 data/mars/test_celsius.txt
rubylabs-0.8.1 data/mars/test_celsius.txt
rubylabs-0.8.0 data/mars/test_celsius.txt
rubylabs-0.7.5 data/mars/test_celsius.txt
rubylabs-0.7.4 data/mars/test_celsius.txt
rubylabs-0.7.3 data/mars/test_celsius.txt
rubylabs-0.7.2 data/mars/test_celsius.txt