-
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
Showing
3 changed files
with
9 additions
and
9 deletions.
There are no files selected for viewing
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: reasuke <[email protected]> +#+ +:+ +#+ */ | ||
/* +#+#+#+#+#+ +#+ */ | ||
/* Created: 2024/02/11 12:41:01 by reasuke #+# #+# */ | ||
/* Updated: 2024/04/20 15:40:33 by reasuke ### ########.fr */ | ||
/* Updated: 2024/04/21 16:30:51 by reasuke ### ########.fr */ | ||
/* */ | ||
/* ************************************************************************** */ | ||
|
||
|
@@ -15,17 +15,17 @@ | |
|
||
# include "push_swap.h" | ||
|
||
typedef void t_operation(t_stack **); | ||
typedef void t_dual_operation(t_stack **, t_stack **); | ||
typedef void (*t_operation)(t_stack **); | ||
typedef void (*t_dual_operation)(t_stack **, t_stack **); | ||
|
||
void push_stack(t_stack **p_s1, t_stack **p_s2); | ||
void swap_stack(t_stack **p_stack); | ||
void rotate_stack(t_stack **p_stack); | ||
void reverse_rotate_stack(t_stack **p_stack); | ||
|
||
void repeat_stack_operations(t_stack **p_st, int n, t_operation *op); | ||
void repeat_stack_operations(t_stack **p_st, int n, t_operation op); | ||
void repeat_dual_stack_operations(t_stack **p_a, t_stack **p_b, int n, | ||
t_dual_operation *op); | ||
t_dual_operation op); | ||
|
||
void operate_sa(t_stack **p_a); | ||
void operate_sb(t_stack **p_b); | ||
|
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,14 +6,14 @@ | |
/* By: reasuke <[email protected]> +#+ +:+ +#+ */ | ||
/* +#+#+#+#+#+ +#+ */ | ||
/* Created: 2024/02/10 19:22:50 by reasuke #+# #+# */ | ||
/* Updated: 2024/04/20 15:40:46 by reasuke ### ########.fr */ | ||
/* Updated: 2024/04/21 16:27:29 by reasuke ### ########.fr */ | ||
/* */ | ||
/* ************************************************************************** */ | ||
|
||
#include "stack_operations.h" | ||
|
||
void repeat_dual_stack_operations(t_stack **p_a, t_stack **p_b, int n, | ||
t_dual_operation *op) | ||
t_dual_operation op) | ||
{ | ||
while (n--) | ||
op(p_a, p_b); | ||
|
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,13 +6,13 @@ | |
/* By: reasuke <[email protected]> +#+ +:+ +#+ */ | ||
/* +#+#+#+#+#+ +#+ */ | ||
/* Created: 2024/02/10 19:22:26 by reasuke #+# #+# */ | ||
/* Updated: 2024/04/20 15:39:53 by reasuke ### ########.fr */ | ||
/* Updated: 2024/04/21 16:27:24 by reasuke ### ########.fr */ | ||
/* */ | ||
/* ************************************************************************** */ | ||
|
||
#include "stack_operations.h" | ||
|
||
void repeat_stack_operations(t_stack **p_st, int n, t_operation *op) | ||
void repeat_stack_operations(t_stack **p_st, int n, t_operation op) | ||
{ | ||
while (n--) | ||
op(p_st); | ||
|