C++ Help with a Code
Go to solution
Solved by 56KBs,
Hi ichihgo,
You've got a problem with your logic if you're trying to detect when it is not X, O or ., in the case of your code:
if(x[i][j] != 'X' || x[i][j] != 'O' || x[i][j] != '.')
You're doing if it is not X or it is not O or it is not ., what you want to be doing is if it is not X and it isn't O and it isn't . then flag as illegal, what you want is:
if(x[i][j] != 'X' && x[i][j] != 'O' && x[i][j] != '.')
Hope this helps

Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now