Modul:Stranica za vježbanje
Pune upute o pisanju Lua koda dostupne su na mw:Extension:Scribunto/Lua_reference_manual#Lua_language (engl.)
Modul ispisuje:
Script error: The function "vjezba" does not exist.
local p = {}
function p.LR(frame)
local targs = frame:getParent().args
local margs = frame.args
mw.log(targs['c'], margs['LR'])
local Lm = string.match(targs['c'], "(%d+[.,]?%d*) +%d+")
local Rm = string.match(targs['c'], "%d+ +(%d+[.,]?%d*)")
mw.log(Lm, Rm)
if Lm then
if margs['LR'] == "L" then
return Lm
else
return Rm
end
end
end
return p