From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/34779 Path: news.gmane.org!not-for-mail From: "Zhichu Chen" Newsgroups: gmane.comp.tex.context Subject: Re: Draw chess board Date: Fri, 25 May 2007 10:49:19 +0800 Message-ID: <769ba7780705241949g7596a0fco77d06db3b682af99@mail.gmail.com> References: <769ba7780705240459l4229c774x7993a5f0ae13eda0@mail.gmail.com> <115224fb0705240701v7a941c59i3f024c244072846b@mail.gmail.com> <769ba7780705240840u1317b749w1535c8483a85ef39@mail.gmail.com> <6faad9f00705241207j484c2dd7wb7ba1d531f1e690@mail.gmail.com> Reply-To: mailing list for ConTeXt users NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============1634703544==" X-Trace: sea.gmane.org 1180061574 15583 80.91.229.12 (25 May 2007 02:52:54 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Fri, 25 May 2007 02:52:54 +0000 (UTC) To: "mailing list for ConTeXt users" Original-X-From: ntg-context-bounces@ntg.nl Fri May 25 04:52:47 2007 Return-path: Envelope-to: gctc-ntg-context-518@m.gmane.org Original-Received: from ronja.vet.uu.nl ([131.211.172.88] helo=ronja.ntg.nl) by lo.gmane.org with esmtp (Exim 4.50) id 1HrPv5-00081x-BE for gctc-ntg-context-518@m.gmane.org; Fri, 25 May 2007 04:52:47 +0200 Original-Received: from localhost (localhost [127.0.0.1]) by ronja.ntg.nl (Postfix) with ESMTP id EA2EC1FF53; Fri, 25 May 2007 04:52:49 +0200 (CEST) Original-Received: from ronja.ntg.nl ([127.0.0.1]) by localhost (smtp.ntg.nl [127.0.0.1]) (amavisd-new, port 10024) with LMTP id 05856-01; Fri, 25 May 2007 04:52:49 +0200 (CEST) Original-Received: from ronja.vet.uu.nl (localhost [127.0.0.1]) by ronja.ntg.nl (Postfix) with ESMTP id 2E3681FF57; Fri, 25 May 2007 04:49:29 +0200 (CEST) Original-Received: from localhost (localhost [127.0.0.1]) by ronja.ntg.nl (Postfix) with ESMTP id 27E0D1FF57 for ; Fri, 25 May 2007 04:49:27 +0200 (CEST) Original-Received: from ronja.ntg.nl ([127.0.0.1]) by localhost (smtp.ntg.nl [127.0.0.1]) (amavisd-new, port 10024) with LMTP id 02702-06-3 for ; Fri, 25 May 2007 04:49:22 +0200 (CEST) Original-Received: from wa-out-1112.google.com (wa-out-1112.google.com [209.85.146.183]) by ronja.ntg.nl (Postfix) with ESMTP id 52BDD1FF56 for ; Fri, 25 May 2007 04:49:20 +0200 (CEST) Original-Received: by wa-out-1112.google.com with SMTP id j32so277355waf for ; Thu, 24 May 2007 19:49:19 -0700 (PDT) Original-Received: by 10.114.169.2 with SMTP id r2mr1283243wae.1180061359798; Thu, 24 May 2007 19:49:19 -0700 (PDT) Original-Received: by 10.114.107.11 with HTTP; Thu, 24 May 2007 19:49:19 -0700 (PDT) In-Reply-To: <6faad9f00705241207j484c2dd7wb7ba1d531f1e690@mail.gmail.com> X-Virus-Scanned: amavisd-new at ntg.nl X-BeenThere: ntg-context@ntg.nl X-Mailman-Version: 2.1.9 Precedence: list List-Id: mailing list for ConTeXt users List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: ntg-context-bounces@ntg.nl Errors-To: ntg-context-bounces@ntg.nl X-Virus-Scanned: amavisd-new at ntg.nl Xref: news.gmane.org gmane.comp.tex.context:34779 Archived-At: --===============1634703544== Content-Type: multipart/alternative; boundary="----=_Part_161906_27484862.1180061359752" ------=_Part_161906_27484862.1180061359752 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline Hi Mojca I original intention is: First, check the sgf file to decide how many rows and lines should be used. For some instance, there is no need to draw the full 19x19 board, like conversion steps demostration---best choices around the corner of the board. Second, I'd like to take advantage of PDF Javascript to show every step by clicking on some area. \fieldstack seems to be a good choice. But if I use some script like sgf2mpost, I don't know how to if there is an easy way to determine how many steps does the sgf include. If I solved the sgf problem, I think I can input a game manually by using sgf syntax On 5/25/07, Mojca Miklavec wrote: > > On 5/24/07, Zhichu Chen wrote: > > Thanks Wolfgang > > > > The first link is very useful. I will took its idea. I really want to > use > > metapost's scantoken to read sgf file directly, so it can easily be a > > cross-platform solution. > > You can use either TeX or metapost to parse sgf file. But you can > forget about TeX, I suppose. Metapost is an option if you love > challenges, but it's not the only possibility if you're looking for > cross-platform solutions. > > In http://match.stanford.edu/bump/sgf2dg-4.026.tar.gz you have > sgf2mpost.c with 1000 lines of pure C code which parses the file and > generates metapost output. > > If I was in your place, I would write a ruby (or lua ;) parser (the > file above can help you, but you can probably parse the input in a > much more clever & efficient way with ruby) + metapost code generator. > > Then you write a ConTeXt module with > > \startSGFscript{name} or \startSGFfile or \startSGFgame or \startGOgame > .... the very special format of your game ... > \stopSGFscript > > You write the content into a file (you can also prepare external files > and tell ConTeXt which one is the source file), call "texmfstart > your-great-ruby-script file.sgf", which generates metapost output, and > then you include that one in the ConTeXt document. > > I'm really not sure if parsing SGF files with metapost can bring you > anything ... ruby scripts are fully portable, at least in ConTeXt. > > Mojca > > > > On 5/24/07, Wolfgang Schuster > > wrote: > > > 2007/5/24, Zhichu Chen < zhichu.chen@gmail.com>: > > > > Hi > > > > > > > > I love chess games, especially one kind of them which is generally > > called > > > > Go. > > > > > > > > I know there is some file can store each details in one game: > > > > http://www.red-bean.com/sgf/ > > > > > > > > AFAIK, there is no module available to draw chess in ConTeXt now. I > > wanna do > > > > this by using MetaPost and fieldstack. But I don't know how to tell > > metapost > > > > the details of the sgf file. Can anyone give me a suggestion? > > > > > > > > BTW, I don't like the name. It's invented by acient Chinese and it's > > called > > > > Weiqi. I think we can call it Siege Chess in English. > > > > > > > > > > > > -- > > > > Best Regards > > > > Chen > > > > > > Hi Chen, > > > > > > if you mean Go take a look at the following page: > > > > > > http://match.stanford.edu/bump/go.html > > > > > > There are also two packages on CTAN for LaTeX: > > > > > > > > http://www.ctan.org/tex-archive/help/Catalogue/bytopic.html#gamesgo > > > > > > Wolfgang > > > > > > ___________________________________________________________________________________ > > > If your question is of interest to others as well, please add an entry > to > > the Wiki! > > > > > > maillist : ntg-context@ntg.nl / > > http://www.ntg.nl/mailman/listinfo/ntg-context > > > webpage : http://www.pragma-ade.nl / http://tex.aanhet.net > > > archive : > > https://foundry.supelec.fr/projects/contextrev/ > > > wiki : http://contextgarden.net > > > > > > ___________________________________________________________________________________ > > > > > > > > > > > -- > > Best Regards > > Chen > > ---------------------------------------------------------------- > > > > Zhi-chu Chen | Shanghai Synchrotron Radiation Facility > > No. 2019 | Jialuo Rd. | Jiading | Shanghai | P.R. China > > tel: 086 21 5955 3405 | zhichu.chen.googlepages.com > > | > > www.sinap.ac.cn > > ---------------------------------------------------------------- > > > ___________________________________________________________________________________ > > If your question is of interest to others as well, please add an entry > to > > the Wiki! > > > > maillist : ntg-context@ntg.nl / > > http://www.ntg.nl/mailman/listinfo/ntg-context > > webpage : http://www.pragma-ade.nl / http://tex.aanhet.net > > archive : https://foundry.supelec.fr/projects/contextrev/ > > wiki : http://contextgarden.net > > > ___________________________________________________________________________________ > > > > > > > ___________________________________________________________________________________ > If your question is of interest to others as well, please add an entry to > the Wiki! > > maillist : ntg-context@ntg.nl / > http://www.ntg.nl/mailman/listinfo/ntg-context > webpage : http://www.pragma-ade.nl / http://tex.aanhet.net > archive : https://foundry.supelec.fr/projects/contextrev/ > wiki : http://contextgarden.net > > ___________________________________________________________________________________ > -- Best Regards Chen ---------------------------------------------------------------- Zhi-chu Chen | Shanghai Synchrotron Radiation Facility No. 2019 | Jialuo Rd. | Jiading | Shanghai | P.R. China tel: 086 21 5955 3405 | zhichu.chen.googlepages.com | www.sinap.ac.cn ---------------------------------------------------------------- ------=_Part_161906_27484862.1180061359752 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 7bit Content-Disposition: inline
Hi Mojca
 
