Starship Code Contest  0.1
A real student nightmare...
rand_all.c
Go to the documentation of this file.
1 
14 #include <stdio.h>
15 #include <stdlib.h>
16 #include "../includes/acquisition.h"
17 
18 static int turn_move=0;
19 static int turn_gun=0;
20 static int turn_radar=0;
21 
22 static double move_modif=0;
23 static double gun_modif=0;
24 static double radar_modif=0;
25 
26 static char me[12]="alea_all.so";
27 
38 
46 void initialize_my_AI(void);
47 
55 void clean_my_AI(void);
56 
57 
59  d->move = 1;
60  if (get_gun_status(me) == 0)
61  d->shot = 1;
62  else
63  d->shot = 0;
64  if (turn_move == 37){
65  turn_move=0;
66  move_modif = 0.05*(double)((rand() % 3) - 1);
67  }
68  else
69  turn_move++;
70  if (turn_gun == 21){
71  turn_gun=0;
72  gun_modif = 0.15*(double)((rand() % 3) - 1);
73  }
74  else
75  turn_gun++;
76  if (turn_radar == 15){
77  turn_radar = 0;
78  radar_modif = 0.15*(double)((rand() % 3) - 1);
79  }
80  else
81  turn_radar++;
82 
83  d->angle_starship = move_modif;
84  d->angle_gun = gun_modif;
85  d->angle_radar = radar_modif;
86 }
87 
88 void initialize_my_AI(void){
89  /* nada */
90  return ;
91 }
92 
93 void clean_my_AI(void){
94  /* nada */
95  return ;
96 }
97 
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)
there is nothing to intialize in this
Definition: rand_all.c:88
This structure gathers the information needed to pilot a starship each frame.
Definition: acquisition.h:21
void clean_my_AI(void)
Clean nothing because there is nothing to clean.
Definition: rand_all.c:93
double angle_starship
Definition: acquisition.h:23
void decision_frame(Decision_frame *d)
the brilliant decision my AI is taking each frame.
Definition: rand_all.c:58