ytwendy
asked on
Chess Java
Hi guys I would like someone to help me put all this together.
It.s supposed to be a text based chess game capable of AI. I am stuck here because it is returning null when the pieces.isValid(Baseboard[c urY][curY] .toString( ), desY); is called
Feel free to change anything. If their is any possibility of getting this up to speed I will appreciate it.
chess.java
Pieces.java
Pawn.java
It.s supposed to be a text based chess game capable of AI. I am stuck here because it is returning null when the pieces.isValid(Baseboard[c
Feel free to change anything. If their is any possibility of getting this up to speed I will appreciate it.
chess.java
Pieces.java
Pawn.java
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Try this one:
public void makeMove()
// make the move with the coords suplied from askMove method
{
if (Baseboard[curX][curY] != null
&& Baseboard[curX][curY].isValid(Baseboard[curX][curY]
.toString(), desY)) {
Baseboard[desX][desY] = Baseboard[curX][curY]; // Move the piece.
Baseboard[curX][curY] = null;
reDraw();
} else {
System.out.println("Can't go here");
}
}
ASKER
The other pieces are similar classes as the Pawn class.