-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
a3a7e40
commit f73aaf8
Showing
13 changed files
with
19 additions
and
21 deletions.
There are no files selected for viewing
Submodule Push-Swap-Tester
added at
2c5958
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,7 +6,7 @@ | |
/* By: ael-maaz <[email protected]> +#+ +:+ +#+ */ | ||
/* +#+#+#+#+#+ +#+ */ | ||
/* Created: 2024/04/09 02:48:47 by ael-maaz #+# #+# */ | ||
/* Updated: 2024/04/09 02:49:29 by ael-maaz ### ########.fr */ | ||
/* Updated: 2024/04/14 22:47:27 by ael-maaz ### ########.fr */ | ||
/* */ | ||
/* ************************************************************************** */ | ||
|
||
|
@@ -55,7 +55,7 @@ int read_input(t_stack *a, t_stack *b) | |
if (line[0] == '\0') | ||
break ; | ||
if (test_line(line, a, b) == -1) | ||
return (-1); | ||
return (free(line),-1); | ||
free(line); | ||
} | ||
if (error == -1) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,7 +6,7 @@ | |
/* By: ael-maaz <[email protected]> +#+ +:+ +#+ */ | ||
/* +#+#+#+#+#+ +#+ */ | ||
/* Created: 2024/04/01 16:58:38 by ael-maaz #+# #+# */ | ||
/* Updated: 2024/04/09 02:49:20 by ael-maaz ### ########.fr */ | ||
/* Updated: 2024/04/14 22:47:53 by ael-maaz ### ########.fr */ | ||
/* */ | ||
/* ************************************************************************** */ | ||
|
||
|
@@ -102,11 +102,11 @@ int main(int ac, char **av) | |
return (write(2, "Error\n", 6), 0); | ||
bubble_sort(&a); | ||
if (read_input(&a, &b) == -1) | ||
return (write(2, "Error\n", 6), 0); | ||
return (system("leaks checker"),write(2, "Error\n", 6), 0); | ||
if (is_sorted(&a) == 0 && b.top == -1) | ||
return (write(1, "OK\n", 3), 0); | ||
return (system("leaks checker"),write(1, "OK\n", 3), 0); | ||
else | ||
return (write(1, "KO\n", 3), 0); | ||
return (system("leaks checker"),write(1, "KO\n", 3), 0); | ||
free(a.stack); | ||
free(b.stack); | ||
} | ||
|
This file was deleted.
Oops, something went wrong.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,7 +6,7 @@ | |
/* By: ael-maaz <[email protected]> +#+ +:+ +#+ */ | ||
/* +#+#+#+#+#+ +#+ */ | ||
/* Created: 2023/12/04 22:26:52 by ael-maaz #+# #+# */ | ||
/* Updated: 2024/04/09 01:40:31 by ael-maaz ### ########.fr */ | ||
/* Updated: 2024/04/14 22:34:12 by ael-maaz ### ########.fr */ | ||
/* */ | ||
/* ************************************************************************** */ | ||
|
||
|
@@ -46,7 +46,7 @@ int get_range(int size) | |
{ | ||
int range; | ||
|
||
range = 0.045 * size + 10.5; | ||
range = -0.0000233333 * size * size + 0.059 * size + 9.3333; | ||
return (range); | ||
} | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,7 +6,7 @@ | |
/* By: ael-maaz <[email protected]> +#+ +:+ +#+ */ | ||
/* +#+#+#+#+#+ +#+ */ | ||
/* Created: 2024/04/01 16:58:38 by ael-maaz #+# #+# */ | ||
/* Updated: 2024/04/08 18:37:13 by ael-maaz ### ########.fr */ | ||
/* Updated: 2024/04/17 16:54:14 by ael-maaz ### ########.fr */ | ||
/* */ | ||
/* ************************************************************************** */ | ||
|
||
|
@@ -28,6 +28,8 @@ int fill_stack(char **av, int ac, t_stack *stack_a, int i) | |
if (av[i][0] == 0) | ||
error = 1; | ||
arg = ft_split(av[i], ' '); | ||
// if(!arg[0]) | ||
// error = 1; | ||
while (arg[++j]) | ||
{ | ||
stack_a->top++; | ||
|
@@ -36,9 +38,7 @@ int fill_stack(char **av, int ac, t_stack *stack_a, int i) | |
} | ||
free(arg); | ||
} | ||
if (error == 0) | ||
return (0); | ||
return (1); | ||
return (error); | ||
} | ||
|
||
int duplicates(t_stack stack_a) | ||
|
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,18 +6,15 @@ | |
/* By: ael-maaz <[email protected]> +#+ +:+ +#+ */ | ||
/* +#+#+#+#+#+ +#+ */ | ||
/* Created: 2024/04/01 16:59:48 by ael-maaz #+# #+# */ | ||
/* Updated: 2024/04/07 22:15:42 by ael-maaz ### ########.fr */ | ||
/* Updated: 2024/04/12 20:45:27 by ael-maaz ### ########.fr */ | ||
/* */ | ||
/* ************************************************************************** */ | ||
|
||
#ifndef PUSH_SWAP_H | ||
# define PUSH_SWAP_H | ||
|
||
# include <stdio.h> | ||
# include <stdlib.h> | ||
# include <unistd.h> | ||
# include <limits.h> | ||
# include <fcntl.h> | ||
|
||
typedef struct s_stack | ||
{ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,7 +6,7 @@ | |
/* By: ael-maaz <[email protected]> +#+ +:+ +#+ */ | ||
/* +#+#+#+#+#+ +#+ */ | ||
/* Created: 2023/12/04 22:26:52 by ael-maaz #+# #+# */ | ||
/* Updated: 2024/04/07 22:48:36 by ael-maaz ### ########.fr */ | ||
/* Updated: 2024/04/14 22:33:53 by ael-maaz ### ########.fr */ | ||
/* */ | ||
/* ************************************************************************** */ | ||
|
||
|
@@ -44,7 +44,10 @@ int get_range(int size) | |
{ | ||
int range; | ||
|
||
range = 0.045 * size + 10.5; | ||
// range = 0.000000053 * size * size + 0.03 * size + 14.5; | ||
// range = (-0.0000089) * size * size + 0.04277614 * size + 10.81125433; | ||
range = -0.0000233333 * size * size + 0.059 * size + 9.3333; | ||
// range = 0.00005472*size*size+0.07429589*size+7.0972073; | ||
return (range); | ||
} | ||
|
||
|
Binary file not shown.