Added function to move cards between stacks.
This commit is contained in:
parent
c744581711
commit
18cf795914
@ -73,3 +73,12 @@ struct stack *pop(struct stack **stack) {
|
||||
|
||||
return(popped_entry);
|
||||
}
|
||||
|
||||
void move_card(struct stack **origin, struct stack **destination) {
|
||||
struct stack *stack = NULL;
|
||||
|
||||
stack = pop(origin);
|
||||
push(destination, stack->card);
|
||||
|
||||
return;
|
||||
}
|
||||
|
@ -15,5 +15,6 @@ bool empty(struct stack *);
|
||||
int length(struct stack *);
|
||||
void push(struct stack **, struct card *);
|
||||
struct stack *pop(struct stack **);
|
||||
void move_card(struct stack **, struct stack **);
|
||||
|
||||
#endif
|
||||
|
Loading…
Reference in New Issue
Block a user