22 lines
465 B
Lua
22 lines
465 B
Lua
return function(query)
|
|
results_table = {}
|
|
for i=1, #words do
|
|
local exit = true
|
|
for j=1, #words[i]-1 do
|
|
if string.find(words[i][j], query) then
|
|
exit = false
|
|
break
|
|
end
|
|
end
|
|
if not exit then
|
|
local word = {i,words[i]}
|
|
table.insert(results_table,word)
|
|
end
|
|
end
|
|
if #results_table ~= 0 then
|
|
results_table = adjustTableSizes(results_table)
|
|
printOutputTable(results_table)
|
|
else
|
|
print("no words found for <" .. query .. ">")
|
|
end
|
|
end |