Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local function lookForWord( target )
- levelName = currentLevel..currentLevelName..".txt"
- local path = system.pathForFile(levelName, system.ResourceDirectory)
- local file = io.open(path)
- for line in file:lines() do
- for word in line:gmatch( "[^,]+" ) do
- if word == target then
- return true
- break
- else
- return false
- end
- end
- -- Close file
- io.close(file)
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment