Jump to content

Template talk:Chess diagram-fen

Page contents not supported in other languages.
From Wikipedia, the free encyclopedia

I tested this. If the user doesn't make the change to the CSS file, it displays an empty board and then the pieces below it in a column. I edited the CSS file, and it displays properly, but we can't expect the user to have to do that. Bubba73 You talkin' to me? 04:12, 22 February 2013 (UTC)[reply]

of course. the idea is either to add these 2 CSS lines to the global css (Mediawiki:common.css), or else, to change the LUA script a little bit and make the CSS unnecessary. i will go now and do the 2nd thing, just so we can move the discussion forward, but eventually i would rather add those 2 lines to the CSS, because it will make many pages that much lighter, at the cost of minuscule addition to the CSS (which is pretty large as it is, and which already contains quite a lot of stuff that's there to support other specific templates, so why not this one?)
peace - קיפודנחש (aka kipod) (talk) 05:15, 22 February 2013 (UTC)[reply]
so i changed the script such that the CSS lines are not needed. i still think that if we are to actually use this template in articles (it needs some tidying: separate the documentation, add categories, etc), it would be good to add those lines to common.css and remove the extra "style". peace - קיפודנחש (aka kipod) (talk) 16:01, 22 February 2013 (UTC)[reply]
If the user doesn't have to do anything special, then I will like it.
There are things that are used in diagrams that are not a part of FEN: black and white dots, crosses, and numbers up to 9, see:

from corresponding squares:

Rösch-Mast 1995
abcdefgh
8
f5 black pawn
e4 black king
d3 one
f3 one
h3 black pawn
d2 two
e2 white king
f2 two
h2 white pawn
d1 three
f1 three
8
77
66
55
44
33
22
11
abcdefgh
White to move, but drawn with either side to move

From bishop and knight checkmate:

abcdefgh
8
d5 white circle
e5 white circle
f5 white circle
g5 black king
e4 white bishop
f4 white circle
d3 white knight
e3 white king
f3 white circle
8
77
66
55
44
33
22
11
abcdefgh
After 5.Be4, White has a wall.
abcdefgh
8
d8 black cross
c7 white bishop
d7 black cross
d6 black cross
e6 black cross
c5 white knight
e5 black cross
e4 black cross
f4 black cross
g4 black king
f3 black cross
g3 black cross
h3 black cross
g2 white king
8
77
66
55
44
33
22
11
abcdefgh
First net
abcdefgh
8
d8 white king
e8 black bishop
a7 black circle
e7 black circle
b6 black knight
d6 black king
8
77
66
55
44
33
22
11
abcdefgh
Black to move, draw! Note that the position would also be drawn if the knight were at a7 or e7 (marked with dots).

But there aren't very many diagrams that use these things, so they can remain the old way. Bubba73 You talkin' to me? 17:20, 22 February 2013 (UTC)[reply]

for number/digits display, i cannot think of a sane way to make this happen: with FEN, digits are used to denote empty squares. however, it would be very easy to add support for X and O: the LUA does not discriminate, and treat all the letters the same way, so by having a pair of images called, say, "Chess xlt45.svn" and "Chess xdt45.svn", the lua code will happily show them, by using "X" and "x" as part of the FEN string. similarly, any "fantasy chess" piece can be used, as long as the corresponding images for the white (uppercase) and black (lowercase) exist. you can try it yourself right now: for instance, using "g" or "G" will display upside-down black or white queen.
also, currently, the module assumes an 8x8 board, but it will be very easy to teach it to actually count rows and columns by analyzing the FEN string, and display different size boards.
this started as an experiment. if we want to actually use it, i would like to discuss which of these possible enhancements actually makes sense and is desirable
peace - קיפודנחש (aka kipod) (talk) 20:23, 22 February 2013 (UTC)[reply]
Yes, the digits would interfere with FEN. But there are only a few of them, so just leave them as they are. There aren't very many diagrams that use dots or x either, so those could be left out.
Now, once this is done, how to make the transition? It would be nice if it could be done with AWB, but I don't know how to do that. However, I wrote a Windows program where the user makes a position graphically and it generates the text for the diagram. That could also generate them in the FEN format. Also, I could write a Windows program so you could edit the page, copy the contents to the clipboard, click a button on my program, and it would replace the contents of the clipboard with the article with the diagrams in the new format. You could paste that back into the article and save it. Bubba73 You talkin' to me? 20:55, 22 February 2013 (UTC)[reply]
first, i think some testing is in order. i would like very much to hear from people using different browsers (including old IE and mobile devices) that they can view it with no problem. second, we need to verify that all the required functionality is there: e.g., "tleft" and "tright", and maybe some other cute things the current template support that are missing.
as to transition - not sure this is necessary: maybe coexistence is good enough. i am pretty sure most dedicated chess editors will be happy with the ability to create chessboard by using the ubiquitous FEN format, instead of the existing "ASCII art", but this does not necessarily mean that the current template should be completely eliminated.
i absolutely agree that some tools that squirt out the new template will be nice. on hewiki, we have a "pgn viewer" tool that can spit out the hebrew version of "chess diagram" template for any state of the game. once "they" will enable lua on hewiki, and once i backport this template to hewiki, i'll teach the pgn viewer to squirt out this template for any specific state, and even for a full game. (if yu want to see the pgn viewer, it's in he:Template:pgn)
peace - קיפודנחש (aka kipod) (talk) 22:42, 22 February 2013 (UTC)[reply]

minor point

[edit]

This is a minor thing, but there is too much space between the file labels and the board and not enough space between the rank labels and the board. Bubba73 You talkin' to me? 05:16, 29 April 2013 (UTC)[reply]

The labels are also misaligned. The e-file and f-file labels are not centered in their columns, and all of the rank labels except 1 are above center of their rows. Quale (talk) 16:26, 3 May 2013 (UTC)[reply]

Source code

[edit]

Sorry, probably dumb question, but where is the code for this? I see the code for chessboard, but not for chess diagram-fen. Peaux (talk) 05:32, 15 March 2023 (UTC)[reply]

see Special:Diff/554459917. the original name of Module:Chessboard was Module:Chess from fen.
the module was renamed and gained a lot of new functionality, but the original one, "chess from fen" remained intact.
peace. קיפודנחש (aka kipod) (talk) 20:37, 16 March 2023 (UTC)[reply]