#include #include #include "sintab.h" #define S() (srand48(getpid())) #define R(x) (drand48()*x) #define NOSHOW (4) #define XSIZE (320/XMAG) #define YSIZE ((200/YMAG)+NOSHOW) #define XMAG (8) #define YMAG (8) #define MOVE (2) #define CMOVE (4) #define SPOTS (8) int spots[6][SPOTS]; char line[XSIZE*XMAG*3]; int world[YSIZE][XSIZE][3][2]; #define W(x,y,z) (world[y][x][z][f]) #define O(x,y,z) (world[y][x][z][1-f]) frame() { static int f=0; int x,y,xx,yy,i,j,k,c[3]; unsigned char *lp; f=1-f; yy=0; for(i=0;i<3;i++) for(j=0;j255)j=255; c[i]=j; } for(xx=0;xxXSIZE-2)spots[3][j]=XSIZE-2; } for(j=0;j(TABSIZE/4))spots[4][j]=TABSIZE/4; spots[5][j]+=((int)R(3))-1; if(spots[5][j]<0)spots[5][j]=0; if(spots[5][j]>(TABSIZE/4))spots[5][j]=TABSIZE/4; } for(j=0;j