5_Gallon_Bucket

Thingy

Jan 30th, 2022
978
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.48 KB | None | 0 0
  1. local Utils = {}
  2.  
  3. function Utils.Matching:matchConstants(C1, C2)
  4.   local Count = 0
  5.   for _, v in next, C1 do
  6.     for _, k in next, C2 do
  7.       if v == k then
  8.         Count = Count + 1
  9.       end
  10.     end
  11.   end
  12.   return Count == #C2
  13. end
  14.  
  15. function Utils.Matching:matchIndexes(I1, I2)
  16.   local Count = 0
  17.   for i, _ in next, I1 do
  18.     for t, _ in next, I2 do
  19.       if i == t then
  20.         Count = Count + 1
  21.       end
  22.     end
  23.   end
  24.   return Count == #I2
  25. end
  26.  
  27. return Utils
Advertisement
Add Comment
Please, Sign In to add comment