How to post chess games

General discussion about computer chess...
Post Reply
Jeremy Bernstein
Site Admin
Posts: 1226
Joined: Wed Jun 09, 2010 7:49 am
Real Name: Jeremy Bernstein
Location: Berlin, Germany
Contact:

How to post chess games

Post by Jeremy Bernstein » Wed Jun 09, 2010 4:46 pm

OpenChess has implemented a JavaScript-based software (pgn4web) to display chess games and positions within the forum body. Using them is easy: it works just like other BBCode markup.

Code: Select all

[fen]1r3rk1/p3pp1p/6p1/3pqb2/Q7/4P1P1/P4PBP/2RR2K1 b - - 0 19[/fen]
looks like this:
1r3rk1/p3pp1p/6p1/3pqb2/Q7/4P1P1/P4PBP/2RR2K1 b - - 0 19

and

Code: Select all

[pgn]
[Event "Miscellaneous Game"]
[Site "?"]
[Date "1620.??.??"]
[EventDate "?"]
[Round "12"]
[Result "0-1"]
[White "NN"]
[Black "Gioachino Greco"]
[ECO "C50"]
[WhiteElo "?"]
[BlackElo "?"]
[PlyCount "26"]

1.e4 e5 2.Nf3 Nc6 3.Bc4 Bc5 4.O-O Nf6 5.Re1 O-O 6.c3 Qe7 7.d4
exd4 8.e5 Ng4 9.cxd4 Nxd4 10.Nxd4 Qh4 11.Nf3 Qxf2+ 12.Kh1 Qg1+
13.Nxg1 Nf2# 0-1
[/pgn]
will display
[Event "Miscellaneous Game"]
[Site "?"]
[Date "1620.??.??"]
[EventDate "?"]
[Round "12"]
[Result "0-1"]
[White "NN"]
[Black "Gioachino Greco"]
[ECO "C50"]
[WhiteElo "?"]
[BlackElo "?"]
[PlyCount "26"]

1.e4 e5 2.Nf3 Nc6 3.Bc4 Bc5 4.O-O Nf6 5.Re1 O-O 6.c3 Qe7 7.d4
exd4 8.e5 Ng4 9.cxd4 Nxd4 10.Nxd4 Qh4 11.Nf3 Qxf2+ 12.Kh1 Qg1+
13.Nxg1 Nf2# 0-1

(you can also skip all of the info in []s above, e.g.

Code: Select all

[pgn]1.e4 e5 2.Nf3 Nc6 3.Bc4 Bc5 4.O-O Nf6 5.Re1 O-O 6.c3 Qe7 7.d4
exd4 8.e5 Ng4 9.cxd4 Nxd4 10.Nxd4 Qh4 11.Nf3 Qxf2+ 12.Kh1 Qg1+
13.Nxg1 Nf2#[/pgn]
if you don't want all of the headers...)

1.e4 e5 2.Nf3 Nc6 3.Bc4 Bc5 4.O-O Nf6 5.Re1 O-O 6.c3 Qe7 7.d4
exd4 8.e5 Ng4 9.cxd4 Nxd4 10.Nxd4 Qh4 11.Nf3 Qxf2+ 12.Kh1 Qg1+
13.Nxg1 Nf2#

This is all in progress. Appearance will probably change a bit over time, but the basic functionality is all there.

Jeremy

Peter C
Posts: 154
Joined: Thu Jun 10, 2010 3:12 am
Real Name: Peter C

Re: How to post chess games

Post by Peter C » Thu Jun 10, 2010 3:22 am

That's pretty sweet. If you need any help modifying the CSS to make it look better (though I think it's pretty good now) I might be able to help with that.

EDIT: Oh, you can play through the games. Actually, that's really sweet.

Peter

64x
Posts: 301
Joined: Thu Jun 10, 2010 2:47 am

Re: How to post chess games

Post by 64x » Thu Jun 10, 2010 3:31 am

I am not sure this feature (playing through games) can be found in any other forum... bravo!!

User avatar
Swaminathan
Posts: 375
Joined: Wed Jun 09, 2010 12:14 pm

Re: How to post chess games

Post by Swaminathan » Thu Jun 10, 2010 3:39 am

64x wrote:I am not sure this feature (playing through games) can be found in any other forum... bravo!!

Yeah, It's such an AWESOME feature!!! ;)

Thanks a lot, Jeremy!!
Logo made by Ulysses P (Vytron)
Co-Authored with Dann Corbit: Strategic Test Suite

User avatar
kingliveson
Posts: 1388
Joined: Thu Jun 10, 2010 1:22 am
Real Name: Franklin Titus
Location: 28°32'1"N 81°22'33"W

Re: How to post chess games

Post by kingliveson » Thu Jun 10, 2010 7:25 am

Man, this is great. It was going to be my first question but already answered. Really nice that you can go through an actually game too instead of just a static position.


Franklin
PAWN : Knight >> Bishop >> Rook >>Queen

Max Cady
Posts: 2
Joined: Thu Jun 10, 2010 8:53 am
Real Name: Robert

Re: How to post chess games

Post by Max Cady » Thu Jun 10, 2010 10:53 am

very nice

Is it possible to add comments on moves? in other words does it recognize comments after a move?

Zarkon
Posts: 20
Joined: Thu Jun 10, 2010 2:40 pm
Contact:

Re: How to post chess games

Post by Zarkon » Thu Jun 10, 2010 3:11 pm

Playing through games is a real bonus! :D

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 » Thu Jun 10, 2010 3:19 pm

Max Cady wrote:very nice

Is it possible to add comments on moves? in other words does it recognize comments after a move?
Check out the home page: http://code.google.com/p/pgn4web/ for features. I believe that it does support comments, but I haven't had a chance to test it out, really. Possibly I have to add a switch to the HTML I am generating to create the image. Try it out and let me know!

Jeremy

Robert Flesher
Posts: 53
Joined: Thu Jun 10, 2010 3:16 pm
Real Name: Robert Flesher

Re: How to post chess games

Post by Robert Flesher » Thu Jun 10, 2010 3:26 pm

Great stuff ! I am glad you started this forum!

Jarkko
Posts: 5
Joined: Thu Jun 10, 2010 2:53 pm

Re: How to post chess games

Post by Jarkko » Thu Jun 10, 2010 4:37 pm

When stepping through the game with next button, Is it possible to get a FEN string from the position one is interested? A button for that would be nice or present at the bottom of the board all the time for the current position.

Good luck for the new site

- Jarkko

Post Reply