Word wheel: Difference between revisions

m
→‎No metatables, simple: more concise loop through characters of string
(Added a simple Lua implementation that does not involve metatables)
m (→‎No metatables, simple: more concise loop through characters of string)
 
Line 2,251:
local word = line:lower()
if word:find(middle) and #word >= 3 then
for iwheel_char =in 1 , #wheel:gmatch('.') do
local wheel_char = wheel:sub(i, i)
word = word:gsub(wheel_char, '', 1)
end -- for
Line 2,261 ⟶ 2,260:
</syntaxhighlight>
 
====Shell command====
 
<pre>$ < unixdict.txt lua ./word-wheel.lua</pre>
{{out}}
31

edits