Find Jobs
Hire Freelancers

Crazy 8s Program

$30-250 USD

Completed
Posted almost 8 years ago

$30-250 USD

Paid on delivery
Crazy Eights: Crazy Eights ([login to view URL]) is a card game that can played by two to seven players. For each game, eight cards are dealt to each player (i.e. the dealer deals one card at a time to each player proceeding clockwise (to the left of the dealer) until each player gets 8 cards). The remaining cards of the deck are placed face down at the center of the table (called stockpile). The top card in the stockpile is then turned face up to start the game. Players discard by matching rank or suit with the top card of the discard pile, starting with the player left of the dealer. If a player is unable to match the rank or suit of the top card of the discard pile and does not have an eight, he or she draws cards from the stockpile until getting a playable card. When a player plays an eight, he or she must declare the suit that the next player is to play; that player must then follow the named suit or play another eight. As an example: Once the six of clubs (6 ♣) is played (called top card of the discard pile) the next player: 1. can put (on the discard pile) any or all of the other sixes (6 of spades (♠) and/or 6 of ♦ (diamonds) and/or 6 of hearts (♥)) 2. can play any of the clubs (♣) 3. can play any 8 (then he/she must declare a suit to play next => The next player must play with the named suit or play another eight) 2 4. can draw from the stockpile until able to play one of the above. Draw a maximum of 3 cards from the stockpile, if none of the 3 cards is matched, the player then passes. The game ends as soon as one player has emptied his/her hand OR there is no card left in the stockpile, the player with minimum number of points on the hand wins. [login to view URL] - a free online version of a crazy eight game that you can play to get an idea of Crazy Eight Project requirements: For this project your team (a group of two students) will write the card game-Crazy Eights, for which you will use a standard deck of 52 cards. There will be only 2 players, the computer (dealer) and one user. The play will always begin with the user. Play will continue with the computer and the user taking turns until one player empties his/her hand which is a winner. Card game: 1) To simulate the deck, and each of the players' hands, your team MUST use a dynamic list of cards with the following type typedef struct card_s { char suit; int face; struct card_s *listp; } card; each card consists of a suit [clubs (♣),spades (♠),hearts (♥), or diamonds (♦)) a face (1(Ace) – 10, Jacks (J), Queens (Q), and Kings (K)) 2) Create a full deck of 52 cards that are in order. In other words, for each of the four suits, the cards should be in order from Ace (1) through King (13). At the demo time, you will be asked to print the deck that you create. 3) You must then shuffle the deck (52 cards), using the following algorithm: (a) For each card in the deck, get a random number in the range of 0 to 50 to be used as the index of the element to swap that card with, i.e. if deck[0] holds the Jack of clubs (J ♣) and the random number generated was 24, and deck[24] holds the 9 of diamonds (9♦), then after the first swap, deck[0] would hold the 9 of diamonds (9♦) and deck[24] would hold the Jack of clubs (J ♣). You would then proceed to deck[1], find a random index of a card to swap with, and swap those cards, etc. (b) Repeat step (a) at least 100 times. 3 Note: You must seed the random number generator with a call to time() with srand(). [see sec 2.22 Random numbers in your Zyante book] At the demo time, you will be asked to print the deck after the shuffle is done. 4) After shuffling the deck, you must deal the cards by giving one card to the user, followed by one card to the computer, followed by one card to the user, etc. until each player get 8 cards. The player’s hand is represented as a dynamic list of cards. The list is populated with the cards drawn by the player. The dealer’s hand is represented as a dynamic list of cards. The list is populated with the cards drawn by the dealer. Note: a) the card(s) added to each of the player/dealer’s hand (drawn from the deck) must be added to that player/dealer’s linked list correctly and MUST be removed from the deck. b) the cards removed from each of the player/dealer's hand MUST BE deleted from that player/dealer’s linked list correctly. At the demo time, you will be asked to print both computer’s hand and user’s hand 5) Your program should then display one card (called, top card of the discard pile) 6) The game will start with a player/user either (only one option below can be used) a) puts (on the discard pile) any or all of card(s) with the same FACE as the face of top card OR b) puts (on the discard pile) any of card with the same SUIT as the SUIT of top card OR c) puts (on the discard pile) any 8 and then he/she must declare a SUIT to play next OR d) draws from the stockpile until he/she is able to play one of the above (a – c). Draw a maximum of 3 cards from the stockpile, if none of the 3 cards is matched, the player then passes. 7) Then it is a computer’s turn. The computer must put the card(s) on the discard pile as discussed in step 6a – 6d above. 8) The game continues (repeat steps 6 – 8) until one player empties his/her hand OR there is no card left in the stockpile -> the winner is the hand with minimum number of points (add up all the face values of the cards left in each hand). 9) At the end of the game, your code should - announce the winner - ask whether a user wants to play a new game (Q/q to quit). If yes, your program should repeat steps 2 – 9. (Note 2 -3 may be optional depending on how you write your program.
Project ID: 10324418

About the project

6 proposals
Remote project
Active 8 yrs ago

Looking to make some money?

Benefits of bidding on Freelancer

Set your budget and timeframe
Get paid for your work
Outline your proposal
It's free to sign up and bid on jobs
Awarded to:
User Avatar
Hello, I would like to take this project. I have experience working with dynamic data structures like lists that are used in this program. I will use C++ language and OOP paradigm to create this program. I have recently been working on a similar project with lists. I can start the program right now. I will finish it in 3 days.
$66 USD in 3 days
0.0 (0 reviews)
0.0
0.0
6 freelancers are bidding on average $192 USD for this job
User Avatar
Hi, i have experience of development similar project on C/C++. So, it will be easily for me to help you with this project. Best regards.
$222 USD in 10 days
4.9 (6 reviews)
3.2
3.2
User Avatar
I will take around 7-8 days to complete this requirement fully. I have been working with C Programming language for the past 4-5 years. Let me know if you need me to re-quote my bid.
$222 USD in 10 days
0.0 (0 reviews)
0.0
0.0

About the client

Flag of UNITED STATES
Tucson, United States
5.0
1
Payment method verified
Member since Apr 25, 2016

Client Verification

Thanks! We’ve emailed you a link to claim your free credit.
Something went wrong while sending your email. Please try again.
Registered Users Total Jobs Posted
Freelancer ® is a registered Trademark of Freelancer Technology Pty Limited (ACN 142 189 759)
Copyright © 2024 Freelancer Technology Pty Limited (ACN 142 189 759)
Loading preview
Permission granted for Geolocation.
Your login session has expired and you have been logged out. Please log in again.