Skip to content

Commit

Permalink
ff
Browse files Browse the repository at this point in the history
  • Loading branch information
Gaetan FAURE-LEVOUX committed Sep 16, 2019
1 parent 2efce6b commit e361d7c
Show file tree
Hide file tree
Showing 16 changed files with 168 additions and 0 deletions.
Binary file added C01x/.DS_Store
Binary file not shown.
16 changes: 16 additions & 0 deletions C01x/ex00/ft_ft.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_ft.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: gfaure-l <[email protected]> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2019/09/02 16:42:20 by gfaure-l #+# #+# */
/* Updated: 2019/09/02 17:46:23 by gfaure-l ### ########.fr */
/* */
/* ************************************************************************** */

void ft_ft(int *nbr)
{
*nbr = 42;
}
16 changes: 16 additions & 0 deletions C01x/ex01/ft_ultimate_ft.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_ultimate_ft.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: gfaure-l <[email protected]> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2019/09/02 17:01:43 by gfaure-l #+# #+# */
/* Updated: 2019/09/03 04:23:33 by gfaure-l ### ########.fr */
/* */
/* ************************************************************************** */

void ft_ultimate_ft(int *********nbr)
{
*********nbr = 42;
}
20 changes: 20 additions & 0 deletions C01x/ex02/ft_swap.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_swap.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: gfaure-l <[email protected]> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2019/09/02 17:51:55 by gfaure-l #+# #+# */
/* Updated: 2019/09/02 21:34:46 by gfaure-l ### ########.fr */
/* */
/* ************************************************************************** */

void ft_swap(int *a, int *b)
{
int tmp;

tmp = *a;
*a = *b;
*b = tmp;
}
17 changes: 17 additions & 0 deletions C01x/ex03/ft_div_mod.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_div_mod.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: gfaure-l <[email protected]> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2019/09/02 18:36:04 by gfaure-l #+# #+# */
/* Updated: 2019/09/02 21:35:55 by gfaure-l ### ########.fr */
/* */
/* ************************************************************************** */

void ft_div_mod(int a, int b, int *div, int *mod)
{
*div = a / b;
*mod = a % b;
}
20 changes: 20 additions & 0 deletions C01x/ex04/ft_ultimate_div_mod.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_ultimate_div_mod.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: gfaure-l <[email protected]> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2019/09/02 21:10:58 by gfaure-l #+# #+# */
/* Updated: 2019/09/03 10:13:52 by gfaure-l ### ########.fr */
/* */
/* ************************************************************************** */

void ft_ultimate_div_mod(int *a, int *b)
{
int tmp;

tmp = *a / *b;
*b = *a % *b;
*a = tmp;
}
25 changes: 25 additions & 0 deletions C01x/ex05/ft_putstr.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_putstr.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: gfaure-l <[email protected]> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2019/09/03 10:17:36 by gfaure-l #+# #+# */
/* Updated: 2019/09/03 12:02:23 by gfaure-l ### ########.fr */
/* */
/* ************************************************************************** */

#include <unistd.h>

void ft_putstr(char *str)
{
int n;

n = 0;
while (str[n] != '\0')
{
write(1, &str[n], 1);
n++;
}
}
23 changes: 23 additions & 0 deletions C01x/ex06/ft_strlen.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_strlen.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: gfaure-l <[email protected]> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2019/09/03 16:13:46 by gfaure-l #+# #+# */
/* Updated: 2019/09/03 16:14:11 by gfaure-l ### ########.fr */
/* */
/* ************************************************************************** */

int ft_strlen(char *str)
{
int n;

n = 0;
while (str[n] != '\0')
{
n++;
}
return (n);
}
24 changes: 24 additions & 0 deletions C01x/ex07/ft_rev_int_tab.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_rev_int_tab.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: gfaure-l <[email protected]> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2019/09/02 22:01:30 by gfaure-l #+# #+# */
/* Updated: 2019/09/03 16:30:43 by gfaure-l ### ########.fr */
/* */
/* ************************************************************************** */

void ft_rev_int_tab(int *tab, int size)
{
int n;

n = 0;
while (size > n)
{
size--;
tab[size] = tab[n];
n++;
}
}
Binary file added Shell01x/.DS_Store
Binary file not shown.
1 change: 1 addition & 0 deletions Shell01x/ex01/print_groups.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
groups $FT_USER | tr ' ' ',' | tr -d "\n"
2 changes: 2 additions & 0 deletions Shell01x/ex02/find_sh.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
find . -name "*.sh" | rev | cut -c 4- | cut -d '/' -f1 | rev
# | cut -c -3 | rev | cut -d '/' -f2
1 change: 1 addition & 0 deletions Shell01x/ex03/count_files.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
find . -type f -o -type d | wc -l | tr -d " "
1 change: 1 addition & 0 deletions Shell01x/ex04/MAC.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
ifconfig | grep ether | cut -c 8- | cut -c -17
1 change: 1 addition & 0 deletions Shell01x/ex05/"\?$*'MaRViN'*$?\"
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
42
1 change: 1 addition & 0 deletions Shell01x/ex06/skip.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
ls -l | sed "n;d"

0 comments on commit e361d7c

Please sign in to comment.