diff options
| author | Lua Team <team@lua.org> | 2003-04-11 12:00:00 +0000 |
|---|---|---|
| committer | repogen <> | 2003-04-11 12:00:00 +0000 |
| commit | f0e4e22f5c119865eb5a8d3844a40df2d5980b3b (patch) | |
| tree | c4df063a747e9c99f8aba1678588a030993780a9 /test/cf.lua | |
| parent | 1981b7c90eb09e956e969cda5c473be4560af573 (diff) | |
| download | lua-github-5.0.tar.gz | |
Lua 5.05.0
Diffstat (limited to 'test/cf.lua')
| -rw-r--r-- | test/cf.lua | 31 |
1 files changed, 10 insertions, 21 deletions
diff --git a/test/cf.lua b/test/cf.lua index 038b5e75..8cda54b9 100644 --- a/test/cf.lua +++ b/test/cf.lua @@ -1,27 +1,16 @@ --- temperature conversion table +-- temperature conversion table (celsius to farenheit) --- 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 +for c0=-20,50-1,10 do + io.write("C ") + for c=c0,c0+10-1 do + io.write(string.format("%3.0f ",c)) end - write("\n") + io.write("\n") - c=c0 - write("F ") - while c<c1 do + io.write("F ") + for c=c0,c0+10-1 do f=(9/5)*c+32 - write(format("%3.0f ",f)) - c=c+1 + io.write(string.format("%3.0f ",f)) end - write("\n\n") - - c0=c1 + io.write("\n\n") end |
