How to post chess games

General discussion about computer chess...
pgn4web
Posts: 97
Joined: Mon Jun 14, 2010 10:26 pm

Re: How to post chess games

Post by pgn4web » Tue Feb 28, 2012 12:00 pm

Jeremy Bernstein wrote:OK. I know you don't like the coordinates and side-to-move indicators, but I think you're just being elitist about it :-) -- I predict that a user survey would indicate that 85% of pgn4web users would find them useful. Nevertheless, I'll do my part without the "patzer features" and drop a note when I'm ready.
I know, I'm a "fundamentalist" about the minimal amount of chess knowledge required to visit a website :-)
In reality, the design goal is to be minimalistic: the center of the attention should be the chessboard, anything else should be there only if necessary and only optionally. So buttons are the bare minimum (and can be shaded or removed), the dropdown is optional (and reverts back to a plain label after selecting the game) and no row/column around the board. Those row/column would also add complexity to the general setup, because in the general case I'd need to make them optional, and allow configuring colors/fonts and so on. Much simpler to leave the board as it should be (without coordinates) and leave it to the developer of each specific web page to add them if they whish, it's not that hard to do :)

Back to the variation code, a couple of comments to clean up your code after an high level look:
1) please dont hard code css styles for variants. Just enclose variants into a <span class="variant"> ... </span> tag in pgn4web.js, then I'll take care to fix the html/css files so that a proper color/font is defined and configured
2) there is a considerable amount of code to define and use random UUIDs, I guess to tag variants. Is the UUID format really needed? Would not it be much simpler to have a nextVariantId number (a global var), set to 1 at startup, used and incremented each time a new variantId is needed? I'd really like to avoid unnecessary chunks of code in the main pgn4web.js

I'm sure I'll have more comments as we go along, my goal is to fully undertand what's being added in order to be able to maintain it if needed...

User avatar
dand
Posts: 9
Joined: Sat Feb 25, 2012 11:56 pm

Re: How to post chess games

Post by dand » Tue Feb 28, 2012 12:54 pm

pgn4web wrote: ... and leave it to the developer of each specific web page to add them if they whish...
I can't agree more! 8-)

User avatar
dand
Posts: 9
Joined: Sat Feb 25, 2012 11:56 pm

Re: How to post chess games

Post by dand » Tue Feb 28, 2012 12:56 pm

pgn4web wrote:...my goal is to fully undertand what's being added in order to be able to maintain it if needed...
Yes... Maintanance is also very important for me as an end user. Thanks for taking this so seriously. :!:

pgn4web
Posts: 97
Joined: Mon Jun 14, 2010 10:26 pm

Re: How to post chess games

Post by pgn4web » Sat Mar 03, 2012 8:51 am

Jeremy Bernstein wrote:OK. I know you don't like the coordinates and side-to-move indicators, but I think you're just being elitist about it :-) -- I predict that a user survey would indicate that 85% of pgn4web users would find them useful. Nevertheless, I'll do my part without the "patzer features" and drop a note when I'm ready.
Hang on for a while longer.
Looking at your code, I got a idea that might work without too much effort, so I'll give it a try... but it might take me a while to finalize or abort...

pgn4web
Posts: 97
Joined: Mon Jun 14, 2010 10:26 pm

Re: How to post chess games

Post by pgn4web » Sun Mar 04, 2012 9:13 pm

pgn4web wrote:Hang on for a while longer.
Looking at your code, I got a idea that might work without too much effort, so I'll give it a try... but it might take me a while to finalize or abort...
After some coding, I have what I hope is a stable draft for variation support.

It's not yet ready for release, but I'd appreciate some feedback if anyone is up for some testing.

Specific sample pages with variation:
http://pgn4web.devio.us/pgn4web/demo.html?frame=huebner
http://pgn4web.devio.us/pgn4web/demo.html?frame=wch08ak
http://pgn4web.devio.us/pgn4web/collect ... t%20sample

To try with your own PGN files, you can try:
http://pgn4web.devio.us/pgn4web/viewer.php
http://pgn4web.devio.us/pgn4web/board-generator.html

I havent updated the sample sites for wordpress, joomla, phpbb, simplemachines and the rest yet.

Any feedback is welcome, if any PGN file fails to be parsed properly, please send me the PGN file.

Thanks

Jeremy Bernstein
Site Admin
Posts: 1226
Joined: Wed Jun 09, 2010 7:49 am
Real Name: Jeremy Bernstein
Location: Berlin, Germany
Contact:

Re: How to post chess games

Post by Jeremy Bernstein » Mon Mar 05, 2012 7:49 am

pgn4web wrote:
pgn4web wrote:Hang on for a while longer.
Looking at your code, I got a idea that might work without too much effort, so I'll give it a try... but it might take me a while to finalize or abort...
After some coding, I have what I hope is a stable draft for variation support.

