Difference between revisions of "Module:Sandbox"

From blackwiki
Jump to navigation Jump to search
blackwiki>Ohm100
blackwiki>Ohm100
Line 3: Line 3:
 
local p = {} -- p stands for package
 
local p = {} -- p stands for package
 
p.temperature = function(frame)
 
p.temperature = function(frame)
 +
 
cel = frame.args.celsius
 
cel = frame.args.celsius
fah = 9*cel/5+32
+
if(cel>9)
return ""..cel.. " degrees Celsius is "..fah.." degrees Fahrenheit".. ".<br>"
+
then
 +
msg=msg.."It is Warm"
 +
else
 +
msg=msg.."It is cold"
 +
 +
 +
 
 
end
 
end
 
return p
 
return p
 +
end return msg

Revision as of 15:38, 18 December 2017

Scribunto Testing Area

This is not an actual Lua module. It exists to provide a convenient pseudo-namespace for code testing, hopefully preventing the main Module: namespace from becoming littered with experiments, as Lua modules cannot exist as subpages in the User: namespace.

Please name your experimental modules in the following format to help keep things tidy:

Module:Sandbox/Your User Name/Module name

You can use Special:PrefixIndex/Module:Sandbox to list modules in this area.



--ohmoma100
-- [Lua task #3]  Create your own Lua module on English Wikipedia
local p = {} -- p stands for package
p.temperature = function(frame)
	
	cel = frame.args.celsius
	if(cel>9)
	then 
	msg=msg.."It is Warm"
	else
		msg=msg.."It is cold"
	
	

end
return p
end return msg