Compare commits
4
Commits
main
..
3815f21215
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
3815f21215 | ||
|
|
3f46ee514d | ||
|
|
1b3f74710e | ||
|
|
9c35f32ffd |
+3
-3
@@ -6,7 +6,7 @@
|
|||||||
/* By: lclerel- <lclerel-@learner.42.tech> +#+ +:+ +#+ */
|
/* By: lclerel- <lclerel-@learner.42.tech> +#+ +:+ +#+ */
|
||||||
/* +#+#+#+#+#+ +#+ */
|
/* +#+#+#+#+#+ +#+ */
|
||||||
/* Created: 2026/03/12 09:38:54 by lclerel- #+# #+# */
|
/* 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++;
|
i++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
/*
|
|
||||||
void ft_putnbr(int nb)
|
/*void ft_putnbr(int nb)
|
||||||
{
|
{
|
||||||
char value;
|
char value;
|
||||||
|
|
||||||
|
|||||||
+3
-3
@@ -6,7 +6,7 @@
|
|||||||
/* By: lclerel- <lclerel-@learner.42.tech> +#+ +:+ +#+ */
|
/* By: lclerel- <lclerel-@learner.42.tech> +#+ +:+ +#+ */
|
||||||
/* +#+#+#+#+#+ +#+ */
|
/* +#+#+#+#+#+ +#+ */
|
||||||
/* Created: 2026/03/12 09:41:12 by lclerel- #+# #+# */
|
/* 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);
|
return (tab2);
|
||||||
}
|
}
|
||||||
/*
|
|
||||||
void ft_putnbr(int nb)
|
/*void ft_putnbr(int nb)
|
||||||
{
|
{
|
||||||
char value;
|
char value;
|
||||||
|
|
||||||
|
|||||||
+1
-1
@@ -6,7 +6,7 @@
|
|||||||
/* By: lclerel- <lclerel-@learner.42.tech> +#+ +:+ +#+ */
|
/* By: lclerel- <lclerel-@learner.42.tech> +#+ +:+ +#+ */
|
||||||
/* +#+#+#+#+#+ +#+ */
|
/* +#+#+#+#+#+ +#+ */
|
||||||
/* Created: 2026/03/12 11:29:41 by lclerel- #+# #+# */
|
/* 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
@@ -6,7 +6,7 @@
|
|||||||
/* By: lclerel- <lclerel-@learner.42.tech> +#+ +:+ +#+ */
|
/* By: lclerel- <lclerel-@learner.42.tech> +#+ +:+ +#+ */
|
||||||
/* +#+#+#+#+#+ +#+ */
|
/* +#+#+#+#+#+ +#+ */
|
||||||
/* Created: 2026/03/12 11:54:32 by lclerel- #+# #+# */
|
/* 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;
|
i = 0;
|
||||||
count = 0;
|
count = 0;
|
||||||
if (!tab || !f)
|
while (tab[i] != NULL)
|
||||||
{
|
{
|
||||||
return (0);
|
if (f(tab[i]) < length)
|
||||||
}
|
|
||||||
while (i < length)
|
|
||||||
{
|
|
||||||
if (f(tab[i]) != 0)
|
|
||||||
{
|
{
|
||||||
count++;
|
count++;
|
||||||
}
|
}
|
||||||
|
|||||||
+2
-10
@@ -6,7 +6,7 @@
|
|||||||
/* By: lclerel- <lclerel-@learner.42.tech> +#+ +:+ +#+ */
|
/* By: lclerel- <lclerel-@learner.42.tech> +#+ +:+ +#+ */
|
||||||
/* +#+#+#+#+#+ +#+ */
|
/* +#+#+#+#+#+ +#+ */
|
||||||
/* Created: 2026/03/13 14:01:47 by lclerel- #+# #+# */
|
/* 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);
|
return (cs || ds);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*void ft_putnbr(int nb)
|
||||||
void ft_putnbr(int nb)
|
|
||||||
{
|
{
|
||||||
char value;
|
char value;
|
||||||
|
|
||||||
@@ -73,7 +72,6 @@ int main(void)
|
|||||||
int croiss[] = {1, 2, 3, 4, 5, 6, 6, 7};
|
int croiss[] = {1, 2, 3, 4, 5, 6, 6, 7};
|
||||||
int decroiss[] = {7, 6, 6, 5, 4, 3, 2, 1};
|
int decroiss[] = {7, 6, 6, 5, 4, 3, 2, 1};
|
||||||
int pas_trie[] = {1, 2, 3, 5, 6, 7, 6, 9};
|
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);
|
write(1, "Test Croissant > (1, 2, 3, 4, 5, 6, 6, 7) : ", 44);
|
||||||
if (ft_is_sort(croiss, 8, &ft_compare) == 1)
|
if (ft_is_sort(croiss, 8, &ft_compare) == 1)
|
||||||
@@ -95,11 +93,5 @@ int main(void)
|
|||||||
else
|
else
|
||||||
write(1, "Not ok (Pas trié)\n", 19);
|
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);
|
return (0);
|
||||||
}*/
|
}*/
|
||||||
|
|||||||
Reference in New Issue
Block a user