Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package proj2;
- import cardgames.*;
- public class Project2 {
- public static void main(String[] args)
- {
- GUI theWindow = new GUI();
- Deck theDeck = new Deck();
- theDeck.shuffleDeck();
- Card card1 = theDeck.dealCard();
- System.out.println("Card 1 is: " + card1.toString());
- Card card2 = theDeck.dealCard();
- System.out.println("Card 2 is: " + card2.toString());
- Card card3 = theDeck.dealCard();
- System.out.println("Card 3 is: " + card3.toString());
- theWindow.showCard(card1);
- theWindow.showCard(card2);
- theWindow.showCard(card3);
- if (card1.getValue() == card2.getValue() || (card1.getValue() == card3.getValue()) || (card2.getValue() == card3.getValue()))
- System.out.println("Pair");
- else
- System.out.println("Not a pair");
- if (card1.getPointValue() > card2.getPointValue() || (card1.getPointValue() > card3.getPointValue()))
- {
- System.out.println("The Highest value is " + card1.getPointValue());
- }
- else
- if (card2.getPointValue() > card3.getPointValue() || (card2.getPointValue() > card1.getPointValue()))
- {
- System.out.println("The Highest value is " + card2.getPointValue());
- }
- else
- if (card3.getPointValue() > card1.getPointValue() || (card3.getPointValue() > card2.getPointValue()))
- {
- System.out.println("The Highest value is " + card3.getPointValue());
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement