diff options
author | Lua Team <team@lua.org> | 1996-05-14 12:00:00 +0000 |
---|---|---|
committer | repogen <> | 1996-05-14 12:00:00 +0000 |
commit | 721542976ebc89f2f8d17d19be7e4426570b69be (patch) | |
tree | 0c79a45c63aa89d6e4b8ac80931e46d74a72f8cb /test/cf.lua | |
parent | 71754d2f6423fb9b6e87658e58bafc5470d53f65 (diff) | |
download | lua-github-2.4.tar.gz |
Lua 2.42.4
Diffstat (limited to 'test/cf.lua')
-rw-r--r-- | test/cf.lua | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/test/cf.lua b/test/cf.lua new file mode 100644 index 00000000..038b5e75 --- /dev/null +++ b/test/cf.lua @@ -0,0 +1,27 @@ +-- temperature conversion table + +-- celsius to farenheit + +c0=-20 +while c0<50 do + + c1=c0+10 + write("C ") + c=c0 + while c<c1 do + write(format("%3.0f ",c)) + c=c+1 + end + write("\n") + + c=c0 + write("F ") + while c<c1 do + f=(9/5)*c+32 + write(format("%3.0f ",f)) + c=c+1 + end + write("\n\n") + + c0=c1 +end |