i have my main and a function that deals with an array.
public static void Main(string[] args)
{
Pieces [,] pieces;
ChessBoard(out pieces[,]); // The IDE shows that the mistake is here.
It says that the overloaded method has some invalid arguments!
How can i make it so that pieces will obtain the array?
}
public static void ChessBoard(out Pieces [,] piece )
{
piece =new Pieces[9,9];
piece[1,1]=new Rook("WR");
piece[1,2]=new Knight("WKN");
piece[1,3]=new Bishop("WB");
piece[1,4]=new Queen("WQ");
piece[1,5]=new King("WK");
piece[1,6]=new Bishop("WB");
piece[1,7]=new Knight("WKN");
piece[1,8]=new Rook("WR");
piece[2,1]= new Pawn("WP");
piece[2,2]=new Pawn("WP");
piece[2,3]=new Pawn("WP");
piece[2,4]=new Pawn("WP");
piece[2,5]=new Pawn("WP");
piece[2,6]=new Pawn("WP");
piece[2,7]=new Pawn("WP");
piece[2,8]=new Pawn("WP");
piece[7,1]= new Rook("BR");
piece[7,2]= new Knight("BKN");
piece[7,3]= new Bishop("BB");
piece[7,4]= new Queen("BQ");
piece[7,5]= new King("WK");
piece[7,6]= new Bishop("BB");
piece[7,7]= new Knight("BKN");
piece[7,8]= new Rook("BR");
piece[8,1]=new Pawn("BP");
piece[8,2]=new Pawn("BP");
piece[8,3]=new Pawn("BP");
piece[8,4]=new Pawn("BP");
piece[8,5]=new Pawn("BP");
piece[8,6]=new Pawn("BP");
piece[8,7]=new Pawn("BP");
piece[8, 8] = new Pawn("BP");
}