7 #ifndef SEARCH_GAME_HPP 8 #define SEARCH_GAME_HPP 28 explicit Game(
int dimension) {
30 int **representation =
new int *[dimension];
34 for (
int x = 0; x < dimension; x ++) {
35 representation[x] =
new int[dimension];
37 for (
int y = 0; y < dimension; y ++) {
38 representation[x][y] = val ++ % (dimension * dimension);
Class representing the rules of a game.
GameState()
Default constructor, everything starts as 0 or NULL.
void setRepresentation(int **representation)
Game(int dimension)
Creates a game representation and keeps a GameState of the goal state.
GameState * getGoal() const
Describes a single state in the 8-puzzle.