I want write Domino game with recursive function and now i have problem in this function and i am hopeful to help me,the follow code:
bool Domino(vector<vector<int> >matrix,int n){
bool value=false;
vector<vector<int> >result;
if(value == true){
print(result);
return true;
}
for(unsigned int i=0 ; i<matrix.size() ; i++){
for(unsigned int j=0 ; j<matrix[i].size() ; j=j+2){
if(check_is_valid(matrix,i,j,i,j+1,n)){
if(value == true){
Domino(matrix,n);
}
}
}
}
return false;
}
i get a boolean variable that set it to false and i want to set in to true when the domino is valid and now i don't know where i should change it to true or false !
thank for help
Comments
Leave a comment