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

Define octrees, Define Octrees?  Hierarchical tree structures called oc...

Define Octrees?  Hierarchical tree structures called octrees, are used to show solid objects in some graphics systems. Medical imaging and other applications that needs display

Clipping and 3d primitives, Clipping and 3D Primitives This unit introd...

Clipping and 3D Primitives This unit introduces you to three important concepts of Computer Graphics. After that discusses the concept of clipping, which means removal of objec

What is graphics, What is Graphics It is a term that refers to any com...

What is Graphics It is a term that refers to any computer device or program which makes a computer able of displaying and manipulating pictures. The name also refers to the im

Phong shading or normal vector interpolation shading, Phong shading OR Norm...

Phong shading OR Normal Vector Interpolation Shading In Gouraud shading we were doing direct interpolation of intensities although a more exact method for rendering a polygon

Different advertising hooks, Question: (a) Name two visual effects you...

Question: (a) Name two visual effects you would use to communicate: i. Good old days ii. Rebellion iii. Fear (b) Explain each of your answers given in section (a).

Sound and audio, Sound and Audio: Sound is a mechanical energy distur...

Sound and Audio: Sound is a mechanical energy disturbance which propagates by matter as a wave. Sound is characterized through the various properties that are: frequency, per

What are the different ways of specifying spline curve, What are the differ...

What are the different ways of specifying spline curve?  Using a set of boundary conditions that are imposed on the spline. Using the state matrix that characteristics

Arithmetic mean filter, QUESTION (a) Describe the following Mean Filter...

QUESTION (a) Describe the following Mean Filters used as Noise Reduction filters: 1. Arithmetic Mean Filter. 2. Geometric Mean Filer. 3. Harmonic Mean Filter. You a

Define the term -monitoring, Define the term -Monitoring Chemical and n...

Define the term -Monitoring Chemical and nuclear plants (monitoring key parameters), hospitals (monitoring patient's vital signs), burglar alarms (monitoring for intruders) etc

Flat panel displays - hardware primitives, Flat Panel Displays - Hardware P...

Flat Panel Displays - Hardware Primitives 1.  Flat panel displays have now become more common. These include liquid crystal displays (LCD) and thin film electroluminescent disp

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