I have a dynamic array [bool] called terrain. I was wondering why my code doesn't work until I had to cout<<terrain[y][x], which returned 205 when false and 105 when true.
I want my code to use
if (terrain[y][x]==false)
instead of
if (terrain[y][x]==205)
How do I do this?
You allocate space for the bool arrays, but you never set anything explicitly to true/false. That is my best guess. Also, that program crashes for me, even if I fix it to work with true/false. I'm guessing it is because the program is trying access the array out of its intended boundaries. How to fix it? I have no idea. I'm guessing it is a problem with the +/- 1 parts. :)
Sorry, I forgot to add a bunch of stuff, and I can't add because I lost my source
But I did set them explicitely as true and false in map generation.
What's weird is that, when I said terrain[y][x]==true.
The things that are missing are includes, as well as the scripts
generate_maze(), clscr(), and gotoxy()