Content deleted Content added
1-index arrays in Lua. Also comment more stuff |
Revert: Looks like align and header already work (???) |
||
(8 intermediate revisions by the same user not shown) | |||
Line 134:
for srow in string.gmatch("/" .. fen, "/%w+") do
srow = srow:gsub("/","") -- clean up row
-- Loop over all letters and numbers in the row
-- Since Lua regexes do not have the | operator, we have
Line 158 ⟶ 157:
if pstart == index then
piece = srow:sub(pstart, pstart)
-- l: White (light); d: Black (dark)▼
index = pstart + 1
▲ -- l: White (light); d: Black (dark)
local color = piece:match( '%u' ) and 'l' or 'd'
piece = piece:lower()
|