pouët.net

Go to bottom

Random line of code thread

category: code [glöplog]
Code: if((z==Depth-1) || (CUBES[x][z+1][y]==Cubes_ES)) { if( (y!=Height-1) && (CUBES[x][z][y+1]==value) //same color below && ((z==Depth-1) || (CUBES[x][z+1][y+1]==value) || (CUBES[x][z+1][y+1]==Cubes_ES)) ) { CurrentStyle=CUBES_ObjectInnerStyle; CurrentWidth=CUBES_ObjectInnerWidth; } else { CurrentStyle=CUBES_ObjectBorderStyle; CurrentWidth=CUBES_ObjectBorderWidth; } PSLine(CUBES_X[x][z+1][y+1],CUBES_Y[x][z+1][y+1],CUBES_X[x+1][z+1][y+1],CUBES_Y[x+1][z+1][y+1],CurrentWidth,CurrentStyle,value); }
added on the 2020-04-29 22:33:37 by baah baah
Code:pix(((((px+ox)+xp)-(sx*8))/(z+(pz+oz)))+124,((((py+oy)+yp)-(sy*8))/(z+(pz+oz)))+72,title_StarColorTable[min(math.floor(-(pz*1.5)+5),#title_StarColorTable)])
added on the 2020-04-30 01:09:35 by DevEd DevEd
Quote:
_asm
{
mov esi,[buffer]
mov edi,[dst]
mov eax,0x1f1f1f1f
mov ebx,4
add si,4
mov di,si
add [esi],0x1010100
movsd
add [esi],0x10101
movsd

add si,308
mov di,si
add [esi],0x1000000
movsd
add [esi],0x2010101
movsd
add [esi],0x1010102
movsd
add [esi],0x1
movsd

......
added on the 2020-04-30 10:18:33 by Optimus Optimus
Code:movdqu xmm0, [rdx] pmovmskb rcx, xmm0 bsf rcx, rcx
added on the 2020-04-30 21:02:49 by Blueberry Blueberry
Code:iii = len(x for x in bs[1] if x in "0123456789") yield EncOp(bs[0],int(bs[1][:iii]),bs[1][iii:],int(bs[2]))


generating opcode tables from someone else's slightly-annoying-to-parse description
added on the 2020-04-30 21:53:51 by porocyon porocyon
Code: mat.extractPlanes(projPlaneN, projPlaneF, projPlaneL, projPlaneR, projPlaneT, projPlaneB );
added on the 2020-05-02 00:09:35 by bsp bsp
Stolen from Molive:

Code:nop ; If i remove this it breaks. I have no idea either.
added on the 2020-05-02 05:28:43 by porocyon porocyon
Code:co[1], co[2], side_length = co[2], co[1], sqrt(#curve) --yes, having this in the loop means 21845 sqrt() calls instead of 7, but think of the one token saved!
added on the 2020-05-02 09:59:21 by jobe jobe
jobe: please tell me you were a few tokens short in the final code and had no choice but to hard coded the value of `sqrt(#curve)`
added on the 2020-05-02 13:20:25 by p01 p01
@porycron, well here is a 7 bytes example that outputs some funny garbage in textmode, but doesn't if you remove the NOP ;)
Code:les bx,[si] nop X: stosb inc ax jmp short X
added on the 2020-05-02 13:41:03 by HellMood HellMood
"porycron", that's a new one :D

Code:0 3 * * * echo pory | wall
added on the 2020-05-02 20:33:20 by porocyon porocyon
:D oh shit sorry, don't know what i was thinking (probably nothing at all)
Anyway, to make the above more graspable, here is the
program with nop
and here is it
without the nop
(You can paste the source there yourself and hit "Run")
added on the 2020-05-03 12:47:57 by HellMood HellMood
Code:let canvasGrolsch = document.createElement("canvas");
Code:#define SWAP(a,b); a=a+b;b=a-b;a=a-b;
added on the 2020-05-04 18:40:56 by baah baah
Code: movsb ; 1 copy first byte of match (could also be movsw for min len 3)
Code: s := #52#18#21#20#19#22#17#4#2#3#2#3#2#3#2#3#16#3#18#3#16#3#1#3#9#3#2; s := s + #3#16#3#1#1#2#1#3#1#4#1#2#1#1#3#16#3#8#1#9#3#16#3#2#1#5#1#5#1#3; s := s + #3#16#3#2#1#5#1#5#1#3#3#16#3#8#2#8#3#15#4#18#3#15#4#12#1#5#4#14#3; s := s + #5#1#1#6#7#3#16#1#20#1#19#1#7#4#7#1#20#1#18#1#21#1#16#1#23#16#23; s := s + #1#2#1#10#1#2#1#20#2#4#1#2#1#2#1#2#1#4#2#17#1#7#2#1#2#1#2#7#1; s := s + #15#1#24#1#14#1#24#1#6;

1bpp pixeled Grandma pic in a string. A late virtual tombstone if you will. From linky.
added on the 2020-05-09 11:19:26 by tomaes tomaes
Code: if (uv2hack) { addUv2(uv1); addUv2(uv1); addUv2(uv1); addUv2(uv1); addUv2(uv1); addUv2(uv1); }
added on the 2020-05-09 12:01:43 by Preacher Preacher
Code:CreateListOfValidMoves(form,Cells,3);
added on the 2020-05-09 20:30:33 by baah baah
Code: .Lloop: ldmia r0!,{r4-r11} uqsub8 r4,r4,r3 uqsub8 r5,r5,r3 uqsub8 r6,r6,r3 uqsub8 r7,r7,r3 uqsub8 r8,r8,r3 uqsub8 r9,r9,r3 uqsub8 r10,r10,r3 uqsub8 r11,r11,r3 stmia r1!,{r4-r11} subs r2,#8 bhi .Lloop
added on the 2020-05-10 01:20:16 by insane insane
insane: rpi?

Code:angle %= 360; angle += (360 & ((angle >> (sizeof(angle)*CHAR_BIT-1)));
added on the 2020-05-10 01:25:38 by porocyon porocyon
@porocyon: exactly! pi zero bare metal. arm11 ftw.
added on the 2020-05-10 13:58:18 by insane insane
// not sure why this semicolon needs to be here
; e_img* the_sprite_image = NULL;
added on the 2020-05-10 15:17:47 by rloaderro rloaderro
Quote:
function isBottomClean: boolean;
added on the 2020-05-11 11:23:28 by tomaes tomaes
Code:dc.l -20+-220+300+30+200,parm_cosin_call,1,110,-60,0,setsprites
added on the 2020-05-11 15:50:19 by bifat bifat
sex
added on the 2020-05-12 13:58:04 by bodo^rab bodo^rab

login

Go to top