#include #include #include "sintab.h" #define S() (srand48(getpid())) #define R(x) (drand48()*x) #define XSIZE (320/XMAG) #define YSIZE (200/YMAG) #define XMAG 8 #define YMAG 8 #define MOVE 4 #define SPOTS 4 int spots[3][2][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]; 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[i][0][j]=XSIZE-2; spots[i][1][j]+=((int)R(3))-1; if(spots[i][1][j]<1)spots[i][1][j]=1; if(spots[i][1][j]>YSIZE-2)spots[i][1][j]=YSIZE-2; } } main(int argc, char **argv[]) { int i,j; S(); vga_setmode(G320x200x16M); for(i=0;i<3;i++) for(j=0;j