The Chess Variant Pages

Check out Hectochess, our featured variant for November, 2023.

Enter Your Reply

The Comment You're Replying To
🕸Fergus Duniho wrote on Sun, Nov 19 04:55 PM UTC in reply to H. G. Muller from 09:29 AM:

Well, the XBoard set has b.svg for all pieces, and Magnetic and Motif has b.svg for the orthodox pieces.

When I made my original Magnetic and Motif pieces, I used only the white pieces from the fonts, and I colored them differently. These solid black pieces made from the solid black pieces in the font are not what I originally intended. So, the showpiece.php script should be able to avoid using them.

As it is, showpiece.php would never allow you to use the black XBoard pieces, which seems a pity.

To accommodate their use, I have added some new parameters and some new conditions on whether a b*.svg gets renamed to a w*.svg piece. The two new parameters are originalblack and originalwhite. These are variables that sometimes get assigned in a set file. They are like originalcolor, but for only one side each. When originalcolor has not been set, and one of these has, the value of the appropriate one will be assigned to originalcolor. The new conditions for changing the file name are that originalblack is an empty string, and black is not. If originalblack is not empty, then it's expected that there are black pieces available for recoloring, and if black is empty, then it's expected that there are black pieces that will appear in their original color. Also, this change only happens when image has been passed a value. If someone indicates a piece with values for set and piece, it simply uses the file named in the set file. So, this doesn't interfere with the use of sets.

I have demonstrated this by adding an Xboard set to the Interactive Diagram on the Chess page. However, there is one issue with your Xboard pieces. They have fixed height and width values, and to resize properly to the dimensions of the container, these should be set to 100% instead. I could do this with sed like I did with Bob Greenwade's pieces, or I could leave it to you.

To accommodate the use of Game Courier sets with Interactive Diagrams, I have added code to modify the value of piece if the provided value is not already a key of the $pieces array. If it begins with w or W, it loses the first letter and is set to uppercase. If it begins with b or B, it loses the first letter and is set to lowercase. In each case, it gets the extension chopped off.

Here's an example of a Chess Interactive Diagram using Game Courier sets to identify piece images.

When JavaScript is running, this static image will be replaced with an Interactive Diagram

promoChoice=NBRQ symmetry=mirror satellite=wizard files=8 ranks=8 graphicsDir=/play/pbm/showpiece.php?set=magnetic%26piece= whitePrefix=W blackPrefix=B lightShade=#EEEECC darkShade=#226822 rimColor=#FFFFF0 coordColor=#000000 squareSize=50 firstRank=1 borders=1 useMarkers=1 Pawn:P:ifmnDfmWfceF:P:a2,b2,c2,d2,e2,f2,g2,h2,,a7,b7,c7,d7,e7,f7,g7,h7 Knight:N:N:N:b1,g1,,b8,g8 Bishop:B:B:B:c1,f1,,c8,f8 Rook:R:R:R:a1,h1,,a8,h8 Queen:Q:Q:Q:d1,,d8 King:K:KisO2:K:e1,,e8 royal=6 stalemate=draw enableAI=2

Edit Form

Comment on the page Home page of The Chess Variant Pages

Quick Markdown Guide

By default, new comments may be entered as Markdown, simple markup syntax designed to be readable and not look like markup. Comments stored as Markdown will be converted to HTML by Parsedown before displaying them. This follows the Github Flavored Markdown Spec with support for Markdown Extra. For a good overview of Markdown in general, check out the Markdown Guide. Here is a quick comparison of some commonly used Markdown with the rendered result:

Top level header: <H1>

Block quote

Second paragraph in block quote

First Paragraph of response. Italics, bold, and bold italics.

Second Paragraph after blank line. Here is some HTML code mixed in with the Markdown, and here is the same <U>HTML code</U> enclosed by backticks.

Secondary Header: <H2>

  • Unordered list item
  • Second unordered list item
  • New unordered list
    • Nested list item

Third Level header <H3>

  1. An ordered list item.
  2. A second ordered list item with the same number.
  3. A third ordered list item.
Here is some preformatted text.
  This line begins with some indentation.
    This begins with even more indentation.
And this line has no indentation.

Alt text for a graphic image

A definition list
A list of terms, each with one or more definitions following it.
An HTML construct using the tags <DL>, <DT> and <DD>.
A term
Its definition after a colon.
A second definition.
A third definition.
Another term following a blank line
The definition of that term.