commit
This commit is contained in:
5
C_01/git_old/.gitignore
vendored
5
C_01/git_old/.gitignore
vendored
@@ -1,5 +0,0 @@
|
||||
**/main.c
|
||||
**/main.sh
|
||||
**/a.out
|
||||
**/a.sh
|
||||
**/Makefile
|
||||
@@ -1,16 +0,0 @@
|
||||
/* ************************************************************************** */
|
||||
/* */
|
||||
/* ::: :::::::: */
|
||||
/* ft_ft.c :+: :+: :+: */
|
||||
/* +:+ +:+ +:+ */
|
||||
/* By: gbaconni <marvin@42lausanne.ch> +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* Created: 2021/08/09 09:25:38 by gbaconni #+# #+# */
|
||||
/* Updated: 2021/08/09 09:25:41 by gbaconni ### ########.fr */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
void ft_ft(int *nbr)
|
||||
{
|
||||
*nbr = 42;
|
||||
}
|
||||
@@ -1,16 +0,0 @@
|
||||
/* ************************************************************************** */
|
||||
/* */
|
||||
/* ::: :::::::: */
|
||||
/* ft_ultimate_ft.c :+: :+: :+: */
|
||||
/* +:+ +:+ +:+ */
|
||||
/* By: gbaconni <marvin@42lausanne.ch> +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* Created: 2021/08/09 10:33:47 by gbaconni #+# #+# */
|
||||
/* Updated: 2021/08/09 10:33:48 by gbaconni ### ########.fr */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
void ft_ultimate_ft(int *********nbr)
|
||||
{
|
||||
*********nbr = 42;
|
||||
}
|
||||
@@ -1,20 +0,0 @@
|
||||
/* ************************************************************************** */
|
||||
/* */
|
||||
/* ::: :::::::: */
|
||||
/* ft_swap.c :+: :+: :+: */
|
||||
/* +:+ +:+ +:+ */
|
||||
/* By: gbaconni <marvin@42lausanne.ch> +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* Created: 2021/08/09 10:49:30 by gbaconni #+# #+# */
|
||||
/* Updated: 2021/08/09 10:49:42 by gbaconni ### ########.fr */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
void ft_swap(int *a, int *b)
|
||||
{
|
||||
int n;
|
||||
|
||||
n = *a;
|
||||
*a = *b;
|
||||
*b = n;
|
||||
}
|
||||
@@ -1,17 +0,0 @@
|
||||
/* ************************************************************************** */
|
||||
/* */
|
||||
/* ::: :::::::: */
|
||||
/* ft_div_mod.c :+: :+: :+: */
|
||||
/* +:+ +:+ +:+ */
|
||||
/* By: gbaconni <marvin@42lausanne.ch> +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* Created: 2021/08/09 10:57:04 by gbaconni #+# #+# */
|
||||
/* Updated: 2021/08/09 10:58:25 by gbaconni ### ########.fr */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
void ft_div_mod(int a, int b, int *div, int *mod)
|
||||
{
|
||||
*div = a / b;
|
||||
*mod = a % b;
|
||||
}
|
||||
@@ -1,22 +0,0 @@
|
||||
/* ************************************************************************** */
|
||||
/* */
|
||||
/* ::: :::::::: */
|
||||
/* ft_ultimate_div_mod.c :+: :+: :+: */
|
||||
/* +:+ +:+ +:+ */
|
||||
/* By: gbaconni <marvin@42lausanne.ch> +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* Created: 2021/08/09 11:11:27 by gbaconni #+# #+# */
|
||||
/* Updated: 2021/08/09 11:11:29 by gbaconni ### ########.fr */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
void ft_ultimate_div_mod(int *a, int *b)
|
||||
{
|
||||
int div;
|
||||
int mod;
|
||||
|
||||
div = *a / *b;
|
||||
mod = *a % *b;
|
||||
*a = div;
|
||||
*b = mod;
|
||||
}
|
||||
@@ -1,25 +0,0 @@
|
||||
/* ************************************************************************** */
|
||||
/* */
|
||||
/* ::: :::::::: */
|
||||
/* ft_putstr.c :+: :+: :+: */
|
||||
/* +:+ +:+ +:+ */
|
||||
/* By: gbaconni <marvin@42lausanne.ch> +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* Created: 2021/08/09 11:19:27 by gbaconni #+# #+# */
|
||||
/* Updated: 2021/08/09 17:03:09 by gbaconni ### ########.fr */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
#include <unistd.h>
|
||||
|
||||
void ft_putstr(char *str)
|
||||
{
|
||||
int size;
|
||||
|
||||
size = 0;
|
||||
while (str[size] != '\0')
|
||||
{
|
||||
size++;
|
||||
}
|
||||
write(1, str, size);
|
||||
}
|
||||
@@ -1,23 +0,0 @@
|
||||
/* ************************************************************************** */
|
||||
/* */
|
||||
/* ::: :::::::: */
|
||||
/* ft_strlen.c :+: :+: :+: */
|
||||
/* +:+ +:+ +:+ */
|
||||
/* By: gbaconni <marvin@42lausanne.ch> +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* Created: 2021/08/09 11:23:08 by gbaconni #+# #+# */
|
||||
/* Updated: 2021/08/09 17:03:24 by gbaconni ### ########.fr */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
int ft_strlen(char *str)
|
||||
{
|
||||
int size;
|
||||
|
||||
size = 0;
|
||||
while (str[size] != '\0')
|
||||
{
|
||||
size++;
|
||||
}
|
||||
return (size);
|
||||
}
|
||||
@@ -1,28 +0,0 @@
|
||||
/* ************************************************************************** */
|
||||
/* */
|
||||
/* ::: :::::::: */
|
||||
/* ft_rev_int_tab.c :+: :+: :+: */
|
||||
/* +:+ +:+ +:+ */
|
||||
/* By: gbaconni <marvin@42lausanne.ch> +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* Created: 2021/08/09 13:52:33 by gbaconni #+# #+# */
|
||||
/* Updated: 2021/08/09 17:02:29 by gbaconni ### ########.fr */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
void ft_rev_int_tab(int *tab, int size)
|
||||
{
|
||||
int i;
|
||||
int j;
|
||||
int n;
|
||||
|
||||
i = 0;
|
||||
while (i < (size / 2))
|
||||
{
|
||||
j = size - 1 - i;
|
||||
n = tab[i];
|
||||
tab[i] = tab[j];
|
||||
tab[j] = n;
|
||||
i++;
|
||||
}
|
||||
}
|
||||
@@ -1,34 +0,0 @@
|
||||
/* ************************************************************************** */
|
||||
/* */
|
||||
/* ::: :::::::: */
|
||||
/* ft_sort_int_tab.c :+: :+: :+: */
|
||||
/* +:+ +:+ +:+ */
|
||||
/* By: gbaconni <marvin@42lausanne.ch> +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* Created: 2021/08/09 14:23:41 by gbaconni #+# #+# */
|
||||
/* Updated: 2021/08/09 14:49:11 by gbaconni ### ########.fr */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
void ft_sort_int_tab(int *tab, int size)
|
||||
{
|
||||
int i;
|
||||
int pass;
|
||||
int n;
|
||||
|
||||
pass = size - 1;
|
||||
while (pass--)
|
||||
{
|
||||
i = 0;
|
||||
while (i < size - 1)
|
||||
{
|
||||
if (tab[i] > tab[i + 1])
|
||||
{
|
||||
n = tab[i];
|
||||
tab[i] = tab[i + 1];
|
||||
tab[i + 1] = n;
|
||||
}
|
||||
i++;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user