update...
This commit is contained in:
parent
63d62aec4d
commit
4d7255f105
26 changed files with 518 additions and 641 deletions
24
src/app/target.c
Normal file
24
src/app/target.c
Normal file
|
|
@ -0,0 +1,24 @@
|
|||
/* ************************************************************************** */
|
||||
/* */
|
||||
/* ::: :::::::: */
|
||||
/* target.c :+: :+: :+: */
|
||||
/* +:+ +:+ +:+ */
|
||||
/* By: maiboyer <maiboyer@student.42.fr> +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* Created: 2024/01/29 20:30:27 by maiboyer #+# #+# */
|
||||
/* Updated: 2024/01/29 22:29:50 by maiboyer ### ########.fr */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
#include "app/target.h"
|
||||
#include "app/rotate.h"
|
||||
|
||||
t_rotation target(t_usize from, t_usize to, t_usize ring_size)
|
||||
{
|
||||
if (ring_size == 0)
|
||||
ring_size++;
|
||||
if (from < to)
|
||||
return (forward(to - from, ring_size));
|
||||
else
|
||||
return (reverse(from - to, ring_size));
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue