Content deleted Content added
No edit summary |
formatting |
||
Line 4:
function image_square( pc, row, col, size )
local colornames = { l = 'white', d = 'black' }
local piecenames = {
p = 'pawn',
r = 'rook',
n = 'knight',
b = 'bishop',
q = 'queen',
k = 'king',
a = 'archbishop',
c = 'chancelor',
z = 'champion',
w = 'wizard',
t = 'fool',
h = 'upside-down pawn',
m = 'upside-down rook',
s = 'upside-down knight',
f = 'upside-down king',
e = 'upside-down bishop',
g = 'upside-down queen',
}
local symnames = {
xx = 'black cross',
ox = 'white cross',
xo = 'black circle',
oo = 'white circle',
ul = 'up-left arrow',
ua = 'up arrow',
ur = 'up-right arrow',
la = 'left arrow',
ra = 'right arrow',
dl = 'down-left arrow',
da = 'down arrow',
dr = 'down-right arrow',
lr = 'left-right arrow',
ud = 'up-down arrow',
x0 = 'zero',
x1 = 'one',
x2 = 'two',
x3 = 'three',
x4 = 'four',
x5 = 'five',
x6 = 'six',
x7 = 'seven',
x8 = 'eight',
x9 = 'nine',
}
function colchar( col ) return ( "abcdefgh" ):sub( col, col ) end
local color = mw.ustring.gsub(pc,'^.*(%w)(%w).*$', '%2') or ''
|