tags:

views:

184

answers:

1

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

+1  A: 

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;
}
glowcoder