Content deleted Content added
No edit summary |
No edit summary |
||
Line 9:
local reverse = string.lower(frame.args['reverse'] or '') == "true"
function rownumFromRow(row)
return reverse and (row + 1) or (8 - row)
end
function filecharFromFile(file)
file = reverse and (8 - file) or (file + 1)
return string.sub("abcdefgh", file, file)
end
function coord(ind)
return (reverse and (7 - ind) * size) or ind * size
Line 16 ⟶ 25:
local pieceColor = string.match(piece, '%u') and 'l' or 'd'
piece = string.lower(piece)
local
local img = string.format('[[File:Chess %s%st45.svg|%dx%dpx|alt=%s|%s]]', piece, pieceColor, size, size, alt, alt)
return string.format('<div style="position:absolute;z-index:3;top:%dpx;left:%dpx;">%s</div>\n', coord(row), coord(file), img)
|