Random line of code thread
category: code [glöplog]
#1=250 ( Piercing Feedrate )
#2=32.5 ( Radius of path )
#10=30 ( Step value in degrees )
G0 X0 Y0 Z5
M98 P1 L11
O1 ( Start )
#11=[0+[#2*cos[#10]]] (X)
#12=[0+[#2*sin[#10]]] (Y)
G0 X#11 Y#12 Z1.5
G1 Z-0.5 F#1
G0 Z1.5
#10=[#10+30]
M99
M30
( )
death loop = 1
#2=32.5 ( Radius of path )
#10=30 ( Step value in degrees )
G0 X0 Y0 Z5
M98 P1 L11
O1 ( Start )
#11=[0+[#2*cos[#10]]] (X)
#12=[0+[#2*sin[#10]]] (Y)
G0 X#11 Y#12 Z1.5
G1 Z-0.5 F#1
G0 Z1.5
#10=[#10+30]
M99
M30
( )
death loop = 1
;shit won't work
Code:
move.w #$C000,SyncCount(A_DEVICE) ;this is obscure - should change
Code:
//why does this prevent a crash? ?
Code:
drawcopy -nmt @dm.zoom.1. [ $+ [ $floor(%dm.zoom.tex.c) ] ] $rgb(255,255,255) $calc((%x1 + (%zoom.x / 2)) - (%stretch.x / 2)) $calc((%y1 + (%zoom.y / 2)) - (%stretch.y / 2)) $calc((320 - %zoom.x) + (%stretch.x * 2)) $calc((180 - %zoom.y) + %stretch.y) @demo 0 0 320 180
what language is that?
my bet would be on mIRC script.
You would be correct.
Code:
SoftwarePirat.MSG0
DC.B 'Software Pirate',0
DC.B '%u Au',0
Killedbys.MSG
DC.B 'Killed by %s',0
aProtectionTh.MSG
DC.B 'a Protection Thug',0
d.MSG
DC.B '%d',0
Spot the differences in ASM implementation, documentation and C++ implementation.
Code:
// returns 12*128*(log2(freq/8363)+midiftune/100)
#ifdef ENABLE_X86
const float _f1_8363 = 1.0f / 8363.0f;
const float _factor = 128 * 12;
const float _fct_100 = 128.0f / 100.0f;
int result;
_asm {
fild nMidiFTune
fld _fct_100
fmulp st(1), st(0)
fld _factor
fild freq
fld _f1_8363
fmulp st(1), st(0)
fyl2x
faddp st(1), st(0)
fistp result
}
return result;
#else
- return Util::Round<int>((12 * 128) * log(freq * (1.0f / 8363.0f) + nMidiFTune * (1.0f / 100.0f)));
#endif
Code:
#ifndef NVIDIAHASFIXEDTHEIRSHIT
ImmContext->CSSetUnorderedAccessViews(0, 1, (ID3D11UnorderedAccessView**)counts, 0);
#endif
Ie the screen uav has to be deselected before presenting, otherwise it will crash the laptop drivers after 3 frames or so (no, not the first time)
kvec_t(glm::vec3)sshape_normals;
kvec_t(glm::vec3)sshape_vertices;
kvec_t(glm::vec3)sshape_colour;
kvec_t(glm::vec3)sshape_vertices;
kvec_t(glm::vec3)sshape_colour;
Code:
.var offset = [[y & $f8] << 4] + [x & $f8] + [y & 7]
Quote:
Spot the differences in ASM implementation, documentation and C++ implementation.
Code:// returns 12*128*(log2(freq/8363)+midiftune/100) #ifdef ENABLE_X86 const float _f1_8363 = 1.0f / 8363.0f; const float _factor = 128 * 12; const float _fct_100 = 128.0f / 100.0f; int result; _asm { fild nMidiFTune fld _fct_100 fmulp st(1), st(0) fld _factor fild freq fld _f1_8363 fmulp st(1), st(0) fyl2x faddp st(1), st(0) fistp result } return result; #else - return Util::Round<int>((12 * 128) * log(freq * (1.0f / 8363.0f) + nMidiFTune * (1.0f / 100.0f))); #endif
wow, evil! they all do 3 different things... very hard to spot.
nope, the fyl2x is a fucker, was a fucker and will stay a fucker, thats in the documentation, maybe not that hardworded! ;)
Quote:
nope, the fyl2x is a fucker, was a fucker and will stay a fucker, thats in the documentation, maybe not that hardworded! ;)
you didn't get it.
I'll try to break it down:
1) The argument passed to the log function is different:
C++:
Code:
log(freq * (1.0f / 8363.0f) + nMidiFTune * (1.0f / 100.0f))
comments:
Code:
log2(freq/8363)
2) The factor for nMidiFTune is different:
x86 asm:
Code:
const float _fct_100 = 128.0f / 100.0f;
//...
fild nMidiFTune
fld _fct_100
fmulp st(1), st(0)
comments:
Code:
midiftune/100
Now the question is: what's correct?
The ASM version is the correct one. ;)
Code:
bool found = false;
foreach(int index in comparisonLineIndicesArray[index0])
{
if (index1==index)
{
found = true;
break;
}
}
if (!found)
{
foreach(int index in comparisonLineIndicesArray[index1])
{
if (index0==index)
{
found = true;
break;
}
}
}
Code:
* = $7c
loop
ldy $c5 ; oh
jsr $f12b ; ah
jsr $e965 ; a pinch of magic scrolling salt
jmp loop ; awaaay... :D
Kinda nice looking interactive c64 effect with kinkily scrolling error messages that change when you press some keys. ;)
Currently playing with games on hexagonal boards:
Code:
x2=x+(NbSteps+y%2)/2;
Code:
x2=x-(NbSteps+1-y%2)/2;
Code:
mov byte[fs:bx],cl
else
Code:
0 c=int(rnd(1)*25)+66:printchr$(c);:fori=.toc*30:next:geta$:iflen(a$)>.thenif((c-1)=asc(a$))goto.
Ok, here's a one-line micro-game. Not the least bit clever, but a nice brain twister. Type in the letter that comes before the random one shown in the alphabet. Better be quick. Select, copy, right-click into VICE, "run"<enter> to play. :P
Code:
************************************************************************
* WARNING!!!!! DO NOT CHANGE ANY OF THE FOLLOWING TYPES! WARNING !!!!! *
* !!!!!!!! All types have to synconized with R/3 kernel types !!!!!!!! *
************************************************************************
comment I just found in commercial code. :)
The wonders of middleware:
Code:
return (*this = M * (*this));