I think i do,
but what i posted before does what you have asked I believe.
1 2 3 4
5 6 7 8
9 10 11 #
13 14 15 12
Enter a number: 12
The user enter the number 12. so the if statement should...
Type: Posts; User: thatguy
I think i do,
but what i posted before does what you have asked I believe.
1 2 3 4
5 6 7 8
9 10 11 #
13 14 15 12
Enter a number: 12
The user enter the number 12. so the if statement should...
public void move(int tileNumber) {
if (!isValid(tileNumber)) {
return;
}
for (int r = 0; r < boardSize; r++) {
for (int c = 0; c < boardSize;...
Here an example
you enter in 12 and the move method will switch the 12 with the empty space like so.
1 2 3 4
5 6 7 8
9 10 11 #
13 14 15 12
but if you enter 12 again it i will not...
I am building a class called TilePuzzle and it is a text base game and it looks like this.
1 2 3 4
5 6 7 8
9 10 11 12
13 14 15 #
The way I programmed the move method it looks...