pouët.net

Go to bottom

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
added on the 2014-04-09 16:09:30 by FunGas FunGas
;shit won't work
Code:move.w #$C000,SyncCount(A_DEVICE) ;this is obscure - should change
added on the 2014-04-10 10:15:44 by StingRay StingRay
Code: //why does this prevent a crash? ?
added on the 2014-04-10 10:40:24 by Preacher Preacher
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
added on the 2014-04-10 11:57:46 by ___ ___
what language is that?
added on the 2014-04-10 12:10:52 by Preacher Preacher
my bet would be on mIRC script.
You would be correct.
added on the 2014-04-10 22:22:56 by ___ ___
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
added on the 2014-04-16 07:15:07 by StingRay StingRay
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)
added on the 2014-04-17 00:14:40 by Psycho Psycho
kvec_t(glm::vec3)sshape_normals;
kvec_t(glm::vec3)sshape_vertices;
kvec_t(glm::vec3)sshape_colour;
added on the 2014-04-28 04:53:35 by mudlord mudlord
Code:.var offset = [[y & $f8] << 4] + [x & $f8] + [y & 7]
added on the 2014-05-01 19:17:18 by Preacher Preacher
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.
added on the 2014-05-02 11:41:22 by xTr1m xTr1m
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?
added on the 2014-05-02 14:36:53 by xTr1m xTr1m
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; } } }
added on the 2014-05-02 15:41:46 by Optimus Optimus
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. ;)
added on the 2014-05-07 22:20:28 by tomaes tomaes
Currently playing with games on hexagonal boards:
Code:x2=x+(NbSteps+y%2)/2;

Code:x2=x-(NbSteps+1-y%2)/2;
added on the 2014-05-11 18:20:54 by baah baah
Code:mov byte[fs:bx],cl
else
added on the 2014-05-11 21:58:26 by pista pista
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
added on the 2014-05-13 12:45:27 by tomaes tomaes
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. :)
added on the 2014-06-04 09:16:32 by StingRay StingRay
The wonders of middleware:

Code:return (*this = M * (*this));
added on the 2014-06-11 13:35:45 by Preacher Preacher

login

Go to top