Modul:Luafunktionstest

Aus SchnuppTrupp
Wechseln zu: Navigation, Suche

Die Dokumentation für dieses Modul kann unter Modul:Luafunktionstest/Doku erstellt werden

-- For unit tests, see [[Module:Bananas/testcases]]
local p = {}

function p.arithmetic()
    local a 
    local b 
    local result
 
    result = ';Arithmetic\n'
    result = result .. ':a is ' .. a .. '\n'
    result = result .. ':b is ' .. b .. '\n'
    result = result .. ':a + b is ' .. a + b .. '\n'
    result = result .. ':a - b is ' .. a - b .. '\n'
    result = result .. ':a * b is ' .. a * b .. '\n'
    result = result .. ':a / b is ' .. a / b .. '\n'
    result = result .. ':a % b is ' .. a % b .. '\n'
    result = result .. ':a ^ b is ' .. a ^ b .. '\n'
    result = result .. ':-a is ' .. -a .. '\n'
 
    return result
end