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);
}
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)])
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
......
Code:
movdqu xmm0, [rdx]
pmovmskb rcx, xmm0
bsf rcx, rcx
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
Code:
mat.extractPlanes(projPlaneN,
projPlaneF,
projPlaneL,
projPlaneR,
projPlaneT,
projPlaneB
);
Stolen from Molive:
Code:
nop ; If i remove this it breaks. I have no idea either.
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!
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)`
@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
"porycron", that's a new one :D
Code:
0 3 * * * echo pory | wall
: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")
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")
Code:
let canvasGrolsch = document.createElement("canvas");
Code:
#define SWAP(a,b); a=a+b;b=a-b;a=a-b;
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.
Code:
if (uv2hack)
{
addUv2(uv1);
addUv2(uv1);
addUv2(uv1);
addUv2(uv1);
addUv2(uv1);
addUv2(uv1);
}
Code:
CreateListOfValidMoves(form,Cells,3);
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
insane: rpi?
Code:
angle %= 360;
angle += (360 & ((angle >> (sizeof(angle)*CHAR_BIT-1)));
@porocyon: exactly! pi zero bare metal. arm11 ftw.
// not sure why this semicolon needs to be here
; e_img* the_sprite_image = NULL;
; e_img* the_sprite_image = NULL;
Quote:
function isBottomClean: boolean;
Code:
dc.l -20+-220+300+30+200,parm_cosin_call,1,110,-60,0,setsprites
sex