谁能帮忙翻成C语言
解析sgf棋谱(;CA[gb2312]SZ[19]AP[MultiGo:4.4.4]MULTIGOGM[1]
;B[qd];W[dp];B[dc];W[ce];B[pq];W[qo];B[pl];W[oc];
解析成r16,d4,d17,c15,q3,r5......
把下面的代码翻译一成C语言,谢谢!
private void Window_Loaded(object sender, RoutedEventArgs e)
{
SGFFile.Text = sgf_string = File.ReadAllText("1.sgf");
}
private void Button_Click(object sender, RoutedEventArgs e)
{
string[] lines = sgf_string.Split(';') ;
foreach (var i in lines)
{
if(i.StartsWith("B") || i.StartsWith("W") )
{
string a = i.Substring(2).Remove(2);
string x = a.Remove(1);
if(System.Text.Encoding.ASCII.GetBytes(x)[0]> System.Text.Encoding.ASCII.GetBytes
("l")[0])
{
byte[] array = new byte[1];
array[0] = (byte)(Convert.ToInt32(System.Text.Encoding.ASCII.GetBytes(x)[0] 1));
x = Convert.ToString(System.Text.Encoding.ASCII.GetString(array));
}
string y = a.Substring(1);
y = (System.Text.Encoding.ASCII.GetBytes("s")[0] -
System.Text.Encoding.ASCII.GetBytes(y)[0] 1).ToString();
decode = decode x y ",";
}
}
decode = decode.Remove(decode.Length-1,1);
SGFDecode.Text = decode;
}
}