• 大小: 49KB
    文件类型: .rar
    金币: 1
    下载: 0 次
    发布日期: 2021-06-10
  • 语言: 其他
  • 标签: 象棋  cmd  

资源简介

cmd版象棋 用字符描述象棋 命令式操作

资源截图

代码片段和文件信息


namespace xiangqi
{
    public class Bing : Chess
    {
        public Bing(string name string camp int x int y int num)
        {
            this.Name = name;
            Camp = camp;
            X = x;
            Y = y;
            Num = num;
        }
        /// 
        /// 兵类第几个对象
        /// 

        public int Num;
        /// 
        /// 移动旗子
        /// 

        /// x坐标
        ///         /// 
        /// e=“y“>y坐标
        /// 
        public override int Move(int x int y)
        {
            ChessBoard cb = new ChessBoard();
            if (x > 8 || y > 9 || x < 0 || y < 0)
            {
                return 0;
            }
            if (ChessBoard.Coordinate[Y X].Camp.Equals(“部落“))
            {
                if (y > 6 || y > 4 && x == 1 || y > 4 && x == 3 || y > 4 && x == 5 || y > 4 && x == 7)
                {
                    return 0;
                }
            }
            if (ChessBoard.Coordinate[Y X].Camp.Equals(“联盟“))
            {
                if (y < 3 || y < 5 && x == 1 || y < 5 && x == 3 || y < 5 && x == 5 || y < 5 && x == 7)
                {
                    return 0;
                }
            }
            if (x - X == 1 && Y == y || x - X == -1 && Y == y || x == X && y - Y == 1 && ChessBoard.Coordinate[Y X].Camp.Equals(“联盟“) || x == X && y - Y == -1 && ChessBoard.Coordinate[Y X].Camp.Equals(“部落“))
            {
                int iny = Y;
                int inx = X;
                ChessBoard.Coordinate[y x] = ChessBoard.Coordinate[Y X];
                ChessBoard.Coordinate[Y X] = cb.nul;
                ChessBoard.Coordinate[Y X].X = inx;
                ChessBoard.Coordinate[Y X].Y = iny;
                X = x;
                Y = y;
                return 1;
            }
            return 0;
        }
    }
}

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----

     文件        859  2012-07-17 22:15  CmdChinaChess\Chess.sln

     文件      26624  2012-07-30 10:14  CmdChinaChess\Chess.suo

     文件      16384  2012-07-30 10:14  CmdChinaChess\xiangqi\bin\Debug\xiangqi.exe

     文件      48640  2012-07-30 10:14  CmdChinaChess\xiangqi\bin\Debug\xiangqi.pdb

     文件      11600  2012-07-30 10:14  CmdChinaChess\xiangqi\bin\Debug\xiangqi.vshost.exe

     文件        490  2010-03-17 22:39  CmdChinaChess\xiangqi\bin\Debug\xiangqi.vshost.exe.manifest

     文件       2032  2012-07-22 19:27  CmdChinaChess\xiangqi\Bing.cs

     文件       3255  2012-07-23 08:36  CmdChinaChess\xiangqi\Che.cs

     文件        854  2012-07-22 19:27  CmdChinaChess\xiangqi\Chess.cs

     文件       2754  2012-07-17 21:25  CmdChinaChess\xiangqi\Chess.csproj

     文件       7268  2012-07-24 16:09  CmdChinaChess\xiangqi\ChessBoard.cs

     文件       2113  2012-07-25 01:02  CmdChinaChess\xiangqi\Ma.cs

     文件        281  2012-07-30 10:14  CmdChinaChess\xiangqi\obj\x86\Debug\Chess.csproj.FileListAbsolute.txt

     文件       5760  2012-07-30 10:14  CmdChinaChess\xiangqi\obj\x86\Debug\DesignTimeResolveAssemblyReferencesInput.cache

     文件       5941  2012-07-23 08:36  CmdChinaChess\xiangqi\obj\x86\Debug\ResolveAssemblyReference.cache

     文件        670  2012-07-17 22:14  CmdChinaChess\xiangqi\obj\x86\Debug\xiangqi.csproj.FileListAbsolute.txt

     文件      16384  2012-07-30 10:14  CmdChinaChess\xiangqi\obj\x86\Debug\xiangqi.exe

     文件      48640  2012-07-30 10:14  CmdChinaChess\xiangqi\obj\x86\Debug\xiangqi.pdb

     文件       4363  2012-07-22 19:27  CmdChinaChess\xiangqi\Pao.cs

     文件       4612  2012-07-24 12:14  CmdChinaChess\xiangqi\Program.cs

     文件       1360  2012-07-17 22:14  CmdChinaChess\xiangqi\Properties\AssemblyInfo.cs

     文件       1590  2012-07-22 19:27  CmdChinaChess\xiangqi\Shi.cs

     文件       1442  2012-07-25 01:02  CmdChinaChess\xiangqi\Shuai.cs

     文件       1601  2012-07-25 01:02  CmdChinaChess\xiangqi\Xiang.cs

     目录          0  2012-07-16 12:29  CmdChinaChess\xiangqi\obj\x86\Debug\TempPE

     目录          0  2012-11-25 12:59  CmdChinaChess\xiangqi\obj\x86\Debug

     目录          0  2012-11-25 12:59  CmdChinaChess\xiangqi\bin\Debug

     目录          0  2012-11-25 12:59  CmdChinaChess\xiangqi\obj\x86

     目录          0  2012-11-25 12:59  CmdChinaChess\xiangqi\bin

     目录          0  2012-11-25 12:59  CmdChinaChess\xiangqi\obj

............此处省略6个文件信息

评论

共有 条评论