FlagVM/flagpole/tests/tempconv.fp

22 lines
513 B
GLSL

$inc fvmstd.fp
proc main
"Source Fahrenheit or Celsius (F/C): " :puts
:getchar
:getchar drop # newline pmo
if dup 0x43 == dup 0x63 == bor then
"Source Temp: " :puts :getint
dup 9 i* 5 i/ 32 i+
swap :putint "*C == " :puts
:putint "*F" :puts :newline
return
endif
if dup 0x46 == dup 0x66 == bor then
"Source Temp: " :puts :getint
dup 32 i- 5 i* 9 i/
swap :putint "*F == " :puts
:putint "*C" :puts :newline
return
endif
"Invalid Unit" :puts :newline
endproc