Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

PYTHON Its a single assignment and i have already written the whole code but where it says your code here you have fill that space.

PYTHON
Its a single assignment and i have already written the whole code but where it says your code here you have fill that space. Please go over all the instructions as given in assignment and also go over the code i provided below.
Please dont tell me this question looks big because i have already done 90% of your work and asking for 10% of the help to complete it. Please go over the instructions given and complete this please.
image text in transcribed
image text in transcribed
image text in transcribed
image text in transcribed
image text in transcribed
I have already wrote the code but where it is commented out in red and says your code here you have to fill that space.
image text in transcribed
image text in transcribed
image text in transcribed
image text in transcribed
image text in transcribed
1. Introduction In this exercise, we will use a data structure known as a LinkedDeque (deque implemented using linked list) to implement the card game Snap! 2. Objectives The purpose of this assignment is to help you *Sharpen your knowledge on basic data structures through an application .Refine your ability to translate real-world scenarios into code Note: Before you start, if you are not familiar with LinkedLists or Deques you are recommended to review the sample codes we covered in lecture first. 3. Background 3.1. Snap Card Game forward. The basic flow of our version of Snap is as follows: Snap is an easy-to-learn card game. Our version of Snap makes the game even more straight Step 1: Divide the deck into 2 halves (1 half per player; deck does not include Jokers) Step 2: While neither player has an empty deck, the two players take turns throwing a card into a public deck (which starts off as an empty deck). If a card is thrown that has the same rank as a previous card in the public deck, the player who threw that card takes the cards in the public deck up until (and including) the card of the same rank. Note: the cards thrown by each player can be from either the top or the bottom of their deck. We will determine whether the top or bottom card is thrown using randomness. Consider this example: suppose player A has the cards A, 2, Q, J, K, 5, Q, player B has the cards 3,2, Q,7, 4, and the public deck has the card 7, 5, 4, 1, 8 (this example is not with 52 cards, it is simplified for the sake of explanation). Player A randomly decides to throw the card that's on the bottom of his/her deck a Queen, which has not appeared thus far in the public deck (so the new public deck is 7, 5,4, 1, 8, Q) Then player B throws a 4 which has appeared in the public deck (now the public deck is 7,5,4,1,8, Q 4), thus player B takes the public deck up until and including the 4 and adds it to the bottom of his/her deck (4, 1, 8, Q,4-in exactly that order). After this one cycle of turns, player A has the cards A, 2, Q, J K, 5, player B has the cards 3, 2,Q,7,4, 1,8,Q,4, and the public deck has 7, 5

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

MySQL/PHP Database Applications

Authors: Jay Greenspan, Brad Bulger

1st Edition

ISBN: 978-0764535376

More Books

Students also viewed these Databases questions

Question

What did they do? What did they say?

Answered: 1 week ago