I'm trying to write a 4 x 4 grid using vertical bars and underscore. I have a class for the puzzle, but i want to know what fields and methods i can use to represent and manipulate a configuration for the puzzle.
Reference: Fifteen puzzle
I'm trying to write a 4 x 4 grid using vertical bars and underscore. I have a class for the puzzle, but i want to know what fields and methods i can use to represent and manipulate a configuration for the puzzle.
Reference: Fifteen puzzle
I agree, you could give more information... however, consider an approach like this:
In your puzzle class, you may have a Value[][] member for storing the values. You could do something like this
public Value get(int x, int y) {
return values[x][y];
}
public void set(int x, int y, Value v) {
values[x][y] = v;
}