Module:Sandbox/AnataBakka

local p = {} local lib      = require('Module:Feature')

function p.get(frame) local args; if frame.args == nil then args = lib.arguments(frame) else args = lib.arguments(frame.args) end x=1 val=string.gsub(string.gsub(string.gsub(string.gsub(string.gsub(string.gsub(args[1]," ",""),"/"," /"),"*"," *"),"+"," +"),"-"," -"),"x",x) val=math(val) return val end function math(val) local i=1 local j=1 local a,b local switcher while i>0 do       while j>0 do            if string.find(val,"/")~=nil then a=mw.text.split(val,"/") b=mw.text.split(a[1]," ") switcher=b[1] switcher2=a[2] switcher3=switcher/switcher2 val=string.gsub(val,switcher.." /"..switcher2,switcher3) break end if string.find(val,"*")~=nil then a=mw.text.split(val,"*") b=mw.text.split(a[1]," ") switcher=b[1] switcher2=a[2] switcher3=switcher*switcher2 val=string.gsub(val,switcher.." *"..switcher2,switcher3) break end if string.find(val,"-")~=nil then a=mw.text.split(val,"-") b=mw.text.split(a[1]," ") switcher=b[1] switcher2=a[2] switcher3=switcher-switcher2 val=string.gsub(val,switcher.." -"..switcher2,switcher3) break end if string.find(val,"+")~=nil then a=mw.text.split(val,"+") b=mw.text.split(a[1]," ") switcher=b[1] switcher2=a[2] switcher3=switcher+switcher2 val=string.gsub(val,switcher.." +"..switcher2,switcher3) break end i=0 break end end return val end return p