/* ************************************************************************** */ /* */ /* ::: :::::::: */ /* best_move_inner.h :+: :+: :+: */ /* +:+ +:+ +:+ */ /* By: maiboyer +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2024/01/29 21:31:42 by maiboyer #+# #+# */ /* Updated: 2024/02/08 14:22:49 by maiboyer ### ########.fr */ /* */ /* ************************************************************************** */ #ifndef BEST_MOVE_INNER_H # define BEST_MOVE_INNER_H # include "app/best_move.h" # include "app/rotate.h" # include "app/state.h" # include "me/types.h" # include "me/vec/vec_i64.h" typedef void (*t_banana_func)(void *); static inline t_banana_func choose_func(struct s_functions *funcs, t_rotation rotate) { if (rotate.direction == FORWARD) return (funcs->forward); else if (rotate.direction == REVERSE) return (funcs->reverse); return (NULL); } static inline t_isize abs_diff(t_isize lhs, t_isize rhs) { if (lhs > rhs) return (lhs - rhs); else return (rhs - lhs); } static inline t_isize min(t_isize lhs, t_isize rhs) { if (lhs > rhs) return (rhs); else return (lhs); } static inline t_isize max(t_isize lhs, t_isize rhs) { if (lhs < rhs) return (rhs); else return (lhs); } #endif /* BEST_MOVE_INNER_H */