You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
icfp11/src/lookahead-main.c

36 lines
557 B

#include "control.h"
#include <stdio.h>
#define LATENCY 20
void trial_loop(trial *t) {
do {
if (-1 == trial_wait_for_start(t)) return;
if (t->finished) break;
while (t->alive) {
lookahead(t);
if (-1 == trial_check_input(t)) return;
}
trial_reset_run(t);
} while (!t->finished);
}
int main(int argc, char **argv) {
trial *t;
if (argc <= 2) {
fprintf(stderr, "Syntax: %s hostname port\n", argv[0]);
return 1;
}
if (NULL == (t = trial_new(argv[1], argv[2]))) {
return 2;
}
trial_loop(t);
trial_free(t);
return 0;
}