pouët.net

Random line of code thread

category: code [glöplog]
INC $d418!
added on the 2017-06-02 14:33:16 by viscid viscid
Code:lda fadeTab,x
added on the 2017-06-02 20:33:37 by ___ ___
Quote:
Code:note - 69.0

nice
added on the 2017-06-02 20:58:43 by ferris ferris
Code:static int bitLen(int w) { // Binary search - decision tree (5 tests, rarely 6) return (w < 1 << 15 ? (w < 1 << 7 ? (w < 1 << 3 ? (w < 1 << 1 ? (w < 1 << 0 ? (w < 0 ? 32 : 0) : 1) : (w < 1 << 2 ? 2 : 3)) : (w < 1 << 5 ? (w < 1 << 4 ? 4 : 5) : (w < 1 << 6 ? 6 : 7))) : (w < 1 << 11 ? (w < 1 << 9 ? (w < 1 << 8 ? 8 : 9) : (w < 1 << 10 ? 10 : 11)) : (w < 1 << 13 ? (w < 1 << 12 ? 12 : 13) : (w < 1 << 14 ? 14 : 15)))) : (w < 1 << 23 ? (w < 1 << 19 ? (w < 1 << 17 ? (w < 1 << 16 ? 16 : 17) : (w < 1 << 18 ? 18 : 19)) : (w < 1 << 21 ? (w < 1 << 20 ? 20 : 21) : (w < 1 << 22 ? 22 : 23))) : (w < 1 << 27 ? (w < 1 << 25 ? (w < 1 << 24 ? 24 : 25) : (w < 1 << 26 ? 26 : 27)) : (w < 1 << 29 ? (w < 1 << 28 ? 28 : 29) : (w < 1 << 30 ? 30 : 31))))); }
added on the 2017-07-03 14:42:49 by Tigrou Tigrou
audio mastering code from MEGADEMO:

Code:soundsGreatSample = (float)( ((char)(floatSample * 127.f)) / 127.f );
added on the 2017-07-04 14:08:25 by jco jco
:D
added on the 2017-07-04 15:15:04 by noby noby
msg db "Well done Kevin!",0
added on the 2017-07-05 03:22:28 by T$ T$
Code:ac = 0.96*clamp(pow(clamp(texture(feedback, (0.5+0.5*(1.0*(-1.0+2.0*uv2)))+off*mix(0.02, 0.5, smoothstep(20.0*0.3, 21.*0.3, time)-0.3*smoothstep(61.*0.3,80.*0.3,time)))-disp, 0.0, 1.0), 0.96*vec4(1.002*(1.0-disp))), 0.0, 1.0);
added on the 2017-07-06 22:17:27 by noby noby
Code:// TODO: More stuff based on cycles or something. :D
added on the 2017-07-17 14:02:05 by ferris ferris
Hey, JavaScript wizard out there...
Code:<FORM NAME="SauteMouton" METHOD=POST> <IMG NAME="pos0" SRC="blanc.png" onClick="Deplacer(this.form,0);"> <IMG NAME="pos1" SRC="blanc.png" onClick="Deplacer(this.form,1);"> <IMG NAME="pos2" SRC="blanc.png" onClick="Deplacer(this.form,2);"> <IMG NAME="pos3" SRC="vide.png" onClick="Deplacer(this.form,3);"> <IMG NAME="pos4" SRC="noir.png" onClick="Deplacer(this.form,4);"> <IMG NAME="pos5" SRC="noir.png" onClick="Deplacer(this.form,5);"> <IMG NAME="pos6" SRC="noir.png" onClick="Deplacer(this.form,6);"> <BR> <INPUT TYPE="button" VALUE="RESET" onClick="Reset(this.form)"> </FORM>
is ugly, how to polish it?

Full ugly code here
added on the 2017-07-17 18:44:17 by baah baah
Code:#include <delta_c.c> // Shouldn't do this, but I did it anyway
added on the 2017-07-17 20:58:38 by Marq Marq
Code:do _nextId++; while (_usedIds.Contains(_nextId));
added on the 2017-07-18 05:42:29 by cpdt cpdt
Evaluation = Scripts[script].EvaluateAll(Evaluator->evaluation, EVALUATE);
added on the 2017-07-19 00:27:37 by TBit TBit
Code:glCullFace(GL_FRONT) //lol falschrum
added on the 2017-07-22 20:31:55 by urs urs
Code:RECTFILL(127,127,0,0,0)
added on the 2017-07-24 18:21:52 by rez rez
rez ^_^
added on the 2017-07-24 22:56:37 by Virgill Virgill
Code: if ((curmode->convflags & PTC_CONVERT_DOUBLE) && !(curmode->convflags & PTC_CONVERT_SOFTDOUBLE)) outp(0x3d4, 0x9); outp(0x3d5, (inp(0x3d5) & 0xE0) | ((inp(0x3d5) + 1) & 0x1F));

this little "why-you-need-braces-dood" caused S3 chips to shift down linear framebuffer pointer to 64kb every mode set (since port 0x3d4 == 0x59 I assume, and it holds bits 16-23 of LFB address) until reboot, so I've spent a couple of time finding out why all VBE2.0 stuff looks misaligned and I even tried to adjust monitor controls :D
added on the 2017-08-04 13:34:12 by wbcbz7 wbcbz7
Quote:
MEMSET(0X6000,0X11,0X2000)


@virgill after tons of tests, RECTFILL(127,127,0,0,0) is the fastest method to clear the screen, even faster (very slightly) than the MEMSET version above :)
added on the 2017-08-04 13:41:06 by rez rez
Rez, didn't knew. Good you tested it ☺
added on the 2017-08-04 14:45:24 by Virgill Virgill
Code:bt dx,8+8
BB Image

^ for a good game, the amount of WTFs per line of source code is just staggering. :)
added on the 2017-08-19 17:38:48 by tomaes tomaes
Code:********************************************************************** ******************Änderungen nur in Absprache mit SD****************** ****Zuwiderhandlungen werden mit einem Kasten Bier sanktioniert!!!**** **********************************************************************
added on the 2017-08-19 20:45:30 by StingRay StingRay
Quote:
sys64738
added on the 2017-08-19 21:46:27 by kwe kwe
Code:// why did I have to type this myself, Cinema4D? static const double unitScales[] = { 1.0, 1000.0, 1.0, 0.01, 0.001, 0.000001, 0.000000001, 1609.344, 0.914, 0.305, 0.0257 };
added on the 2017-10-20 16:35:30 by kb_ kb_
import numpy as fuckingdontknowanythingaboutmathematics
added on the 2017-10-21 12:08:14 by baldrick baldrick

login