Skip to content
Little GolemMake your next move.

HSGF->EPS and HSGF->HGT

Public forum discussion.

#1 · Tom Ace

13 May 2013

I have made some upgrades to my HSGF-to-EPS web server
and I've added another service to convert HSGF to HGT.
I've had trouble with JHex's own HSGF import function;
the HSGF-to-HGT server gives another option for doing
the conversion.

Both servers accept HSGF text, or (more conveniently)
accept an LG game number and download the HSGF from LG
behind the scenes.

To generate EPS (encapsulated PostScript):
http://minortriad.com/golem2eps.html
to generate HGT for use with JHex:
http://minortriad.com/golem2hgt.html

Comments, bug reports, requests, etc. are welcome.

#2 · Ruben Berenguel

19 Feb 2014

Hi Tom,

any chance the code might be available? I'd like to print some games to look over them on a real hex board, so I'd probably do an automatic script getting a few dozens of top-rated games, eps-ing them and merging them through a TeX file... I'd rather not do it by hand, neither automate the in-browser pasting (I could do it with selenium, but it's bad karma doing this to a live web server ;)

#3 · Ruben Berenguel

19 Feb 2014

Edit: whoah, the EPS is REAL PS code that I can tweak and use... Awesome! This is the way to use PostScript ;) (I'm glad I spent a week coding a PS Christmas postcard 5 years ago, now)

#4 · Ignatius J Reilly

20 Feb 2014

Tom: If you can describe to me the problems you are having with SGF import on Jhex, I can try to fix them. Note that Little Golem SGF is not the same as normal SGF, and the latest version of Jhex (http://canyon23.net/xyz/jgame_beta/) has separate "LGSGF" and "SGF" import functions.

The way I import my own games into Jhex is to cut/paste the game record from the LG game web page into the Jhex import window. (It's OK to include extra text, so for example pasting in "List of moves hsgf << < > >> 1.a10 2.swap 3.f6 4.e4 5.j9" would work.)

Of course it would be better if Jhex could just download the game record, given the LG game number (similar to your service). I started coding this a couple of years ago, but I got distracted by other projects and didn't finish it.

#5 · Ruben Berenguel

20 Feb 2014

Hmm I have checked the FF[4] spec and from what I've seen LittleGolem's is compliant: it almost has nothing in it, so I don't see where the non-compliance may be. I wrote a micro-parser for it in JavaScript in a few minutes, without much testing, though (I got carried away adding variations, too.) It turns SGF into a kind of JSON object, with the goal of using that in some "displaying" way

#7 · Ruben Berenguel

20 Feb 2014

After a long afternoon of chatting with Gregorio and fighting the HSGF from LG: according to standard, Black connects top to bottom, but in LG red starts from top to bottom... and red is mapped to white, which is the starting player. Add swap rule and it's a nightmare

#8 · Ignatius J Reilly

20 Feb 2014

Yes, the way LGSGF treats swaps is one important difference. Also, LGSGF does not properly escape '[' and ']' in player names. (Does not attempt to escape them at all, in fact.) I don't think the Hex SGF standard was in existence when I wrote the Jhex implementation of plain SGF (or at least I was not aware of it at that time).

#9 · Tom Ace

22 Mar 2014

Ruben: do you still have an interest in source code, or is the configurability of the PostScript I generate enough for your purposes?

Ignatius: I don't remember exactly which problem(s) I was having last year with Jhex's import function. It might just have been the way it handles swaps, which is a matter of taste.

Sorry for the delay in responding; I haven't read LG forums in a while. If ever you have a question I haven't responded to here, a contact link is in my player info here at LG.