0
0
This commit is contained in:
2021-10-29 05:53:53 +00:00
parent 9079386c18
commit 18c867ca18
130 changed files with 0 additions and 3249 deletions

View File

@@ -1,21 +0,0 @@
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft.h :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: gbaconni <gbaconni@42lausanne.ch> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2021/08/20 10:17:09 by gbaconni #+# #+# */
/* Updated: 2021/08/20 12:05:50 by gbaconni ### ########.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

View File

@@ -1,19 +0,0 @@
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* main.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: gbaconni <gbaconni@42lausanne.ch> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2021/08/20 10:26:50 by gbaconni #+# #+# */
/* Updated: 2021/08/20 10:34:14 by gbaconni ### ########.fr */
/* */
/* ************************************************************************** */
#include "ft.h"
int main(int argc, char *argv[])
{
(void) argc;
(void) argv;
}

View File

@@ -1,14 +0,0 @@
#!/bin/sh
set -e
rm -f a.out
find . -type f -name '*.h' -exec \
norminette -R CheckDefine {} \;
find . -type f -name '*.c' \! -name 'main.c' -exec \
norminette -R CheckForbiddenSourceHeader {} \;
echo
gcc -Wall -Wextra -Werror -o a.out *.c
#cpp *.c | tail -n 30
echo
echo $(basename $PWD):
./a.out "$@"
rm -f a.out

View File

@@ -1,26 +0,0 @@
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_boolean.h :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: gbaconni <gbaconni@42lausanne.ch> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2021/08/20 10:17:09 by gbaconni #+# #+# */
/* Updated: 2021/08/22 15:41:04 by gbaconni ### ########.fr */
/* */
/* ************************************************************************** */
#ifndef FT_BOOLEAN_H
# define FT_BOOLEAN_H
# include <unistd.h>
typedef int t_bool;
# define TRUE 1
# define FALSE 0
# define EVEN(nbr) nbr % 2 == 0
# define EVEN_MSG "I have an even number of arguments.\n"
# define ODD_MSG "I have an odd number of arguments.\n"
# define SUCCESS 0
#endif

View File

@@ -1,34 +0,0 @@
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* main.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: gbaconni <gbaconni@42lausanne.ch> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2021/08/20 10:26:50 by gbaconni #+# #+# */
/* Updated: 2021/08/20 10:34:14 by gbaconni ### ########.fr */
/* */
/* ************************************************************************** */
#include "ft_boolean.h"
void ft_putstr(char *str)
{
while (*str)
write(1, str++, 1);
}
t_bool ft_is_even(int nbr)
{
return ((EVEN(nbr)) ? TRUE : FALSE);
}
int main(int argc, char **argv)
{
(void) argv;
if (ft_is_even(argc - 1) == TRUE)
ft_putstr(EVEN_MSG);
else
ft_putstr(ODD_MSG);
return (SUCCESS);
}

View File

@@ -1,14 +0,0 @@
#!/bin/sh
set -e
rm -f a.out
find . -type f -name '*.h' -exec \
norminette -R CheckDefine {} \;
find . -type f -name '*.c' \! -name 'main.c' -exec \
norminette -R CheckForbiddenSourceHeader {} \;
echo
gcc -Wall -Wextra -Werror -o a.out *.c
#cpp *.c | tail -n 30
echo
echo $(basename $PWD):
./a.out "$@"
rm -f a.out

View File

@@ -1,18 +0,0 @@
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_boolean.h :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: gbaconni <gbaconni@42lausanne.ch> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2021/08/20 10:17:09 by gbaconni #+# #+# */
/* Updated: 2021/08/22 15:39:27 by gbaconni ### ########.fr */
/* */
/* ************************************************************************** */
#ifndef FT_ABS_H
# define FT_ABS_H
# define ABS(Value) ((Value < 0)? (-Value): (Value))
#endif

View File

@@ -1,52 +0,0 @@
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* main.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: gbaconni <gbaconni@42lausanne.ch> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2021/08/20 10:26:50 by gbaconni #+# #+# */
/* Updated: 2021/08/20 10:34:14 by gbaconni ### ########.fr */
/* */
/* ************************************************************************** */
#include "ft_abs.h"
#include <stdio.h>
static int ft_atoi(char *str)
{
int nb;
int s;
int i;
nb = 0;
s = 1;
i = 0;
while (str[i] != '\0' && (str[i] == ' ' || (str[i] >= '\t' && str[i] <= '\r')))
i++;
while (str[i] != '\0')
{
if (str[i] == '+')
s += 0;
else if (str[i] == '-')
s *= -1;
else if (str[i] >= '0' && str[i] <= '9')
nb = nb * 10 + str[i] - '0';
else
break ;
i++;
}
return (nb * s);
}
int main(int argc, char *argv[])
{
int n;
if (argc > 1)
{
n = ft_atoi(argv[1]);
printf("%d\n", ABS(n));
}
return (0);
}

View File

@@ -1,14 +0,0 @@
#!/bin/sh
set -e
rm -f a.out
find . -type f -name '*.h' -exec \
norminette -R CheckDefine {} \;
find . -type f -name '*.c' \! -name 'main.c' -exec \
norminette -R CheckForbiddenSourceHeader {} \;
echo
gcc -Wall -Wextra -Werror -o a.out *.c
#cpp *.c | tail -n 30
echo
echo $(basename $PWD):
./a.out "$@"
rm -f a.out

View File

@@ -1,22 +0,0 @@
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_point.h :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: gbaconni <gbaconni@42lausanne.ch> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2021/08/20 10:17:09 by gbaconni #+# #+# */
/* Updated: 2021/08/20 12:05:50 by gbaconni ### ########.fr */
/* */
/* ************************************************************************** */
#ifndef FT_POINT_H
# define FT_POINT_H
typedef struct s_point
{
int x;
int y;
} t_point;
void set_point(t_point *point);
#endif

View File

@@ -1,27 +0,0 @@
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* main.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: gbaconni <gbaconni@42lausanne.ch> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2021/08/20 10:26:50 by gbaconni #+# #+# */
/* Updated: 2021/08/20 10:34:14 by gbaconni ### ########.fr */
/* */
/* ************************************************************************** */
#include "ft_point.h"
void set_point(t_point *point)
{
point->x = 42;
point->y = 21;
}
int main(void)
{
t_point point;
set_point(&point);
return (0);
}

View File

@@ -1,14 +0,0 @@
#!/bin/sh
set -e
rm -f a.out
find . -type f -name '*.h' -exec \
norminette -R CheckDefine {} \;
find . -type f -name '*.c' \! -name 'main.c' -exec \
norminette -R CheckForbiddenSourceHeader {} \;
echo
gcc -Wall -Wextra -Werror -o a.out *.c
#cpp *.c | tail -n 30
echo
echo $(basename $PWD):
./a.out "$@"
rm -f a.out