Think about it a bit more: If the user enters 'X', it enters the while loop because 'X' ne 'Y', right?
If the user enters 'Y' then the first bit of your conditional fails ('Y' eq 'Y') so it continues to the next bit--but 'Y' ne 'y' so the conditional is satisfied anyway.
Any character you enter will satisfy one of the parts of your while condition. I suggest you think about your logic AND change the conditional to make it do what you want. ;^)
...roboticus
When your only tool is a hammer, all problems look like your thumb.
In reply to Re: comparison of character
by roboticus
in thread comparison of character
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |