Tilted Forum Project Discussion Community  

Go Back   Tilted Forum Project Discussion Community > Interests > Tilted Technology


 
 
LinkBack Thread Tools
Old 10-03-2003, 03:20 PM   #1 (permalink)
Swashbuckling
 
Location: Iowa...sometimes
C Foxtrot Comic

I was reading the Friday Oct. 8th Chicago Tribune and saw this funny Foxtrot comic.

I wasn't sure if this would fit better in Humor, but I figured it would be more appreciated here.
BuddyHawks is offline  
Old 10-03-2003, 03:25 PM   #2 (permalink)
Junkie
 
That's awesome.
__________________
"Fuck these chains
No goddamn slave
I will be different"
~ Machine Head
spectre is offline  
Old 10-03-2003, 03:29 PM   #3 (permalink)
Banned
 
Location: shittown, CA
I love it

man I could have use this back in 3ed grade....he could stand to tighten up that code a bit too
juanvaldes is offline  
Old 10-03-2003, 04:12 PM   #4 (permalink)
Upright
 
Location: Hell a.k.a. Stockton
Nice, I need that right now
__________________
There once was a man from Nantucket,
His ......
nickdman is offline  
Old 10-03-2003, 04:30 PM   #5 (permalink)
In Your Dreams
 
Latch's Avatar
 
Location: City of Lights
That was great.. thanks!
Latch is offline  
Old 10-03-2003, 05:01 PM   #6 (permalink)
The GrandDaddy of them all!
 
The_Dude's Avatar
 
Location: Austin, TX
nice! that's one smart kid
__________________
"Luck is what happens when preparation meets opportunity." - Darrel K Royal
The_Dude is offline  
Old 10-03-2003, 07:33 PM   #7 (permalink)
kel
WARNING: FLAMMABLE
 
Location: Ask Acetylene
Quote:
Originally posted by juanvaldes
I love it

man I could have use this back in 3ed grade....he could stand to tighten up that code a bit too
LOL... didn't even pick up on that.
__________________
"It better be funny"
kel is offline  
Old 10-03-2003, 08:26 PM   #8 (permalink)
Tilted Cat Head
 
Cynthetiq's Avatar
 
Administrator
Location: Manhattan, NY
i did this in my second year in HS. Had to write,"I will not make chin music in class." 100 times... i convinced the teacher that i had actually typed it 100 times, since I had a diasy wheel printer.

After that.... everyone started doing it. I had started a trend, and he wasn't all that happy with it. He then only started to collect hand written only.
__________________
I don't care if you are black, white, purple, green, Chinese, Japanese, Korean, hippie, cop, bum, admin, user, English, Irish, French, Catholic, Protestant, Jewish, Buddhist, Muslim, indian, cowboy, tall, short, fat, skinny, emo, punk, mod, rocker, straight, gay, lesbian, jock, nerd, geek, Democrat, Republican, Libertarian, Independent, driver, pedestrian, or bicyclist, either you're an asshole or you're not.
Cynthetiq is offline  
Old 10-03-2003, 08:34 PM   #9 (permalink)
Crazy
 
Location: Anchorage, Alaska
I've got UNIX underpants!

no, wait, wrong strip.
__________________
"They shoot without shame
In the name of a piece of dirt
For a change of accent
Or the colour of your shirt
Better the pride that resides
In a citizen of the world
Than the pride that divides
When a colorful rag is unfurled"

-Neil Peart
Melllvar is offline  
Old 10-03-2003, 09:19 PM   #10 (permalink)
With a mustache, the cool factor would be too much
 
Fremen's Avatar
 
Location: left side of my couch, East Texas
I got it and I don't understand coding.
Am I a genius all of a sudden? *looks around* Nope!

Thanks, BuddyHawks, pretty funny stuff.
__________________
Google
Fremen is offline  
Old 10-03-2003, 09:22 PM   #11 (permalink)
Über-Rookie
 
Location: No longer, D.C
Cynthique, that is pretty cool.. I never had a teacher make us do the repitition on computer.. It was always hand written

nice strip I always love fox trot
__________________
"All that we can do is just survive.
.All that we can do to help ourselves is stay alive." - Rush
oblar is offline  
Old 10-04-2003, 08:48 AM   #12 (permalink)
Crazy
 
Location: Nova Scotia, Canada
he forgot the \n
__________________
Ask a simple question... get pain.
Marburg is offline  
Old 10-04-2003, 09:32 AM   #13 (permalink)
Tilted
 
hehe.. that's funny.. =)
Peutetre is offline  
Old 10-04-2003, 12:50 PM   #14 (permalink)
Quadrature Amplitude Modulator
 
oberon's Avatar
 
Location: Denver
LOL, good find! Agreed, he did forget the \n...
__________________
"There are finer fish in the sea than have ever been caught." -- Irish proverb
oberon is offline  
Old 10-04-2003, 05:31 PM   #15 (permalink)
Junkie
 