I original intention is:
 
First, check the sgf file to decide how many rows and lines should be used. For some instance, there is no need to draw the full 19x19 board, like conversion steps demostration---best choices around the corner of the board.
 
Second, I'd like to take advantage of PDF Javascript to show every step by clicking on some area. \fieldstack seems to be a good choice. But if I use some script like sgf2mpost, I don't know how to if there is an easy way to determine how many steps does the sgf include.
 
If I solved the sgf problem, I think I can input a game manually by using sgf syntax

 
On 5/25/07, Mojca Miklavec <mojca.miklavec.lists@gmail.com > wrote:
On 5/24/07, Zhichu Chen wrote:
> Thanks Wolfgang
>
> The first link is very useful. I will took its idea. I really want to use
> metapost's scantoken to read sgf file directly, so it can easily be a
> cross-platform solution.

You can use either TeX or metapost to parse sgf file. But you can
forget about TeX, I suppose. Metapost is an option if you love
challenges, but it's not the only possibility if you're looking for
cross-platform solutions.

In http://match.stanford.edu/bump/sgf2dg-4.026.tar.gz you have
sgf2mpost.c with 1000 lines of pure C code which parses the file and
generates metapost output.

If I was in your place, I would write a ruby (or lua ;) parser (the
file above can help you, but you can probably parse the input in a
much more clever & efficient way with ruby) + metapost code generator.

