Guest User

Untitled

a guest
Jul 22nd, 2018
85
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.48 KB | None | 0 0
  1. function make_counter()
  2. local count = 0
  3. return function()
  4. count = count + 1
  5. return count
  6. end
  7. end
  8. c1 = make_counter()
  9. c2 = make_counter()
  10. print(c1())--print->1
  11. print(c1())--print->2
  12. print(c1())--print->3
  13.  
  14. print(c2())--print->1
  15. print(c2())--print->2
  16.  
  17. function() <some Lua code> end
  18.  
  19. function CreateTable()
  20. return {}
  21. end
  22.  
  23. tableA = CreateTable()
  24. tableB = CreateTable()
  25. if(tableA == tableB) then
  26. print("You will never see this")
  27. else
  28. print("Always printed")
  29. end
Add Comment
Please, Sign In to add comment