Design a game using graphical user interface, Computer Graphics

Assignment Help:

BlackJack is a popular card game played in many casinos. The player plays against the dealer aiming to reach 21 points, or a score higher than the dealer without exceeding 21. The values of the cards in Blackjack are as follows: Ace can be either 1 or 11 points (player's choice), face card (i.e., Jack, Dame, and King) are 10 points, and all the remaining cards have their scores equal to their numbers (e.g., 2 is 2, 3 is 3, and so on). The game can be played with one or several decks of 52 cards. In our version of Blackjack, we will use a single deck of 52 cards.

In this assignment you will implement a simplified version of Blackjack, which is as follows. The player and the dealer are initially dealt 2 cards each with one of the dealer's card (called a hole card) being dealt face-down, and the other one face up. Both of the player's cards are being dealt face-up. The player can then choose to ask the dealer to repeatedly hit his hand by dealing him one card at a time until either the value of the player's hand exceeds 21, in which case the player is "busted", and loses immediately, or the player decides to "stand". If the player stands, the dealer reveals its hole card, and proceeds by dealing himself more cards until the value of his hand is 17 or higher. At this point, if the value of the dealer's hand is higher than 21, then the dealer is busted, and loses immediately. Otherwise, the values of the player's and the dealer's hands are compared against each other, and the hand with the higher value wins. The ties are resolved in favor of the dealer.

The game's graphical user interface (GUI) is already implemented by code in the template, and will appear on the screen when you run it.

The game's GUI consists of the following elements:

  • three buttons: "Deal", "Hit", and "Stand",
  • text labels for displaying the score,
  • text labels demarcating the player's and dealer's areas of the game table.

Focus on the code appearing in the following four classes: Card, Deck, Hand, and BlackJack (which is the main game's class). 
First, review the class definitions for Card and Hand. Note that a hand is modeled as a linked list of cards. Implement the following methods of the Hand class:

  • addCard: adds a card to the hand
  • Value: returns the total value of the cards in the hand
  • Busted: returns true if and only the hand's total value exceeds 21

 


Related Discussions:- Design a game using graphical user interface

Disadvantage of the raster scan display device, Disadvantage of the Raster ...

Disadvantage of the Raster Scan Display Device The major disadvantage of the raster scan is the jagged nature of the lines, happening from the information that the pixels are

Computations with phong shading, Computations with Phong Shading Compu...

Computations with Phong Shading Computations involved along with Phong Shading:  i)   Find out average unit normal vector at each polygon vertex. ii)   Linearly interpol

Languge, what languge do computers speak

what languge do computers speak

Parallel projection - viewing transformation, Parallel Projection - viewing...

Parallel Projection - viewing transformation Parallel projection methods are utilized by engineers to make working drawings of an object that preserves its true shape. In t

Panning and zooming a component, Panning and zooming Components (such as yo...

Panning and zooming Components (such as your Polybounce or Animation) is simply a matter of reFrameing the world window. To pan right or left horizontally, one shifts it in the pos

Stochastic animation - computer animation, Stochastic Animation - Computer ...

Stochastic Animation - Computer Animation This utilizes stochastic processes that are a stochastic process can be identified as a random function. Such randomness could be in

Program to implement procedures or functions, The goal of this assignment i...

The goal of this assignment is to implement procedures/functions using x86 assembly. In addition to implementing procedures/functions, this assignment requires to pass arguments us

Categories of parallel projection - viewing transformation, Categories of P...

Categories of Parallel Projection Parallel projection can be categorized as per to the angle which the direction of projection makes along with the projection plane. For illu

Programming, i want to learn how to programme

i want to learn how to programme

What is 2d, Question 1 What is 2D? Explain method of converting 2D pattern...

Question 1 What is 2D? Explain method of converting 2D patterns into 3D images Question 2 Write about the following tools to create dart Create dart Multiply dar

Write Your Message!

Captcha
Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd