Results 1 to 2 of 2
  1. #1
    Kidd91 is offline Member
    Join Date
    Dec 2010
    Rep Power

    Default Creating a Card Game

    Hi, I need help creating a card game. In the card game there are two revealed cards and a hidden third card. In this game, the player has an amount of 200 dollars and needs to make a bet. He also needs to call a number from 0 to 2;
    '0' means that the third card < the lowest of the first two cards, '1', means that the third card is between the two cards, and '2' means that the third card is greater than the two cards. I need to keep the amount that the player has updated after every round. I keep on receiving errors such as cannot return a value from method whose result type is void and
    Here is what I got so far:
    public class cardGame
    public static void main (String []args)
    String ret;
    GUI theTable = new GUI(3);
    Deck tooManyCards = new Deck();
    double theAmount = theTable.showAmount(playerOneBet);
    Card theOne = tooManyCards.dealCard();
    Card theTwo = tooManyCards.dealCard();
    String A = JOptionPane.showInputDialog("Enter A Digit from 0 through 2;0 is less than, 1 is between, 2 is greater than");
    int B = Integer.parseInt(A);
    String C = JOptionPane.showInputDialog("Place your bet player 1");
    double playerOneBet = Double.parseDouble(C);
    Card DeckCard = tooManyCards.dealCard();
    if(DeckCard.betweenCards(theOne, theTwo))
    theAmount = theAmount + playerOneBet;
    ret = "You have won" + playerOneBet . + " dollars!! You now have" + theAmount;
    theAmount = theAmount - playerOneBet;
    ret = "You have lost" + playerOneBet + "dollars!! You . know have" + theAmount;
    return ret;

  2. #2
    Fubarable's Avatar
    Fubarable is offline Moderator
    Join Date
    Jun 2008
    Blog Entries
    Rep Power

Similar Threads

  1. Card Game
    By abby0910 in forum New To Java
    Replies: 1
    Last Post: 07-24-2010, 12:38 AM
  2. please help me with this card game
    By noobinoo in forum New To Java
    Replies: 13
    Last Post: 03-28-2010, 02:07 PM
  3. Creating a Card Game in Java
    By Natrix in forum New To Java
    Replies: 1
    Last Post: 05-05-2009, 05:55 PM
  4. card game Rummy
    By javafox in forum New To Java
    Replies: 4
    Last Post: 03-14-2009, 03:53 PM
  5. A Online Card Game
    By GonzaloP in forum Networking
    Replies: 0
    Last Post: 12-28-2008, 06:37 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