alestane icon

Dictionary loader (resume)

alestane | PRO | 01/17/14 03:54:05 PM UTC | 0 ⭐ | 332 👁️ | Never ⏰ | []
Lua |

380 B

|

None

|

0 👍

/

0 👎

local path = system.pathForFile("wordlist.txt",system.ResourceDirectory)
 
local function dictionary(path, trigger)
    local dictTable = {}
    coroutine.yield(dictTable)
    for line in io.lines(path) do
        dictTable[line] = true
        print(tostring(line))
    end
    timer.cancel(trigger)
end
 
local loader = coroutine.wrap(dictionary)
 
return loader(path, timer.performWithDelay(1, loader, 0))

Comments