bool good() { int counter = 0; for(int i = 0; i < MAX; i++) { for(int n = 0; n < MAX; n++) { if(board[i][n] == 1) { counter++; if(counter >= 2) { return false; } } } counter = 0; } for(int n = 0; n < MAX; n++) { for(int i = 0; i < MAX; i++) { if(board[i][n] == 1) { counter++; if(counter >= 2) { return false; } } } counter = 0; } int n = 0; for(int s = 0; s < MAX; s++) { for(int i = s; i < MAX; i++) { if(board[i][n] == 1) { counter++; if(counter >= 2) { return false; } } n++; } n = 0; counter = 0; } int i = 0; for(int s = 0; s < MAX; s++) { for(int n = s; n < MAX; n++) { if(board[i][n] == 1) { counter++; if(counter >= 2) { return false; } } i++; } i = 0; counter = 0; } n = 0; for(int s = 7; s <= 0; s--) { for(int i = s; i <= 0; i--) { if(board[i][n] == 1) { counter++; if(counter >= 2) { return false; } } n++; } n = 0; counter = 0; } i = 0; for(int s = 7; s < MAX; s++) { for(int n = s; n <= 0; n--) { if(board[i][n] == 1) { counter++; if(counter >= 2) { return false; } } i++; } i = 0; counter = 0; } return true; }

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)