Link to home
Start Free TrialLog in
Avatar of sisqu
sisquFlag for Bulgaria

asked on

first steps -> How "Mazes" have been made

Do you have a idea, how to present a "maze"  in C++. Especialy how to present a structure of DATA , I heard
that  I must to describe neibourgh cells e. tc?
ASKER CERTIFIED SOLUTION
Avatar of _iskywalker_
_iskywalker_

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of sisqu

ASKER

Yes, but I mean how to present if the cell is wall,how to walk over the matrix and mark cells have already visited, how to return and change may way
this tings.........................
Avatar of _iskywalker_
_iskywalker_

well that you can define by the cell type like
typdef struct mazecell{
int type;
bool visited;
}

mazecell mymaze[10][10];
Avatar of sisqu

ASKER

There havent easier way :(
what is hard in it? you can also create a class instead of a struct, but you need some data strcuture to describe your maze cell, if you need many information about the cell, you can also create for every information you need a matrix like:
int visited[10][10];
int type[10][10];
so i would propose the creating a class cell and making a matrix of it, since in the class you can add any property which will be add to every cell.
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial