加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
Program.cs 1.10 KB
一键复制 编辑 原始数据 按行查看 历史
冰凌呀 提交于 2022-05-09 20:35 . 添加项目文件。
using System;
using System.Collections.Generic;
namespace ChineseChessPieceRule
{
class Program
{
static void Main(string[] args)
{
char[,] board = new char[,]
{
{ 'r','n','b','a','k','a','b','n','r' },
{ '0','0','0','0','0','0','0','0','0' },
{ '0','c','0','0','0','0','0','c','0' },
{ 'p','0','p','0','p','0','p','0','p' },
{ '0','0','0','0','0','0','0','0','0' },
{ '0','0','0','0','0','0','0','0','0' },
{ 'P','0','P','0','P','0','P','0','P' },
{ '0','C','0','0','0','0','0','C','0' },
{ '0','0','0','0','0','0','0','0','0' },
{ 'R','N','B','A','K','A','B','N','R' },
};
List<int[]> result = PieceRule.GetPiecesMoves(board,"black");
Console.WriteLine(result.Count);
int i = 1;
foreach(var item in result)
{
Console.WriteLine(i+" ==== "+string.Join(" ", item));
i++;
}
}
}
}
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化