?
>>56332345
Quake source code
MAKE EVERYTHING STATIC
>>56332345(define-syntax dotimes
(lambda (x)
(syntax-case x ()
((_ (var count) body ...)
(with-syntax ((return (datum->syntax x 'return)))
#'(call/cc (lambda (return)
((lambda (f)
(f 0 f))
(lambda (var f)
(if (< var count)
(begin body
...
(f (+ 1 var) f))))))))))))
(dotimes (i 10) (when (= i 5)
(return i)))
Macro magic
>>56332411
I am a Unity babby and I know this
>>56332411
why
>>56332572
What does it do?
>>56334627
It shows off his autism.
>>56332572
Is this scheme?
I tried to run it but my compiler didn't know the "define-syntax" keyword..
Fast inverse square root is pretty cool.
>>56332345
sudoku solver in 33 lines of clojure
https://gist.github.com/swannodette/3217582
>>56332371
>>56335735
thisfloat Q_rsqrt( float number )
{
long i;
float x2, y;
const float threehalfs = 1.5F;
x2 = number * 0.5F;
y = number;
i = * ( long * ) &y; // evil floating point bit level hacking
i = 0x5f3759df - ( i >> 1 ); // what the fuck?
y = * ( float * ) &i;
y = y * ( threehalfs - ( x2 * y * y ) ); // 1st iteration
// y = y * ( threehalfs - ( x2 * y * y ) ); // 2nd iteration, this can be removed
return y;
}
>>56332345
Quake's Engine's source code is pretty beautiful.
>>56336751
>>56332371
Is there a C++ variant of it?
This Malbolge(=<_@^]nZH:FWD0w.dc1aqM-&8H)5hhC$dA.Q`<^Myxw7uts!~p/R@P,=<K(JIGGb"CYkA@?>fvQcO'`RQJn1Mj/hgff)vD'&A@]][}5GXED0fAd?+*<;'n+lkjh~%${zy~w={z\rqvutsrk1Rhmlkjiha`_d]#[`YX]VzZ<Rv9ONSRQJImMLK-IHAeE'=<;_?>=654X2Vw54-Q10/.-,l$H('&%|#"y?}_uzsrwvutm3Tpihmlkjc)gfHdcb[!_^]\[ZYXWVUTSRKPImGLEDIHAe(>C<`@">=<;:321U/.-210/.'K+$#('&%$#"y?}|{zyxq7Xnmrqj0nglkjihgf_%FbaZ~^]?UZYRvVUTSRQPONMLKJIHGF?c=BA@98=<;4X87w5432+*/(L&+*#"!E}|{"y?}_{zyxq7uWmrkponmlkjc)gfHdcb[!BX|V[ZYRvVUTSLKoO1GFEJIBfFEDC%A@?8\<;{3816543,P*/(',+$HG'~%$#zy?}|{]yxwp6tVrqj0nmlkMihg`&dcbD`_XW{[=YRQVOsSR4Jn1MFEiCBG@dDCB$@?>7[|498165.RQ10p.-,+*)('~D$dzyx>|uzyr8Yutmlqjih.Oe+ihgfedcba`_^]?UZYXWVUTSLpJOHMLKDhHG@?c&B;:9]~<5Y9876/4-Q+*).'&%I)i'&%|B"!~w={zyxwYutmrqj0{
>>56336727
Isn't that what a union is for?
>>56336819
Yes, but back then, it was undefined behaviour to use unions that way.
>>56334627
It's CL's dotimes loop implemented in Scheme, complete with a return statement.
>>56335699
Yes, it is Scheme. Try it in Guile or Racket.
>>56336778
Can't risk losing my mobo
mandelbrot code in C formatted as a mandelbrot setint main(int argc, char* argv[]){ unsigned
char c='r';double x1,y,y1,t=0,q=78,r=22,x,
x2,y2,a,b,v;do{(c=='r')?(y2=-(y1=-1.6),x1=
-2.0f,x2=0.8):(c=='?')? c=0, printf("%f\
,%f:%f,%f",x1,y1,x2,y2):(c <':'&&c>48)
?x=x1,y=y1,*(c>'3'&&c<':' ?&y1: &t)
+=(y2-y1)/3,*(c>'6'&&c< ':'?&y1
:&t)+=(y2-y1)/3, *((c == '8'
||c+3=='8'||c+3 +3== '8'?&x1
:&t))+=(x2-x1 )/ 3,*((c
=='9'||c+3== '9'||c
+6=='9' ?&x1: &t)
)+=2*(x2-x1) /3,x2=
x1+(x2-x)/3, y2 =y1+(
y2-y)/3:(c=0);for(y= y2;y>=
y1&&c;c=1,y-=(y2-y1)/r, putchar
('\n')) for(x=x1;x<=x2; x+=(x2-
x1)/q){a=b=c=0; while ( ++c&&(a=(t
=a)*a)<4&&(v=b*b)<4)a-=v-x ,b=y+b*2*t;
putchar("#@XMW*N&KPBQYKG$R" "STEEVxHOUV"
"CT()[]%JL={}eou?/\\|Ili+~<>_-^\"!;:`,. "[
c?c>>2:63]);}} while((c=getchar ())!='x');
return 0;/* Mandelbrot - S.Goodwin.2001*/}
(the formatting is probabyl gonna be fucked up)
>>56337437
and in python_ = (
255,
lambda
V ,B,c
:c and Y(V*V+B,B, c
-1)if(abs(V)<6)else
( 2+c-4*abs(V)**-0.4)/i
) ;v, x=1500,1000;C=range(v*x
);import struct;P=struct.pack;M,\
j ='<QIIHHHH',open('M.bmp','wb').write
for X in j('BM'+P(M,v*x*3+26,26,12,v,x,1,24))or C:
i ,Y=_;j(P('BBB',*(lambda T:(T*80+T**9
*i-950*T **99,T*70-880*T**18+701*
T **9 ,T*i**(1-T**45*2)))(sum(
[ Y(0,(A%3/3.+X%v+(X/v+
A/3/3.-x/2)/1j)*2.5
/x -2.7,i)**2 for \
A in C
[:9]])
/9)
) )
>>56332345
>prefixing class names with type initial
absolutely disgusting