Welcome to the Java Programming Forums


The professional, friendly Java community. 21,500 members and growing!


The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.


>> REGISTER NOW TO START POSTING


Members have full access to the forums. Advertisements are removed for registered users.

Results 1 to 3 of 3

Thread: Card Game Problem.

  1. #1
    Junior Member
    Join Date
    Jun 2011
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Card Game Problem.

    Im just new in programming.
    and our trainer just gave us this problem.
    can u help me with this?


    Create a Java program that will do the following functions:
    1. Create a 52 card deck with the following values in descending order:
    suit: diamond, heart, spades, clubs
    face: ace, king, queen, jack, ten, nine, eight, seven, six, five, four, three, two,
    2. The cards will be placed in a stack and shall serve as the initial content of the deck.
    3. The program should be able to shuffle the initial content of the deck. The number of shuffles will be an input parameter.
    4. Deal the shuffled content to x no. of players .
    5. Each player then plays the first card that was stored in his own stack.
    6. The values of each card played are then compared. The player who owns the highest card, gets the other 3 cards and places all of the cards at the bottom of his stack.
    7. The next top card from each player's stack are then played. Do step 6.
    8. Perform steps 6 and 7 until one player has all 52 cards in his stack.

    Outputs:
    1. Display the content of the deck before the start of the shuffle and gameplay.
    2. Display the content of the stack of the winning player


  2. #2
    Super Moderator Norm's Avatar
    Join Date
    May 2010
    Location
    Eastern Florida
    Posts
    25,162
    Thanks
    65
    Thanked 2,725 Times in 2,675 Posts

    Default Re: Card Game Problem.

    Yes we can help.
    Do you have any specific questions about your assignment?
    We'll help you get your program written. Post your code and any error messages you are having problems with.
    Use code tags when posting code. See: BB Code List - Java Forums

  3. #3
    Super Moderator Norm's Avatar
    Join Date
    May 2010
    Location
    Eastern Florida
    Posts
    25,162
    Thanks
    65
    Thanked 2,725 Times in 2,675 Posts

    Default Re: Card Game Problem.

    To use a HashMap you would need keys and values. Given a key you can get the value from the HashMap
    What makes sense in your program to use that technique?

Similar Threads

  1. How to add card images to Blackjack game??
    By Jayc44 in forum What's Wrong With My Code?
    Replies: 2
    Last Post: May 15th, 2011, 12:43 PM
  2. Card Game help....
    By macFs89H in forum What's Wrong With My Code?
    Replies: 1
    Last Post: May 2nd, 2011, 07:55 AM
  3. Card Game Problem....Need Help
    By macFs89H in forum What's Wrong With My Code?
    Replies: 1
    Last Post: April 28th, 2011, 07:30 AM
  4. Credit Card Problem (While and Switch will be used)
    By odun in forum Object Oriented Programming
    Replies: 3
    Last Post: March 29th, 2011, 12:54 AM
  5. help on war card game project
    By sc0field1 in forum What's Wrong With My Code?
    Replies: 2
    Last Post: March 3rd, 2011, 04:51 AM