move here
This commit is contained in:
commit
86e3373d6f
|
|
@ -0,0 +1,16 @@
|
||||||
|
/* ************************************************************************** */
|
||||||
|
/* */
|
||||||
|
/* ::: :::::::: */
|
||||||
|
/* ft__ft.c :+: :+: :+: */
|
||||||
|
/* +:+ +:+ +:+ */
|
||||||
|
/* By: lfirmin <marvin@42.fr> +#+ +:+ +#+ */
|
||||||
|
/* +#+#+#+#+#+ +#+ */
|
||||||
|
/* Created: 2024/02/10 09:46:49 by lfirmin #+# #+# */
|
||||||
|
/* Updated: 2024/02/13 16:34:05 by lfirmin ### ########.fr */
|
||||||
|
/* */
|
||||||
|
/* ************************************************************************** */
|
||||||
|
|
||||||
|
void ft_ft(int *nbr)
|
||||||
|
{
|
||||||
|
*nbr = 42;
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,16 @@
|
||||||
|
/* ************************************************************************** */
|
||||||
|
/* */
|
||||||
|
/* ::: :::::::: */
|
||||||
|
/* ft_ultimate_ft.c :+: :+: :+: */
|
||||||
|
/* +:+ +:+ +:+ */
|
||||||
|
/* By: lfirmin <marvin@42.fr> +#+ +:+ +#+ */
|
||||||
|
/* +#+#+#+#+#+ +#+ */
|
||||||
|
/* Created: 2024/02/10 09:52:22 by lfirmin #+# #+# */
|
||||||
|
/* Updated: 2024/02/10 10:29:47 by lfirmin ### ########.fr */
|
||||||
|
/* */
|
||||||
|
/* ************************************************************************** */
|
||||||
|
|
||||||
|
void ft_ultimate_ft(int *********nbr)
|
||||||
|
{
|
||||||
|
*********nbr = 42;
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,20 @@
|
||||||
|
/* ************************************************************************** */
|
||||||
|
/* */
|
||||||
|
/* ::: :::::::: */
|
||||||
|
/* ft_swap.c :+: :+: :+: */
|
||||||
|
/* +:+ +:+ +:+ */
|
||||||
|
/* By: lfirmin <marvin@42.fr> +#+ +:+ +#+ */
|
||||||
|
/* +#+#+#+#+#+ +#+ */
|
||||||
|
/* Created: 2024/02/10 10:10:40 by lfirmin #+# #+# */
|
||||||
|
/* Updated: 2024/02/10 19:09:55 by lfirmin ### ########.fr */
|
||||||
|
/* */
|
||||||
|
/* ************************************************************************** */
|
||||||
|
|
||||||
|
void ft_swap(int *i, int *j)
|
||||||
|
{
|
||||||
|
int t;
|
||||||
|
|
||||||
|
t = *i;
|
||||||
|
*i = *j;
|
||||||
|
*j = t;
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,17 @@
|
||||||
|
/* ************************************************************************** */
|
||||||
|
/* */
|
||||||
|
/* ::: :::::::: */
|
||||||
|
/* ft_div_mod.c :+: :+: :+: */
|
||||||
|
/* +:+ +:+ +:+ */
|
||||||
|
/* By: lfirmin <marvin@42.fr> +#+ +:+ +#+ */
|
||||||
|
/* +#+#+#+#+#+ +#+ */
|
||||||
|
/* Created: 2024/02/10 21:02:39 by lfirmin #+# #+# */
|
||||||
|
/* Updated: 2024/02/10 21:07:17 by lfirmin ### ########.fr */
|
||||||
|
/* */
|
||||||
|
/* ************************************************************************** */
|
||||||
|
|
||||||
|
void ft_div_mod(int a, int b, int *div, int *mod)
|
||||||
|
{
|
||||||
|
*div = a / b;
|
||||||
|
*mod = a % b;
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,22 @@
|
||||||
|
/* ************************************************************************** */
|
||||||
|
/* */
|
||||||
|
/* ::: :::::::: */
|
||||||
|
/* ft_ultimate_div_mod.c :+: :+: :+: */
|
||||||
|
/* +:+ +:+ +:+ */
|
||||||
|
/* By: lfirmin <marvin@42.fr> +#+ +:+ +#+ */
|
||||||
|
/* +#+#+#+#+#+ +#+ */
|
||||||
|
/* Created: 2024/02/10 21:09:43 by lfirmin #+# #+# */
|
||||||
|
/* Updated: 2024/02/10 21:22:15 by lfirmin ### ########.fr */
|
||||||
|
/* */
|
||||||
|
/* ************************************************************************** */
|
||||||
|
|
||||||
|
void ft_ultimate_div_mod(int *a, int *b)
|
||||||
|
{
|
||||||
|
int temp;
|
||||||
|
int temp1;
|
||||||
|
|
||||||
|
temp = *a / *b;
|
||||||
|
temp1 = *a % *b;
|
||||||
|
*a = temp;
|
||||||
|
*b = temp1;
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,30 @@
|
||||||
|
/* ************************************************************************** */
|
||||||
|
/* */
|
||||||
|
/* ::: :::::::: */
|
||||||
|
/* ft_putstr.c :+: :+: :+: */
|
||||||
|
/* +:+ +:+ +:+ */
|
||||||
|
/* By: lfirmin <marvin@42.fr> +#+ +:+ +#+ */
|
||||||
|
/* +#+#+#+#+#+ +#+ */
|
||||||
|
/* Created: 2024/02/11 01:07:34 by lfirmin #+# #+# */
|
||||||
|
/* Updated: 2024/02/11 02:03:06 by lfirmin ### ########.fr */
|
||||||
|
/* */
|
||||||
|
/* ************************************************************************** */
|
||||||
|
|
||||||
|
#include <unistd.h>
|
||||||
|
|
||||||
|
void ft_putchar(char c)
|
||||||
|
{
|
||||||
|
write(1, &c, 1);
|
||||||
|
}
|
||||||
|
|
||||||
|
void ft_putstr(char *str)
|
||||||
|
{
|
||||||
|
int curs;
|
||||||
|
|
||||||
|
curs = 0;
|
||||||
|
while (str[curs] != '\0')
|
||||||
|
{
|
||||||
|
ft_putchar(str[curs]);
|
||||||
|
++curs;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,34 @@
|
||||||
|
/* ************************************************************************** */
|
||||||
|
/* */
|
||||||
|
/* ::: :::::::: */
|
||||||
|
/* ft_strlen.c :+: :+: :+: */
|
||||||
|
/* +:+ +:+ +:+ */
|
||||||
|
/* By: lfirmin <marvin@42.fr> +#+ +:+ +#+ */
|
||||||
|
/* +#+#+#+#+#+ +#+ */
|
||||||
|
/* Created: 2024/02/14 21:11:59 by lfirmin #+# #+# */
|
||||||
|
/* Updated: 2024/02/15 07:37:57 by lfirmin ### ########.fr */
|
||||||
|
/* */
|
||||||
|
/* ************************************************************************** */
|
||||||
|
|
||||||
|
int ft_strlen(char *str)
|
||||||
|
{
|
||||||
|
int n;
|
||||||
|
|
||||||
|
n = 0;
|
||||||
|
while (str[n] != '\0')
|
||||||
|
{
|
||||||
|
n++;
|
||||||
|
}
|
||||||
|
return (n);
|
||||||
|
}
|
||||||
|
|
||||||
|
/*#include <stdio.h>
|
||||||
|
int main()
|
||||||
|
{
|
||||||
|
char *str;
|
||||||
|
int n;
|
||||||
|
|
||||||
|
str = "Hello world !";
|
||||||
|
n = ft_strlen(str);
|
||||||
|
printf("%d\n", n);
|
||||||
|
}*/
|
||||||
Binary file not shown.
|
|
@ -0,0 +1,29 @@
|
||||||
|
/* ************************************************************************** */
|
||||||
|
/* */
|
||||||
|
/* ::: :::::::: */
|
||||||
|
/* ft_rev_int_tab.c :+: :+: :+: */
|
||||||
|
/* +:+ +:+ +:+ */
|
||||||
|
/* By: lfirmin <marvin@42.fr> +#+ +:+ +#+ */
|
||||||
|
/* +#+#+#+#+#+ +#+ */
|
||||||
|
/* Created: 2024/02/15 07:38:23 by lfirmin #+# #+# */
|
||||||
|
/* Updated: 2024/02/15 08:32:37 by lfirmin ### ########.fr */
|
||||||
|
/* */
|
||||||
|
/* ************************************************************************** */
|
||||||
|
|
||||||
|
void ft_rev_int_tab(int *tab, int size)
|
||||||
|
{
|
||||||
|
int temp;
|
||||||
|
int start;
|
||||||
|
int end;
|
||||||
|
|
||||||
|
end = size - 1;
|
||||||
|
start = 0;
|
||||||
|
while (start < end)
|
||||||
|
{
|
||||||
|
temp = tab[start];
|
||||||
|
tab[start] = tab[end];
|
||||||
|
tab[end] = temp;
|
||||||
|
start++;
|
||||||
|
end--;
|
||||||
|
}
|
||||||
|
}
|
||||||
Loading…
Reference in New Issue