中国像棋/blackbing.cs
(完整代码) 1KBusing System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Drawing;
namespace 中国像棋
{
class blackbing : ChessBase
{
public blackbing(int x, int y, string Imgpath, ChessType type,CheckWin edg) : base(x, y, Imgpath, type,edg)
{
}
public override bool Eatablemove(Point startpoint, Point endpoint)
{
if (endpoint.Y <6)//黑兵没有过界
{
if (startpoint.Y - endpoint.Y > 0 || Math.Abs(endpoint.X - startpoint.X) > 0)
return false;
//if (startpoint.Y-endpoint.Y>0)//黑兵未过界之前,只能前进
// return false;
//if (Math.Abs(endpoint.X - startpoint.X) > 0)//黑兵未过界时,不能左右移动
// return false;
}
if (endpoint.Y > 5)//黑兵已经过界了
{
if (startpoint.Y - endpoint.Y > 0 || endpoint.Y - startpoint.Y >= 2 || Math.Abs(endpoint.X - startpoint.X) >= 2)
return false;
//if (startpoint.Y - endpoint.Y > 0)//黑兵未过界之后,只能前进
// return false;
//if (endpoint.Y - startpoint.Y >= 2)//过界之后一次竖向走两格以上,返回false;
// return false;
//if (Math.Abs(endpoint.X - startpoint.X) >= 2)//过界之后一次横向走两格或两格以上,返回false;
// return false;
}
return true;
}
public override bool Noteatablemove(Point startpoint, Point endpoint)
{
return Eatablemove(startpoint, endpoint);
}
}
}
24 小时内免费解锁 3 个项目,之后 1 算力/个。 规则说明
AI 解读 AI
登录后可用,每次 10 算力,解读结果公开显示在下面。
还没有人解读过这个文件。