Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length

 
Advanced search

1056121 Posts in 42889 Topics- by 34833 Members - Latest Member: paulie3sticks

October 22, 2014, 01:40:01 PM
TIGSource ForumsDeveloperTechnical (Moderators: Glaiel-Gamer, ThemsAllTook)Post if you just laughed at your code.
Pages: 1 ... 19 20 [21] 22 23 ... 28
Print
Author Topic: Post if you just laughed at your code.  (Read 60040 times)
Evan Balster
Level 10
*****


I live in this head.


View Profile WWW Email
« Reply #400 on: March 19, 2013, 12:39:27 AM »

That is absolutely glorious, Fic.  Grin
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>
JobLeonard
Level 10
*****



View Profile
« Reply #401 on: March 19, 2013, 04:17:46 AM »

:D

Highly relevant comic
Logged
AlexStv
Level 0
**


Based on real events!


View Profile
« Reply #402 on: April 05, 2013, 01:49:47 AM »

Not my code but the Jedi Academy source code was just released and it's full of great comments.

Quote
jediAcademy/codemp/qcommon/stringed_ingame.cpp:41:// Yeah, it's hardcoded. I don't give a shit.
Quote
jediAcademy/tools/ModView/modviewdoc.cpp:88:void FuckingWellSetTheDocumentNameAndDontBloodyIgnoreMeYouCunt(LPCSTR psDocName)

Quote
jediOutcast/codemp/ghoul2/G2_bones.cpp:326:             // why I should need do this Fuck alone knows. But I do.
Logged

Klaim
Level 10
*****



View Profile WWW
« Reply #403 on: April 05, 2013, 04:04:12 AM »

A loooooong time ago (like 2008?ish) I wrote a collision detection system in C++ that takes any two Shape objects, then depending on their subclass, executes a function that checks against those two shapes. It's pretty tight, but I didn't bother implementing every function at the time. Especially the reeeeeally complex ones. Years passed, deeds became legend, legend became myth, blah blah, and I forgot about them.

While trying to debug why two objects with complex shapes weren't hitting each other, I eventually figured maybe my collision detection function was incorrect, and found this as the entire body of the function:

Code:
// HAVE FUN WITH THIS ONE FUCKER AHAHAHAHAHA
return false;

 Lips Sealed

Hahaha that one is good.

I use a macro for this kind of stuff (UCX_NOT_IMPLMENTED_YET), it generate a debug-break (which generate a crash in release) with the message "NOT IMPLEMENTED YET!!! DO IT NOW!!!!!!!".

I also have a macro for remembering to write a function before compiling:

Code:
/// Use this macro when you just want to remember to implement a function before compiling
#define UCX_DO_IT_NOW       static_assert( false, "NOT IMPLEMENTED : DO IT NOW!" );
Logged

http://www.klaimsden.net | Game : NetRush | Digital Story-Telling Technologies : Art Of Sequence
kamac
Level 10
*****


Notorious posts editor


View Profile Email
« Reply #404 on: April 05, 2013, 07:59:58 AM »

Not my code but the Jedi Academy source code was just released and it's full of great comments.

Quote
jediAcademy/codemp/qcommon/stringed_ingame.cpp:41:// Yeah, it's hardcoded. I don't give a shit.
Quote
jediAcademy/tools/ModView/modviewdoc.cpp:88:void FuckingWellSetTheDocumentNameAndDontBloodyIgnoreMeYouCunt(LPCSTR psDocName)

Quote
jediOutcast/codemp/ghoul2/G2_bones.cpp:326:             // why I should need do this Fuck alone knows. But I do.

I downloaded that source to look for a weird bug I had when I was younger and I had been playing JKA. It occured when you:
-Jumped up slightly
-In the air you had to kick in any direction with staff lightsaber
-Then, in the same moment you hit the ground, you had to jump & kick at the same time. That made you jump skyyyy high.

Didn't really find any answer to that  Sad
I guess it's just a dirty bug.
Logged

Nothing to do here
JobLeonard
Level 10
*****



View Profile
« Reply #405 on: April 05, 2013, 08:08:10 AM »

I downloaded that source to look for a weird bug I had when I was younger and I had been playing JKA. It occured when you:
-Jumped up slightly
-In the air you had to kick in any direction with staff lightsaber
-Then, in the same moment you hit the ground, you had to jump & kick at the same time. That made you jump skyyyy high.

Didn't really find any answer to that  Sad
I guess it's just a dirty bug.
Sounds like a floating point divide by near-zero error.

EDIT: The paging, it burnssss!
Logged
kamac
Level 10
*****


Notorious posts editor


View Profile Email
« Reply #406 on: April 05, 2013, 08:42:57 AM »

I downloaded that source to look for a weird bug I had when I was younger and I had been playing JKA. It occured when you:
-Jumped up slightly
-In the air you had to kick in any direction with staff lightsaber
-Then, in the same moment you hit the ground, you had to jump & kick at the same time. That made you jump skyyyy high.

