Module:Sandbox/VitoSmo

-- (Vitosmo Google Code-in, Introduction to Lua in Wikipedia)

-- ________________ older code _________________________________

-- For unit tests, see Modul:VitoSmoCode/testniprimeri local p = {} --p stands for package

local i = {};

function p.helloAlt( frame ) return "Hello, world!" end

function p.zivjo( frame ) return "zivjo, svet!" end

function p.HelloArg( frame) return frame.args[1] end

function p.getTitle(fname)

return fname.args[1].getCurrentTitle

-- local pTitle = mw.title.getCurrentTitle

-- return pTitle:getContent end

--____________ end of older code __

-- Vitosmo Google Code-in, Task 2.

function p.hello( frame ) return "Hello, world!" end

-- Vitosmo Google Code-in, Task 3. function temperature(celsius) cel = frame.args.celsius fah = cel*9 / 5 + 32 return cel.."degrees Celsius is "..fah.." degrees Fahrenheit" end

return p