How do you create a a python program that implements the following functions get_top_card(card_stack) - returns the top card from any stack of cards (the return type is integer) and removes it from the card_stack . Used at the start of gameplay for dealing cards. This same function will also be used during each player’s turn to remove the top card from either the discard pile or from the deck. For example: get_top_card(lst) will return 53 and update the list (shown under section "Actual Program") to be lst = [3, 17, 11, 30, 33, 38, 49, 46, 25] add_card_to_discard(card, discard) - add the card (represented as just an integer) to the top of the discard pile (which is a list). This function does not return anything. For example: add_card_to_discard(77, lst) will update the list (shown under section "Actual Program") to be lst = [3, 17, 11, 30, 33, 38, 49, 46, 25, 53, 77] find_and_replace(new_card, card_to_be_replaced, hand, discard) - find the card_to_be_replaced (represented by an integer) in the hand and replace it with new_card. The replaced card then gets put on top of the discard pile. This function does not return anything. For example: find_and_replace(25, 50, [18, 50, 35], [28, 3]) will update the hand and discard piles to be hand = [18, 25, 35] discard = [28, 3, 50] main() - a function that puts it all together. Wherever possible, this function should call the above functions. The basic structure and the starting values of the deck and hand are pr
How do you create a a python program that implements the following functions get_top_card(card_stack) - returns the top card from any stack of cards (the return type is integer) and removes it from the card_stack . Used at the start of gameplay for dealing cards. This same function will also be used during each player’s turn to remove the top card from either the discard pile or from the deck. For example: get_top_card(lst) will return 53 and update the list (shown under section "Actual Program") to be lst = [3, 17, 11, 30, 33, 38, 49, 46, 25] add_card_to_discard(card, discard) - add the card (represented as just an integer) to the top of the discard pile (which is a list). This function does not return anything. For example: add_card_to_discard(77, lst) will update the list (shown under section "Actual Program") to be lst = [3, 17, 11, 30, 33, 38, 49, 46, 25, 53, 77] find_and_replace(new_card, card_to_be_replaced, hand, discard) - find the card_to_be_replaced (represented by an integer) in the hand and replace it with new_card. The replaced card then gets put on top of the discard pile. This function does not return anything. For example: find_and_replace(25, 50, [18, 50, 35], [28, 3]) will update the hand and discard piles to be hand = [18, 25, 35] discard = [28, 3, 50] main() - a function that puts it all together. Wherever possible, this function should call the above functions. The basic structure and the starting values of the deck and hand are pr
Operations Research : Applications and Algorithms
4th Edition
ISBN:9780534380588
Author:Wayne L. Winston
Publisher:Wayne L. Winston
Chapter13: Decision Making Under Uncertainty
Section13.4: Decision Trees
Problem 16P
Related questions
Question
How do you create a a python
-
-
get_top_card(card_stack) - returns the top card from any stack of cards (the return type is integer) and removes it from the card_stack . Used at the start of gameplay for dealing cards. This same function will also be used during each player’s turn to remove the top card from either the discard pile or from the deck.
For example: get_top_card(lst) will return 53 and update the list (shown under section "Actual Program") to be
lst = [3, 17, 11, 30, 33, 38, 49, 46, 25] - add_card_to_discard(card, discard) - add the card (represented as just an integer) to the top of the discard pile (which is a list). This function does not return anything.
For example: add_card_to_discard(77, lst) will update the list (shown under section "Actual Program") to be
lst = [3, 17, 11, 30, 33, 38, 49, 46, 25, 53, 77] - find_and_replace(new_card, card_to_be_replaced, hand, discard) - find the card_to_be_replaced (represented by an integer) in the hand and replace it with new_card. The replaced card then gets put on top of the discard pile. This function does not return anything.
For example: find_and_replace(25, 50, [18, 50, 35], [28, 3]) will update the hand and discard piles to be
hand = [18, 25, 35]
discard = [28, 3, 50]
-
-
- main() - a function that puts it all together. Wherever possible, this function should call the above functions. The basic structure and the starting values of the deck and hand are provided below:
Expert Solution
This question has been solved!
Explore an expertly crafted, step-by-step solution for a thorough understanding of key concepts.
Step by step
Solved in 2 steps
Knowledge Booster
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.Recommended textbooks for you
Operations Research : Applications and Algorithms
Computer Science
ISBN:
9780534380588
Author:
Wayne L. Winston
Publisher:
Brooks Cole
EBK JAVA PROGRAMMING
Computer Science
ISBN:
9781337671385
Author:
FARRELL
Publisher:
CENGAGE LEARNING - CONSIGNMENT
Microsoft Visual C#
Computer Science
ISBN:
9781337102100
Author:
Joyce, Farrell.
Publisher:
Cengage Learning,
Operations Research : Applications and Algorithms
Computer Science
ISBN:
9780534380588
Author:
Wayne L. Winston
Publisher:
Brooks Cole
EBK JAVA PROGRAMMING
Computer Science
ISBN:
9781337671385
Author:
FARRELL
Publisher:
CENGAGE LEARNING - CONSIGNMENT
Microsoft Visual C#
Computer Science
ISBN:
9781337102100
Author:
Joyce, Farrell.
Publisher:
Cengage Learning,