How to post chess games

General discussion about computer chess...
User avatar
Rebel
Posts: 515
Joined: Wed Jun 09, 2010 7:45 pm
Real Name: Ed Schroder

Re: How to post chess games

Post by Rebel » Mon Mar 11, 2013 12:06 pm

I trying to get familiar with pgn4web for off-line showing search results in a PGN file. So far I got the mini-template to work, example at: http://www.top-5000.nl/pgn4web/output.htm

But I am much more in love with the London template.

As I noticed the author of pgn4web posts here (thanks for cool sofware BTW) it seems to me the most logical place to post my question how to make the needed script changes to get the London outlook (or something even better) to work.

A second question is how to use the initial halfmove number actual halfmove number when the setting above is custom number as described on the Board Generator in order that a game can start from that position.

Currently I am using:

Code: Select all

<link href="mini.css" type="text/css" rel="stylesheet" />
<link rel="shortcut icon" href="pawn.ico" />
<script src="pgn4web.js" type="text/javascript"></script>
<script type="text/javascript">
   SetImagePath ("alpha/24");
   SetImageType("png");
   SetGameSelectorOptions("Select a game...", false, 0, 8, 0, 0, 0, 0, 10); // (head, num, chEvent, chSite, chRound, chWhite, chBlack, chResult, chDate);
   SetCommentsOnSeparateLines(true);
   SetAutoplayDelay(2500); // milliseconds
   SetAutostartAutoplay(true);
   SetAutoplayNextGame(true);
   SetInitialGame("first");
   SetShortcutKeysEnabled(false);
</script>

Code: Select all

<form style="display: none;"><textarea style="display: none;" id="pgnText">
[Event "PCA/Intel-GP"]
[Site "New York"]
[Date "1995.??.??"]
[Round "3"]
[White "Kramnik, Vladimir"]
[Black "Kasparov, Gary"]
[Result "1/2-1/2"]
[WhiteElo "2715"]
[BlackElo "2805"]
[ECO "C42"]

1.e4 e5 2.Nf3 Nf6 3.Nxe5 d6 4.Nf3 Nxe4 5.Nc3 Nxc3 6.dxc3 Be7 7.Be3 O-O 8.Qd2 Nc6
9.O-O-O Ne5 10.Nd4 c5 11.Nb5 Qa5 12.a3 Be6 13.Nxd6 Qb6 14.f4 Ng4 15.f5 Qxd6
16.Qxd6 Bxd6 17.Rxd6 Nxe3 18.fxe6 fxe6 19.Bd3 Rae8 20.Be4 Re7 21.Re1 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
[Black "Dao Thien Hai"]
[Result "1-0"]
[WhiteElo "2838"]
[BlackElo "2572"]
[ECO "C42"]

1.e4 e5 2.Nf3 Nf6 3.Nxe5 d6 4.Nf3 Nxe4 5.d4 d5 6.Bd3 Nc6 7.O-O Be7 8.c4 Nb4
9.Be2 O-O 10.a3 Nc6 11.cxd5 Qxd5 12.Nc3 Nxc3 13.bxc3 Bf6 14.Bf4 Bf5 15.Re1 Rac8
16.Nd2 Na5 17.Bf3 Qd7 18.Ne4 Be7 19.Ng3 Bg6 20.Bg4 f5 21.Bf3 Bd6 22.Be5 Kh8
23.h4 Bf7 24.h5 Kg8 25.Qc2 Bc4 26.Rab1 b6 27.Qc1 Rce8 28.Qf4 Bxe5 29.Rxe5 Rxe5
30.dxe5 Be6 31.h6 g6 32.Ne2 c5 33.Qg3 Nc4 34.Nf4 Nxe5 35.Rd1 Nxf3+ 36.Qxf3 Qf7
37.Qc6 Bc8 38.Re1 g5 39.Nh3 Bb7 40.Qd6 Qf6 41.Re6 Qxc3 42.Re7 Bc8 43.Rg7+ Qxg7
44.hxg7 Kxg7 45.Nxg5  1-0

[Event "Wch U16"]
[Site "Wattignies"]
[Date "1976.??.??"]
[Round "?"]
[White "Kasparov, Gary"]
[Black "Cramling, Pia"]
[Result "1/2-1/2"]
[WhiteElo ""]
[BlackElo ""]
[ECO "C42"]

1.e4 e5 2.Nf3 Nf6 3.Nxe5 d6 4.Nf3 Nxe4 5.Qe2 Qe7 6.d3 Nf6 7.Bg5 Nbd7 8.Nc3 Qxe2+
9.Bxe2 h6 10.Bh4 g6 11.d4 a6 12.O-O-O Bg7 13.Rhe1 O-O 14.Bc4 b5 15.Bd5 Rb8
16.Bc6 Nb6 17.a3 Bb7 18.Bxb7 Rxb7 19.Bxf6  1/2-1/2

</textarea></form>

<center>
<b><span id="GameWhite"></span>&nbsp;-&nbsp;<span id="GameBlack"></span>&nbsp;&nbsp;<span id="GameResult"></span></b>
<p></p>
<div id="GameNextMove"></div> 
<div id="GameEvent"></div>  <div id="GameSite"></div>   <div id="GameDate"></div>    
<div id="GameBoard"></div><p></p>
<div id="GameButtons"></div><p></p>
<div id="GameSelector"></div>
</center>

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

Re: How to post chess games

Post by pgn4web » Mon Mar 11, 2013 12:22 pm

