Content deleted Content added
make the CSS unnecessary, to help the demo |
No edit summary |
||
Line 1:
local p = {
piecename = {p = 'Pawn', r = 'Rook', n = 'Knight', b = 'Bishop', q = 'Queen', k = 'King'},
colornames = { l = 'White', d = 'Black' }
}
p.f = function(frame)
Line 8 ⟶ 11:
end
function
local colorname = p.colornames[pieceColor]
local alt = colorname .. ' ' .. p.piecename[piece]
return string.format('<div style="position:absolute;top:%dpx;left:%dpx;">%s</div>\n', coord(row), coord(file), img)
▲ local pieceColor = colBool(piece == string.upper(piece))
▲ return string.format('[[File:Chess %s%st45.svg|%dx%dpx|link=]]', string.lower(piece), pieceColor, size, size)
end
Line 22 ⟶ 24:
local result = ''
for piece in string.gmatch(s, "%\w") do
if string.match(piece, "%\d") then
file = file + piece
else
result = result ..
end
end
|