Open main menu
Home
Random
Donate
Recent changes
Special pages
Community portal
Preferences
About Stockhub
Disclaimers
Search
User menu
Talk
Contributions
Create account
Log in
Editing
Module:Sandbox/Luis150902
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
--[[This is a test created by Luis150902]] local test = {} local getArgs = require("Module:Arguments").getArgs local yesno = require("Module:Yesno") function test.f1(frame) local args = getArgs(frame) return mw.ustring.len(args["1"]) end function test.f2(frame) local args = getArgs(frame) local i = 0 for j in args do i = i + 1 end return i end function test.f3(frame) local args = getArgs(frame) local op = args["1"] if (op == nil) or (op == "{{{1}}}") or (op == "") then op = args["s"] if (op == nil) or (op == "{{{1}}}") or (op == "") then return 0 end end if (op == "+") then return test._f3_0(args) end if (op == "-") then return test._f3_1(args) end if (op == "*") then return test._f3_2(args) end if (op == "/") then return test._f3_3(args) end if (op == "%") then return test._f3_4(args) end if (op == "!") then return test._f3_5(args) end end function test._f3_0(args) local a = args["2"] if (a == nil) or (a == "{{{2}}}") or (a == "") then a = args["a"] if (a == nil) or (a == "{{{2}}}") or (a == "") then return 0 end end local b = args["3"] if (b == nil) or (b == "{{{3}}}") or (b == "") then a = args["b"] if (b == nil) or (b == "{{{3}}}") or (b == "") then return 0 end end return a + b end function test._f3_1(args) local a = args["2"] if (a == nil) or (a == "{{{2}}}") or (a == "") then a = args["a"] if (a == nil) or (a == "{{{2}}}") or (a == "") then return 0 end end local b = args["3"] if (b == nil) or (b == "{{{3}}}") or (b == "") then a = args["b"] if (b == nil) or (b == "{{{3}}}") or (b == "") then return 0 end end return a - b end function test._f3_2(args) local a = args["2"] if (a == nil) or (a == "{{{2}}}") or (a == "") then a = args["a"] if (a == nil) or (a == "{{{2}}}") or (a == "") then return 0 end end local b = args["3"] if (b == nil) or (b == "{{{3}}}") or (b == "") then a = args["b"] if (b == nil) or (b == "{{{3}}}") or (b == "") then return 0 end end return a * b end function test._f3_3(args) local a = args["2"] if (a == nil) or (a == "{{{2}}}") or (a == "") then a = args["a"] if (a == nil) or (a == "{{{2}}}") or (a == "") then return 0 end end local b = args["3"] if (b == nil) or (b == "{{{3}}}") or (b == "") then a = args["b"] if (b == nil) or (b == "{{{3}}}") or (b == "") then return 0 end end return a / b end function test._f3_4(args) local a = args["2"] if (a == nil) or (a == "{{{2}}}") or (a == "") then a = args["a"] if (a == nil) or (a == "{{{2}}}") or (a == "") then return 0 end end local b = args["3"] if (b == nil) or (b == "{{{3}}}") or (b == "") then a = args["b"] if (b == nil) or (b == "{{{3}}}") or (b == "") then return 0 end end return a % b end function test._f3_5(args) local a = args["2"] if (a == nil) or (a == "{{{2}}}") or (a == "") then a = args["a"] if (a == nil) or (a == "{{{2}}}") or (a == "") then return 0 end end local result = yesno(a) if result then return "false" else return "true" end end return test
Summary:
Please note that all contributions to Stockhub may be edited, altered, or removed by other contributors. If you do not want your writing to be edited mercilessly, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource (see
Stockhub:Copyrights
for details).
Do not submit copyrighted work without permission!
Cancel
Editing help
(opens in new window)
Template used on this page:
Module:Sandbox/Luis150902/doc
(
edit
)