Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Clarify use of queue in Magician in Training exercise #377

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions exercises/concept/magician-in-training/.docs/instructions.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ As a magician-to-be, Elyse needs to practice some basics. She has a stack of car

To make things a bit easier she only uses the cards 1 to 10.

The stack of cards is represented by a `queue`, with the bottom of the stack at the front of the queue, and the top of the stack at the back.

## 1. Insert a card at the of top the stack

Implement the function `insert_top` that returns a copy of the stack with the new card provided added to the top of the stack.
Expand All @@ -15,7 +17,7 @@ insert_top(queue.from_list([5, 9, 7, 1]), 8)

## 2. Remove the top card from the stack

Implement the function `remove_top_card` that returns a copy of the stack which has had the card at the top of the stack removed. If the given stack is empty, the original stack should be returned, unchanged.
Implement the function `remove_top_card` that returns a copy of the stack having had its top card removed. If the given stack is empty, the original stack should be returned, unchanged.

```gleam
remove_top_card(queue.from_list([3, 2, 6, 4, 8]))
Expand All @@ -33,7 +35,7 @@ insert_bottom(queue.from_list([5, 9, 7, 1]), 8)

## 4. Remove a card from the bottom of the stack

Implement the function `remove_bottom_card` that returns a copy of the stack which has had the card at the bottom of the stack removed. If the given stack is empty, the original stack should be returned, unchanged.
Implement the function `remove_bottom_card` that returns a copy of the stack having had its bottom card removed. If the given stack is empty, the original stack should be returned, unchanged.

```gleam
remove_bottom_card(queue.from_list([8, 5, 9, 7, 1]))
Expand Down
Loading