Re: visualizing chess

Discussion in 'Perl Misc' started by Ben Bacarisse, Aug 21, 2013.

  1. Eli the Bearded <*@eli.users.panix.com> writes:

    > use Chess::Rep; # turn move seq. into a FEN
    > use Games::Chess; # turn a FEN into a GIF
    > use GD; # GIF library
    >
    > my $game = Chess::Rep->new;
    >
    > while(my $halfmove = sub_to_get_halfmove()) {
    >
    > # a halfmove looks like "Bf4" or "O-O"
    > $game->go_move($halfmove);
    >
    > if(show_this_board()) {
    >
    > my $fen = $game->get_fen;
    > my $board = Games::Chess::position->new($fen);
    > do_something_with_gif($board->to_GIF());
    >
    > }
    > }
    >
    >
    > That basically works. Chess::Rep is fairly recent (2007), Games::Chess
    > is very old (1999), but both are pure perl and work fine with my
    > v5.14.2. My big complaint is that Games::Chess' to_GIF() hardcodes a
    > lot of things, like colors and sizes. (And output image format.)
    >
    > Any other suggestions for drawing chessboards besides "roll my own"?
    > Shelling out to other open source Unix programs is acceptable, but
    > not optiminal.
    >
    > Elijah
    > ------
    > will roll his own with HTML output if that's what's needed


    Maybe not "needed" but it's probably quite easy if using Unicode chess
    symbols is acceptable. I think they are quite well supported. Colours,
    patterns on squares, borders etc can then all be done with some simple
    CSS.

    http://en.wikipedia.org/wiki/Chess_symbols_in_Unicode
    --
    Ben.
     
    Ben Bacarisse, Aug 21, 2013
    #1
    1. Advertisements

  2. Eli the Bearded <*@eli.users.panix.com> writes:

    > In comp.lang.perl.misc, Ben Bacarisse <> wrote:
    >> Eli the Bearded <*@eli.users.panix.com> writes:
    >> > will roll his own with HTML output if that's what's needed

    >> Maybe not "needed" but it's probably quite easy if using Unicode chess
    >> symbols is acceptable. I think they are quite well supported. Colours,
    >> patterns on squares, borders etc can then all be done with some simple
    >> CSS.

    >
    > I'm quite aware of that part of Unicode.


    OK, it seemed worth a mention.

    <snip>
    > The big issue with HTML is not making it, it is then limited to
    > HTML viewers / contexts. Getting a good HTML design to render in
    > a forum, etc, is fraught with difficulty.


    Ah, I misunderstood your closing remark and took it to mean that HTML
    was the intended rendering.

    <snip>
    --
    Ben.
     
    Ben Bacarisse, Aug 21, 2013
    #2
    1. Advertisements

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Kristof Thys

    visualizing image

    Kristof Thys, Sep 27, 2004, in forum: ASP .Net
    Replies:
    3
    Views:
    680
    Kevin Spencer
    Sep 27, 2004
  2. Replies:
    2
    Views:
    656
  3. Replies:
    0
    Views:
    465
  4. Varun Hiremath
    Replies:
    1
    Views:
    591
    Will McGugan
    Sep 18, 2006
  5. kaens

    Visualizing a wav file?

    kaens, Jul 11, 2007, in forum: Python
    Replies:
    3
    Views:
    753
    Diez B. Roggisch
    Jul 11, 2007
  6. wesley chun

    FYA: visualizing repository commits

    wesley chun, Jun 17, 2008, in forum: Python
    Replies:
    0
    Views:
    383
    wesley chun
    Jun 17, 2008
  7. Tassilo Horn
    Replies:
    5
    Views:
    525
    Tassilo Horn
    Apr 9, 2009
  8. Manfred Lotz

    visualizing xsd

    Manfred Lotz, Apr 19, 2010, in forum: XML
    Replies:
    5
    Views:
    2,863
    Manfred Lotz
    Apr 22, 2010
Loading...