daily pastebin goal
2%
SHARE
TWEET

Untitled

a guest May 21st, 2018 60 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. // this is cardgame.java
  2.  
  3. package cardgame;
  4.  
  5. public class CardGame {
  6.     private Deck gameDeck;
  7.     private Card cardCurrent;
  8.     private Card cardNext;
  9.     private int score;
  10.     private int currentGuess;
  11.    
  12.     public CardGame(){
  13.         gameDeck = new Deck();
  14.         gameDeck.shuffle();
  15.         score = 0;
  16.         cardCurrent = gameDeck.dealACard();
  17.         cardNext = gameDeck.dealACard();
  18.     }
  19.    
  20.     public void getUserGuess(){
  21.         do{
  22.             currentGuess = Integer.parseInt(JOptionPane.showInputDialog("Current card : "
  23.                     + cardCurrent.getDetail() + " \n")
  24.                     + "Your card is : \n 0: higher \n 1: lower than the next card");
  25.         }while(currentGuess > 2 || currentGuess < 0);
  26.     }
  27.    
  28.     public boolean endGame(){
  29.         return (cardNext == null);
  30.     }
  31.    
  32. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top