Boolean matrix problems

Jul 26, 2011 at 6:29am
Hello, I am having problems defining a Boolean matrix for a maze program I am writing. I am wondering what is wrong with my code. I am trying to receive values from the Boolean matrix for wall information, true= wall false= space. The programming is messy, but I don't know of a cleaner way to do it, also is the matrix automatically tied to coordinates? Thanks for your help and time.


// I initialize the function here
void walls(bool[8][12]);



//I am trying to define the matrix here but when I compile the program it says that "expected constructor, destructor, or type conversion before '=' token"

walls( bool[8][12])= {true,true,true,true,true,true,true,true,true,true,
true,true,true,true,false,false,false,false,true,false,false,false,
true,false,false,true,true,false,false,true,true,true,false,true,
false,true,false,true,true,true,false,true,true,false,false,false,true,
false,false,false,true,true,true,false,false,true,false,true,false,true,
false,true,false,true,true,true,true,false,true,false,true,false,true,
true,true,false,true,true,true,false,false,true,false,true,false,true,
false,true,false,true,true,true,false,true,true,false,true,false,true,
false,true,false,true,true,true,false,false,false,false,true,false,true,
false,false,false,true,true,true,true,true,true,true,true,true,true,true,
true,true,true,true};
Jul 26, 2011 at 8:43am
I think I figured out my problem, however I am having a huge problem linking the boolian matrix to the coordinate matrix, what keyword would I use if doing it one value at a time
IE: [0][0]= true.....ect


or is there an easier way to do it
Jul 26, 2011 at 12:10pm
I guess this const bool walls[8][12] = {true,true,true,true,true, ... is what you want.

What do you mean by
linking the boolian matrix to the coordinate matrix
?

if the coordinate is not in the same space (maybe pixel or so?) you have to transform it
Topic archived. No new replies allowed.