ForeverDev

Untitled

Sep 27th, 2014
190
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.55 KB | None | 0 0
  1. --IN MY LANGUAGE
  2.  
  3. scope containsFalse -> function(array)
  4.     for (value in array) :
  5.         if (!value) :
  6.             give(false)
  7.         <-
  8.     <-
  9.     give(true)
  10. <-
  11.    
  12. scope arrayOne, arrayTwo -> {true, true}, {false, true}
  13.  
  14. output(containsFalse(arrayOne))
  15. output(containsFalse(arrayTwo))
  16.  
  17.  
  18.  
  19. --IN LUA
  20.  
  21.  
  22. local containsFalse = function(array)
  23.     for _, value in pairs(array) do
  24.         if not value then
  25.             return false
  26.         end
  27.     end
  28.     return true
  29. end
  30.    
  31. local arrayOne, arrayTwo = {true, true}, {false, true}
  32.  
  33. print(containsFalse(arrayOne))
  34. print(containsFalse(arrayTwo))
Advertisement
Add Comment
Please, Sign In to add comment