Location: RI
I should print that out and put it on somethin and show my programming concepts teacher...
Thanks a bunch
Fallon is offline  
Old 10-04-2003, 10:33 PM   #16 (permalink)
Upright
 
Still nasty code. If he's only using the counter inside the for loop, should definitly be defined inside of it (assuming C++, and not C):

for ( int count = 0; count < 500; count++ )

Also, of course, the code in the strip's only going to print it 499 times. Think the teacher'll count 'em?
Melraidin is offline  
Old 10-04-2003, 11:24 PM   #17 (permalink)
Banned
 
Location: Greater Vancouver
Nah, it's C (stdio, not iostream)

Also, I believe it's running 500 times because he used <= instead of <.

Good pick up on the '\n' though ... i totally missed that when i read this in the paper lol
Flippy is offline  
Old 10-04-2003, 11:54 PM   #18 (permalink)
Very Proud of Ya
 
Location: Simi Valley, CA
Quote:
Originally posted by Marburg
he forgot the \n
Haha I caught that too...
Is it good when we catch stuff like this in a comic?
__________________
Do not speak Latin in front of the books.
TheClarkster is offline  
Old 10-05-2003, 01:15 PM   #19 (permalink)
Stop. Think. Question.
 
rubicon's Avatar
 
Location: Redondo Beach, CA
lol
__________________
How you do anything is how you do everything.
rubicon is offline  
Old 10-06-2003, 09:03 AM   #20 (permalink)
Sexy eh?
 
Location: Sweden
Hehehe... I've just started learning C++ but that was really funny.. Nice find!
__________________
Life is shit,
Death is even worse,
So what's the point of killing yourself?
/Ignatius Camryn Paladine
Regziever is offline  
Old 10-06-2003, 11:06 AM   #21 (permalink)
Crazy
 
Location: Nova Scotia, Canada
actually, now that I look at it he forgot the braces { } in the for loop.

Jeebus, Jason is falling apart!


ps. My CSci prof loved it.
__________________
Ask a simple question... get pain.
Marburg is offline  
Old 10-07-2003, 08:14 PM   #22 (permalink)
back from sabbatical
 
hawkeye's Avatar
 
Location: Mosptopia
Quote:
Originally posted by Marburg
actually, now that I look at it he forgot the braces { } in the for loop.

Jeebus, Jason is falling apart!


ps. My CSci prof loved it.
you don't actually need the {} when yoiu are looping only one line of code.

hey, juan, how would//should he tighten it up?
__________________
You're not fat,
You're just a giant ball
of love, covered in anger.
hawkeye is offline  
Old 10-08-2003, 03:43 PM   #23 (permalink)
Banned
 
Location: shittown, CA
C
Code:
#include &lt;stdio.h&gt;
int main(void) {
    for(int count=1; count<=500; count++){ printf("I will not throw paper airplaces in class.\n"); }
    return 0;
}
C++
Code:
#include &lt;iostream&gt;
void main() { for(int count=1; count<=500; count++){ cout << "I will not throw paper airplaces in class." << endl; } }
Just two of the many ways you can play with it...




Had to edit to make the includes show up. It was driving me nuts

Last edited by hrdwareguy; 10-09-2003 at 04:19 AM..
juanvaldes is offline  
Old 10-08-2003, 08:28 PM   #24 (permalink)
Junkie
 
Location: North Hollywood
juanvaldes thats invalid C, plus making everything appear on one line isn't doing anything to affect code performance, but does make it harder to read.

adding braces is arguably neater to stop running the risk of a later programmer adding more lines and it not working as one might expect , but if its a finalized app its mainly syntactic sugar, though it is something i would recommend doing and do.

He may have deliberately left out the \n as that would fill the entire stdout with the phrase.

and they say programmers over analyze
charliex is offline  
Old 10-08-2003, 11:22 PM   #25 (permalink)
Banned
 
Location: shittown, CA
I did not mean to imply faster code, just shorter. A friend did one using a while loop with trinary operators in it just for the hell of it, pretty funny.
juanvaldes is offline  
Old 10-09-2003, 03:16 AM   #26 (permalink)
Psycho
 
Location: New Orleans
A little different but would this work as well?

Code:
#include &lt;stdio.h&gt;
 main()
  {int count; count=1; while (count <= 500)
    {++count;printf("I will not throw paper airplanes in class.\n");
    }
  return 0;
  }

Had to edit to make the include show up
__________________
"Everyone thinks of changing the world, but no one thinks of changing himself." -- Tolstoy

Last edited by hrdwareguy; 10-09-2003 at 04:20 AM..
krazykemist is offline  
Old 10-09-2003, 04:18 AM   #27 (permalink)
"Officer, I was in fear for my life"
 
