中国像棋/redshi.cs
(完整代码) 1KBusing System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Drawing;
namespace 中国像棋
{
class redshi:ChessBase
{
public redshi(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.X < 3 || endpoint.X > 7) return false;
//if (endpoint.Y < 8) return false;
if (endpoint.X < 4 || endpoint.X > 6) return false;
if (startpoint.Y < 8) return false;
if (Math.Abs(endpoint.X - startpoint.X) != 1 || Math.Abs(endpoint.Y - startpoint.Y) != 1)
{
return false;
}
if (Math.Abs(endpoint.X - startpoint.X) == 1 && Math.Abs(endpoint.Y - startpoint.Y) == 1)
{
if (startpoint.X == endpoint.X || startpoint.Y == endpoint.Y)//不能走直线
return false;
int chessnum = 0;
foreach (ChessBase chess in ChessBoard.AllChess)
{
if (endpoint.Y == chess.Y && endpoint.X == chess.X)
chessnum++;
}
if (chessnum != 0) return false;
}
return true;
}
public override bool Noteatablemove(Point startpoint ,Point endpoint)
{
return Eatablemove(startpoint, endpoint);
}
}
}
24 小时内免费解锁 3 个项目,之后 1 算力/个。 规则说明
AI 解读 AI
登录后可用,每次 10 算力,解读结果公开显示在下面。
还没有人解读过这个文件。