1. Blackjack Programming Assignment Example

BlackJack - Java IO. BlackJack IO (console) Game Assignment for 420-603-AB - Object Oriented Programming. See /res/assignment.pdf for assignment details. Eclipse 3.7+ (4.2 recommended) JRE 1.7; Usage - Eclipse. Choose to import a project by going to File (in the menu bar) - Import. Select General - Existing. Assignment BLACKJACK GAME ( GRAPHICAL) create the “class” card. Optionally inherit from class obj; write a method to draw the cards. Create a constructor method card.card for initializing each card. Write a main program to clear the screen and draw one deck of cards overlapped in rows.

Blackjack

Answers

Blackjack Programming Assignment
  • the combination of partial code, terrible indenting and german comments probably means you won't get any answers to this...

    but, from the description i think the problem is that draw() only shows a result when it finishes. so if you draw 5 things on top of each other in a single draw loop then you'll only see the last one.

  • Generic remarks:

    • I question the usefulness of lines like:

    {YouWin = 1 ;
    if(YouWin 1 )

    or

    {YouLose = 0;
    if (YouLose0){

    The test after the assignment is totally useless...

    • In general, avoid the usage of delay(). In the case of delay(1200); the sketch is frozen for 1.2 second, which seems long for the user...

    • There is duplicate code in your two branches, you should move it to a method.

  • I also invite you to read the Technical FAQ. The third article can be relevant. Basically: don't use a loop with delay(), use millis() with some logic.

  • What i tried to code is a loop which does the exact same thing like the first button but all by itself. Do you have a solution for this? Deadline is 01.04. and I am a bit scared...

  • you wrote:

    What i tried to code is a loop which does the exact same thing like the first button but all by itself.

    what is it that the 1st button does?

    how is that behaiour triggered?

    the advices above are good

    moreover your code is not complete and we don't have the images.

    can you provide the current version with images as zip via dropbox?

Blackjack Programming AssignmentBlackjack Programming Assignment

Blackjack Programming Assignment Example

P: 8
I've found some programs of how to create a standard game of blackjack on C++. But how would you do it using structs? Here is my assignment:
Problem Statement: The purpose of this project is to create a game of Blackjack, which can be played by one player against the dealer (represented by the computer). The deck of cards is to be stored as an array of Card structures.
Blackjack is played with a deck of 52 cards, consisting of four suits (hearts, clubs, diamonds, spades), each with 13 face values (Ace, King, Queen, Jack, 10, 9, ... 2). King, Queen, Jack and 10 all have a point count of 10; the Ace may be counted as either 1 or 11 whichever gives the higher count without going over 21; the remaining cards have their face values as their point count. The objective of the game for the player is to hold a higher point count than the dealer without going over 21. Ties go to the dealer.
Playing the game proceeds as follows
1. Dealer shuffles the cards and lays them face down (that means neither the player nor the dealer can see them until cards are dealt). Cards are dealt off the top of this deck.
2. One card is dealt face down to the dealer and one to the player. The player is allowed to see the card dealt to him/her, but cannot see the card dealt to the dealer.
3. One card is dealt face up to the dealer and to the player. The player can see both these cards.
4. On each successive round, both the player and the dealer may request one more card face up. Once the player or dealer declines a card, that person cannot receive any more cards. When both the player and the dealer decide to stop, or one of them goes over 21, cards are turned up and the winner is determined as follows. The point count used for each is the highest possible without going over 21 – with an Ace counting 11 or with an Ace counting 1. In case the player goes over 21 the dealer wins. In case the dealer goes over 21 and the player does not, the player wins. If neither goes over 21, the winner is determined by the highest point count, with ties going to the dealer.
5. To keep it simple - here is how the dealer figures out when to stop asking for cards. The dealer must continue to request cards until his total is 17 or greater. An Ace in the dealer's hand is always counted as 11 if possible without the dealer going over 21
How to play the game with a computer
Design and implement a program to simulate the game of Blackjack as described above.
Make the human-computer interface as clear and user-friendly as possible.
Cards shown should be the ones the player can see. Show the cards in the form, for example, “Ace of Diamonds”, “Three of Hearts”, etc. The player (user of the program) inputs choices for the player. The dealer choices must be played your program.
Requirements:
Representing the card deck:
The deck of cards should be stored as an array of Card structures, where each struct has three members – one string giving the suit, one string giving the card name, one integer giving the face value.
So, for example, the three of Diamonds will be represented as
suit as string “Diamonds”
name as string “three”
value as int 3
And the Jack of Spades will be represented as
suit as string “Spades”
name as string “Jack”
value as int 11
Initialize the card deck array with the correct values. The first card should be an “Ace” of “Diamonds” with a value of 1, the second card should be a “Two” of “Diamonds” with a value of 2, etc.
Write at least 5 functions
Write a function to shuffle the cards. . Here’s how to shuffle the cards: Pick 2 random numbers between 0 and 51 and exchange these cards in the deck – do this at least 25 times to get the card deck well shuffled.
When the game starts, the dealer/computer shuffles the cards (by calling the shuffle function) and then deals two cards to the player and two to the computer/dealer. Use two more arrays of card structures to hold the player’s cards and the dealer’s cards.
Write a second function to get a total count of the cards in a hand,
Now the game continues until either the computer/dealer or the player decides to stop or either’s total point count goes over 21.
Write a third function to get input from you, the player. Remember to let the player see all of their own cards as well as the top card held by the dealer. The player can decide to ask for another card, or to stop asking for cards, or to stop the game.
Write a fourth function to act as the computer/dealer playing the game. A dealer can only see their own cards. When it is the dealer’s turn, they can get another card or stop asking for cards (see the strategy described in 5 above.)
When the game is over (either has a total of over 21 or the player has requested that the game stops), the winner must be determined. Write a fifth function to determine and announce the winner.
Organize the program so that the main program calls functions to do the work. Be sure to provide comments describing what each function does as well as describing what each segment of your program is doing. Your program should be organized using separate files:
1 The .h file
2 The .cpp file containing the main program
3 One or more .cpp file(s) containing the functions
Submission: Zip all files and upload the zipped file.