-
Notifications
You must be signed in to change notification settings - Fork 0
/
choose_the_right_algorithm.c
executable file
·28 lines (26 loc) · 1.5 KB
/
choose_the_right_algorithm.c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* choose_the_right_algorithm.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: ioleksiu <[email protected]> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2017/05/06 19:33:59 by ioleksiu #+# #+# */
/* Updated: 2017/05/07 19:28:55 by ioleksiu ### ########.fr */
/* */
/* ************************************************************************** */
#include "filler.h"
void choose_the_right_algorithm(t_filler *f, t_list *player, t_list *other_p)
{
are_borders_touched(f);
if (f->i_am_up && !f->right_border_touched && f->size_map_x > 50)
go_to_the_left_border(f, player, other_p);
else if (f->i_am_up && !f->left_border_touched && f->size_map_x > 50)
go_to_the_right_border(f, player, other_p);
else if (!f->i_am_up && !f->right_border_touched && f->size_map_x > 50)
go_to_the_left_border(f, player, other_p);
else if (!f->i_am_up && !f->left_border_touched && f->size_map_x > 50)
go_to_the_right_border(f, player, other_p);
else
find_the_closest_xy(f, player, other_p);
}