aboutsummaryrefslogtreecommitdiff
path: root/c08
diff options
context:
space:
mode:
authorCharles <sircharlesaze@gmail.com>2019-07-08 12:12:58 +0200
committerCharles <sircharlesaze@gmail.com>2019-07-08 12:12:58 +0200
commit03b4d8a03fb1b2cf93aaac0dc9d317ff9c2ba705 (patch)
tree5888339d16bd74b1cd14a63b8c5ecf39fb9091f2 /c08
parenta2ef228b981df5ad417a0e8377e1e832002a7644 (diff)
downloadpiscine-03b4d8a03fb1b2cf93aaac0dc9d317ff9c2ba705.tar.gz
piscine-03b4d8a03fb1b2cf93aaac0dc9d317ff9c2ba705.tar.bz2
piscine-03b4d8a03fb1b2cf93aaac0dc9d317ff9c2ba705.zip
c05/c06 normed, c07/c08 begining
Diffstat (limited to 'c08')
-rw-r--r--c08/ex00/ft.h22
-rw-r--r--c08/ex01/ft_boolean.h34
-rw-r--r--c08/ex02/ft_abs.h18
-rw-r--r--c08/ex03/ft_point.h21
-rw-r--r--c08/ex04/ft_strs_to_tab.c13
5 files changed, 108 insertions, 0 deletions
diff --git a/c08/ex00/ft.h b/c08/ex00/ft.h
new file mode 100644
index 0000000..5dbbb51
--- /dev/null
+++ b/c08/ex00/ft.h
@@ -0,0 +1,22 @@
+/* ************************************************************************** */
+/* */
+/* ::: :::::::: */
+/* ft.h :+: :+: :+: */
+/* +:+ +:+ +:+ */
+/* By: cacharle <charles.cabergs@gmail.com> +#+ +:+ +#+ */
+/* +#+#+#+#+#+ +#+ */
+/* Created: 2019/07/07 16:33:44 by cacharle #+# #+# */
+/* Updated: 2019/07/07 16:34:58 by cacharle ### ########.fr */
+/* */
+/* ************************************************************************** */
+
+#ifndef FT_H
+#define FT_H
+
+void ft_putchar(char c);
+void ft_swap(int *a, int *b);
+void ft_putstr(char *str);
+int ft_strlen(char *str);
+int ft_strcmp(char *s1, char *s2);
+
+#endif
diff --git a/c08/ex01/ft_boolean.h b/c08/ex01/ft_boolean.h
new file mode 100644
index 0000000..43a3c4f
--- /dev/null
+++ b/c08/ex01/ft_boolean.h
@@ -0,0 +1,34 @@
+/* ************************************************************************** */
+/* */
+/* ::: :::::::: */
+/* ft_boolean.h :+: :+: :+: */
+/* +:+ +:+ +:+ */
+/* By: cacharle <charles.cabergs@gmail.com> +#+ +:+ +#+ */
+/* +#+#+#+#+#+ +#+ */
+/* Created: 2019/07/07 16:35:29 by cacharle #+# #+# */
+/* Updated: 2019/07/07 17:07:47 by cacharle ### ########.fr */
+/* */
+/* ************************************************************************** */
+
+#ifndef FT_BOOLEAN_H
+#define FT_BOOLEAN_H
+
+#include <unistd.h>
+
+#define TRUE 1
+#define FALSE 1
+#define SUCCESS 0
+#define EVEN_MSG "I have an even number of arguments.\n"
+#define ODD_MSG "I have an odd number of arguments.\n"
+#define EVEN(x) (x % 2 == 0 ? 1 : 0)
+
+typedef enum {
+ FALSE,
+ TRUE
+} t_bool;
+
+void ft_putstr(char *str);
+t_bool ft_is_even(int nbr);
+
+
+#endif
diff --git a/c08/ex02/ft_abs.h b/c08/ex02/ft_abs.h
new file mode 100644
index 0000000..9a41241
--- /dev/null
+++ b/c08/ex02/ft_abs.h
@@ -0,0 +1,18 @@
+/* ************************************************************************** */
+/* */
+/* ::: :::::::: */
+/* ft_abs.h :+: :+: :+: */
+/* +:+ +:+ +:+ */
+/* By: cacharle <charles.cabergs@gmail.com> +#+ +:+ +#+ */
+/* +#+#+#+#+#+ +#+ */
+/* Created: 2019/07/07 17:09:37 by cacharle #+# #+# */
+/* Updated: 2019/07/07 17:11:50 by cacharle ### ########.fr */
+/* */
+/* ************************************************************************** */
+
+#ifndef FT_ABS_H
+#define FT_ABS_H
+
+#define ABS(x) (x < 0 ? -x : x)
+
+#endif
diff --git a/c08/ex03/ft_point.h b/c08/ex03/ft_point.h
new file mode 100644
index 0000000..088b792
--- /dev/null
+++ b/c08/ex03/ft_point.h
@@ -0,0 +1,21 @@
+/* ************************************************************************** */
+/* */
+/* ::: :::::::: */
+/* ft_point.h :+: :+: :+: */
+/* +:+ +:+ +:+ */
+/* By: cacharle <charles.cabergs@gmail.com> +#+ +:+ +#+ */
+/* +#+#+#+#+#+ +#+ */
+/* Created: 2019/07/07 17:12:47 by cacharle #+# #+# */
+/* Updated: 2019/07/07 17:15:20 by cacharle ### ########.fr */
+/* */
+/* ************************************************************************** */
+
+#ifndef FT_POINT_H
+#define FT_POINT_H
+
+typedef struct {
+ int x;
+ int y;
+} t_point;
+
+#endif
diff --git a/c08/ex04/ft_strs_to_tab.c b/c08/ex04/ft_strs_to_tab.c
new file mode 100644
index 0000000..bc4c42f
--- /dev/null
+++ b/c08/ex04/ft_strs_to_tab.c
@@ -0,0 +1,13 @@
+/* ************************************************************************** */
+/* */
+/* ::: :::::::: */
+/* ft_strs_to_tab.c :+: :+: :+: */
+/* +:+ +:+ +:+ */
+/* By: cacharle <charles.cabergs@gmail.com> +#+ +:+ +#+ */
+/* +#+#+#+#+#+ +#+ */
+/* Created: 2019/07/07 17:15:32 by cacharle #+# #+# */
+/* Updated: 2019/07/07 17:16:52 by cacharle ### ########.fr */
+/* */
+/* ************************************************************************** */
+
+