Okay it worked! Thank you!
Type: Posts; User: corong1997
Okay it worked! Thank you!
Oh right, so the location isn't updating. I'm not sure how to get the location to update though, any ideas?
Once the Pawn moves to (4,4), the next valid move should be (3,4). It goes (rows, columns), so it's (y,x), and it starts from (0,0) in the top left corner
First call of getMoveLocations(), nothing moved
locX = 6
locY = 4
l1 = (5, 4)
l2 = (4, 4)
getGrid().getValid(l1) returns true
Moves = [(5, 4)]
getGrid().isValid(l2) returns true
After...
locX = 6
locY = 4
l1 = (5, 4)
l2 = (4, 4)
locX = 6
locY = 4
l1 = (5, 4)
l2 = (4, 4)
locX = 6
locY = 4
This is the board2980
I have moved the pawn to E4 (4,4)2981
Now, the only move option it is giving me is one space back (5,4)2982
I move it to that spot2983
Now it just brings up an empty...
l1 and l2 are variables for two different locations
--- Update ---
And yes I tried debugging it, but the code keeps pulling up logic errors I have no idea how to deal with
I am making a chess game in Gridworld. My pawn method is not working. For example, when I use getMoveLocations() on a pawn the first time, it brings up both valid moves. Once I move it two spaces and...
public ArrayList<Location> getAttackLocations()
{
ArrayList<Location> moves = new ArrayList<Location>();
ArrayList<Location> possibleMoves = new ArrayList<Location>();
...
I'm writing a Chess program in Gridworld, and I'm running into a bit of a problem coming up with a line of code that checks if a location is occupied or not. Right now, I am using ...