Starship Code Contest  0.1
A real student nightmare...
rand_move.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_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 
36  d->move = 1;
37  d->shot = 0;
38  if (turn_move == 37){
39  turn_move=0;
40  move_modif = 0.05*(double)((rand() % 3) - 1);
41  }
42  else
43  turn_move++;
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  if (turn_radar == 15){
51  turn_radar = 0;
52  radar_modif = 0.15*(double)((rand() % 3) - 1);
53  }
54  else
55  turn_radar++;
56 
57  d->angle_starship = move_modif;
58  d->angle_gun = gun_modif;
59  d->angle_radar = radar_modif;
60 }
61 
69 void initialize_my_AI(void){
70  return ;
71 }
72 
80 void clean_my_AI(void){
81  return ;
82 }
double angle_gun
Definition: acquisition.h:24
void clean_my_AI(void)
Clean nothing because there is nothing to clean.
Definition: rand_move.c:80
void decision_frame(Decision_frame *d)
the brilliant decision my AI is taking each frame.
Definition: rand_move.c:35
void initialize_my_AI(void)
there is nothing to intialize in this
Definition: rand_move.c:69
double angle_radar
Definition: acquisition.h:25
This structure gathers the information needed to pilot a starship each frame.
Definition: acquisition.h:21
double angle_starship
Definition: acquisition.h:23