Chief Delphi

Chief Delphi (http://www.chiefdelphi.com/forums/index.php)
-   Chit-Chat (http://www.chiefdelphi.com/forums/forumdisplay.php?f=14)
-   -   Some code in C that we may need if we are in trouble (http://www.chiefdelphi.com/forums/showthread.php?t=22161)

Andrew Rudolph 04-10-2003 10:44

Some code in C that we may need if we are in trouble
 
1 Attachment(s)
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

Quote:

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

Quote:

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
Code:

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

Quote:

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:
Code:

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

Quote:

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:

Code:

#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

Quote:

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>


All times are GMT -5. The time now is 11:28.

Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi