Compare commits

..
4 Commits
Author SHA1 Message Date
lclerel- lclerel- 3815f21215 Remove Test file (Compile result) 2026-03-16 09:29:22 +01:00
lclerel- lclerel- 3f46ee514d Update Ex4 2026-03-16 09:28:20 +01:00
lclerel- lclerel- 1b3f74710e update 2026-03-13 14:33:55 +01:00
lclerel- lclerel- 9c35f32ffd Exos 2026-03-12 17:06:05 +01:00
5 changed files with 12 additions and 24 deletions
+3 -3
View File
@@ -6,7 +6,7 @@
/* By: lclerel- <lclerel-@learner.42.tech> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2026/03/12 09:38:54 by lclerel- #+# #+# */
/* Updated: 2026/03/17 11:36:19 by lclerel- ### ########.fr */
/* Updated: 2026/03/12 11:26:41 by lclerel- ### ########.fr */
/* */
/* ************************************************************************** */
@@ -24,8 +24,8 @@ void ft_foreach(int *tab, int length, void (*f)(int))
i++;
}
}
/*
void ft_putnbr(int nb)
/*void ft_putnbr(int nb)
{
char value;
+3 -3
View File
@@ -6,7 +6,7 @@
/* By: lclerel- <lclerel-@learner.42.tech> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2026/03/12 09:41:12 by lclerel- #+# #+# */
/* Updated: 2026/03/17 11:36:53 by lclerel- ### ########.fr */
/* Updated: 2026/03/12 11:28:20 by lclerel- ### ########.fr */
/* */
/* ************************************************************************** */
@@ -31,8 +31,8 @@ int *ft_map(int *tab, int length, int (*f)(int))
}
return (tab2);
}
/*
void ft_putnbr(int nb)
/*void ft_putnbr(int nb)
{
char value;
+1 -1
View File
@@ -6,7 +6,7 @@
/* By: lclerel- <lclerel-@learner.42.tech> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2026/03/12 11:29:41 by lclerel- #+# #+# */
/* Updated: 2026/03/17 11:37:55 by lclerel- ### ########.fr */
/* Updated: 2026/03/12 11:50:58 by lclerel- ### ########.fr */
/* */
/* ************************************************************************** */
+3 -7
View File
@@ -6,7 +6,7 @@
/* By: lclerel- <lclerel-@learner.42.tech> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2026/03/12 11:54:32 by lclerel- #+# #+# */
/* Updated: 2026/03/19 11:56:49 by lclerel- ### ########.fr */
/* Updated: 2026/03/12 14:00:32 by lclerel- ### ########.fr */
/* */
/* ************************************************************************** */
@@ -19,13 +19,9 @@ int ft_count_if(char **tab, int length, int (*f)(char*))
i = 0;
count = 0;
if (!tab || !f)
while (tab[i] != NULL)
{
return (0);
}
while (i < length)
{
if (f(tab[i]) != 0)
if (f(tab[i]) < length)
{
count++;
}
+2 -10
View File
@@ -6,7 +6,7 @@
/* By: lclerel- <lclerel-@learner.42.tech> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2026/03/13 14:01:47 by lclerel- #+# #+# */
/* Updated: 2026/03/17 11:39:02 by lclerel- ### ########.fr */
/* Updated: 2026/03/16 09:25:12 by lclerel- ### ########.fr */
/* */
/* ************************************************************************** */
@@ -40,8 +40,7 @@ int ft_is_sort(int *tab, int length, int (*f)(int, int))
return (cs || ds);
}
/*
void ft_putnbr(int nb)
/*void ft_putnbr(int nb)
{
char value;
@@ -73,7 +72,6 @@ int main(void)
int croiss[] = {1, 2, 3, 4, 5, 6, 6, 7};
int decroiss[] = {7, 6, 6, 5, 4, 3, 2, 1};
int pas_trie[] = {1, 2, 3, 5, 6, 7, 6, 9};
int neg[] = {-1, -12, 11, -19};
write(1, "Test Croissant > (1, 2, 3, 4, 5, 6, 6, 7) : ", 44);
if (ft_is_sort(croiss, 8, &ft_compare) == 1)
@@ -95,11 +93,5 @@ int main(void)
else
write(1, "Not ok (Pas trié)\n", 19);
// Test 4 : Negatif
write(1, "Test avec negatif > (-1, -12, 11, -19) : ", 42);
if (ft_is_sort(neg, 4, &ft_compare) == 1)
write(1, "Ok :3 (Trié)\n", 14);
else
write(1, "Not ok (Pas trié)\n", 19);
return (0);
}*/