The Cellar  

Go Back   The Cellar > Main > Technology
FAQ Community Calendar Today's Posts Search

Technology Computing, programming, science, electronics, telecommunications, etc.

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Old 11-24-2010, 09:05 AM   #24
Flint
Snowflake
 
Join Date: Mar 2006
Location: Dystopia
Posts: 13,136
When I call containDigit("abc")...

Quote:
Please enter a password: abcdef
Passwords must include at least on digit (1-9)
Please enter a password: abc
Passwords must be at least 6 characters long
Please enter a password: abc123
Thank you that is a valid password

Press Enter to close window...
If a condition is met, he loop "toggles" to the next false condition. If you DON'T meet the condition, you are stuck at that point until it is met (calling that same bool function with your input). Once you enter the correct input, the loop falls through to evaluate the next condition. Repeat. No matter what you input into my program, you can't make it break, and you can't make it behave wrongly. It works with 100% accuracy.

Again, the while function simply decides whether to enter the loop or not at each iteration.

Quote:
A function can only be false if it is called and executed.
That seems to make sense, but running my program suggests otherwise.

I find it hard to argue with the fact that what I've done works. Because it works.

Quote:
You don't see the problem in your execution because your while loop corrects for the behavior of the test functions. But if you tested the functions individually, you would see it.
I am interested to test this, but not right now, as I am about to leave to go to our cabin in the country where we have no internet and no cell phone service! Thanks for your thoughts and conversation on this--I am new to this and it really helps me to bounce ideas off of people such as yourself that I trust are logical. :::checking out:::
__________________
******************
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
 


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

All times are GMT -5. The time now is 08:13 AM.


Powered by: vBulletin Version 3.8.1
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.