Starship Code Contest  0.1
A real student nightmare...
circle_rand_shot.c
Go to the documentation of this file.
1 
10 #include <stdio.h>
11 #include <stdlib.h>
12 #include "../includes/acquisition.h"
13 
15 void initialize_my_AI(void);
16 void clean_my_AI(void);
17 
18 static int turn_gun=0;
19 static int turn_radar=0;
20 
21 static double gun_modif=0;
22 static double radar_modif=0;
23 
24 static char me[25]="move_circle_rand_shot.so";
25 
37  d->move = 1;
38 
39  if (get_gun_status(me) == 0)
40  d->shot = 1;
41  else
42  d->shot = 0;
43 
44  if (turn_gun == 21){
45  turn_gun=0;
46  gun_modif = 0.15*(double)((rand() % 3) - 1);
47  }
48  else
49  turn_gun++;
50 
51  if (turn_radar == 15){
52  turn_radar = 0;
53  radar_modif = 0.15*(double)((rand() % 3) - 1);
54  }
55  else
56  turn_radar++;
57 
58  d->angle_starship = 0.05;
59  d->angle_gun = gun_modif;
60  d->angle_radar = radar_modif;
61 }
62 
71 void initialize_my_AI(void){
72  return ;
73 }
74 
83 void clean_my_AI(void){
84  return ;
85 }
void decision_frame(Decision_frame *d)
the brilliant decision my AI is taking each frame.
void clean_my_AI(void)
Clean this test plugin.
double angle_gun
Definition: acquisition.h:24
int get_gun_status(char *me)
Get the number of frames needed to reload the gun of the starship piloted by the plugin me...
double angle_radar
Definition: acquisition.h:25
void initialize_my_AI(void)
Initialization of this test plugin.
This structure gathers the information needed to pilot a starship each frame.
Definition: acquisition.h:21
double angle_starship
Definition: acquisition.h:23