Module:Chessboard/Dou Shou Qi Explained

local p =

function p.dims return 9, 7end

function p.letters return end

function p.image_board(size) return string.format('

' .. '

' .. '

', 7*size + 1, 9*size + 1, (size - 1)/2, (size - 1)/2, 8*size, 8*size, 10*size)end

function p.image_square(pc, row, col, size) local colornames = local piecenames = local symnames = local colchar = local color = mw.ustring.gsub(pc, '^.*(%w)(%w).*$', '%2') or local piece = mw.ustring.gsub(pc, '^.*(%w)(%w).*$', '%1') or local alt = colchar[col] .. row .. ' '

if colornames[color] and piecenames[piece] then alt = alt .. colornames[color][piecenames[piece]['gender']] .. ' ' .. piecenames[piece]['name'] else alt = alt .. (symnames[piece .. color] or piece .. ' ' .. color) end

fn =

if pc

'el' then fn = 'Doushouqi-elephant' elseif pc

'ed' then fn = 'Doushouqi-elephant-inv' elseif pc

'll' then fn = 'Doushouqi-lion' elseif pc

'ld' then fn = 'Doushouqi-lion-inv' elseif pc

'tl' then fn = 'Doushouqi-tiger' elseif pc

'td' then fn = 'Doushouqi-tiger-inv' elseif pc

'pl' then fn = 'Doushouqi-leopard' elseif pc

'pd' then fn = 'Doushouqi-leopard-inv' elseif pc

'wl' then fn = 'Doushouqi-wolf' elseif pc

'wd' then fn = 'Doushouqi-wolf-inv' elseif pc

'dl' then fn = 'Doushouqi-dog' elseif pc

'dd' then fn = 'Doushouqi-dog-inv' elseif pc

'cl' then fn = 'Doushouqi-cat' elseif pc

'cd' then fn = 'Doushouqi-cat-inv' elseif pc

'ml' then fn = 'Doushouqi-rat' elseif pc

'md' then fn = 'Doushouqi-rat-inv' end

return string.format('', fn, size, size, alt, alt)

end

return p