How JustAnswer Works:

  • Ask an Expert
    Experts are full of valuable knowledge and are ready to help with any question. Credentials confirmed by a Fortune 500 verification firm.
  • Get a Professional Answer
    Via email, text message, or notification as you wait on our site.
    Ask follow up questions if you need to.
  • 100% Satisfaction Guarantee
    Rate the answer you receive.

Ask Scott Your Own Question

Scott
Scott, MIT Graduate
Category: Homework
Satisfied Customers: 3040
Experience:  MIT Graduate (Math, Programming, Science, and Music)
3546829
Type Your Homework Question Here...
Scott is online now
A new question is answered every 9 seconds

Implement a simplified Bridge game with betting between 1 user

Customer Question

Implement a simplified Bridge game with betting between 1 user player and the computer 3 AI agents for 2 games. Our Contract Bridge game is a trick-taking game using a standard 52-card deck without any joker.
The players will be positioned: down (the user), left, up, right (the 3 AI players). The player is paired with the up AI player, while the left and right AI players are grouped together.
The computer deals out all the cards equally to all the players, so that each player receives a hand of thirteen cards. The user can only see his own cards and none of the other AI players hands.
The user then looks at his cards and starts playing the game:
- the player selects a card and puts it in the middle face-up;
- each player will play clockwise (left player first, up player next, down player last) one card face-up that must "follow suit" (that is, play a card of the suit lead to the trick) if able. A player that cannot follow suit may play "sluff" (i.e., play a card of any other suit). The player that plays the highest card that matches the suite of the starting card wins 1 point the trick for its side and proceeds to lead to the next trick.
At the end of the game you should print if the user's team won or lost.
Submitted: 1 year ago.
Category: Homework
Customer: replied 1 year ago.
that's how should be look like.
Customer: replied 1 year ago.
Sample run:
CONTRACT BRIDGEPLAYER Hand10_SPADES ACE_HEARTS 10_CLUBS 8_DIAMONDS KING_CLUBS 7_CLUBS 2_SPADES 3_HEARTS 9_HEARTS 10_HEARTS 7_HEARTS 3_CLUBS 9_CLUBS0 1 2 3 4 5 6 7 8 9 10 11 12Computer 15_DIAMONDS 2_DIAMONDS JACK_DIAMONDS 6_SPADES 4_DIAMONDS 6_DIAMONDS 7_DIAMONDS 3_SPADES 9_SPADES 3_DIAMONDS ACE_SPADES 9_DIAMONDS 8_SPADESComputer 28_HEARTS QUEEN_CLUBS 7_SPADES 2_CLUBS JACK_HEARTS 5_SPADES JACK_CLUBS 8_CLUBS JACK_SPADES ACE_CLUBS 6_HEARTS 6_CLUBS 4_HEARTSComputer 310_DIAMONDS 2_HEARTS 5_CLUBS KING_HEARTS KING_DIAMONDS QUEEN_HEARTS 4_CLUBS ACE_DIAMONDS 4_SPADES QUEEN_DIAMONDS 5_HEARTS QUEEN_SPADES KING_SPADES------------ Which card would you like to play?0Player1 Card: 10_SPADESComputer 1: ACE_SPADESComputer 2: 5_SPADESComputer 3: 4_SPADESThis is the highest card on the table: ACE_SPADESTeam You and Computer 2 Points: 0Team Computer 1 and Computer 3 Points: 1CONTRACT BRIDGEPLAYER HandACE_HEARTS 10_CLUBS 8_DIAMONDS KING_CLUBS 7_CLUBS 2_SPADES 3_HEARTS 9_HEARTS 10_HEARTS 7_HEARTS 3_CLUBS 9_CLUBS0 1 2 3 4 5 6 7 8 9 10 11Computer 15_DIAMONDS 2_DIAMONDS JACK_DIAMONDS 6_SPADES 4_DIAMONDS 6_DIAMONDS 7_DIAMONDS 3_SPADES 9_SPADES 3_DIAMONDS 9_DIAMONDS 8_SPADESComputer 28_HEARTS QUEEN_CLUBS 7_SPADES 2_CLUBS JACK_HEARTS JACK_CLUBS 8_CLUBS JACK_SPADES ACE_CLUBS 6_HEARTS 6_CLUBS 4_HEARTSComputer 310_DIAMONDS 2_HEARTS 5_CLUBS KING_HEARTS KING_DIAMONDS QUEEN_HEARTS 4_CLUBS ACE_DIAMONDS QUEEN_DIAMONDS 5_HEARTS QUEEN_SPADES KING_SPADESComputer 1: JACK_DIAMONDSComputer 2: 2_CLUBSComputer 3: ACE_DIAMONDS------------ Which card would you like to play?2Player1 Card: 8_DIAMONDSThis is the highest card on the table: ACE_DIAMONDSTeam You and Computer 2 Points: 0Team Computer 1 and Computer 3 Points: 2CONTRACT BRIDGEPLAYER HandACE_HEARTS 10_CLUBS KING_CLUBS 7_CLUBS 2_SPADES 3_HEARTS 9_HEARTS 10_HEARTS 7_HEARTS 3_CLUBS 9_CLUBS0 1 2 3 4 5 6 7 8 9 10Computer 15_DIAMONDS 2_DIAMONDS 6_SPADES 4_DIAMONDS 6_DIAMONDS 7_DIAMONDS 3_SPADES 9_SPADES 3_DIAMONDS 9_DIAMONDS 8_SPADESComputer 28_HEARTS QUEEN_CLUBS 7_SPADES JACK_HEARTS JACK_CLUBS 8_CLUBS JACK_SPADES ACE_CLUBS 6_HEARTS 6_CLUBS 4_HEARTSComputer 310_DIAMONDS 2_HEARTS 5_CLUBS KING_HEARTS KING_DIAMONDS QUEEN_HEARTS 4_CLUBS QUEEN_DIAMONDS 5_HEARTS QUEEN_SPADES KING_SPADES
Expert:  Mr. Gregory White replied 1 year ago.
Hello, my name is ***** ***** this might be time sensitive.Do you still need this answered?
Customer: replied 1 year ago.
yes i still need
Expert:  Mr. Gregory White replied 1 year ago.
After going through my resources, I do not have what is necessary to complete at this time.I am opting out and opening up to the other professionals and messaging a couple who might be able to help. Someone should be with you shortly.

Related Homework Questions