View Single Post
Old 11-22-2010, 02:16 PM   #7
Flint
Snowflake
 
Join Date: Mar 2006
Location: Dystopia
Posts: 13,136
Quote:
Originally Posted by Pete Zicato View Post
No. Step through the code and ask yourself what would happen if the password were too short and had no digit.
I should explain, the condition of the while loop would be written as:

Quote:
while ((!passLength(password)) || (!containDigit(password)))
...so it actually calls both functions, and should execute the loop if either one (or both) is false.

Once inside the loop, it should keep prompting and re-executing the loop until "false OR false" is false.
...

If I step through using "abc" as the input (too short and has no digit), it would say too short and get a new password. Then evaluate for digits. Then evaluate the loop again. Right?
__________________
******************
There's a level of facility that everyone needs to accomplish, and from there
it's a matter of deciding for yourself how important ultra-facility is to your
expression. ... I found, like Joseph Campbell said, if you just follow whatever
gives you a little joy or excitement or awe, then you're on the right track.

. . . . . . . . . . . . . . . . . . . . . . . . . . Terry Bozzio

Last edited by Flint; 11-22-2010 at 02:31 PM.
Flint is offline   Reply With Quote