|
bateleur
|
|
« Reply #41 on: March 18, 2011, 01:04:50 AM » |
|
I really must stop using string literals as abstract handles to things. Today's first bug located... mainView.switchTo("TitLepage");
I'm pretty sure I saw one of her DVDs for sale in a banner ad once.
|
|
|
Logged
|
|
|
|
BitPuffin
|
|
« Reply #42 on: March 18, 2011, 02:32:54 AM » |
|
I was once bored enough to type this and laugh at it: I was also laughing like a mad scientist while finishing up my Java Tetris clone, at both the things that actually worked and the things that went horribly wrong. HAHA, damn; that cracked me up
|
|
|
Logged
|
You can\'t spell \"Programmer\" without \"Pro\"
|
|
|
Triplefox
|
|
« Reply #43 on: March 21, 2011, 04:43:17 PM » |
|
// units to be rescued var resQueue = new Array<Dynamic>();
|
|
|
Logged
|
|
|
|
Evan Balster
|
|
« Reply #44 on: March 21, 2011, 09:05:14 PM » |
|
Hah. ResQueue. LOG ("Cancel lock (" << x << ", " << y << ") for #" << client << endl << " Result: ");if (world.checkLock(x, y) == client) { LOG("OKAY"); user.lock = false; cell.lock = 0; resp.sendTo(client) << NC_CELL << NC_CELL_CANCEL << x << y; world.toUsers(resp) << NC_CELL << NC_CELL_EVENT << NC_CELL_CANCEL << x << y; } else { LOG("NO SUCH LOCK"); //The third time I saw this I laughed.
//Anyway, humor the little fella resp.sendTo(client) << NC_CELL << NC_CELL_CANCEL << x << y; }
|
|
|
Logged
|
Creativity births expression. Curiosity births exploration. Our work is as soil to these seeds; our art is what grows from them...Wreath, SoundSelf, Infinite Blank, Cave Story+, <plaid/audio>
|
|
|
Cheezmeister
|
|
« Reply #45 on: March 23, 2011, 12:11:21 PM » |
|
My favorite line of code in the history of ever, just in case it hasn't been posted already:
|
|
|
Logged
|
|
|
|
grapefrukt
|
|
« Reply #46 on: March 24, 2011, 02:39:37 AM » |
|
i recently stumbled upon this comment in code i wrote about two months ago, the code itself isn't very amusing, but my nice little insult at the end cracked me up. if(isLandscape){ // w/h needs to be swapped here for landscape, took me about half a day to figure that out. communists. glTranslatef(-h/2,-w/2,0); } else { glTranslatef(-w/2,-h/2,0); }
|
|
|
Logged
|
|
|
|
Wilson Saunders
|
|
« Reply #47 on: March 24, 2011, 10:29:02 AM » |
|
I used to put little puns in my comments about how the World class was by far the best class in the the entire program. Recently I spent 20 minutes trying to figure out why a sprite wasn't rendering when I was drawing it before the background. That caused the laugh of stupidity and dispair.
|
|
|
Logged
|
|
|
|
Evan Balster
|
|
« Reply #48 on: March 24, 2011, 11:52:38 AM » |
|
Oh, laugh of stupidity and despair.
At times, you are my only true friend.
|
|
|
Logged
|
Creativity births expression. Curiosity births exploration. Our work is as soil to these seeds; our art is what grows from them...Wreath, SoundSelf, Infinite Blank, Cave Story+, <plaid/audio>
|
|
|
BitPuffin
|
|
« Reply #49 on: March 24, 2011, 01:54:56 PM » |
|
String tanga = "Worst joke ever";
|
|
|
Logged
|
You can\'t spell \"Programmer\" without \"Pro\"
|
|
|
GeoffBorchers
|
|
« Reply #50 on: March 24, 2011, 05:47:24 PM » |
|
My favorite line of code in the history of ever, just in case it hasn't been posted already: I find myself preferring:
|
|
|
Logged
|
|
|
|
Derakon
|
|
« Reply #51 on: March 24, 2011, 09:36:16 PM » |
|
Here's one I found in my code just a bit ago: if not shouldContinue: continue Of course, when I named the variable, I was thinking in terms of "should continue with the rest of the iteration", not in terms of Python keywords...
|
|
|
Logged
|
|
|
|
Evan Balster
|
|
« Reply #52 on: March 24, 2011, 09:47:59 PM » |
|
if not shouldContinue: continue You rebel, you.
|
|
|
Logged
|
Creativity births expression. Curiosity births exploration. Our work is as soil to these seeds; our art is what grows from them...Wreath, SoundSelf, Infinite Blank, Cave Story+, <plaid/audio>
|
|
|
RobAnthony
|
|
« Reply #53 on: March 25, 2011, 03:29:13 PM » |
|
It's late at night, I'm working on my GLSL
I read Uniform as Unicorn...
can't unsee it!
|
|
|
Logged
|
|
|
|
st33d
Guest
|
|
« Reply #54 on: March 28, 2011, 12:09:04 PM » |
|
|
|
|
Logged
|
|
|
|
BadgerManufactureInc
Guest
|
|
« Reply #55 on: March 28, 2011, 12:41:50 PM » |
|
First time I've seen that. This line should be another thread 'post if you just made your code impossible to debug': #define TRUE FALSE //Happy debugging suckers Of course, that kind of idea could be good for deliberate obfuscation, if you wanted to avoid decompiling for example.
|
|
|
Logged
|
|
|
|
drChengele
Level 2
if (status = UNDER_ATTACK) launch_nukes();
|
|
« Reply #56 on: March 28, 2011, 01:17:28 PM » |
|
void add_influence(Influence influence) // influence influence influence. // influence. { ... }
But this : #define TRUE FALSE //Happy debugging suckers This wins the evil olympics.
|
|
|
Logged
|
PraetorCurrently working on : tactical battles.
|
|
|
Evan Balster
|
|
« Reply #57 on: March 28, 2011, 07:55:55 PM » |
|
Exception up = new Exception("Something is really wrong."); throw up; //ha ha Hah!
|
|
|
Logged
|
Creativity births expression. Curiosity births exploration. Our work is as soil to these seeds; our art is what grows from them...Wreath, SoundSelf, Infinite Blank, Cave Story+, <plaid/audio>
|
|
|
Player 3
|
|
« Reply #58 on: April 13, 2011, 04:49:19 AM » |
|
My favorite line of code in the history of ever, just in case it hasn't been posted already: I find myself preferring: Time to put actual use to the hammertime! stop();
this.loaderInfo.addEventListener(ProgressEvent.PROGRESS, hammertime); this.loaderInfo.addEventListener(Event.COMPLETE, onComplete);
function hammertime(e:ProgressEvent):void { ... ... It actually stops for hammertime. I'm dead inside.
|
|
« Last Edit: April 13, 2011, 04:57:04 AM by Player 3 »
|
Logged
|
|
|
|
Klaim
|
|
« Reply #59 on: April 13, 2011, 01:31:00 PM » |
|
I didn't laugh right now but I just remembered about the time I read the code I did 7/8 years before for my first C++ game that was also my first "big" game.
The gameplay mechanics were fully written in one unique function. (the GUI and graphics were well separated, only the gameplay was a unique block of ifs...)
The gameplay function started with a if that looked if there was at least one game entity of a specific type. If there was, it did one half of the function. If there wasn't, it did the other half. Both the if and else blocks were the same but few minor modifications.
I created objects using new. I deleted them using free. It's still apparently stable on Windows7.
There was 5 cpp files and 5 headers files. One for each "module". (really fast compilation!)
The scripting was done using a command-line application that asked you for each script line what instruction and parameter you wanted.
That was so wrong and naive, yet it's the most complete game I ever done outside my dayjob. I was almost crying from laughing (is it english?) while reading this code. Incredible.
|
|
|
Logged
|
|
|
|
|