首页
社区
课程
招聘
未解决 [求助]怎么解析sgf棋谱
发表于: 2019-1-9 13:32 1035

未解决 [求助]怎么解析sgf棋谱

2019-1-9 13:32
1035
(;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......有没有现存的库,不想重复造轮子了。

[培训]《安卓高级研修班(网课)》月薪三万计划,掌握调试、分析还原ollvm、vmp的方法,定制art虚拟机自动化脱壳的方法

收藏
免费 0
支持
分享
最新回复 (2)
雪    币: 1540
活跃值: (2807)
能力值: ( LV2,RANK:10 )
在线值:
发帖
回帖
粉丝
2
现在有这段代码,谁能翻译成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;
}
}
2019-1-9 15:48
0
雪    币: 5
能力值: ( LV1,RANK:0 )
在线值:
发帖
回帖
粉丝
3
很棒呀 
2019-1-17 20:28
0
游客
登录 | 注册 方可回帖
返回
//