Line 12: What does return0h return if none of the cells are 0?
Line 20: ditto
Lines 46-54: What do these values mean? You have no comments. You should consider using a
enum
here. Not providing a comment or using an enum makes your code hard toread.
Line 109,110,120,121,131,132: You've edited your original post, but the code still shows you're using the wrong operator. These should be an assignment (=), not an equality operator (==).
Lines 25,84: You trying to use std::string, but haven't included the <string> header.
if you go LEFT it causes a run time error |
Well, yeah. You're indexing out of bounds.
Line 93,98: What happens when x is 0? These statements become
1 2 3 4
|
if (d[-1][y]
...
d[-1][y] = 0;
|
Both are illegal references.
You have this problem in all four directions.
Lines 56,65,95,106,117,128: You're setting prIsCompleted to an int value. That's legal, but the better practice is to use the
bool
constants
true
and
false
.
Lines 142-145: maze::isCompleted does not need an if statement. Simply return the bool variable.
1 2 3
|
bool maze::isCompleted()
{ return prIsCompleted;
}
|