Open main menu
Home
Random
Donate
Recent changes
Special pages
Community portal
Preferences
About Stockhub
Disclaimers
Search
User menu
Talk
Contributions
Create account
Log in
Editing
Module:Chessboard/Dou Shou Qi
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
local p = {} function p.dims() return 9, 7 end function p.letters() return {'A', 'B', 'C', 'E', 'E', 'F', 'G', 'H', 'I'} end function p.image_board(size) return string.format( '<div style="width: %dpx; height: %dpx; overflow: hidden;">' .. '<div style="position: relative; top: -%dpx; left: -%dpx; width: %dpx">' .. '<div class="noresize">[[File:DouShouQi.svg|%dx%dpx|link=]]</div></div></div>', 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 = { l = { m = 'white', f = 'white' }, d = { m = 'black', f = 'black' } } local piecenames = { e = { name = 'elephant', gender = 'm' }, l = { name = 'lion', gender = 'm' }, t = { name = 'tiger', gender = 'm' }, p = { name = 'leopard', gender = 'm' }, w = { name = 'wolf', gender = 'm' }, d = { name = 'dog', gender = 'm' }, c = { name = 'cat', gender = 'm' }, m = { name = 'mouse', gender = 'm' } } 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 arroe', 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', } local colchar = {'A','B','C','D','E','F','G','H','I'} 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( '[[File:%s.svg|%dx%dpx|alt=%s|%s|top]]', fn, size, size, alt, alt ) end return p
Summary:
Please note that all contributions to Stockhub may be edited, altered, or removed by other contributors. If you do not want your writing to be edited mercilessly, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource (see
Stockhub:Copyrights
for details).
Do not submit copyrighted work without permission!
Cancel
Editing help
(opens in new window)
Templates used on this page:
Template:Chess diagram
(
edit
)
Template:Documentation subpage
(
edit
)
Module:Chessboard/Dou Shou Qi/doc
(
edit
)