Content deleted Content added
←Created page with '--this is a comment --task2 function FirstTry(frame) return "Hello World" end' |
No edit summary |
||
(11 intermediate revisions by the same user not shown) | |||
Line 1:
--this is a comment
--
p = {} -- empty table
function p.FirstTry(frame)▼
▲function FirstTry(frame)
return "Hello World"
end
--task2
p.Hi = function(frame)
anyName = frame.args.name or "Jimbo"
return "Hello from lua to my friend " .. anyName .. ".<br>" -- .. catanation
end
--task3
function p.temperature_one(frame)
cel = frame.args.celsius
fah = cel * 9 / 5 + 32
return fah
end
--task4
function p.temperature_two(frame)
cel = frame.args.celsius
fah = cel * 9 / 5 + 32
return "The temperature in Fahrenheit is " .. fah .. ".<br>"
end
--task5
function p.temperature_three(frame)
cel = frame.args.celsius2
fah = cel * 9 / 5 + 32
if cel > 10 then
msg = " it is warm."
else
msg = " it is not warm."
end -- "if" needs an "end" too
return "The temperature is " .. fah .. ", " .. msg
end
return p
|