View Full Version : C programming is fun

baseline bum
09-02-2004, 08:22 PM
#ifdef s

&nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp z

&nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp r(

&nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp ){z

&nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp k=0,l

&nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp =0,n,x

&nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp XQueryPointer(i

&nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp ,XRootWindow (i,j),&m,

&nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &m,&o,&p,&n,&n,( ghj)&n),(o

&nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp >=s(g)||s(o

&nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp )<=0)&&(k=1),

&nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp (p>=h||p<=0)&&

&nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp (l=1),(e==1)&&(

&nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp c=o,d=p,e=0,1)||(

&nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp (k==0&&o-c-(z)(a+y

&nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp (a)*.5)!=0)&&(a=o-c

&nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp ),(l^-1==-1&&p-d-(z)(

&nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp b+y(b)*.5)!=0)&&(b=p-d),a/=f,b/=f

&nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp ,k=0,l=0);(o >=s(g)||o<=0)&&(a=-a),(

&nbsp &nbsp &nbsp &nbsp p>=h||s(p)<=0) &&(b=-b),c=o,d=p,I(XWarpP

&nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp ,ointer)(i,None,None,0,0,s

&nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp (g),h,(z)(a+y(a)*.5),(int)(

&nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp b+y(b)*.5 JJ(float B;int)C,D;

&nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp #else/*Egads! something has */

&nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp #include<X11/Xlib.h>/*taken a*/

&nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp #include<stdio.h>/*huge bite o-*/

&nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp #include<stdlib.h>/*ut of the m-*/

&nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp #include<time.h>/*ouse pointer!!!*/

&nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp #define H(a, b) (((a)&(7<<3*(b)))>>3*(b))

&nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp #define G(c,d) ((H(c,d)<<3*(d+1))|((H(c,d+1)<<3*d)|/*

_XSetPointer(display, screen,GREASY|BOUNCY)*/c&~(63<<3*(d))))

#define s(e) (G(G(G(G(G(G(e,(z)0),1),2),1),0),1))

&nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp typedef int z;float a=0,b=0,c,d,f=1.03;z e

&nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp =s(512),g,h,j;

&nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp Display/**/*i;

&nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp #define y(X)((X>0)-(X<0))

&nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp #define x o,p; Window m;

&nbsp &nbsp &nbsp &nbsp #define ghj unsigned int*

&nbsp &nbsp &nbsp &nbsp #define I(aa,bb)aa##bb

&nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp #define JJ(X)\

&nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp ));return 0;}X

&nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp z r();int main

&nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp (z X,char**Y){

&nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp clock_t q=0;(X

&nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp ==2)&&(f=atof(Y[1])),((i

&nbsp &nbsp &nbsp &nbsp =XOpenDisplay(0) )==0)&&(exit(1

),1),j=I(Defa, ultScreen)(i),

&nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp g=s(I(Display,

&nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp Width)(i,j)-1)

&nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp ,h=I(DisplayH,

&nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp eight)(i,j)-1;

&nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp for(;;((I(clo,

&nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp ck)()-q)*100>(

&nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp CLOCKS_PER_SEC

&nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp ))&&(r(),q=clock()));}

#include __FILE__


