diff options
author | Rudy Bousset <rbousset@z2r5p6.le-101.fr> | 2020-02-02 18:12:45 +0100 |
---|---|---|
committer | Rudy Bousset <rbousset@z2r5p6.le-101.fr> | 2020-02-02 18:12:56 +0100 |
commit | 95670611b3636932b6e64c3e485a4e4bf40d8b07 (patch) | |
tree | 77a588ad4c2b9ac84bfc124f8fab37887d7d8bf8 /src/ft_select_get.c | |
parent | Norme (diff) | |
download | 42-cub3d-95670611b3636932b6e64c3e485a4e4bf40d8b07.tar.gz 42-cub3d-95670611b3636932b6e64c3e485a4e4bf40d8b07.tar.bz2 42-cub3d-95670611b3636932b6e64c3e485a4e4bf40d8b07.tar.xz 42-cub3d-95670611b3636932b6e64c3e485a4e4bf40d8b07.tar.zst 42-cub3d-95670611b3636932b6e64c3e485a4e4bf40d8b07.zip |
Norme again
Diffstat (limited to '')
-rw-r--r-- | src/ft_select_get.c | 33 |
1 files changed, 23 insertions, 10 deletions
diff --git a/src/ft_select_get.c b/src/ft_select_get.c index 6c1900d..448223e 100644 --- a/src/ft_select_get.c +++ b/src/ft_select_get.c @@ -1,31 +1,44 @@ +/* ************************************************************************** */ +/* LE - / */ +/* / */ +/* ft_select_get.c .:: .:/ . .:: */ +/* +:+:+ +: +: +:+:+ */ +/* By: rbousset <marvin@le-101.fr> +:+ +: +: +:+ */ +/* #+# #+ #+ #+# */ +/* Created: 2020/02/02 17:19:33 by rbousset #+# ## ## #+# */ +/* Updated: 2020/02/02 17:19:33 by rbousset ### #+. /#+ ###.fr */ +/* / */ +/* / */ +/* ************************************************************************** */ + #include <libft.h> #include <cub3d.h> #include <stdint.h> static uint8_t -ft_get_id(char **words) + ft_get_id(char **words) { - if (!ft_strncmp(words[0], "R", 1)) + if (!ft_strncmp(words[0], "R", 2)) return (0); - if (!ft_strncmp(words[0], "NO", 2)) + if (!ft_strncmp(words[0], "NO", 3)) return (1); - if (!ft_strncmp(words[0], "SO", 2)) + if (!ft_strncmp(words[0], "SO", 3)) return (2); - if (!ft_strncmp(words[0], "EA", 2)) + if (!ft_strncmp(words[0], "EA", 3)) return (3); - if (!ft_strncmp(words[0], "WE", 2)) + if (!ft_strncmp(words[0], "WE", 3)) return (4); - if (!ft_strncmp(words[0], "S", 1)) + if (!ft_strncmp(words[0], "S", 2)) return (5); - if (!ft_strncmp(words[0], "F", 1)) + if (!ft_strncmp(words[0], "F", 2)) return (6); - if (!ft_strncmp(words[0], "C", 1)) + if (!ft_strncmp(words[0], "C", 2)) return (7); return (12); } uint8_t -ft_select_get(char **words, t_cub *clist) + ft_select_get(char **words, t_cub *clist) { int (*fun_ptr[8])(char**, t_cub*); uint8_t id; |