I am having hard time understanding what the problem is with my code here. Basically I have a map that contains Key objects as the key, and Block* as the value. The point of this for loop is to print out the values that the key contains on to the console in the form of a game board. However it is only printing one role, in a infinite loop. the variable r never gets incremented for some reason. if you guys could help that would be great. Thanks in advance!
for (int r=0; r::iterator it = blocks.begin(); it != blocks.end(); ++it){
Key key = it->first;
int x = key.getX();
int y = key.getY();
if (r=y && c==x){
Block *block = it->second;
name = block->getBlockName();
break;
}
else {
name = "__ ";
}
}
std::cout<