Skip to content

Commit 1ef549a

Browse files
committed
all pool
1 parent e77fde7 commit 1ef549a

File tree

123 files changed

+4512
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

123 files changed

+4512
-0
lines changed

c00/ex00/ft_putchar.c

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
/* ************************************************************************** */
2+
/* */
3+
/* ::: :::::::: */
4+
/* ft_putchar.c :+: :+: :+: */
5+
/* +:+ +:+ +:+ */
6+
/* By: uzanchi <[email protected]> +#+ +:+ +#+ */
7+
/* +#+#+#+#+#+ +#+ */
8+
/* Created: 2024/03/12 17:58:34 by uzanchi #+# #+# */
9+
/* Updated: 2024/03/13 10:05:28 by uzanchi ### ########.fr */
10+
/* */
11+
/* ************************************************************************** */
12+
13+
#include <unistd.h>
14+
15+
void ft_putchar(char c)
16+
{
17+
write(1, &c, 1);
18+
}

c00/ex01/ft_print_alphabet.c

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
/* ************************************************************************** */
2+
/* */
3+
/* ::: :::::::: */
4+
/* ft_print_alphabet.c :+: :+: :+: */
5+
/* +:+ +:+ +:+ */
6+
/* By: uzanchi <[email protected]> +#+ +:+ +#+ */
7+
/* +#+#+#+#+#+ +#+ */
8+
/* Created: 2024/03/12 18:14:14 by uzanchi #+# #+# */
9+
/* Updated: 2024/03/13 10:07:32 by uzanchi ### ########.fr */
10+
/* */
11+
/* ************************************************************************** */
12+
13+
#include <unistd.h>
14+
15+
void ft_print_alphabet(void)
16+
{
17+
write(1, "abcdefghijklmnopqrstuvwxyz", 26);
18+
}

c00/ex02/ft_print_reverse_alphabet.c

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
/* ************************************************************************** */
2+
/* */
3+
/* ::: :::::::: */
4+
/* ft_print_reverse_alphabet.c :+: :+: :+: */
5+
/* +:+ +:+ +:+ */
6+
/* By: uzanchi <[email protected]> +#+ +:+ +#+ */
7+
/* +#+#+#+#+#+ +#+ */
8+
/* Created: 2024/03/12 18:31:26 by uzanchi #+# #+# */
9+
/* Updated: 2024/03/12 18:38:20 by uzanchi ### ########.fr */
10+
/* */
11+
/* ************************************************************************** */
12+
13+
#include <unistd.h>
14+
15+
void ft_print_reverse_alphabet(void)
16+
{
17+
char lettre;
18+
19+
lettre = 122;
20+
while (lettre >= 97)
21+
{
22+
write(1, &lettre, 1);
23+
lettre--;
24+
}
25+
}

c00/ex03/ft_print_numbers.c

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
/* ************************************************************************** */
2+
/* */
3+
/* ::: :::::::: */
4+
/* ft_print_numbers.c :+: :+: :+: */
5+
/* +:+ +:+ +:+ */
6+
/* By: uzanchi <[email protected]> +#+ +:+ +#+ */
7+
/* +#+#+#+#+#+ +#+ */
8+
/* Created: 2024/03/12 18:44:31 by uzanchi #+# #+# */
9+
/* Updated: 2024/03/13 13:07:15 by uzanchi ### ########.fr */
10+
/* */
11+
/* ************************************************************************** */
12+
13+
#include <unistd.h>
14+
15+
void ft_print_numbers(void)
16+
{
17+
write(1, "0123456789", 10);
18+
}

c00/ex04/ft_is_negative.c

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
/* ************************************************************************** */
2+
/* */
3+
/* ::: :::::::: */
4+
/* ft_is_negative.c :+: :+: :+: */
5+
/* +:+ +:+ +:+ */
6+
/* By: uzanchi <[email protected]> +#+ +:+ +#+ */
7+
/* +#+#+#+#+#+ +#+ */
8+
/* Created: 2024/03/12 20:10:20 by uzanchi #+# #+# */
9+
/* Updated: 2024/03/14 08:24:13 by uzanchi ### ########.fr */
10+
/* */
11+
/* ************************************************************************** */
12+
13+
#include <unistd.h>
14+
15+
void ft_is_negative(int n)
16+
{
17+
if (n < 0)
18+
write(1, "N", 1);
19+
else
20+
write(1, "P", 1);
21+
}

c00/ex05/ft_print_comb.c

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
/* ************************************************************************** */
2+
/* */
3+
/* ::: :::::::: */
4+
/* ft_print_comb.c :+: :+: :+: */
5+
/* +:+ +:+ +:+ */
6+
/* By: uzanchi <[email protected]> +#+ +:+ +#+ */
7+
/* +#+#+#+#+#+ +#+ */
8+
/* Created: 2024/03/12 20:51:23 by uzanchi #+# #+# */
9+
/* Updated: 2024/03/13 10:03:07 by uzanchi ### ########.fr */
10+
/* */
11+
/* ************************************************************************** */
12+
13+
#include <unistd.h>
14+
15+
void ft_conc_numbers(int a, int b, int c)
16+
{
17+
write(1, &a, 1);
18+
write(1, &b, 1);
19+
write(1, &c, 1);
20+
if (!(a == '7' && b == '8' && c == '9'))
21+
{
22+
write(1, ", ", 2);
23+
}
24+
}
25+
26+
void ft_print_comb(void)
27+
{
28+
char a;
29+
char b;
30+
char c;
31+
32+
a = '0';
33+
while (a <= '7')
34+
{
35+
b = a + 1;
36+
while (b <= '8')
37+
{
38+
c = b + 1;
39+
while (c <= '9')
40+
{
41+
if (a != b && b != c && a != c)
42+
ft_conc_numbers(a, b, c);
43+
c++;
44+
}
45+
b++;
46+
}
47+
a++;
48+
}
49+
}

