diff options
| author | Dominik Kaiser | 2024-04-13 17:49:06 +0200 |
|---|---|---|
| committer | Dominik Kaiser | 2024-04-13 17:49:06 +0200 |
| commit | 5427f29f7f8b4a6691330c2fc8a1c24027d8fe71 (patch) | |
| tree | 9019af4afb9aff02a17c0ef4f35068892b4d3c20 /main.c | |
| parent | e8647732192f1e6cda3ed5d4c17403a0446296c2 (diff) | |
| download | push_swap-5427f29f7f8b4a6691330c2fc8a1c24027d8fe71.tar.gz push_swap-5427f29f7f8b4a6691330c2fc8a1c24027d8fe71.zip | |
Add cmd optimization
After the sorting algorithm was executed remove unneccessary commands.
Diffstat (limited to 'main.c')
| -rw-r--r-- | main.c | 6 |
1 files changed, 3 insertions, 3 deletions
@@ -6,7 +6,7 @@ /* By: dkaiser <dkaiser@student.42heilbronn.de +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2024/04/12 17:03:30 by dkaiser #+# #+# */ -/* Updated: 2024/04/13 15:32:03 by dkaiser ### ########.fr */ +/* Updated: 2024/04/13 16:58:36 by dkaiser ### ########.fr */ /* */ /* ************************************************************************** */ @@ -33,12 +33,12 @@ int main(int argc, char *argv[]) pscmds = NULL; stack_optimize(&stack_a); stack_sort(&stack_a, &stack_b, &pscmds); - // TODO: Optimize commands + optimize_commands(&pscmds); print_commands(pscmds); ft_printf("A:"); ft_lstiter(stack_a, print_content); ft_printf("\nB:"); ft_lstiter(stack_b, print_content); - ft_printf("\n"); + ft_printf("\nExecuted %d push_swap commands.\n", ft_lstsize(pscmds)); return (0); } |
