your-own-drum/text.lua

17 lines
370 B
Lua
Raw Normal View History

2023-01-13 18:28:58 +00:00
--Load poems.
local love = love
local txt = {}
local info = love.filesystem.getInfo( "text" )
for _, filename in ipairs(love.filesystem.getDirectoryItems( "text" )) do
local s = love.filesystem.read( "text/"..filename )
local t = {}
local i = 1
for w in s:gmatch( "%a+") do
t[i] = w
i = i + 1
end
txt[filename:gsub( ".txt", "" )] = t
end
return txt