Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function make_counter()
- local count = 0
- return function()
- count = count + 1
- return count
- end
- end
- c1 = make_counter()
- c2 = make_counter()
- print(c1())--print->1
- print(c1())--print->2
- print(c1())--print->3
- print(c2())--print->1
- print(c2())--print->2
- function() <some Lua code> end
- function CreateTable()
- return {}
- end
- tableA = CreateTable()
- tableB = CreateTable()
- if(tableA == tableB) then
- print("You will never see this")
- else
- print("Always printed")
- end
Add Comment
Please, Sign In to add comment