前田稔(Maeda Minoru)の超初心者のプログラム入門
![]()
![]()
(;GM[1]FF[4]CA[UTF-8]AP[CGoban:3]ST[2] RU[Japanese]SZ[19]KM[0.00] GN[Kogo's Joseki, Jeongseok, Di`ngshi` Dictionary]DT[13.9.2007]CP[see below]GC[No commercial distribution. Please, no non-commercial distribution without permission and a link to the KJD webpage. Contact kogo@waterfire.us. or kogo on KGS Updates available at: http://waterfire.us/joseki.htm. Copyright 2006-2007 by Andre Ay. Copyright 1998-2005 by Gary Odom. Portions copyright 2000-2001 by Stefan Verstraeten. ]EV[]PC[]SO[]LB[nc:F][oc:D][qc:A][nd:G][od:E][pd:C][qd:B][oe:H][qj:I]]VW[] ( ・・・ 以下棋譜が続きます |
// SGF FILE をロード
private void LoadSGF(string file_name)
{
if (!File.Exists(file_name)) return;
StreamReader reader = new StreamReader(file_name,Encoding.GetEncoding("utf-8"));
m_SGF= reader.ReadToEnd();
reader.Close();
int find = m_SGF.IndexOf("CA[UTF-8]", 0, 80);
if (find<0)
{ reader = new StreamReader(file_name, Encoding.GetEncoding("shift_jis"));
m_SGF = reader.ReadToEnd();
reader.Close();
}
・・・
|
string head = "(\r\n;FF[4]CA[UTF-8]GM[1]AP[IGO Soft by maeda Ver-2]SZ[19]";
|
// SGF ファイルに保存
private void SGFSave(string file)
{ DialogResult rc;
if (File.Exists(file))
{ rc = MessageBox.Show("上書きで保存しますか", "選択",
MessageBoxButtons.YesNo, MessageBoxIcon.Question);
if (rc == DialogResult.No) return;
}
writer = new StreamWriter(file,false, Encoding.GetEncoding("utf-8"));
writer.WriteLine(head);
・・・
|
LB[xy:m] (座標xyに文字mをマーク) (;W[pd]LB[ob:c][oc:b][qd:a]] |
( ;FF[4]CA[UTF-8]GM[1]AP[IGO Soft by maeda Ver-2]SZ[19] AB[bc][cc][db]AW[cd][cf][dc][de][eb][ec] ;B[ca]LB[ab:a][bb:b][ea:c]] (;W[ab];B[bb];W[ea];B[aa]LB[ba:a][da:b]] (;W[ba];B[ac];W[da];B[cb]) (;W[da];B[cb];W[ba];B[ac])) (;W[bb];B[ab];W[ba];B[bd];W[be];B[ad]) (;W[ea];B[ab];W[bd];B[ba])) ) |
![]()
[Next Chapter ↓] LB tag をプログラム
[Previous Chapter ↑] 分岐の入力