コード例 #1
0
        public SquareBoard Build()
        {
            var board = new SquareBoard(8);

            board.Set(Figure.CreateSimple(1, 7, Side.Red));
            board.Set(Figure.CreateSimple(1, 3, Side.Red));
            board.Set(Figure.CreateSimple(2, 2, Side.Black));
            //board.Set(Figure.CreateSimple(7, 0, Side.Black));
            return(board);
        }
コード例 #2
0
        public SquareBoard Build()
        {
            var board = new SquareBoard(8);

            for (int i = 0; i < board.Size; i++)
            {
                for (int j = 0; j < board.Size; j++)
                {
                    if (i == 3 || i == 4)
                    {
                        continue;
                    }

                    var side = i < 3 ? Side.Red : Side.Black;
                    if (i % 2 != j % 2)
                    {
                        board.Set(Figure.CreateSimple(i, j, side));
                    }
                }
            }
            return(board);
        }