Results 1 to 4 of 4
  1. #1
    adjit is offline Senior Member
    Join Date
    Mar 2011
    Posts
    171
    Rep Power
    0

    Default Creating a game of blackjack

    so this is what I have to do. Having a lot of problems with the calculations. When you are getting the value of the cards you have to call a method previously made called getValue()

    Fields:
    private String name;


    Text containing the name of the player.
    private ArrayList<Card> hand;

    The playerís hand (set of cards).
    Constructors:
    public Player(String n) Must initialize all fields.
    Methods:
    public String toString()


    Returns text describing the current status of this player in the game.
    Must include all known information.
    public void addCard(Card c)
    Adds a given card to this playerís hand.
    public int getCurrentScore()
    Returns the total current value of this playerís hand. This is the sum of the value of
    each card they currently hold.
    Note: must call another method to get the value of a card.
    BLACKJACK
    Create a new class, save the new file as Blackjack.java.
    Fields:
    private Player user;


    Handles the userís hand.
    private Player dealer;


    Handles the dealerís hand.
    private ArrayList<Card> shoe;

    Contains the decks of cards in play.
    Constructors:
    public Blackjack()


    Must initialize all fields, and add five decks to the shoe.
    Methods:
    public void shuffle()
    Shuffles all cards currently in the shoe.
    public int getDealerScore()
    Returns the dealerís current score (the current value of their hand).
    Note: must call another method to do the work of calculating the value.
    public int getPlayerScore()
    Returns the userís current score (the current value of their hand).
    Note: must call another method to do the work of calculating the value.
    public String toString()
    Returns text describing the current status of each player in the game.
    Note: must call other method(s) to generate the text.
    Page 2public void addDeck()


    Creates a new Deck and adds each Card object in it to the shoe.
    public void dealCardToUser()
    Deals a card to the user.
    Must add the card to the userís hand and remove that card from the shoe.
    public void dealCardToDealer()
    Deals a card to the dealer.
    Must add the card to the dealerís hand and remove that card from the shoe.
    public void printWinner()
    Checks the current scores of all players, and prints an appropriate message to the
    console. The method must check for the following cases:
    ē Push
    ē Bust (player or dealer)
    ē Blackjack (player or dealer)
    ē Win (player or dealer)

  2. #2
    dlorde is offline Senior Member
    Join Date
    Jun 2008
    Posts
    339
    Rep Power
    6

    Default

    So what have you got so far, and what is your question about Java?

  3. #3
    adjit is offline Senior Member
    Join Date
    Mar 2011
    Posts
    171
    Rep Power
    0

    Default

    Kind of stuck on the Blackjack class from public void addDeck on. any hints on what I would need to do would be helpful

  4. #4
    dlorde is offline Senior Member
    Join Date
    Jun 2008
    Posts
    339
    Rep Power
    6

    Default

    Quote Originally Posted by adjit View Post
    any hints on what I would need to do would be helpful
    My hints are that you should post the code you already have and explain exactly what it is that you're stuck on.

Similar Threads

  1. Creating a flying game
    By george222 in forum Java Gaming
    Replies: 1
    Last Post: 02-11-2011, 10:21 AM
  2. Help With BlackJack Game !
    By TangoMango in forum New To Java
    Replies: 1
    Last Post: 01-24-2011, 05:40 PM
  3. Creating a Card Game
    By Kidd91 in forum New To Java
    Replies: 1
    Last Post: 12-24-2010, 02:25 PM
  4. Need ideas and help for a simple BlackJack Game
    By Dannii in forum New To Java
    Replies: 5
    Last Post: 04-27-2009, 10:53 AM
  5. need help creating my Tic Tac Toe game!
    By bobmasta5 in forum New To Java
    Replies: 6
    Last Post: 12-09-2008, 05:45 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •