summaryrefslogtreecommitdiff
path: root/test/cf-for.lua
diff options
context:
space:
mode:
authorLua Team <team@lua.org>2000-11-06 12:00:00 +0000
committerrepogen <>2000-11-06 12:00:00 +0000
commit8cb71cb5548e3138e5d4e4744f52c79d9fafb116 (patch)
tree25859eb162c67eafc46866e0ec3a9a7ebf93157a /test/cf-for.lua
parentb7610da5fed99f59ac73ae452da8839a0f2c1bda (diff)
downloadlua-github-4.0.tar.gz
Lua 4.04.0
Diffstat (limited to 'test/cf-for.lua')
-rw-r--r--test/cf-for.lua19
1 files changed, 19 insertions, 0 deletions
diff --git a/test/cf-for.lua b/test/cf-for.lua
new file mode 100644
index 00000000..1bd0ab27
--- /dev/null
+++ b/test/cf-for.lua
@@ -0,0 +1,19 @@
+-- temperature conversion table
+-- now using the new "for" statement
+
+-- celsius to farenheit
+
+for c0=-20,50-1,10 do
+ write("C ")
+ for c=c0,c0+10-1 do
+ write(format("%3.0f ",c))
+ end
+ write("\n")
+
+ write("F ")
+ for c=c0,c0+10-1 do
+ f=(9/5)*c+32
+ write(format("%3.0f ",f))
+ end
+ write("\n\n")
+end