domingo, 18 de fevereiro de 2007

42 - Como criar um arquivo em formato SGF

Em muitos sites são publicadas partidas de Go. Algumas partidas podem ser baixadas já em formato SGF (Smart Game Format). Porém, muitas são apresentadas em formato texto (ou seja, é publicado apenas a codificação SGF) e precisam ser convertidas para SGF. O procedimento para gravar um texto em formato SGF é muito simples. Abaixo, instruções sobre como gravar uma partida em formato SGF utilizando o processador de texto Word, da Microsoft.

Texto de exemplo:
(Fonte: http://www.msoworld.com/mindzine/news/orient/go/sgf/longshi1.sgf)


(;SZ[19]FF[3]
PW[Huang Longshi]
PB[Zhou Donghou]
DT[Late 17th century]
RU[Old Chinese]
RE[W+]
SO[Huang's Collected Games, #1]
US[GoGoD95]
AB[pp][dd]
AW[pd][dp]
;W[qn];B[fq];W[kq];B[qf];W[mc];B[kc];W[fc];B[qj];W[on];B[cn]
C[Zhou Donghou once said that when players are evenly matched and the
other side has first move, it is impossible to achieve victory by using orthodox
moves. It is necessary to use unorthodox moves to seek complications. On the
whole this is not a sound theory. The double attack on the corner with C6 instead
of defending at N3 is an example of this.]
;W[eo]
C[Not especially severe, but versatile. Once he sees how Black responds, he can
prepare ways to press on either side. Good.]
;B[iq];W[ci];B[ck];W[cf];B[df];W[dg];B[ce];W[bf];B[eg];W[be];B[bd];W[cc];B[cd];W[ef]
;B[de];W[dh];B[ff]
C[Ineffectual. He should block off the corner at D17.]
;W[dc];B[bp]
C[Impetuous, just like C6.]
;W[er]
C[This and White's next two moves show great insight.]
;B[fr];W[eq];B[fp];W[bq];B[cq]
C[Black feels unable to pull back to B5. This is the problem with the
double-wing attack on the corner. He should still play N3.]
;W[bo]
C[Now Black will find it troublesome to look after both his outside groups.]
;B[br];W[co];B[dn];W[cp];B[aq];W[en];B[bn];W[ao];B[ep];W[do];B[dq]
C[Once he played B6, Black left himself no option but to capture these two stones.]
;W[ek]C[Now this is White's privilege, and it is all because of the foresight of E2
and the impetuosity of C3.]
;B[em];W[fm];B[el];W[fl];B[dk];W[ej]
C[Steadier and more careful would be the solid connection at F9.]
;B[bj]
C[Should be at A6 to seek life.]
;W[an];B[cm];W[bl];B[cl];W[am]
C[White has foreseen all of this and the next twenty moves. Black's replies may be
considered forced.]
;B[fn];W[fo];B[gn];W[go];B[hn];W[ho];B[fk];W[gl];B[ei];W[dj];B[fj];W[bi];B[io];W[bk]
;B[il];W[gj];B[hp];W[dm];B[dl];W[cj];B[no]
C[Should be at R5 first. Then there are even more variations.]
;W[jp];B[ip];W[nq];B[or]
C[Both players play the ensuing moves correctly.]
;W[nr];B[oq];W[oo];B[np];W[op];B[mq];W[mr];B[mp];W[lq];B[ns];W[lr];B[qq];W[rp]
C[White is like the proverbial butcher who skilfully wields his knife with room to spare.]
;B[nn]
C[Insufferable. He should block at S3.]
;W[rq];B[om];W[po];B[qo];W[pn];B[rr];W[qp]
C[Start of a brilliant 20-move sequence. He bides his time and shows no anxiety about
taking the corner.]
;B[pq];W[sr];B[qs];W[kn];B[ko];W[jo];B[jn];W[lo];B[km];W[ln];B[nl];W[jm];B[in];W[kl]
;B[sq];W[sp];B[rm]
C[Seals White in before playing the ko. But White's group has already established a base
and Black must get three moves before he can settle the ko. Yet Black has no option but
to play the ko in earnest.]
;W[rn];B[qm];W[jr];B[sn];W[rs];B[ss];W[qr];B[sq];W[gp];B[gq];W[sr];B[pr];W[rs];B[pm]
;W[ro];B[ss];W[mm];B[nm];W[rs];B[lp];W[kp];B[ss];W[ic];B[sq];W[pf];B[sr];W[qe]
C[With J17, Q14 and this, White has gained double what he lost in the ko. He has extracted
the utmost from all the complications. But J17 should really have been the peep at F16.
Having reassured himself that he can give up the lower right corner, he could have freely
forced White by making more ko threats and so acted even more decisively. Moreover, he
ought not to have left his weak group in the botton centre in doubt. He cannot be totally
satisfied.]
;B[fd];W[gc];B[ee]
C[Steady and careful.]
;W[qg];B[hd];W[hc]
C[Best under the circumstances, his attack having lost time.]
;B[qc];W[pc];B[rf];W[rg];B[pb];W[ob];B[rd];W[re];B[rb];W[je];B[nb];W[oa]
C[Resolutely denies Black the connection along the edge.]
;B[ke];W[kf];B[jf];W[jd];B[lf];W[kg];B[oc];W[nc];B[od];W[mb];B[oe];W[qd];B[of];W[og]
;B[ng];W[nh];B[oh];W[pg];B[mg];W[mh]
C[This and his next are overplays. He should seal off his territory with L16.]
;B[lh];W[lg]
C[Once he cuts here, White must play N14 and later go back to L16. There will be a ko
for the group on the outside, and so he cannot yet settle the game. It ought not to
have come to this.]
;B[jg];W[kh];B[li];W[mf];B[nf];W[mj];B[me];W[kd];B[ld];W[lc];B[lj]
C[A mistake. It is too weak, and should be K11. He should start the ko in order to
seek a trade, and of course to turn a lost game into victory. He should certainly do this,
because both the top right and top left corners still have potential.]
;W[jh];B[ih];W[ji];B[oi];W[ii];B[kk];W[fh]
C[With J11 and this, Black's corner group is already doomed.]
;B[ir];W[fi];B[ri]
C[Sets up a ko, but Black cannot win it because of White's large group below.]
;W[sd];B[sc];W[rc];B[hk];W[gk];B[rd];W[lk];B[ll];W[rc];B[cg];W[bg];B[rd];W[mk];B[mi]
;W[rc];B[jl]
C[No option, even though it means losing the corner - this is all because of the hasty M10.]
;W[qb];B[hg];W[hf];B[ij];W[hi];B[jj]
C[White won. With such imprecise calculations it may seem this game is not worthy of
selection as a masterpiece, but it keeps its place because White's moves were deeply
significant and brilliant, and the way he played when he leisurely ignored the ko in the
bottom right was wonderful.])

Procedimento para gravar um texto em formato SGF

  1. Abra o processador de texto e crie um “Novo documento em branco”.
  2. Acesse a página Web da partida.
  3. Selecione o texto de exemplo - de (;SZ até wonderful.]) - e execute o comando de cópia Ctrl + C (ou clique em Editar e selecione copiar).
  4. Em “Novo documento em branco”; clique em Editar e selecione: Colar especial... /Texto não formatado. E execute a cópia não formatada.
  5. Clique em Arquivo, Salvar como e defina os parâmetros:
    a) indique onde o arquivo será salvo;
    b) nome do arquivo - que deve ser colocado entre aspas seguido de .SGF, exemplo: “partidateste.sgf”;
    c) salvar como tipo – escolha somente texto: Texto sem formatação (*.txt);
    d) confirme a conversão Windows (padrão).
  6. Salve o arquivo.
  7. Ao executar o comando de salvar, o processador cria o arquivo partidateste.sgf, no microcomputador.

Pronto! Utilize um leitor de SGF e reproduza a partida. Não possui nenhum programa que permita a leitura de arquivo SGF? Então baixe e instale o MultiGo. No site GOBR você poderá obter mais informações sobre a instalação do MultiGo.