jseely

utils

Nov 17th, 2012
91
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.29 KB | None | 0 0
  1. module(...)
  2.  
  3. function sum(array)
  4. local total = 0
  5. for i = 1, #array, 1 do
  6. total = total + array[i]
  7. end
  8. return total
  9. end
  10.  
  11. function equal(a, b)
  12. if #a ~= #b then
  13. return false
  14. end
  15. for i = 1, #a, 1 do
  16. if a[i] ~= b[i] then
  17. return false
  18. end
  19. end
  20. return true
  21. end
Advertisement
Add Comment
Please, Sign In to add comment