Rebel wrote:I trying to get familiar with pgn4web for off-line showing search results in a PGN file. So far I got the mini-template to work, example at: http://www.top-5000.nl/pgn4web/output.htm

But I am much more in love with the London template.

As I noticed the author of pgn4web posts here (thanks for cool sofware BTW) it seems to me the most logical place to post my question how to make the needed script changes to get the London outlook (or something even better) to work.
The london template is defined in the files lon09r5.html and lon09r5.css, you probably need to know a bit of html and css to copy and improve on those. Please note that the game list in lon09r5.html is hardcoded in the HTML file and might not be easy to replicate into a generic template, it might be easier to replace with the dropdown menu.
Rebel wrote:A second question is how to use the initial halfmove number actual halfmove number when the setting above is custom number as described on the Board Generator in order that a game can start from that position.
When building a web page there are few javascript functions that allows you to control which game/move is shown at startup:

Code: Select all

SetInitialGame(1); // number of game to be shown at load, from 1 (default); values (keep the quotes) of "first", "last", "random" are accepted; other string values assumed as PGN search string
SetInitialVariation(0); // number for the variation to be shown at load, 0 (default) for main variation
SetInitialHalfmove(0,false); // halfmove number to be shown at load, 0 (default) for start position; values (keep the quotes) of "start", "end", "random", "comment" (go to first comment or variation), "variation" (go to the first variation) are also accepted. Second parameter if true applies the setting to every selected game instead of startup only instead of startup only (default)
The full set of javascript configuration functions for web pages is documented here:
https://code.google.com/p/pgn4web/wiki/HowTo

User avatar
Rebel
Posts: 515
Joined: Wed Jun 09, 2010 7:45 pm
Real Name: Ed Schroder

Re: How to post chess games

Post by Rebel » Mon Mar 11, 2013 3:18 pm

Got it to work now. One thing I noticed, loading another game from the drop-down menu ignores the

SetInitialHalfmove(5,false);

setting.

See: http://www.top-5000.nl/pgn4web/output.htm

Is there a workaround?

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

Re: How to post chess games

Post by pgn4web » Mon Mar 11, 2013 3:26 pm

Rebel wrote:Got it to work now. One thing I noticed, loading another game from the drop-down menu ignores the

SetInitialHalfmove(5,false);

setting.

See: http://www.top-5000.nl/pgn4web/output.htm

Is there a workaround?
From the note above:

Code: Select all

Second parameter if true applies the setting to every selected game instead of startup only instead of startup only (default)

chinanzio
Posts: 2
Joined: Sun Jan 27, 2013 3:11 am
Real Name: chino

Re: How to post chess games

Post by chinanzio » Fri Sep 05, 2014 1:38 pm

what about this one ?

white to move and win
1q2r1k1/2p1bpp1/8/1r6/8/1B6/1B6/1K2Q2R w - - 0 1

taken from http://chess.marpla.net

zullil
Posts: 82
Joined: Thu Jun 10, 2010 10:17 am
Real Name: Louis Zulli
Location: Pennsylvania, USA

Re: How to post chess games

Post by zullil » Tue Sep 09, 2014 12:11 am

chinanzio wrote:what about this one ?

white to move and win
1q2r1k1/2p1bpp1/8/1r6/8/1B6/1B6/1K2Q2R w - - 0 1

taken from http://chess.marpla.net
Stockfish solves it in about half a second.

Code: Select all

info depth 15 seldepth 31 score mate 4 nodes 434227 nps 893471 time 486 multipv 1 pv e1e6 b5b3 h1h8 g8h8 e6h6 h8g8 h6g7

User avatar
Rebel
Posts: 515
Joined: Wed Jun 09, 2010 7:45 pm
Real Name: Ed Schroder

Re: How to post chess games

Post by Rebel » Tue Apr 26, 2016 3:17 pm

I use TLCV for live support of chess games. Unfortunately it doesn't support positions nor the PGN with moves that lead to the position. I am considering PGN4WEB, is there a ready to use template available I could work on?

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

Re: How to post chess games

Post by pgn4web » Tue Apr 26, 2016 3:31 pm

Rebel wrote:I use TLCV for live support of chess games. Unfortunately it doesn't support positions nor the PGN with moves that lead to the position. I am considering PGN4WEB, is there a ready to use template available I could work on?
The main zipfile at the project site has a number of examples for live games: http://pgn4web-downloads.casaschi.net
Just unzip pgn4web-x.xx.zip (currently pgn4web-3.00.zip), then make sure your live pgn file is saved in the pgn4web folder as live/live.pgn and open the different live*.html pages.

You can see some of those examples at the pgn4web homepage: http://pgn4web.casaschi.net see the live links on the right column.

I enjoyed a few of your chess engines, so if you have any question or you'd like to try some customization, please email me at pgn4web(at)casaschi.net and I'll try to help.

User avatar
Rebel
Posts: 515
Joined: Wed Jun 09, 2010 7:45 pm
Real Name: Ed Schroder

Re: How to post chess games

Post by Rebel » Wed Apr 27, 2016 7:10 am

Thank you Paolo, I have used PGN4WEB before with ProDeo 1.85 searching for games in a database. I will try to get the live-support to work. Does the PGN part via the FEN tag support start positions?

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

Re: How to post chess games

Post by pgn4web » Wed Apr 27, 2016 7:57 am

Rebel wrote:Does the PGN part via the FEN tag support start positions?
Yes.

Post Reply