-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathft_coordsplit.c
42 lines (39 loc) · 1.19 KB
/
ft_coordsplit.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
29
30
31
32
33
34
35
36
37
38
39
40
41
42
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_coordsplit.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: ciglesia <ciglesia@student.42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2020/09/08 23:51:49 by ciglesia #+# #+# */
/* Updated: 2020/09/22 02:02:03 by ciglesia ### ########.fr */
/* */
/* ************************************************************************** */
#include "libft.h"
t_coords ft_coordsplit(char **split, char *pos)
{
int x;
int y;
t_coords c;
x = 0;
c.i = -1;
c.j = -1;
c.x = -1;
c.y = -1;
while (split[x])
{
y = 0;
while (split[x][y])
{
if (&split[x][y] == pos)
{
c.i = x;
c.j = y;
return (c);
}
y++;
}
x++;
}
return (c);
}