Log in

View Full Version : Some code in C that we may need if we are in trouble


Andrew Rudolph
04-10-2003, 10:44
Attached is a funny comic using C...enjoy!

mattf
04-10-2003, 10:54
hah, that's great, but he forgot to print \n

Tytus Gerrish
04-10-2003, 11:37
OMG!
if you understand this its funny

djcapelis
04-10-2003, 14:39
They did another one like this, it was using applescript then... (I think...) it's good to see they've migrated their jokes to a real language. ;)

Ian W.
04-10-2003, 16:39
Originally posted by mattf
hah, that's great, but he forgot to print \n

I'm sorry, but that's just sad (even though I probably would've said it if you didn't :p).

Raven_Writer
04-10-2003, 17:21
Originally posted by mattf
hah, that's great, but he forgot to print \n
Actually, you don't need the \n.

Like in the Bloodshed Dev-C++ 4.0.1 compiler/IDE, you just did something like

printf("asdfasdfasdf");

and it'd come out as:
asdfasdfasdf

press any key....

[Sorry, just felt like pointing that out]

FotoPlasma posted this same comic in a different thread, and I saw this yesterday while sifting through the newspaper (those are so boring, thus I go straight and only look at the comics).

NOTE: I don't use Dev-C++ anymore, I use Microsoft Visual Studio .NET and Microsoft Visual C++ 6.0 Enterprise Edition

Yan Wang
04-10-2003, 17:30
Yes, I was very surprised to see the comic yesterday because years ago, there was one in Applescript.

Also, \n is needed, Raven... your IDE just is acting nice and putting each new call on a new line. I use DEVC++ sometimes too.

Heh, our team's electrical engineer sent out a team email about teaching people C, and his wife pointed out the comic immediately after he sent out the email - what a coinkydink.

Melissa Nute
04-10-2003, 19:33
This makes me happy...

Greg Ross
06-10-2003, 01:15
Originally posted by mattf
hah, that's great, but he forgot to print \n Also, "real" C programmers start counting with 0, not with 1. It "should" be:for (count=0;count<500;count++);)

Trashed20
06-10-2003, 09:43
yeah, my old c++ teacher would kill us if we started from one. Good comic.

Trashed20
07-10-2003, 09:47
now that i think about it, you wouldn't need a new line return. when you write out things like that on a chalk board you go all the way across and down, so no new line is needed

I will not throw paper airplanes in class. I will not throw paper airplanes in class. I will not throw paper airplanes in class.
I will not throw paper airplanes in class. I will not throw paper airplanes in class. I will not throw paper airplanes in class.
I will not throw paper airplanes in class. I will not throw paper airplanes in class. I will not throw paper airplanes in class.
I will not throw paper airplanes in class. I will not throw paper airplanes in class. I will not throw paper airplanes in class.
I will not throw paper airplanes in class. I will not throw paper airplanes in class. I will not throw paper airplanes in class.
I will not throw paper airplanes in class. I will not throw paper airplanes in class. I will not throw paper airplanes in class.

Joel J
07-10-2003, 10:04
Originally posted by Trashed20
now that i think about it, you wouldn't need a new line return. when you write out things like that on a chalk board you go all the way across and down, so no new line is needed

I will not throw paper airplanes in class. I will not throw paper airplanes in class. I will not throw paper airplanes in class.
I will not throw paper airplanes in class. I will not throw paper airplanes in class. I will not throw paper airplanes in class.
I will not throw paper airplanes in class. I will not throw paper airplanes in class. I will not throw paper airplanes in class.
I will not throw paper airplanes in class. I will not throw paper airplanes in class. I will not throw paper airplanes in class.
I will not throw paper airplanes in class. I will not throw paper airplanes in class. I will not throw paper airplanes in class.
I will not throw paper airplanes in class. I will not throw paper airplanes in class. I will not throw paper airplanes in class. Lol, but there is also no space at the end of the line:

I will not throw paper airplanes in class.I will not throw paper airplanes in class.I will not throw paper airplanes in class.I will not throw paper airplanes in class.I will not throw paper airplanes in class.I will not throw paper airplanes in class.I will not throw paper airplanes in class.I will not throw paper airplanes in class.I will not throw paper airplanes in class.I will not throw paper airplanes in class.I will not throw paper airplanes in class.I will not throw paper airplanes in class.I will not throw paper airplanes in class.I will not throw paper airplanes in class.I will not throw paper airplanes in class.I will not throw paper airplanes in class.I will not throw paper airplanes in class.I will not throw paper airplanes in class.

...nitpickers ;)

SeanCassidy
07-10-2003, 19:17
Or you could have it just enough so that three lines fit and then throw in a newline like so:

#include <cstdio>
using namespace std;

main()
{
int i = 0, n = 0;

while( i < 500 )
{
printf("I will not throw paper airplanes in class.");
i++;
n++;
if( n == 3)
{
printf("\n");
n = 0;
}
}
return 0;
}

Shows how much free time I have. Hehe :p

KenWittlief
07-10-2003, 19:31
I would have skipped the count, and used a goto at the end to create an infinite loop

and let it run all night

the next day every blackboard in the school would be completely covered in chalk 1" deep!

FotoPlasma
07-10-2003, 19:48
Originally posted by SeanCassidy
[post]
Actually, I think you want to test n with "if( n % 3 == 0 )". I love the modulus operator. :)

<edit>
Oh, sorry. You're using different indexes. Heh. Either way, good idea.
</edit>

KenWittlief
07-10-2003, 20:57
he could have abrv the message to

"throw planes?" = F

Katie Reynolds
07-10-2003, 21:34
I can't believe you are actually carrying on a conversation about this.

Oh wait - yes I can . :p :yikes:

;)