[pmwiki-users] Questions about chess.php

Christian Bartolomaeus bartolin at gmx.de
Sat Dec 24 11:00:27 CST 2005


Hi Patrick,

since you wrote that wonderful recipe "chess.php" about one month ago
I looked forward to find some time to have a closer look at that
script. Not that I did understand all of it right now, but there
appeared three questions -- or maybe feature requests.

====
#1
I would suggest to insert the following line in 
chess.php (above line 184):

  table.chesstable td.square0 { background-color: #ffffff; }

Otherwise the white squares have the background color, which hasn't to
be white. (I use some gray as the default background color and the
chessboard looks strange with gray squares.)

====
#2
Is it possible to add a title like "White to move" or "position after
3. Nf3" directly below a chessboard, generated using the
(:chessboard:) directive? I think there are ways to do that manually,
but it would be nice if those title could somehow remain stuck to the
chessboard, however this is aligned or styled. Maybe there is a way to
do that with (:div:) directives? I tried 

  (:div align=center:)(:chessboard:)Title goes here(:divend:)

which is okay for align=center and align=left but looks murky for
align=right.

OTOH one can do

  Chessboard:{$FEN}&t=.gif | your_title_goes_here

instead of

  (:chessboard title="your_title_goes_here":) or something like that

so this question is not that important ...

====
#3
Analysing chess games, it is -- as you surely know -- common to give
variations like:

  1. e4 d6 2. d4 Nf6 3. Nc3 g6 4. f4 Bg7 5. Nf3 c5 6. Bb5+ Bd7 
  7. e5 Ng4 8. e6 fxe6

    Another variation is 8. ... Bxb5 9. exf7+ Kd7 10. Nxb5 Qa5+ 
    11. Nc3 cxd4 12. Nxd4 Bxd4 13. Qxd4 with a promising position for
    white (D)

  9. Ng5 (D)

Unfortunately it isn't possible to just copy such an analysis into
PmWiki and replace (D) with (:chessboard:), since the 8th move of
black will not be restored to the "main variation" (8. ... fxe6), so
that the second board will be displayed the wrong way.

Do you think it is possible to alter chess.php in a way that it takes
care of such situations? I guess, one has to mark each "branch" of a
new variation, so that PGNMove() can see to which position in the game
it should return.

One easy way around the problem would be to insert the last move
before the start of a new variation as a comment like in the following
example:

  !!!The Austrian Attack
  
  1. e4 d6 2. d4 Nf6 3. Nc3 g6 4. f4 Bg7 5. Nf3 c5 6. Bb5+ Bd7 
  7. e5 Ng4 8. e6 fxe6

  --> [-Another variation is 8. ... Bxb5 9. exf7+ Kd7 10. Nxb5 Qa5+ 11. Nc3 cxd4 12. Nxd4 Bxd4 13. Qxd4 with a promising position for white-]

  (:chessboard width=200 align=center:)

  %comment%8. ... fxe6%% 9. Ng5
  
  (:div align=center:)
  (:chessboard:)
  position after 9. Ng5
  (:divend:)

====

I wish you and everyone on the list a merry Christmas

Christian
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
Url : /pipermail/pmwiki-users/attachments/20051224/7061653d/attachment.bin 


More information about the pmwiki-users mailing list