#include <unistd.h>
#include <sys/time.h>
#include <time.h>
+#include <math.h>
int
die(int code)
return (rand() % (high - low + 1)) + low;
}
+int
+randsign(void)
+{
+ return pow(-1, rand());
+}
+
int
main(void) {
srand((unsigned int)time(NULL));
int pad_h = 5;
int a_score = 0, b_score = 0;
int slope_x = randslope();
- int index_dir = 1;
+ int index_dir = randsign();
int direction = 1;
double speed = 0.02;
struct timeval start, stop;
x = max_x/2;
index = slope_x*max_y/2;
slope_x = randslope();
+ index_dir = randsign();
speed = 0.02;
sleep(1);
} else if (y == 0 || y == max_y) {