hrdwareguy's Avatar
 
Location: Oklahoma City
Quote:
Originally posted by krazykemist
A little different but would this work as well?

Code:
#include &lt;stdio.h&gt;
 main()
  {int count; count=1; while (count <= 500)
    {++count;printf("I will not throw paper airplanes in class.\n");
    }
  return 0;
  }
You would only get it printed out 499 times. Count starts at 1 and before you do anything with it you are incrementing it to 2 so you loose 1 line of print.
__________________
Gun Control is hitting what you aim at

Aim for the TFP, Donate Today
hrdwareguy is offline  
Old 10-09-2003, 11:56 AM   #28 (permalink)
Swashbuckling
 
Location: Iowa...sometimes
Yeah,

for
whlie
do while

all the loops can be applied.
__________________
Watch More TV
BuddyHawks is offline  
Old 10-09-2003, 08:42 PM   #29 (permalink)
Junkie
 
Location: North Hollywood
Quote:
You would only get it printed out 499 times. Count starts at 1 and before you do anything with it you are incrementing it to 2 so you loose 1 line of print.
Not true, its <= so it will do 500 times, starting loops at 1 is often the sign of a pascal programmer or such switching to C, the ending value will be 501, not 500. so from 2 to 501

int i=500;
while(i--) {
.....
}
simple, uses a faster test which is generally implemented as a single instruction, the whole loop can be done in one instruction on a pc (ignoring the inital load), though some optimizing compilers will pick up on that the for loop and fix it.

Last edited by charliex; 10-09-2003 at 08:47 PM..
charliex is offline  
Old 10-10-2003, 08:35 AM   #30 (permalink)
alpaca lunch for the trip
 
jujueye's Avatar
 
Location: in my computer
Quote:
Originally posted by Marburg
he forgot the \n
Good point. It would all run together. My C instructor would kick his ass for that one....!
jujueye is offline  
Old 10-10-2003, 01:47 PM   #31 (permalink)
"Officer, I was in fear for my life"
 
hrdwareguy's Avatar
 
Location: Oklahoma City
Quote:
Originally posted by charliex
Not true, its <= so it will do 500 times, starting loops at 1 is often the sign of a pascal programmer or such switching to C, the ending value will be 501, not 500. so from 2 to 501

I was referring to krazykemist's post where the counter started at 1 then went into the loop. First thing he did in the loop was increment the counter to 2, then print. So you would end up with this at the bottom of the loop:

count&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;number of times printed
2&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 1
3&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 2
4&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 3
.
.
.
498&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 497
499&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 498
500&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 499
501&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; End of loop
</pre>
So you would only end up with the sentence being printed 499 times.
__________________
Gun Control is hitting what you aim at

Aim for the TFP, Donate Today

Last edited by hrdwareguy; 10-10-2003 at 01:52 PM..
hrdwareguy is offline  
Old 10-10-2003, 03:04 PM   #32 (permalink)
Junkie
 
Location: North Hollywood
hrdwareguy: nope, you are missing the key point,
2 to 501 is inclusive which equals 500 steps.

example

say it was i=1 to i<=5 instead of 500 so
int i ; while (i<=5){ i++ };

program starts :
i = 1

:loop starts

is i less than or equal to 5 ? i=1, so yes, continue.

i is incremented to 2
"message is printed' (1rst time)

go back to top of loop

is i less than or equal to 5 ? i=2 so yes, continue.

i is incremented , is now 3
"message is printed' ( 2nd time)

go back to top of loop

is i less than or equal to 5 ? i=3 so yes, continue.

i is incremented , is now 4
"message is printed' (3rd time)

go back to top of loop

is i less than or equal to 5 ? i=4 so yes, continue.

i is incremented , is now 5
"message is printed' (4th time)

go back to top of loop

is i less than or equal to 5 ? i=5 so yes, continue. (not the key part here is less than *or* equal to 5 = 5 so its true, so it meets the condition.

i is incremented , is now 6
"message is printed' (5th time)

go to start of loop

is i less than or equal to 5 ? i is now 6, so stop the loop since 6 <= 5 is false (0)

5 messages were printed.

This is quite a common mistake made for junior or new programmers, its similar to people using the 5th element on an array defined as say int[5] and then using i = array[5]; which is of course the 6th element.

Last edited by charliex; 10-10-2003 at 03:12 PM..
charliex is offline  
Old 10-13-2003, 02:54 AM   #33 (permalink)
"Officer, I was in fear for my life"
 
hrdwareguy's Avatar
 
Location: Oklahoma City
Quote:
Originally posted by charliex
hrdwareguy: nope, you are missing the key point,
2 to 501 is inclusive which equals 500 steps.
Charliex:

I understand this. The original code I was referring to did not say <= 501 it said <=500. Go back and look at it if you want to. Since the original code I was referring to was therefore 2 to 500, I still stand by my statement that it will only print 499 times.
__________________
Gun Control is hitting what you aim at

Aim for the TFP, Donate Today
hrdwareguy is offline  
Old 10-13-2003, 11:15 AM   #34 (permalink)
Junkie
 
Location: North Hollywood
hrdwareguy: dear oh dear, please read over my comment

Quote:
say it was i=1 to i<=5 instead of 500 so "
Its 2 to 501 because of the increment inside of the loop, before the while is tested.

For instance my example is 1 to 5 but it runs as 2 to 6. so when you do <=n , n ends up being + 1

i really don't know how to simplify it anymore so that you can understand it.

So heres another proof (hope this posts correctly) i added my comments with a // to the actual session

Code:
// show contents of file test.cpp ( i copied and pasted from hrdwareguys quote exactly as was )
[C:\4nt]type test.cpp
#include &lt;stdio.h&gt;
 main()
  {int count; count=1; while (count <= 500)
    {++count;printf("I will not throw paper airplanes in class.\n");
    }
  return 0;
  }

// compile it 
[C:\4nt]cl -nologo test.cpp
test.cpp

// run it with a redirect into a file
[C:\4nt]test >out.txt

//run wc, which is a wordcounter with line count
[C:\4nt]wc out.txt

out.txt:             Words: 4000       Lines: 500        Chars: 21000
Lines = 500 , as expected, i could post the whole output but that'd be silly.

I could post the exe if you still don't believe me, but if you go over the loop i typed it in the previous comment it will be come obvious to you (since it does seem like you didn't read it through as the comment you made indicates you didn't see where i said <=500 twice)

Last edited by hrdwareguy; 10-13-2003 at 11:31 AM..
charliex is offline  
Old 10-13-2003, 11:32 AM   #35 (permalink)
Psycho
 
Location: New Orleans
I'm never going to post any code in this forum again.
__________________
"Everyone thinks of changing the world, but no one thinks of changing himself." -- Tolstoy
krazykemist is offline  
Old 10-13-2003, 11:32 AM   #36 (permalink)
"Officer, I was in fear for my life"
 
hrdwareguy's Avatar
 
Location: Oklahoma City
Charliex: OK, I get it, you are correct. I was getting getting confused because I usually increment my loops at the bottom. Got one to many tests in there.

By the way, I edited your post for the sole purpose of making the &lt;stdio.h&gt; display correctly.
__________________
Gun Control is hitting what you aim at

Aim for the TFP, Donate Today

Last edited by hrdwareguy; 10-13-2003 at 11:35 AM..
hrdwareguy is offline  
Old 10-13-2003, 11:53 AM   #37 (permalink)
Psycho
 
Location: New Orleans
hrdwareguy-
How did you get it to include the #include?
I tried like 3 different ways.
Just curious.
__________________
"Everyone thinks of changing the world, but no one thinks of changing himself." -- Tolstoy
krazykemist is offline  
Old 10-13-2003, 12:01 PM   #38 (permalink)
Junkie
 
Location: North Hollywood
Code:
#include &lt;stdio.h&gt;
 main()
  {int count; count=1; do 
    {++count;printf("I will not throw paper airplanes in class.\n");
    }while(count <= 500);
  return 0;
  }
You mean like that ? (sorry i never found out how to quote the <'s properly in forum speak)

It would still print 500 lines.

Last edited by hrdwareguy; 10-13-2003 at 12:12 PM..
charliex is offline  
Old 10-13-2003, 12:12 PM   #39 (permalink)
"Officer, I was in fear for my life"
 
hrdwareguy's Avatar
 
Location: Oklahoma City
Quote:
Originally posted by krazykemist
hrdwareguy-
How did you get it to include the #include?
I tried like 3 different ways.
Just curious.
You have to use the HTML tags. & l t ; is the &lt; and & g t ; is the &gt;
__________________
Gun Control is hitting what you aim at

Aim for the TFP, Donate Today
hrdwareguy is offline  
Old 10-13-2003, 12:17 PM   #40 (permalink)
"Officer, I was in fear for my life"
 
hrdwareguy's Avatar
 
Location: Oklahoma City
Actuall in my mind it was something like this:
Code:
#include &lt;stdio.h&gt;
int main(void)
{
     int count=1;
     while(count <=500)
     {
          ++count; //as a one time increment
          printf("I will not throw paper airplanes in class\n");
          ++count;//as I usuall do my incrementing at the bottom
     }
     return 0;
}
__________________
Gun Control is hitting what you aim at

Aim for the TFP, Donate Today
hrdwareguy is offline  
 

Tags
comic, foxtrot

Thread Tools

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
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT -8. The time now is 03:29 PM.

Tilted Forum Project

Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Search Engine Optimization by vBSEO 3.6.0 PL2
© 2002-2012 Tilted Forum Project

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360