www0.us.ioccc.org/2001/rosten.c (http://www0.us.ioccc.org/2001/rosten.c)

baseline bum
09-02-2004, 08:27 PM
#include <X11/Xlib.h>

#include <unistd.h>

typedef long O; typedef struct { O b,f,u,s,c,a,t,e,d; } C;

Display *d; Window w; GC g; XEvent e;

char Q[] = "Level %d Score %d", m[222];

#define N(r) (random()%(r))

#define U I[n++]=L[n]=l; n%=222

#define K c=-l.u; l=I; l.t=0; c+=l.u
#define E l.e--&&!--L[l.e].d&&(L[l.e].t=3)
#define M(a,e,i,o) a[0]=e,(a[1]=i)&&XFillPolygon(d,w,g,(void*)a,o,1,1)
#define F return
#define R while(
#define Y if(l.t

O p ,B,
D,A=6,Z ,S=0,v=
0,n=0,W=400 ,H=300,a[7]
={ 33,99, 165, 231,297,363} ;
XGCValues G={ 6,0 ,~0L,0,1} ; short
T[]={ 0,300,-20,0,4 ,-20,4,10,4,-5,4,5,
4,-20,4,20,4,-5,4,5,4, -10,4,20},b[]={ 0,0,4,
0,-4,4,-4,-4,4,-4,4,4} ; C L[222],I[222];dC(O x){
M(T,a[x],H,12); } Ne(C l,O s) { l.f=l.a=1; l.b=l.u=s;
l.t=16; l.e=0; U; } nL(O t,O a,O b,O x,O y,O s,O p){ C l;
l.d=0; l.f=s; l.t=t; y-=l.c=b; l.e=t==2?x:p; x-=l.s=a;s=(x|1)
%2*x; t=(y|1)%2*y; l.u=(a=s>t?s: t)>>9;l.a=(x<<9)/a;l.b=(y<<9)/a;
U; } di(C I){ O p,q,r,s,i=222;C l; B=D=0; R i--){ l=L; Y>7){ p=I.s
-l.s>>9; q=I.c-l.c>>9; r=l.t==8?l.b: l.a; s=p*p+q*q; if(s<r*r||I.t==2&&s<
26) F S+=10; s=(20<<9)/(s|1); B+=p*s; D+=q*s; }} F 0; } hi(O x,O d){ O i=A;
R i--&&(x<a-d||x>a+d)); F i; } dL(){ O c,r=0, i=222,h; C l; R i--){ l=L;
Y){ r++;c=l.f; Y==3){c=l.u; l.t=0; E; }R c--){-- l.u;h=l.c>>9; Y>7){XDrawArc(d,w,g,
(l.s>>9)-++l.a,h-l.a,l.a*2,l.a*2,0 ,90<<8); if(!l.u){ I.t-=8; l=I; } } else Y==2)M
(b,l.s>>9,h,6); else XDrawPoint(d ,w,g,(l.s+=l.a)>>9, h=(l.c+=l.b)>>9); Y==4&&!l.u){ Ne
(l,20); K; } Y&&l.t<3&&(di(l)||h> H)){ if(h>H&&(c=hi( l.s>>9,25))>=0){ dC(c); a[c]=a[--
A]; }Ne(l,30); Y==1){ E;K; } else c=l.t=0;} Y==1&&h<H -75&&!N(p*77)){ do{ nL(1,l.s,l.c,
1); I.d++;
}R N(3)

); K;
l.u=c; c=0; } Y
==2){ l.s+=l.a+B;
l.a= (l.e-l.s)/((H+
20-h)|1); l.c+=l.b+D;
M(b,l.s>>9,l.c>>9,6); }
} L=l; } } F r; } J(){
R A) { XFlush(d); v&&sleep(
3); Z=++v*10; p=50-v; v%2&&hi
((a[A]=N(W-50)+25),50)<0 &&A++;
&nbsp &nbsp &nbsp &nbsp XClearWindow (d,w); for(B=0; B<A;
dC(B++)); R Z|dL()){ Z&&!N(p)&&(Z--
,nL(1+!N(p),N(W<<9), 0,N(W<<9),H<<9,1
,0)); usleep(p*200); XCheckMaskEvent(d,
B=sprintf(m,Q,v,S); XDrawString(d,w
,g,W/3,H/2,m,B); } }

main ()
O i=2;
R i--) XMapWindow(d,w=XCreateSimpleWindow(d,w,0,0,W,H,0,0 ,0));

www0.us.ioccc.org/2001/williams.c (http://www0.us.ioccc.org/2001/williams.c)

A linux clone of Missle Command for X

Das Texan
09-02-2004, 08:36 PM
C programming can fucking goto hell.

09-02-2004, 09:00 PM
That shit is so easy along with ++, Assembly and all that shit is locked up in my head.

Guru of Nothing
09-03-2004, 12:42 AM
Relatively speaking, wiping my ass is fun too.

EDIT: I speak only from personal experience.

09-03-2004, 03:08 AM
Program this,,,,,, http://www.sahoops.net/smilies/lmao.gif www.virtual-vibrator.com/ (http://www.virtual-vibrator.com/)



09-03-2004, 04:36 PM
^^U R Crazy mouse:rollin