Didn't really find any answer to that  Sad
I guess it's just a dirty bug.
Sounds like a floating point divide by near-zero error.

EDIT: The paging, it burnssss!

Yeah, I thought that the cause might be some division fail.. Namely, there's a division by forceJumpCharge and a timer - by guess I think that when you land and jump right away, one of these is very, very little.
Logged

Nothing to do here
JobLeonard
Level 10
*****



View Profile
« Reply #407 on: April 05, 2013, 12:37:08 PM »

So if you time it correctly you jump sky high, and the suspects are forceJumpCharge and a timer?

Book 'm Danno Noir
Logged
Postmita
Manbaby
*


View Profile
« Reply #408 on: April 05, 2013, 07:11:55 PM »

I have laughed at my own code a few time. Recently I discovered that "if" statements only seem to work if you are checking the right variables. Gave me a little relief that I wasn't losing my mind, but also planted some doubt that maybe I was.
Logged
Eigen
Level 10
*****


Jebus backups.


View Profile WWW
« Reply #409 on: April 11, 2013, 10:43:54 AM »

Code:
// Divide into 256 x 256 pieces

int pieceSize = 128;

Huh?
Logged

BleakProspects
Level 4
****



View Profile WWW Email
« Reply #410 on: April 15, 2013, 06:50:54 PM »

I just made the most retarded programming decision in my life.

here's the problem:
I have a bunch of different kind of ramps. Basically, each "ramp type" is a combination of whether or not each top vertex of a cube is lowered into a ramp. So there are ~16 ramp types.

Supposing I have a bunch of these ramps all next to each other, how can I efficiently render them without rendering any non-visible faces? Basically, I needed a function that, given two ramps next to each other and a face, returned whether or not the face should be drawn.

After spending a lot of time trying to derive the solution to this problem and running into a bunch of corner cases, I got frustrated, gave up and decided to do it all by brute force. It turns out that combinatorically, this blows up to 784 cases.

So I just made an array that was 784 large. Then I wrote a script to loop through all the cases and prompt me on whether or not to draw the face in that situation. Looks something like this:



The red face is the face in question, and I press "t" or "f" to decide whether or not to draw it. It then loops through every case. The program spits out C# code which then runs in my game and fills the giant array.

After a few runs of this program, I finally made no mistakes and the thing works perfectly.

WTF was I thinking?
« Last Edit: April 15, 2013, 07:07:36 PM by BleakProspects » Logged

Geti
Level 10
*****



View Profile WWW
« Reply #411 on: April 15, 2013, 10:54:30 PM »

Bahahaha awesome Coffee Hope it didn't take longer than an hour.
Logged

_Tommo_
Level 8
***


frn frn frn


View Profile WWW
« Reply #412 on: April 16, 2013, 02:05:58 AM »

WTF was I thinking?

I... I... Master, please teach us Hand ClapEpileptic

(but on the other hand it's better than wasting a day to have a "real" solution!)
Logged

JobLeonard
Level 10
*****



View Profile
« Reply #413 on: April 16, 2013, 04:46:11 AM »

Quite often, "real" solutions are for when you need general solutions, which kind of misses the point of optimisations.

Like the name of the Processing sketch Tongue
Logged
Muz
Level 10
*****



View Profile Email
« Reply #414 on: April 18, 2013, 12:02:46 AM »

I was rushing through testing a file output function. Not wanting to bother finding the folder of my app, I just copied it from another function. Also copied the file name too.

Turns out that I just overriden my main database file with some dummy text. It killed the whole app, but thankfully, it's recoverable. Would've been more amusing if the database was located in the root directory, since I overrode all the root protection stuff to debug faster.
Logged
2DArray
Level 0
**


View Profile Email
« Reply #415 on: May 07, 2013, 08:23:10 AM »

My line ended with "List.<int[,]>();" and suddenly I feel like I'm typing in Wingdings.
Logged
Belimoth
Level 10
*****


high-heeled cyberbully


View Profile
« Reply #416 on: May 07, 2013, 11:41:00 AM »

If keyboards had wingdings instead of a numpad or something I would enjoy coding with them.
ZODIAC SYMBOLS EVERYWHERE
Logged

JobLeonard
Level 10
*****



View Profile
« Reply #417 on: May 08, 2013, 02:39:23 AM »

Try APL
Logged
Belimoth
Level 10
*****


high-heeled cyberbully


View Profile
« Reply #418 on: May 08, 2013, 08:18:54 AM »

 Kiss
Logged

ThemsAllTook
Moderator
Level 10
******


Alex Diener


View Profile WWW
« Reply #419 on: May 08, 2013, 10:20:03 AM »

Try APL

What I experience watching this must be what it's like for my parents if I ever talk about programming around them.
Logged
Pages: 1 ... 19 20 [21] 22 23 ... 28
Print
Jump to:  

Theme orange-lt created by panic