Fun with TeX: Igo Hatsuyo-ron

2006-11-26

It all started by me stumbling upon a text file containing all Igo Hatsuyo-ron problems. Well, as you can see the format is not so great and encoding is obscure (GB2312). I used vim to transfer this garbage into something reasonable.

Now if you don’t know what regular expressions are, read on, if you do know, skip a few dozens lines. :-)

:%s/replaced thing/replacement/g

The colon just tells vim that I’m going to write something longer after which I’ll press enter, the “%” means all lines in the file, “s” means substitute, the slashes are used for separating the expressions (you can use something else too, but slashes are most common), and “g” means that you want to do all occurences (on (each) line).

get rid of all the lines that are not diagrams…
:%s/1.//g
no empty lines…
:%s/^\n//g
add some tex code before and after each diagram
:%s/┏/}reak}igskip box{ box to 100 pt{= 190 pt┏/g
transfer the ascii goban into tex
:%s/┏/??<
:%s/┯/??(/g
:%s/┓/??>
:%s/┠/??[
:%s/┼/??+/g
:%s/┨/??]
:%s/┗/??,
:%s/┷/??)/g
:%s/┛/??.
transfer the stones
:%s/●/- @+/g
:%s/○/- !+/g
very regular dents left – oups… forgot the star points…
:%s/╋/??
/g

After this and adding a header we have a pretty much usable TeX code. There were a few things left to do – I found a few bumps because there were some letters in the diagrams, so I had to manually delete them (this was no big deal), I also found some duplicated problems and problems that shouldn’t have even been there, I compared it to the version on sensei’s library, and some japanese site using java. This was much worse, having to manually go through the problems (I admit I cheated a bit, I put eight problems on a page and only checked each eighth and if it was same I proceeded).

After finally having all and exactly the 183 problems that I wanted, I went to writing whose turn it was (duh, should have done that before, when checking) and change the sizes of the go boards so that it would fit nicely on the page. This was quite tiring, especially the repetitive process of checking “white to move” and “black to move” (I checkedgroups of four and tried to remember it, I was on the verge of my brain’s memory limits – trying to remember BWBW, or WBBB, or something similar for just a few seconds). Fitting diagrams aws a bit like solving a puzzle, so I enjoyed it much more.

And I cheated with the front page Japanese characters… I copied them from sensei’s library into OpenOffice, made the page small enough, and exported into pdf. Then used to embed it… Anyone knows how to do this better?

Well, that’s about it. Now you can download & print the entire Igo Hatsuyo-ron collection (and it’s for free, kids).

If, for some reason, you think that the problems are a bit too much for you, go with the Encyclopedia of Lifa and Death, that I made almost two years ago. There are 3 volumes with almost 1000 problems each (the creation of that collection was pretty much only automatical, I could never process such an amount (3000) by hand). Ok, links, finally: elementary problems, intermediate problems, advanced problems.

You shouldn’t use old (4,5, maybe even 6 (dunno, I use evince or xpdf anyway)) acrobat reader for viewing these pdfs, as I didn’t manage to convert the bloody metafont fonts into anything better like type1 or ttf (any help? anyone volunteering?), so they are included as bitmaps, which sucks.


  1. ^┠┏┗○●

← Particularly frightening Is this move good or is that one better? →

5 thoughts on “Fun with TeX: Igo Hatsuyo-ron”

Keo 2006-11-27

Já zase nedávno dělal z wordovskýho dokumentu HTML. Samozřejmě za peníze, jinak bych do toho nešel. Uložil jsem to v Abiwordu jako HTML (exportuje líp než OO) a pak na to aplikoval následující skript clean.sed. Pak už to bylo skoro čistý HTML, jenom bylo potřeba přidat nadpisy, upravit odkazy atd. Hrůza.

[[redacted]]

Keo 2006-11-27

LOL, vypadá to, že Wordpress to nezvládl.

2006-12-07

Me by dost zajimalo jak dlouhu jsi to delal… Budu se muset o prazdninach crhnout na TeX ;)

Drc 2006-12-07

Anonym jsem ja… Uz zase… viz keo.cz

Ulrich 2006-12-24

Sorry, but can you write down your reply in English please? Thanks. :x

Add your commentHow does this work?