Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- require "pippo"
- a = 17
- b = 22
- a = "ciao"
- b = a .. " mondo"
- -- adder is a reference to a function
- adder = function(first, second)
- return first + second
- end
- function adder2(first, second)
- local boh = 50
- return first + second
- end
- print(adder(1, 2))
- foobar = {}
- foobar.dumbadder = adder2
- print(foobar.dumbadder(3, 4))
- print(pippo.multiplier(4, 5))
- arr = {"ciao", "foo"}
- for k,v in pairs(_G) do
- print(k, v)
- end
- print(math.sin( 50 ))
- mt = {}
- mt.__add = function(a, b)
- if type(a.key) == "string" then
- return a.key .. b.key3
- end
- return a.value + b.value
- end
- t1 = {key="foo", key2="bar", value=50}
- setmetatable(t1, mt)
- t2 = {key3="test", key4="test2", value=90}
- print(t1 + t2)
Add Comment
Please, Sign In to add comment