Guest User

Untitled

a guest
Jan 25th, 2013
139
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.43 KB | None | 0 0
  1. local function lookForWord( target )
  2.  
  3. levelName = currentLevel..currentLevelName..".txt"
  4. local path = system.pathForFile(levelName, system.ResourceDirectory)
  5. local file = io.open(path)
  6.  
  7. for line in file:lines() do
  8. for word in line:gmatch( "[^,]+" ) do
  9. if word == target then
  10. return true
  11. break
  12. else
  13. return false
  14. end
  15. end
  16.  
  17. -- Close file
  18. io.close(file)
  19. end
  20.  
  21. end
Advertisement
Add Comment
Please, Sign In to add comment