Random line of code thread
category: code [glöplog]
Code:
if (SignalsNeeded) { /* Do I need to wait? */
SignalIn = WaitSignal(SignalsNeeded | AbortSongSignal);
}
if (OhShit) { /* Time to abort? */
BadNews:
StopSoundFile(SongItem); /* Stop the current song */
UnloadSoundFile(SongItem); /* Release the memory!! IMPORTANT! */
This is from Doom 3DO source. Funny.
Forgot the other part with goto inside :)
Code:
if (Result<0 || OhShit) { /* Sound error?!? */
goto BadNews; /* Forget it! */
}
The whole thing is funny. More gotos and funny comments, just check the link :)
This is in the (currently unreleased) Daikatana v1.2 source code I have access to:
///////////////////////////////////////////////////////////////////////
// Logic [7/22/99]:
// <BEGIN RANTING COMMENTARY>
// The follogin ai_ code was in zeus.cpp (and used in two other objects!)
// so I think to myself, "what kind of dumbass would be lazy enough to
// make this mess? Now I gotta go and move this shit around and waste
// my time cleaning shit up." Of course, I am the kind of dumbass that
// will try out code one place, and maybe "move it later", though this
// wasn't the case this time. So PLEASE PLEASE PLEASE, don't write
// "test code" and leave it sitting in production. Clean it up and
// put it where it belongs to save others the extra hassle of trying
// to understand what the hell you were thinking, then doing the right
// thing with your "test code". (I suspect The ThirdTurd crew did this)
// I'll try to do the same so I don't come off as such a hypocrite :)
// </END RANTING COMMENTARY>
// ***[11/24/99]: Shut the fuck up dumbass. You suck. You're code sucks.
// ***[11/24/99]: You're a hypocrite. You're fired.
Name censored
///////////////////////////////////////////////////////////////////////
// Logic [7/22/99]:
// <BEGIN RANTING COMMENTARY>
// The follogin ai_ code was in zeus.cpp (and used in two other objects!)
// so I think to myself, "what kind of dumbass would be lazy enough to
// make this mess? Now I gotta go and move this shit around and waste
// my time cleaning shit up." Of course, I am the kind of dumbass that
// will try out code one place, and maybe "move it later", though this
// wasn't the case this time. So PLEASE PLEASE PLEASE, don't write
// "test code" and leave it sitting in production. Clean it up and
// put it where it belongs to save others the extra hassle of trying
// to understand what the hell you were thinking, then doing the right
// thing with your "test code". (I suspect The ThirdTurd crew did this)
// I'll try to do the same so I don't come off as such a hypocrite :)
// </END RANTING COMMENTARY>
// ***[11/24/99]: Shut the fuck up dumbass. You suck. You're code sucks.
// ***[11/24/99]: You're a hypocrite. You're fired.
Name censored
Me drunk at night working on a Quake port:
/* FS: Address Book -- This could probably be an array, but I am so lazy
(or is it ironic that probably just coding the array would have taken
less time? Therefore, coding an array would be lazy! (or more efficient?)
((who sees what??)) (((what am i talking about??))) ((((lol at drunk coding))))*/
/* FS: Address Book -- This could probably be an array, but I am so lazy
(or is it ironic that probably just coding the array would have taken
less time? Therefore, coding an array would be lazy! (or more efficient?)
((who sees what??)) (((what am i talking about??))) ((((lol at drunk coding))))*/
For any true fun grep -r fuck *.* in any unedited large code base. Great for checking out frustrations of game developers.
Code:
tst.w BALLS_UP
beq.b .noballs
subq.w #1,BALLS_UP
.noballs
He called him code!
Code:
lea $5fc(a5),a0
move.w #$6100,(a0)+ ; bsr
move.w #$2344+(AckVBI-LoadIntroFiles)-$5fc-2,(a0)+ -> AckVBI
move.w #$4e71,(a0) ; NOP
Quote:
//texturecolumn = 0; // shut up compiler warning
I just realized the thread is called "Random line of code thread" and not "Random many lines of code thread" but whatever.
Code:
inc byte[fs:si+bx]
Code:
float flop = smoothstep(-0.75, 2.0, sin(0.15/noise(vec3(t*4.0))-1.0));
float flip = smoothstep(-1.20, 1.5, sin(0.15/noise(vec3(t*3.7))-1.0));
Production quality:
Code:
if(!this) return 0; // this shouldn't be necessary, but do it "just in case"
Code:
if(pTarget->getParent()->getParent()->getParent() == m_viewmodel.mContentProduction.mTableLeft.getElement())
Oh whyyy...
Code:
move.w $500+$e16+(DiskID-DiskChange).w,d0
Just realized I could do these in C:
Code:
int a[10];
for (int i=0; i<10; i++)
i[a] = i;
5[a] = 100;
9[a] = 255;
for (int i=0; i<10; i++)
printf("%d ", a[i]);
printf("LOL??!\n");
printf("%c\n", 0["Hello World"]);
printf("%c\n", "Hello World"[6]);
cause a[b] = *(a+b) and b[a] = *(b+a)
also ??! will be translated as |
also this // blahblah??????????????/
int a = 1;
would screw you.
Ahhh..
also ??! will be translated as |
also this // blahblah??????????????/
int a = 1;
would screw you.
Ahhh..
And you can write URLs:
Code:
void main()
{
http://www.pouet.net
goto http;
}
Also this.
Code:
#include"analogliterals.hpp"
using namespace analog_literals::symbols;
unsigned int c = ( o-----o
| !
! !
! !
o-----o ).area;
Or, another example with a 3D cube:
assert( ( o-------------o
|L \
| L \
| L \
| o-------------o
| ! !
! ! !
o | !
L | !
L | !
L| !
o-------------o ).volume == ( o-------------o
| !
! !
! !
o-------------o ).area * int(I-------------I)
Code:
if ((time >= timeFrom) && (time <= timeTo))
{
switch(type)
{
case VAR_POINT:
*value.valueSync = value.valueFrom;
break;
case VAR_LINEAR:
{
T vars[2] = { value.valueFrom, value.valueTo };
*value.valueSync = Interpolator<T>::Linear((time - timeFrom) / (timeTo - timeFrom), vars);
}
break;
case VAR_GENERATOR:
// value.valueSync = value.valueFrom;
*value.valueSync = (T)*value.genPtr; //eller valueFrom (slik som VAR_POINT) //copy value from pointer
break;
}
}
Code:
add di,word ptr [es:bx+di].tscrgraf.lineoffsets
Code:
// If the code crashes here, it means your vertices are too close together.
Ok, first post on pouet.net
(yup, I did it wih my hands)
Code:
return mix(hsv2rgb(vec3(floor(p.x+time*SPEED)/(8.), 1., 1.))*(1.-smoothstep(.01, 0., 1. -mod(p.x+time*SPEED, 1.))), vec3(step(0.,cos(p.y*(20.*p.x)))), smoothstep( mod(p.x+time*SPEED, 1.), mod(p.x+time*SPEED, 1.) +.025, abs(p.y)));
(yup, I did it wih my hands)
Code:
auto &colors = g->color.getValue().getPointer()->color.getValues();