Then you write a ConTeXt module with

\startSGFscript{name} or \startSGFfile or \startSGFgame or \startGOgame
.... the very special format of your game ...
\stopSGFscript

You write the content into a file (you can also prepare external files
and tell ConTeXt which one is the source file), call "texmfstart
your-great-ruby-script file.sgf", which generates metapost output, and
then you include that one in the ConTeXt document.

I'm really not sure if parsing SGF files with metapost can bring you
anything ... ruby scripts are fully portable, at least in ConTeXt.

Mojca


> On 5/24/07, Wolfgang Schuster
> <schuster.wolfgang@googlemail.com > wrote:
> > 2007/5/24, Zhichu Chen < zhichu.chen@gmail.com>:
> > > Hi
> > >
> > > I love chess games, especially one kind of them which is generally
> called
> > > Go.
> > >
> > > I know there is some file can store each details in one game:
> > > http://www.red-bean.com/sgf/
> > >
> > > AFAIK, there is no module available to draw chess in ConTeXt now. I
> wanna do
> > > this by using MetaPost and fieldstack. But I don't know how to tell
> metapost
> > > the details of the sgf file. Can anyone give me a suggestion?
> > >
> > > BTW, I don't like the name. It's invented by acient Chinese and it's
> called
> > > Weiqi. I think we can call it Siege Chess in English.
> > >
> > >
> > > --
> > > Best Regards
> > > Chen
> >
> > Hi Chen,
> >
> > if you mean Go take a look at the following page:
> >
> > http://match.stanford.edu/bump/go.html
> >
> > There are also two packages on CTAN for LaTeX:
> >
> >
> http://www.ctan.org/tex-archive/help/Catalogue/bytopic.html#gamesgo
> >
> > Wolfgang
> >
> ___________________________________________________________________________________
> > If your question is of interest to others as well, please add an entry to
> the Wiki!
> >
> > maillist : ntg-context@ntg.nl /
> http://www.ntg.nl/mailman/listinfo/ntg-context
> > webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
> > archive  :
> https://foundry.supelec.fr/projects/contextrev/
> > wiki     : http://contextgarden.net
> >
> ___________________________________________________________________________________
> >
>
>
>
> --
> Best Regards
> Chen
> ----------------------------------------------------------------
>
>           Zhi-chu Chen | Shanghai Synchrotron Radiation Facility
>          No. 2019 | Jialuo Rd. | Jiading | Shanghai | P.R. China
>              tel: 086 21 5955 3405 | zhichu.chen.googlepages.com
>                                                |
> www.sinap.ac.cn
> ----------------------------------------------------------------
> ___________________________________________________________________________________
> If your question is of interest to others as well, please add an entry to
> the Wiki!
>
> maillist : ntg-context@ntg.nl /
> http://www.ntg.nl/mailman/listinfo/ntg-context
> webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
> archive  : https://foundry.supelec.fr/projects/contextrev/
> wiki     : http://contextgarden.net
> ___________________________________________________________________________________
>
>
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : https://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________



--
Best Regards
Chen
----------------------------------------------------------------

          Zhi-chu Chen | Shanghai Synchrotron Radiation Facility
         No. 2019 | Jialuo Rd. | Jiading | Shanghai | P.R. China
             tel: 086 21 5955 3405 | zhichu.chen.googlepages.com
                                               | www.sinap.ac.cn
---------------------------------------------------------------- ------=_Part_161906_27484862.1180061359752-- --===============1634703544== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline ___________________________________________________________________________________ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://tex.aanhet.net archive : https://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___________________________________________________________________________________ --===============1634703544==--