Thread: Endless shampoo loop

  1. #1
    the Corvetter
    Join Date
    Sep 2001
    Posts
    1,584

    Endless shampoo loop

    I was just reading the back of a shampoo bottle and the directions were this:

    -apply to hair
    -rinse
    -repeat

    This is a never ending loop! Put into code:
    Code:
    while (1)
    {
        applyToHair(shampoo);
        rinse(hair);
    }
    Can you ctrl-c out of this one when washing your hair?

    --Garfield the Great
    1978 Silver Anniversary Corvette

  2. #2
    Disagreeably Disagreeable
    Join Date
    Aug 2001
    Posts
    711
    LOL, I've always wondered about this too....

  3. #3
    the Corvetter
    Join Date
    Sep 2001
    Posts
    1,584
    >>> LOL, I've always wondered about this too....

    I knew I wasn't the only one...

    --Garfield the Great
    1978 Silver Anniversary Corvette

  4. #4
    Just one more wrong move. -KEN-'s Avatar
    Join Date
    Aug 2001
    Posts
    3,227
    See, now I never did until I read a random page in C For Dummies volume I where he says that exact same thing...

  5. #5
    back? dbaryl's Avatar
    Join Date
    Oct 2001
    Posts
    597
    doesn't it say something like "repeat if nessessary?

  6. #6
    the Corvetter
    Join Date
    Sep 2001
    Posts
    1,584
    >>> See, now I never did until I read a random page in C For Dummies volume I where he says that exact same thing...

    Are you kidding? I swear on my programming honor, I never picked up that book. I don't like that series (the Dummies). I find it very degrading.

    --Garfield the Great
    1978 Silver Anniversary Corvette

  7. #7
    Just one more wrong move. -KEN-'s Avatar
    Join Date
    Aug 2001
    Posts
    3,227
    what? you want me to be ashamed? I thought it was a very good book considering I knew nothing about programming at the time, and I had trouble with the online tutorials, coupled with the fact it was the only C book at the bookstore withing reach of my bike...

    ...in other words - shutup.

  8. #8
    Registered User Aran's Avatar
    Join Date
    Aug 2001
    Posts
    1,301
    When i write something wrong on a test i look for the undo button, but i never find it.. where do they hide those damned things?

  9. #9
    Ecologist
    Join Date
    Aug 2001
    Location
    Utah.
    Posts
    1,291
    Originally posted by -KEN-
    what? you want me to be ashamed? I thought it was a very good book considering I knew nothing about programming at the time, and I had trouble with the online tutorials, coupled with the fact it was the only C book at the bookstore withing reach of my bike...

    ...in other words - shutup.

    Hehe. I started with C for Dummies. I read it
    until the "Creepy DOS and Bios Functions..." then
    moved on to Teach Yourself C++ in 21 Days (400
    days later, I still haven't finished it. False
    advertising.)

    I'll finish learning C eventually. Maybe I'll buy
    that complete reference book Doubleanti
    talks about. I just (tried to) quit m job, so
    I'm going to be spending all of December (gave
    1 months notice) cramming programming information
    into my head.

    I'm going to try to find a new job in a very,
    very boring store. A place that is so boring,
    people don't really shop there. Like a clock
    store, or a tie shop. Then, I'll be able to
    learn at work.

    Shampoo. I hate it when I wash my hair, and
    then realize that there is no conditioner. I have
    long hair, so when it's unconditioned--it gets
    all tangly.

    Excuse spelling/grammar. I just woke up...
    Staying away from General.

  10. #10
    .
    Join Date
    Aug 2001
    Posts
    598
    Yea, I know. I could read it in 5 days. But I didn't. I never finshed the book (since I don't realy understaned anything after basic inheridence (spelled wrong I know))

    Note:I read the online version

    Please excuse the spelling and grammer,
    because I can't think of a reason
    To Err Is To Be Human. To Game Is Divine!"

  11. #11
    Bobish
    Guest
    I never finished teach your self c++ in 21 days ether i couldn't stand all that advanced class suff. I spent about 3 months reading the book to because i didn't have the time to read a chapeter a day.

    An heres how the program would go:

    int Dandrufdurtandgrease=rand()

    while(Dandrufdurtandgrease<0)
    {
    applyToHair(shampoo);
    rinse(hair);
    Dandrufdurtandgrease--;
    }

  12. #12
    Back! ^.^ *Michelle*'s Avatar
    Join Date
    Oct 2001
    Posts
    568
    Originally posted by Aran Elus
    When i write something wrong on a test i look for the undo button, but i never find it.. where do they hide those damned things?

    Me too! Not on tests tho, but on posters and drawings, especially when I use permanent ink pens and I screwed up something...
    Michelle (o^.^o)
    *Unique*
    Kaomoji House

  13. #13
    Former Member
    Join Date
    Oct 2001
    Posts
    955
    mine says

    Code:
    while(shampoo.bottle.status!=empty) //to encourage use of a bottle each day
    {
        shampoo.apply(in_hair);
        hair.rinse(with_water);
    }
    I just have to use ctrl-break! I would be broke if I followed the instructions properly!

    Oskilian

  14. #14
    Linguistic Engineer... doubleanti's Avatar
    Join Date
    Aug 2001
    Location
    CA
    Posts
    2,459
    >False advertising.)

    LOL...

    >Me too! Not on tests tho, but on posters and drawings, especially when I use permanent ink pens and I screwed up something...

    Me too! with music too! [no rewind... dang...] note to self: control 4th dimension by next sunday so i can rewrite my music ad lib...
    hasafraggin shizigishin oppashigger...

  15. #15
    Back! ^.^ *Michelle*'s Avatar
    Join Date
    Oct 2001
    Posts
    568
    Originally posted by oskilian
    mine says

    [code]
    //to encourage use of a bottle each day

    Oskilian
    Looks like it's not each day, it's all day long!!
    Michelle (o^.^o)
    *Unique*
    Kaomoji House

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Fscanf endless loop
    By krum in forum C Programming
    Replies: 3
    Last Post: 12-05-2007, 12:14 AM
  2. return to start coding?
    By talnoy in forum C++ Programming
    Replies: 1
    Last Post: 01-26-2006, 03:48 AM
  3. loop needed also how to make input use letters
    By LoRdHSV1991 in forum C Programming
    Replies: 3
    Last Post: 01-13-2006, 05:39 AM
  4. when a while loop will stop ?
    By blue_gene in forum C Programming
    Replies: 13
    Last Post: 04-20-2004, 03:45 PM
  5. How to change recursive loop to non recursive loop
    By ooosawaddee3 in forum C Programming
    Replies: 1
    Last Post: 06-24-2002, 08:15 AM