imported>The wub
No edit summary
 
(No difference)

Latest revision as of 12:12, 19 May 2013

Documentation for this module may be created at Module:Sandbox/The wub/Playground/doc

-- set up a table to be used as a module
local p = {}

-- now make a function in the module
p.helloworld = function(frame)
    name = frame.args.name or "unknown"
    return "Hello from Lua " .. name
end

p.euler1 = function(limit)
    total = 0
    for i = 1, limit do
        if (i%3==0 or i%5==0) then
            total = total + i 
        end
    end
    return total
end
        
    


-- need to return the module for use
return p