17 #include "../includes/acquisition.h" 19 static int turn_move=0;
20 static int turn_radar=0;
22 static double move_modif=0;
23 static double radar_modif=0;
25 static char me[18]=
"rand_move_info.so";
51 move_modif = 0.05*(double)((rand() % 3) - 1);
55 if (turn_radar == 15){
57 radar_modif = 0.15*(double)((rand() % 3) - 1);
65 printf(
"\n ---- FRAME INFORMATIONS ---- \n");
66 printf(
"My position in abscicca : %lf\n",
get_x(me));
67 printf(
"My position in ordinate : %lf\n",
get_y(me));
68 printf(
"My life point : %d\n",
get_life(me));
69 printf(
"My gear (1=front, 0=neutral, -1=reverse) : %d\n",
get_life(me));
71 printf(
"My gun status (0 if ready for fire) : %d\n",
get_nb_team(me));
78 printf(
"\n--> What my radar see :\n");
79 for (i=0 ; i<nb_starship ; i++){
80 printf(
"I see a starship : \n");
81 printf(
"x = %lf\n", S[i].x);
82 printf(
"y = %lf\n", S[i].y);
83 printf(
"moving angle = %lf\n", S[i].angle_move);
84 printf(
"gear = %d\n", S[i].speed);
85 printf(
"team number = %d\n", S[i].nb_team);
87 for (i=0 ; i<nb_missile ; i++){
88 printf(
"I see a missile : \n");
89 printf(
"x = %lf\n", M[i].x);
90 printf(
"y = %lf\n", M[i].y);
91 printf(
"moving angle = %lf\n", M[i].angle_move);
93 assert(scanf(
"%*c") == 0);
void decision_frame(Decision_frame *d)
Function which produce a random move and scan elements with the radar.
double get_radar_angle(char *me)
Get the angle of the radar of the starship piloted by the plugin me.
double get_y(char *me)
Get the position in ordinate of the starship piloted by the plugin me.
void initialize_my_AI(void)
Initialization of this test plugin.
This structure gathers information scaned by the radar about other starships.
double get_x(char *me)
Get the position in absicca of the starship piloted by the plugin me.
int get_nb_team(char *me)
Get the number of the team of the starship piloted by the plugin me.
void get_scan_from_radar(char *me, View_starship **S, int *nb_starship, View_missile **M, int *nb_missile)
Set information that the radar can get in its current position.
This structure gathers the information needed to pilot a starship each frame.
double get_gun_angle(char *me)
Get the angle of the gun of the starship piloted by the plugin me.
This structure gathers information scaned by the radar about missiles.
double get_move_angle(char *me)
Get the moving angle of the starship piloted by the plugin me.
int get_life(char *me)
Get the life of the starship piloted by the plugin me.
void clean_my_AI(void)
Clean this test plugin.