Place your order

Fill in the order form and provide all details of your assignment.

Proceed with the payment

Choose the payment system that suits you most.

Receive the final file

Once your paper is ready, we will email it to you.

You are going to create a deck of cards and deal a five (5) card poker hand. You

by | Nov 25, 2021 | Computer and Web Programming : Python Programming | 0 comments

GET HELP WITH YOUR ESSAY

If you need assistance with writing your essay, our professional Essay Writing Service is here to help!

ORDER THIS OR A SIMILAR PAPER NOW

You are going to create a deck of cards and deal a five (5) card poker hand.
Your program should create a deck of cards, shuffle it, and then put the first five cards in the deck into a 5 element list which represents a hand. Use the functions we created together. You can (and should) import the card program we created in lecture directly. You do not need to copy and paste the code into a new program. Simply add an import statement and use the functions.
You are going to write a series of functions which take a hand (a list of 5 cards) as an input and return Boolean values that can be used to analyze this hand.
– is_high_card: should return true if there are no cards with matching faces, and the cards do not increase in value (no straight) and do not have a matching suit (no flush). This hand is also known as nothing.
– is_pair: should return true if there are exactly 2 cards of the same value
– is_2_pair: should return true if there is one set of 2 cards with a common value and a second set of 2 cards with a different common value
– is_3_of_a_kind: returns true if there are exactly 3 cards with a common value
– is_4_of_a_kind: returns true if there are exactly 4 cards with a common value
– is_full_house: returns true if there are 3 cards with a common value and the other cards share a different common value
– is_flush: if the five cards all have the same suit
– is_straight: returns true if the value of the five cards form a sequence which increases by 1 in each case. For instance (2,”hearts”). (3,”spades”), (4, “diamonds”), (5,”hearts”), (6,”clubs”)
– is_straight_flush: returns true if the value of the five cards form a sequence which increases by 1 in each case and each card has the same suit. For instance (2,”hearts”). (3,”hearts”), (4, “hearts”), (5,”hearts”), (6,”hearts”)
Your program should create a deck, shuffle it, draw a hand from the first five cards, then call each of the above functions and print out which of them return True. Do not print out information about functions that return False. Finally, the program should print the cards from the hand.
Rules and Requirements
– Your program MUST BE broken into two files.
– One file MUST BE a module that contains all the card hand assessment functions.
– The module containing the test functions file MUST BE named “card_tests.py”. If the module is named anything else, your program will instantly lose 50% credit.
– Your program that creates the deck and deals the hand and tests the hand MUST BE named “deal_and_test.py” this program should consolidate all code into functions and should run a main function as per our normal class standard. This file can have in import statement to use the functions we created in class.
– The functions used to test the cards MUST BE named as described above. If the functions are named anything else, your program will instantly lose 50% credit.
– Your functions MUST accept a list of cards (dictionaries) as input. Any function that accepts anything else will receive a zero score.
– Your functions MUST return Boolean values. Any function that returns anything else will receive a zero score.
– You MUST use the playing card structure that we produced in class. Do not change the names of the dictionary keys.
– The order of functions in the module does not matter.
– You may not use list comprehension or classes of your own creation. Any check that uses these techniques will earn zero points.
Your final submission will include three (3) files. The playing card program we created in class, your deal_and_test.py file and your card_test.py file.
Note: It is possible for multiple conditions to be met in a single hand. For instance a straight-flush is both a straight and a flush. But while three of a kind also technically contains a single pair, it should not be listed as a pair because a pair is EXACTLY two matching cards. I will be testing your program by feeding it different hands. Your functions must accurately categorize valid and invalid hands. That is to say, “is_pair” or “is_3_of_a_kind” should return True when given a pair or three of a kind respectively but False when given a full house. As a result, “is_pair” is probably the hardest function to get right.
For Extra Credit, make a third file in your program that creates two hands by alternating cards from the shuffled deck into each hand. Determine which hand wins based on the rankings of poker hands (https://en.wikipedia.org/wiki/List_of_poker_hands#Hand-ranking_categories (Links to an external site.)). You may add functions to your module of card tests but make sure the original functions still work properly and return the proper results. If you do the extra credit, your submission will include four (4) files.

ORDER THIS OR A SIMILAR PAPER NOW

Our Services

Top quality papers

We always make sure that writers follow all your instructions precisely. You can choose your academic level: high school, college/university, or professional, and we will assign a writer who has a respective degree.

Professional writers

We have hired a team of professionals who provide expert academic help. Most of them are native speakers and PhD holders who are able to take care of any assignment you need help with.

 

Free Revision

If you feel that we missed something, send the order for a free revision. You will have 10 days to send the order for revision after you receive the final paper. You can either do it on your own after signing in to your personal account or by contacting our support team.

On Time Delivery

All papers are always delivered on time. In case we need more time to master your paper, we may contact you regarding the deadline extension. In case you cannot provide us with more time, a 100% refund is guaranteed.

24/7 Support

Our support agents are available 24/7 and committed to providing you with the best customer experience. Get in touch whenever you need any assistance.

Original

We use several checkers to make sure that all papers you receive are plagiarism-free. Our editors carefully go through all sources and in-text citations. We also promise full confidentiality in all our services.

 

Pediatric Care

Customer satisfaction has always been one of our basic concerns. If you don’t feel satisfied with our delivered work, you can request for a refund.

 

Authentic Source

We assure you that your document will be thoroughly checked for plagiarism and grammatical errors as we use highly authentic and licit sources.

 

Our confidential essay writing service protects your privacy

We cherish your trust and do our best to protect you. Anything that you share with our private essay writing service is never misused as the access to your personal data is very limited. Your payment details and credit card number also fall under strict protection when you buy a custom essay online from us.

    Meet Our Team

    Wondering who’s working behind the scenes of our professional essay writing service? We have over 700 amazing people on our team including developers, QA engineers, designers, managers, HR specialists, marketers, essay writers, and many more. See who takes care of the orders you place.

     

    Super writers

    There are 400+ essay writers from all over the world on our team who go through a 3-step hiring process. We call them super-writers because most of them have master’s degrees; therefore, they know the ins and outs of the discipline in which they specialize.

     

    WOW-support

    Our extra-fast and caring support assistants answer your questions 24/7 and resolve any of your troubles. Our team was even nominated for the 2019 Best Quality Management Team Award by the European Contact Centre & Customer Service.

    If you are looking for a reputable and cheapest college essay writing service or homework help websites for college students to write your essay for you or do your homework, you are at the right place. We have more than 1000 essay writers who can help you write your essays for you. Just fill the order form above to submit your instructions and get an online essay helper or essay writer who can “write my essay for me”. Once you do, you will be happy that you used our essay services instead of any other online essay writing service.

    Talk To Us

    Need any help? Feel free to Send Us a Note

    Email:  support@eliteacademicessays.com