icfp11/src/main.c

34 lines
499 B
C
Raw Normal View History

2008-07-11 20:38:17 +00:00
2008-07-11 22:55:36 +00:00
#include "control.h"
#include "path.h"
2008-07-11 22:55:36 +00:00
#include <stdio.h>
2008-07-11 22:24:00 +00:00
int main(int argc, char **argv) {
2008-07-11 22:55:36 +00:00
trial *t;
path *p;
2008-07-11 22:55:36 +00:00
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;
}
/*create trivial path towards the origin*/
2008-07-11 22:55:36 +00:00
2008-07-12 01:29:24 +00:00
trial_wait_for_start(t);
2008-07-12 01:47:36 +00:00
p = path_new(&t->map,&t->vehicle);
while(t->alive){
path_execute(t,p);
2008-07-12 08:43:11 +00:00
trial_check_input(t);
}
path_free(p);
2008-07-11 22:55:36 +00:00
trial_free(t);
2008-07-11 20:38:17 +00:00
return 0;
}