if(y-- > 0 && matriz[x][y--]!=9 && matriz[x][y--]!=0)
When i’m doing this, my variable y is not decremented, right? And i can do this comparison y– > 0?
Imagine that i have y=0, i want to compare if -1 > 0.
Thanks
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Assuming all tests pass, your code is effectively equivalent to this:
If any fail, you still decrement (equivalence would be in an else-clause), but I’m omitting that for brevity.
Hopefully this is enough to clarify. I find it quite unwieldy, and if
y < 2at the start you’ll end up with a negative index, which is probably a bad thing.