Results 1 to 2 of 2
Thread: Creating a Card Game
- 12-24-2010, 12:56 PM #1
Member
- Join Date
- Dec 2010
- Posts
- 1
- Rep Power
- 0
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();
tooManyCards.shuffleDeck();
theTable.showAmount(200);
double theAmount = theTable.showAmount(playerOneBet);
Card theOne = tooManyCards.dealCard();
Card theTwo = tooManyCards.dealCard();
theTable.showCard(theOne);
theTable.showCard(theTwo);
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);
theTable.showBet(playerOneBet);
Card DeckCard = tooManyCards.dealCard();
theTable.showCard(DeckCard);
if(DeckCard.betweenCards(theOne, theTwo))
{
theAmount = theAmount + playerOneBet;
ret = "You have won" + playerOneBet . + " dollars!! You now have" + theAmount;
}
else
{
theAmount = theAmount - playerOneBet;
ret = "You have lost" + playerOneBet + "dollars!! You . know have" + theAmount;
}
return ret;
-
Similar Threads
-
Card Game
By abby0910 in forum New To JavaReplies: 1Last Post: 07-24-2010, 12:38 AM -
please help me with this card game
By noobinoo in forum New To JavaReplies: 13Last Post: 03-28-2010, 02:07 PM -
Creating a Card Game in Java
By Natrix in forum New To JavaReplies: 1Last Post: 05-05-2009, 05:55 PM -
card game Rummy
By javafox in forum New To JavaReplies: 4Last Post: 03-14-2009, 03:53 PM -
A Online Card Game
By GonzaloP in forum NetworkingReplies: 0Last Post: 12-28-2008, 06:37 PM


LinkBack URL
About LinkBacks
Reply With Quote

Bookmarks