diff --git a/lib/stack.c b/lib/stack.c index 21fa5d8..e712ac9 100644 --- a/lib/stack.c +++ b/lib/stack.c @@ -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; +} diff --git a/lib/stack.h b/lib/stack.h index 2f3a79b..7c6e212 100644 --- a/lib/stack.h +++ b/lib/stack.h @@ -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