PDA

View Full Version : Endless shampoo loop



Garfield
11-04-2001, 02:13 PM
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:


while (1)
{
applyToHair(shampoo);
rinse(hair);
}

Can you ctrl-c out of this one when washing your hair?

--Garfield the Great

Hillbillie
11-04-2001, 02:15 PM
LOL, I've always wondered about this too....

Garfield
11-04-2001, 02:16 PM
>>> LOL, I've always wondered about this too....

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

--Garfield the Great

-KEN-
11-04-2001, 02:40 PM
See, now I never did until I read a random page in C For Dummies volume I where he says that exact same thing...

dbaryl
11-04-2001, 03:41 PM
doesn't it say something like "repeat if nessessary?

Garfield
11-04-2001, 03:47 PM
>>> 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

-KEN-
11-04-2001, 05:10 PM
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. :p

Aran
11-04-2001, 06:29 PM
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?

Cheeze-It
11-04-2001, 06:55 PM
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. :p


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...

gamegod3001
11-04-2001, 07:37 PM
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

Bobish
11-04-2001, 10:03 PM
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--;
}

*Michelle*
11-04-2001, 10:09 PM
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...

oskilian
11-04-2001, 10:20 PM
mine says



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

doubleanti
11-04-2001, 11:06 PM
>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... :)

*Michelle*
11-04-2001, 11:21 PM
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*
11-04-2001, 11:22 PM
actually, it would stop after you've done one bottle...

doubleanti
11-04-2001, 11:25 PM
i'm sure this will work, but ...


ah!
choo!!
would
be
what
i'dsayifiweresneezing

hmmm... lol... that'd be funny if someone was in the shower forever and talked to us via a waterproof laptop and s/he'd just found out the universal ctrl-break sequence... and was like... 'wow!' with very clean hair...

*Michelle*
11-04-2001, 11:26 PM
i don't get it...

doubleanti
11-04-2001, 11:27 PM
dang, it didn't work... quotes within quotes work tho... [as in PMs]...

oskilian
11-04-2001, 11:27 PM
oh sorry, there was a small 'thing' covering the bottle's back, it says



while(shampoo.bottle.status!=empty) //to encourage use of a bottle each day
{
shampoo.apply(in_hair);
hair.rinse(with_water);
}
shampoo.disposeof(recycle); // :)
shampoo.buynew(MOST_EXPENSIVE_AVAILABLE);

*Michelle*
11-04-2001, 11:29 PM
hehe... :D

biterman
11-05-2001, 04:58 AM
The all caps in MOST_EXPENSIVE_AVAILABLE suggests a constant, but the name suggests a variable. Which are you assuming it to be? I don't think it's wise to assume it to be a constant, eventually there would be another shampoo with a higher price tag.

adios,
biterman.

-KEN-
11-05-2001, 07:44 AM
dude
you
forgottocapitalize

Oh, wait...I'm wrong...no nested CODE tags

Yoshi
11-05-2001, 09:56 AM
:D That message is driving me absolutely crazy :D

oskilian
11-05-2001, 10:50 AM
it's a macro, not a constant!

Oskilian

doubleanti
11-05-2001, 06:17 PM
oooh!!! good one... osk one, biterman zero...

oskilian
11-05-2001, 06:43 PM
he he he

Oskilian

Aran
11-05-2001, 06:45 PM
you are a real lammington.. i mean, lamer.

Cheeze-It
11-05-2001, 07:57 PM
Originally posted by *Michelle*



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

Ahahaha. I thought I was the only one who did
that. I've become so used to doodling in
Painter (or any other art-graphic-program), that
when I doodle on paper, after a mistake, I almost
always say "edit-undo' instead of using the
eraser. It doesn't work.

oskilian
11-05-2001, 09:57 PM
Originally posted by Aran Elus
you are a real lammington.. i mean, lamer.

who?

Oskilian

biterman
11-06-2001, 12:18 AM
Excuse my ignorance, but i'm not really familiar with the term.

adios,
biterman.

oskilian
11-06-2001, 09:29 AM
well, letme say it with an example:

a Win32 Function:
CreateWindowEx()

a Win32 Macro
MAKEINTRESOURCE

get it?

Oskilian

biterman
11-07-2001, 05:51 AM
No. :(

adios,
biterman.

Garfield
11-07-2001, 01:50 PM
> actually, it would stop after you've done one bottle...

Well, that would be a runtime (I mean...showertime) error. When you run out of ram, you get the runtime error. When you run out of shampoo, you get a showertime error. The results of the error will be excessive crying.

--Garfield the Magnificent

Aran
11-07-2001, 04:06 PM
or just REALLY nasty hair.

Garfield
11-07-2001, 07:29 PM
> or just REALLY nasty hair.

Well, I didn't want to mention that but...thanks.

--Garfield the Programmer

Yoshi
11-07-2001, 07:49 PM
Nasty Nasty Nasty

oskilian
11-07-2001, 09:48 PM
I bought another bottle and it says (recursive version in C++)



int shampoo::apply(int where, int amountofshampooleftinbottle)
{
int amountused;
if(amountofshampooleftinbottle>0)
{
this->move(where);
amountused=this->squeeze();
RinseHair(withwater);
this->apply(where,amountofshampooleftinbottle-amountused);
}
else
{
MessageBox("No more shampoo, buy another bottle!","Error",MB_OK);
CloseShower();
}

}


and I get stack overflows!!, well, shampoo overflows!

Oskilian

Yoshi
11-07-2001, 09:50 PM
LOL:D

*Michelle*
11-07-2001, 10:36 PM
teeheehee :D