Class representing the rules of a game.
More...
#include <Game.hpp>
Class representing the rules of a game.
- Author
- Douglas De Rizzo Meneghetti (dougl.nosp@m.asri.nosp@m.zzom@.nosp@m.gmai.nosp@m.l.com)
- Date
- 2017-6-22Class representing the rules of a game. Used to generalize the search algorithms to any dimension of the 8-puzzle game.
Definition at line 15 of file Game.hpp.
◆ ~Game()
◆ Game()
Game::Game |
( |
int |
dimension | ) |
|
|
inlineexplicit |
Creates a game representation and keeps a GameState of the goal state.
- Parameters
-
dimension | dimensions of the puzzle board. |
Definition at line 28 of file Game.hpp.
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);
void setRepresentation(int **representation)
Describes a single state in the 8-puzzle.
◆ getGoal()
◆ goal
The documentation for this class was generated from the following file: