View Full Version : Pirates and C programming
markotu
08/12/2009, 09:30 pm
I found a joke about pirates and C programming (which I though was funny;)
Q: How does a pirate pass parameters to a C program?
A: With "arrrrgv" and "arrrrgc".
gordy
08/12/2009, 09:35 pm
http://i79.photobucket.com/albums/j121/gwhy6933/guybrushtongue.gif
dumpling321
08/12/2009, 10:01 pm
http://i79.photobucket.com/albums/j121/gwhy6933/guybrushtongue.gif
agreed
hansschmucker
08/12/2009, 10:20 pm
For those who are not familiar with the C programming language:
The arguments which were passed to the application when it was invoked are accessible inside the program via two variables, typically named argc for ARGumnetCount and argv for ARGumentValues.
alexonfyre
08/12/2009, 10:29 pm
We get it, still...
http://i79.photobucket.com/albums/j121/gwhy6933/guybrushtongue.gif
dzamir
08/12/2009, 10:38 pm
I found a joke about pirates and C programming (which I though was funny;)
Q: How does a pirate pass parameters to a C program?
A: With "arrrrgv" and "arrrrgc".
ARRGHHHHHHV!!! :eek:
meander
08/13/2009, 01:20 am
I thought all pirates learned programming from "Sea++ for beginners" from the voodoo library....
gordy
08/13/2009, 03:50 am
And here is a pirate's keyboard
http://biomesblog.typepad.com/the_biomes_blog/files/pirate_keyboard.jpg
SHODANFreeman
08/13/2009, 06:49 am
http://i79.photobucket.com/albums/j121/gwhy6933/guybrushtongue.gif
This is accurate.
JohanShogun
08/13/2009, 09:59 am
http://i79.photobucket.com/albums/j121/gwhy6933/guybrushtongue.gif
qft
meander
08/13/2009, 11:03 am
And here is a pirate's keyboard
http://biomesblog.typepad.com/the_biomes_blog/files/pirate_keyboard.jpg
I actually laughed out loud at this :D
Mad Mary
08/13/2009, 11:08 am
I never was able to learn the whole thing on my own... but that was funny.
Magwill
08/13/2009, 12:09 pm
I thought all pirates learned programming from "Sea++ for beginners" from the voodoo library....
No no, Guybrush had his first programming lesson right before he fell into the quicksand in CMI.
tbm1986
08/13/2009, 02:16 pm
No no, Guybrush had his first programming lesson right before he fell into the quicksand in CMI.
What, "That makes...syrup of ipecac. It seems logical."
How does that count as a programming lesson?
Magwill
08/13/2009, 02:25 pm
What, "That makes...syrup of ipecac. It seems logical."
How does that count as a programming lesson?
Python
Yes its bad, but I love bad jokes!
hansschmucker
08/13/2009, 02:32 pm
I feel the urge to add another frighteningly bad C/adventure game joke. It works best in German, so I'm going to spare the English speaking folks for now.
Warum sind nicht-Adventure-Spiele wie die Programmiersprache C?
In beidem gibt's Null Zeiger.
meander
08/13/2009, 02:37 pm
And I suppose he would never have sorted out all the idols in Tales without a rather ingenious use of Perl (on a stick)
tbm1986
08/13/2009, 02:46 pm
I feel the urge to add another frighteningly bad C/adventure game joke. It works best in German, so I'm going to spare the English speaking folks for now.
Warum sind nicht-Adventure-Spiele wie die Programmiersprache C?
In beidem gibt's Null Zeiger.
Aber es gibt Null Zeiger fuer alle die Programmiersprachen! Wie ist das lustig?
tbm1986
08/13/2009, 02:54 pm
Ich weiss, dass mein Deutsch scheisse ist. Also, ich muss Englisch zurueck.
Ich werde meine Jacke bekommen...
hansschmucker
08/13/2009, 02:55 pm
Bei Zeigern denken die meisten Leute immer noch an C, weil sie da breitere Verwendung finden wie in jeder anderen Sprache (und vor allen Dingen komplexere). Aber hauptsächlich hab' ich C genannt, weil dieses Thread mit C begonnen hat.
P.S. Dein Deutsch ist gar nicht so schlecht.
ssn626391689
08/13/2009, 02:56 pm
I thought that joke was hysterical. A nice laugh in the middle of bugfixing. :)
Magwill
08/13/2009, 03:06 pm
What does Visual Parrot 2008 output when the code is missing a ;?
Arrrr CS1002: ; expected
I only laugh because its past midnight.
tbm1986
08/13/2009, 03:13 pm
Bei Zeigern denken die meisten Leute immer noch an C, weil sie da breitere Verwendung finden wie in jeder anderen Sprache (und vor allen Dingen komplexere). Aber hauptsächlich hab' ich C genannt, weil dieses Thread mit C begonnen hat.
P.S. Dein Deutsch ist gar nicht so schlecht.
Es geht gut. Es tut mir leid. Du bist richtig. Andere Sprachen haben aehnlische Mechanismen aber sie heissen unterschiedlicher Namen. Naturlich denken wir ueber C, weil diese Gewidetitel C hast.
*boege zum Bessermann und sich rausen*
Sie versuchen, nett zu sein und Sie brauchen nicht zu sein. (Ja, ich benutzte Babelfish gegen das Ende.)
tbm1986
08/13/2009, 03:16 pm
I used to use my German as a party piece (thinking myself so clever) but after meeting people like you, I hold my head in shame. Your English is as good as my (native) English will ever be, never mind my German!
alexonfyre
08/13/2009, 09:31 pm
I know German, I understood most of all of that, but I didn't get the Answer to the joke, I probably need to go crack open my dictionary to recheck all the words... =P
EDIT: Ohhhh Zeiger is pointer, lol okay, I get it now.
Anyway, for English speakers, the best way I can translate (and try to keep the joke)
Why are non-adventure games like the C Programming language?
Because they both have null pointers (In German null pointers translates to both "null pointers (as in the C term)" and "zero [implying lack of] pointers")
In case anyone wanted to be in the loop.
corruptbiggins
08/14/2009, 06:29 am
I hate pointers in C++, they're the main thing I struggled with in my algorithms & data structures module.
JohanShogun
08/14/2009, 07:04 am
I hate pointers in C++, they're the main thing I struggled with in my algorithms & data structures module.
:O
Pointers are the only things I really like with C/C++ :)
DjNDB
08/14/2009, 07:12 am
I hate pointers in C++, they're the main thing I struggled with in my algorithms & data structures module.
Segmentation fault
Nothing more fun then debugging others crappy source code... Even more fun when it's multi-threaded.
DjNDB
08/14/2009, 07:16 am
:O
Pointers are the only things I really like with C/C++ :)
I really like operator overloading and template classes and -functions.
Magwill
08/14/2009, 07:43 am
I think this thread just POINTED in another direction...
[TTG] Yare
08/14/2009, 04:18 pm
Hold up guys, I got this.
Q: Why don't pirates like combinatorial optimization of NP-complete problems?
A: Because they're NP-Harrrrrrrrd.
Iron Curtain
08/14/2009, 05:37 pm
I get it, being a programmer/nerd whatever.
I thought it wasn't funny, though.
quickfics
08/14/2009, 06:13 pm
Hey, guys... If we move this over to IRC, we can tell each other some /KNOCK /KNOCK jokes.
Iron Curtain
08/14/2009, 06:19 pm
Here's some code I typed for s***s and giggles:
#include <string>
#include <iostream>
using namespace std;
string recursiveParrot(int limit);
int main ()
{
cout << recursiveParrot(2);
return(0);
}
//precondition: limit must start == 2
string recursiveParrot(int limit)
{
if (limit > 4)
return "BRAAWWK!\n";
if (limit > 3)
return "cracker? " + recursiveParrot(limit+1);
if (limit > 2)
return "wanna " + recursiveParrot(limit+1);
return "Polly " + recursiveParrot(limit+1);
}
Edit: I'd like a telltale programmer to please opine on my code.
Edit: Fixed indentation. Legibility++.
[TTG] Yare
08/14/2009, 07:13 pm
Edit: I'd like a telltale programmer to please opine on my code.
Serious: You should always program with readability and ease of use as your primary goals, followed shortly by efficiency. Clever code is not as impressive as clean, readable, well-documented code with a consistent interface! Minimalism is key!
Internet serious:
http://en.wikipedia.org/wiki/Duff%27s_device http://img33.imageshack.us/img33/8186/emotarghfist1.gif:mad:
http://en.wikipedia.org/wiki/Obfuscated_code
http://en.wikipedia.org/wiki/Brainf**k (http://en.wikipedia.org/wiki/Brainfuck)
Iron Curtain
08/14/2009, 07:22 pm
Yare;181701']Serious: You should always program with readability and ease of use as your primary goals, followed shortly by efficiency. Clever code is not as impressive as clean, readable, well-documented code with a consistent interface! Minimalism is key!
Internet serious:
http://en.wikipedia.org/wiki/Duff%27s_device
http://en.wikipedia.org/wiki/Obfuscated_code
http://en.wikipedia.org/wiki/Brainf**k (http://en.wikipedia.org/wiki/Brainfuck)
Thanks for the tips!
[TTG] Yare
08/14/2009, 07:48 pm
Nobody liked my complexity joke. :(
SHODANFreeman
08/14/2009, 09:17 pm
Yare;181713']Nobody liked my complexity joke. :(
I'll like it in 4 years, when I have my degree in programming :)
Everlast
08/14/2009, 09:35 pm
http://i79.photobucket.com/albums/j121/gwhy6933/guybrushtongue.gif
:confused:
[TTG] Yare
08/14/2009, 10:58 pm
I am clearly the worst at jokes.
Ravey
08/15/2009, 03:12 am
Yare;181713']Nobody liked my complexity joke. :(
I liked it! (http://i79.photobucket.com/albums/j121/gwhy6933/guybrushtongue.gif) :D
tbm1986
08/15/2009, 04:16 am
/*
Author: Tom Moore
Date: 15/8/2009
Title: Pyrite Parrot
Purpose: For the lols
*/
#include <stdio.h>
#include <string.h>
int main(void)
{
printf("\nPyrite Parrot Knock Knock Utility v0.1\n\n");
string response0;
:start
string prompt = "\nSay something to the parrot: ";
printf(prompt);
scanf("%s", &response0);
printf("\nYou: %s", response0);
if(response0 == "Knock knock")
runJoke(prompt);
else
{
printf("\n...\n\n\n...\n\nNo response. Try the knock knock joke.");
response0 = null;
getchar();
goto start;
}
return 0;
}
void runJoke(string prompt)
{
string response1, dummy;
printf("\nParrot: Who's there?");
printf(prompt);
scanf("%s", &response1);
printf("\nYou: %s", response1);
printf("\nParrot: Bwaaaarrrrk!\n\t%s", response1);
:repeat
printf(prompt);
scanf("%s", &dummy);
printf("\nYou: %s", dummy);
dummy = null;
getchar();
printf("\nParrot: Bwaaarrrrk!\n\t%s", response1);
printf("\n\n\nHint: when you're bored of this, type Ctrl-c");
goto repeat;
}
No comments but I don't think a simple text program needs them. Will get improved if there's a demand.
EDIT: I studied C four years ago and haven't touched it since, ok? I'm rather rusty, hence inevitable mistakes.
Magwill
08/15/2009, 04:45 am
Yare;181637']Hold up guys, I got this.
Q: Why don't pirates like combinatorial optimization of NP-complete problems?
A: Because they're NP-Harrrrrrrrd.
I guessed "Because its Non Pirate" Guess I'm even worse than you ;)
And now for another bad joke. What do you call Guybrush when he's handling his inventory?
Answer: OOP - Object Oriented Pirate
Iron Curtain
08/15/2009, 05:25 am
/*
Author: Tom Moore
Date: 15/8/2009
Title: Pyrite Parrot
Purpose: For the lols
*/
#include <stdio.h>
#include <string.h>
int main(void)
{
printf("\nPyrite Parrot Knock Knock Utility v0.1\n\n");
string response0;
:start
string prompt = "\nSay something to the parrot: ";
printf(prompt);
scanf("%s", &response0);
printf("\nYou: %s", response0);
if(response0 == "Knock knock")
runJoke(prompt);
else
{
printf("\n...\n\n\n...\n\nNo response. Try the knock knock joke.");
response0 = null;
getchar();
goto start;
}
return 0;
}
void runJoke(string prompt)
{
string response1, dummy;
printf("\nParrot: Who's there?");
printf(prompt);
scanf("%s", &response1);
printf("\nYou: %s", response1);
printf("\nParrot: Bwaaaarrrrk!\n\t%s", response1);
:repeat
printf(prompt);
scanf("%s", &dummy);
printf("\nYou: %s", dummy);
dummy = null;
getchar();
printf("\nParrot: Bwaaarrrrk!\n\t%s", response1);
printf("\n\n\nHint: when you're bored of this, type Ctrl-c");
goto repeat;
}
No comments but I don't think a simple text program needs them. Will get improved if there's a demand.
EDIT: I studied C four years ago and haven't touched it since, ok? I'm rather rusty, hence inevitable mistakes.
You included a goto statement. DIE DIE DIE!!!
:P
I'm sorry, but I'm a firm believer that goto statements are considered harmful...
tbm1986
08/15/2009, 06:13 am
You included a goto statement. DIE DIE DIE!!!
:P
I'm sorry, but I'm a firm believer that goto statements are considered harmful...
My lecturers shared this view. Unfortunately, since then I've been doing more GNU Assembly than C, hence I've become lazy. I can't be arsed atm to redo it properly with while loops, switch cases and more functions.
tbm1986
08/15/2009, 06:14 am
Ohhhhh, all right...
tbm1986
08/15/2009, 07:05 am
/**********************
Author: Tom Moore
Created: 15/8/2009
Updated: 15/8/2009
Title: Pyrite Parrot
Purpose: For the lols
**********************/
#include <stdio.h>
#include <string.h>
void runJoke(string prompt);
void clear_stdin(void);
int main(void)
{
printf("\nPyrite Parrot Knock Knock Utility v0.2\n\n");
string response0;
bool knock = false;
while(!knock)
{
string prompt = "\nSay something to the parrot: ";
printf(prompt);
scanf("%s", &response0);
printf("\nYou: %s", response0);
switch(response0)
{
case "Knock knock":
{
~knock;
break;
}
case "knock knock":
{
~knock;
break;
}
case "Knock, knock!":
{
~knock;
break;
}
case "knock, knock!":
{
~knock;
break;
}
case "Knock knock!":
{
~knock;
break;
}
case "knock knock":
{
~knock;
break;
}
case "Knock knock!":
{
~knock;
break;
}
case "Knock knock, you stupid fucking parrot!":
{
~knock;
break;
}
case "exit":
return 0;
default:
{
printf("\n...\n\n\n...\n\nNo response. Try the knock knock joke.");
response0 = null;
clear_stdin();
break;
}
}
runJoke(prompt);
return 0;
}
void runJoke(prompt)
{
string response1, dummy;
printf("\nParrot: Who's there?");
printf(prompt);
scanf("%s", &response1);
printf("\nYou: %s", response1);
printf("\nParrot: Bwaaaarrrrk!\n\t%s", response1);
do
{
printf(prompt);
scanf("%s", &dummy);
printf("\nYou: %s", dummy);
dummy = null;
clear_stdin();
printf("\nParrot: Bwaaarrrrk!\n\t%s", response1);
printf("\n\n\nHint: when you're bored of this, type exit or Ctrl-c");
} while(dummy != "exit");
return;
}
void clear_stdin(void)
{
short length = strlen(stdin);
for(; length > 0; length--)
getchar();
}
Iron Curtain
08/16/2009, 03:38 am
/**********************
Author: Tom Moore
Created: 15/8/2009
Updated: 15/8/2009
Title: Pyrite Parrot
Purpose: For the lols
**********************/
#include <stdio.h>
#include <string.h>
void runJoke(string prompt);
void clear_stdin(void);
int main(void)
{
printf("\nPyrite Parrot Knock Knock Utility v0.2\n\n");
string response0;
bool knock = false;
while(!knock)
{
string prompt = "\nSay something to the parrot: ";
printf(prompt);
scanf("%s", &response0);
printf("\nYou: %s", response0);
switch(response0)
{
case "Knock knock":
{
~knock;
break;
}
case "knock knock":
{
~knock;
break;
}
case "Knock, knock!":
{
~knock;
break;
}
case "knock, knock!":
{
~knock;
break;
}
case "Knock knock!":
{
~knock;
break;
}
case "knock knock":
{
~knock;
break;
}
case "Knock knock!":
{
~knock;
break;
}
case "Knock knock, you stupid fucking parrot!":
{
~knock;
break;
}
case "exit":
return 0;
default:
{
printf("\n...\n\n\n...\n\nNo response. Try the knock knock joke.");
response0 = null;
clear_stdin();
break;
}
}
runJoke(prompt);
return 0;
}
void runJoke(prompt)
{
string response1, dummy;
printf("\nParrot: Who's there?");
printf(prompt);
scanf("%s", &response1);
printf("\nYou: %s", response1);
printf("\nParrot: Bwaaaarrrrk!\n\t%s", response1);
do
{
printf(prompt);
scanf("%s", &dummy);
printf("\nYou: %s", dummy);
dummy = null;
clear_stdin();
printf("\nParrot: Bwaaarrrrk!\n\t%s", response1);
printf("\n\n\nHint: when you're bored of this, type exit or Ctrl-c");
} while(dummy != "exit");
return;
}
void clear_stdin(void)
{
short length = strlen(stdin);
for(; length > 0; length--)
getchar();
}
That's much better. :)
tbm1986
08/16/2009, 03:45 am
That's much better. :)
I'm glad someone appreciates it! It took me a good half hour typing all that out.
Magwill
08/16/2009, 04:01 am
I'm glad someone appreciates it! It took me a good half hour typing all that out.
We're not commenting for your own good. Spending that much time on a joke isn't healthy! ;)
DjNDB
08/16/2009, 04:12 am
I'm glad someone appreciates it! It took me a good half hour typing all that out.
I had fun reading it too :)
JohanShogun
08/16/2009, 04:42 am
You included a goto statement. DIE DIE DIE!!!
:P
I'm sorry, but I'm a firm believer that goto statements are considered harmful...
They're a tool like all other tools in the programming toolbox, used correctly they are quite powerful and can help you optimise your code quite a bit, but then, using them wrongfully you get awfully bad code ;)
tbm1986
08/16/2009, 05:25 am
Goto statements are most useful in Assembly, in the form of Jumps. Having said that, the CJNE is the equivalent of a While loop.
Was Goto instruction invented for beginner C users that're familiar with Assembly? You can get tighter code with Assembly if you're compact, but if you do every program the same, imo, ppl are better using either C or Basic.
hansschmucker
08/16/2009, 09:24 am
Goto statements were a necessary evil at some point, but today we are rarely interested enough in performance to justify sacrificing good code readability for that.
Truth be told, I haven't thought about goto in almost a decade and that's a good thing. Goto is too dangerous to let the average programmer decide when it can or cannot be used, so we simply say it's evil. Of course you can write good code with goto and bad code without, but you're simply more likely to produce bad code if you splatter gotos and labels all over the code.
JohanShogun
08/16/2009, 11:41 am
That it's tricky to use gotos is very true and for the most part you should avoid them, at the same time, using them correctly can really boost the performance on your coding allowing you to get more for your money when writing very processing intense algorithms.
tbm1986
08/16/2009, 01:26 pm
That it's tricky to use gotos is very true and for the most part you should avoid them, at the same time, using them correctly can really boost the performance on your coding allowing you to get more for your money when writing very processing intense algorithms.
That applies to little beyond realtime applications on microcontrollers these days (having said that, what are cellphones and wireless routers? lol)
DjNDB
08/16/2009, 01:45 pm
That applies to little beyond realtime applications on microcontrollers these days (having said that, what are cellphones and wireless routers? lol)
Routers/cell phones are no realtime applications, that's for sure.
I think in terms of performance a "goto statement" should make no difference. I haven't tried it, but i am pretty confident that compiler optimization will get similar, if not the same, results with or without "goto".
There is a legendary discussion (http://kerneltrap.org/node/553/2131) on that topic, by the way.
vBulletin® v3.8.2, Copyright ©2000-2013, Jelsoft Enterprises Ltd.