Module:Chessboard/Eurojanggi Explained

local p =

function p.dims return 10, 9end

function p.letters return end

function p.image_board(size) return string.format('', 9 * 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

'kl' then fn = 'Red_King_(Western)' elseif pc

'kd' then fn = 'Green_King_(Western)' elseif pc

'gl' then fn = 'Red_Guard_(Western)' elseif pc

'gd' then fn = 'Green_Guard_(Western)' elseif pc

'el' then fn = 'Red_Elephant_(Western)' elseif pc

'ed' then fn = 'Green_Elephant_(Western)' elseif pc

'hl' then fn = 'Red_Horse_(Western)' elseif pc

'hd' then fn = 'Green_Horse_(Western)' elseif pc

'rl' then fn = 'Red_Chariot_(Western)' elseif pc

'rd' then fn = 'Green_Chariot_(Western)' elseif pc

'cl' then fn = 'Red_Cannon_(Western)' elseif pc

'cd' then fn = 'Green_Cannon_(Western)' elseif pc

'pl' then fn = 'Red_Soldier_(Western)' elseif pc

'pd' then fn = 'Green_Soldier_(Western)' end

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

end

return p