It's not yet ready for release, but I'd appreciate some feedback if anyone is up for some testing.

Specific sample pages with variation:
http://pgn4web.devio.us/pgn4web/demo.html?frame=huebner
http://pgn4web.devio.us/pgn4web/demo.html?frame=wch08ak
http://pgn4web.devio.us/pgn4web/collect ... t%20sample

To try with your own PGN files, you can try:
http://pgn4web.devio.us/pgn4web/viewer.php
http://pgn4web.devio.us/pgn4web/board-generator.html

I havent updated the sample sites for wordpress, joomla, phpbb, simplemachines and the rest yet.

Any feedback is welcome, if any PGN file fails to be parsed properly, please send me the PGN file.

Thanks
This is fantastic -- effort-free implementation (on my part). The initial check seems to work (keyboard navigation is not implemented, but you know that). I'll try some more complicated PGNs today or tomorrow.

Very happy to see this getting into the main distro.

jb

pgn4web
Posts: 97
Joined: Mon Jun 14, 2010 10:26 pm

Re: How to post chess games

Post by pgn4web » Mon Mar 05, 2012 10:06 am

Jeremy Bernstein wrote:keyboard navigation is not implemented
there is some keyboard navigation support for variations:
- the arrow keys left/rigth work as before
- the up/down keys always send you to beginning/end of the whole game
- shift-up/shift-down sends you to the beginning/end of the variation
- shift-left sends you to the "parent" variation
- shift-right sends you to the next "sibling" variation (= alternative move)

That should be enough to move around with the keyboard

User avatar
dand
Posts: 9
Joined: Sat Feb 25, 2012 11:56 pm

Re: How to post chess games

Post by dand » Mon Mar 05, 2012 10:27 am

pgn4web wrote:
Jeremy Bernstein wrote:keyboard navigation is not implemented
there is some keyboard navigation support for variations:
- the arrow keys left/rigth work as before
- the up/down keys always send you to beginning/end of the whole game
- shift-up/shift-down sends you to the beginning/end of the variation
- shift-left sends you to the "parent" variation
- shift-right sends you to the next "sibling" variation (= alternative move)

That should be enough to move around with the keyboard
Maybe think of the way to enter variation with a keyboard?

I'm used to using Chessbase Fritz, and there you can go through the game completely with a keyboard: when the next move can be Main line or a Variation1 or a Variatio2, then a small window pops-up offering:
A) 13. a6
B) 13. c6
C) 13. Sf2
User can select a, b, or c on the keyboard and then continue with arrows.

Or some other way.
I don't think this is major issue, but should have it in mind.
Thanks.

pgn4web
Posts: 97
Joined: Mon Jun 14, 2010 10:26 pm

Re: How to post chess games

Post by pgn4web » Mon Mar 05, 2012 10:34 am

dand wrote:Maybe think of the way to enter variation with a keyboard?

I'm used to using Chessbase Fritz, and there you can go through the game completely with a keyboard: when the next move can be Main line or a Variation1 or a Variatio2, then a small window pops-up offering:
A) 13. a6
B) 13. c6
C) 13. Sf2
User can select a, b, or c on the keyboard and then continue with arrows.

Or some other way.
I don't think this is major issue, but should have it in mind.
Thanks.
I dont like at all the Chessbase way of selecting variations, because it interrupts the flow of the game when most people likely just want to go through the main line.

The pgn4web way to enter a variation is this, assuming the game is 1. e4 e5 (1... e6 2. d4 d5) 2. f4 and starting from the game beginning:
1) with the right key you browse to the move e5
2) with shift-right you select the next sibling variation of e5, in this case the move e6. From then on you are in the variation and further right keys bring you d4 and d5

User avatar
dand
Posts: 9
Joined: Sat Feb 25, 2012 11:56 pm

Re: How to post chess games

Post by dand » Mon Mar 05, 2012 10:38 am

pgn4web wrote:
dand wrote:Maybe think of the way to enter variation with a keyboard?

I'm used to using Chessbase Fritz, and there you can go through the game completely with a keyboard: when the next move can be Main line or a Variation1 or a Variatio2, then a small window pops-up offering:
A) 13. a6
B) 13. c6
C) 13. Sf2
User can select a, b, or c on the keyboard and then continue with arrows.

Or some other way.
I don't think this is major issue, but should have it in mind.
Thanks.
I dont like at all the Chessbase way of selecting variations, because it interrupts the flow of the game when most people likely just want to go through the main line.

The pgn4web way to enter a variation is this, assuming the game is 1. e4 e5 (1... e6 2. d4 d5) 2. f4 and starting from the game beginning:
1) with the right key you browse to the move e5
2) with shift-right you select the next sibling variation of e5, in this case the move e6. From then on you are in the variation and further right keys bring you d4 and d5
Sounds good! Will try Shift-right.

Post Reply