c00/ex06/ft_print_comb2.c

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
/* ************************************************************************** */
2+
/* */
3+
/* ::: :::::::: */
4+
/* ft_print_comb2.c :+: :+: :+: */
5+
/* +:+ +:+ +:+ */
6+
/* By: uzanchi <[email protected]> +#+ +:+ +#+ */
7+
/* +#+#+#+#+#+ +#+ */
8+
/* Created: 2024/03/13 12:17:44 by uzanchi #+# #+# */
9+
/* Updated: 2024/03/13 13:09:12 by uzanchi ### ########.fr */
10+
/* */
11+
/* ************************************************************************** */
12+
13+
#include <unistd.h>
14+
15+
void ft_putchar(char c)
16+
{
17+
write(1, &c, 1);
18+
}
19+
20+
void ft_print_comb2(void)
21+
{
22+
int a;
23+
int b;
24+
25+
a = 0;
26+
b = 1;
27+
while (a <= 98 && a < b)
28+
{
29+
while (b <= 99)
30+
{
31+
ft_putchar(a / 10 + '0');
32+
ft_putchar(a % 10 + '0');
33+
ft_putchar(' ');
34+
ft_putchar(b / 10 + '0');
35+
ft_putchar(b % 10 + '0');
36+
if (a != 98)
37+
write(1, ", ", 2);
38+
b++;
39+
}
40+
a++;
41+
b = a + 1;
42+
}
43+
}
44+
/*
45+
int main()
46+
{
47+
ft_print_comb2();
48+
}
49+
*/

c00/ex07/ft_putnbr.c

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
/* ************************************************************************** */
2+
/* */
3+
/* ::: :::::::: */
4+
/* ft_putnbr.c :+: :+: :+: */
5+
/* +:+ +:+ +:+ */
6+
/* By: uzanchi <[email protected]> +#+ +:+ +#+ */
7+
/* +#+#+#+#+#+ +#+ */
8+
/* Created: 2024/03/13 13:10:25 by uzanchi #+# #+# */
9+
/* Updated: 2024/03/13 13:10:30 by uzanchi ### ########.fr */
10+
/* */
11+
/* ************************************************************************** */
12+
13+
#include <unistd.h>
14+
15+
void ft_putchar(char c)
16+
{
17+
write(1, &c, 1);
18+
}
19+
20+
void ft_putnbr(int nb)
21+
{
22+
if (nb == -2147483648)
23+
{
24+
write(1, "-2147483648", 11);
25+
return ;
26+
}
27+
if (nb < 0)
28+
{
29+
ft_putchar('-');
30+
nb = -nb;
31+
}
32+
if (nb > 9)
33+
{
34+
mod = nb % 10;
35+
nb_divided = nb / 10;
36+
ft_putnbr(nb_divided);
37+
}
38+
if (nb > 9)
39+
ft_putchar(mod + '0');
40+
else
41+
ft_putchar(nb + '0');
42+
}
43+
/*
44+
int main(void)
45+
{
46+
ft_putnbr(2147483647);
47+
ft_putchar('\n');
48+
ft_putnbr(7483648);
49+
ft_putchar('\n');
50+
ft_putnbr(0);
51+
ft_putchar('\n');
52+
ft_putnbr(-7);
53+
ft_putchar('\n');
54+
ft_putnbr(5);
55+
ft_putchar('\n');
56+
ft_putnbr(-2147483648);
57+
ft_putchar('\n');
58+
}
59+
*/

c00/ex08/ft_print_combn.c

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
/* ************************************************************************** */
2+
/* */
3+
/* ::: :::::::: */
4+
/* ft_print_combn.c :+: :+: :+: */
5+
/* +:+ +:+ +:+ */
6+
/* By: uzanchi <[email protected]> +#+ +:+ +#+ */
7+
/* +#+#+#+#+#+ +#+ */
8+
/* Created: 2024/03/13 20:21:13 by uzanchi #+# #+# */
9+
/* Updated: 2024/03/13 20:21:17 by uzanchi ### ########.fr */
10+
/* */
11+
/* ************************************************************************** */
12+
13+
#include <unistd.h>
14+
15+

c01/ex00/ft_ft.c

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
/* ************************************************************************** */
2+
/* */
3+
/* ::: :::::::: */
4+
/* ft_ft.c :+: :+: :+: */
5+
/* +:+ +:+ +:+ */
6+
/* By: uzanchi <[email protected]> +#+ +:+ +#+ */
7+
/* +#+#+#+#+#+ +#+ */
8+
/* Created: 2024/03/13 19:19:43 by uzanchi #+# #+# */
9+
/* Updated: 2024/03/13 19:19:55 by uzanchi ### ########.fr */
10+
/* */
11+
/* ************************************************************************** */
12+
13+
void ft_ft(int *nbr)
14+
{
15+
*nbr = 42;
16+
}

0 commit comments

Comments
 (0)