pouët.net

Go to bottom

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.
added on the 2014-12-03 16:10:19 by Optimus Optimus
Forgot the other part with goto inside :)

Code:if (Result<0 || OhShit) { /* Sound error?!? */ goto BadNews; /* Forget it! */ }
added on the 2014-12-03 16:11:13 by Optimus Optimus
The whole thing is funny. More gotos and funny comments, just check the link :)
added on the 2014-12-03 16:12:37 by Optimus Optimus
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
added on the 2014-12-04 02:17:54 by Maraakate Maraakate
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))))*/
added on the 2014-12-04 02:19:18 by Maraakate Maraakate
For any true fun grep -r fuck *.* in any unedited large code base. Great for checking out frustrations of game developers.
added on the 2014-12-04 02:20:57 by Maraakate Maraakate
Code: tst.w BALLS_UP beq.b .noballs subq.w #1,BALLS_UP .noballs
added on the 2014-12-04 10:25:41 by StingRay StingRay
He called him code!
added on the 2014-12-04 11:08:34 by Optimus Optimus
Code: lea $5fc(a5),a0 move.w #$6100,(a0)+ ; bsr move.w #$2344+(AckVBI-LoadIntroFiles)-$5fc-2,(a0)+ -> AckVBI move.w #$4e71,(a0) ; NOP
added on the 2014-12-10 08:29:26 by StingRay StingRay
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.
added on the 2014-12-12 15:19:23 by Optimus Optimus
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));
added on the 2014-12-17 21:16:43 by noby noby
Production quality:
Code: if(!this) return 0; // this shouldn't be necessary, but do it "just in case"
added on the 2014-12-19 12:16:33 by Mystran Mystran
Code:if(pTarget->getParent()->getParent()->getParent() == m_viewmodel.mContentProduction.mTableLeft.getElement())

Oh whyyy...
added on the 2014-12-19 12:42:46 by Preacher Preacher
Code: move.w $500+$e16+(DiskID-DiskChange).w,d0
added on the 2014-12-29 11:31:01 by StingRay StingRay
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]);
added on the 2015-02-19 15:01:41 by Optimus Optimus
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..
added on the 2015-02-19 15:04:09 by Optimus Optimus
And you can write URLs:
Code: void main() { http://www.pouet.net goto http; }
added on the 2015-02-19 15:05:17 by Optimus Optimus
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)
added on the 2015-02-19 15:06:42 by Optimus Optimus
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; } }
added on the 2015-02-20 19:07:32 by rudi rudi
Code:add di,word ptr [es:bx+di].tscrgraf.lineoffsets
added on the 2015-02-21 04:57:51 by trixter trixter
Code:// If the code crashes here, it means your vertices are too close together.
added on the 2015-02-21 05:44:40 by snoutmate snoutmate
Ok, first post on pouet.net

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)
added on the 2015-02-23 18:22:59 by kloumpt kloumpt
Code:auto &colors = g->color.getValue().getPointer()->color.getValues();

login

Go to top