View Single Post
Old 11-23-2010, 11:34 AM   #14
Flint
Snowflake
 
Join Date: Mar 2006
Location: Dystopia
Posts: 13,136
Quote:
Originally Posted by HM
You are reading new passwords all over the place.
...
You should only do one getline() per loop.
I understand what you're saying, but the program has to do this:

Quote:
Please enter a password: pass6

Passwords must be at least 6 characters long


Please enter a password: TarrantNW

Passwords must include at least one digit (1-9)


Please enter a password: Tccd03

Thank you that is a valid password
Quote:
Originally Posted by HM
What if the password you read in passLength() is good? You return false anyway and ask for a new one at the next step.
If the password I read in passLength is good (true for both conditions) then it is not false for containDigit. containDigit only runs on the condition of containDigit being false. If it is true, containDigit is not called, and the while condition of the loop exits to main function.
__________________
******************
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
Flint is offline   Reply With Quote