Advertisement
Guest User

Untitled

a guest
Oct 4th, 2015
67
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.34 KB | None | 0 0
  1. package proj2;
  2. import cardgames.*;
  3.  
  4. public class Project2 {
  5. public static void main(String[] args)
  6. {
  7. GUI theWindow = new GUI();
  8. Deck theDeck = new Deck();
  9. theDeck.shuffleDeck();
  10. Card card1 = theDeck.dealCard();
  11. System.out.println("Card 1 is: " + card1.toString());
  12. Card card2 = theDeck.dealCard();
  13. System.out.println("Card 2 is: " + card2.toString());
  14. Card card3 = theDeck.dealCard();
  15. System.out.println("Card 3 is: " + card3.toString());
  16.  
  17. theWindow.showCard(card1);
  18. theWindow.showCard(card2);
  19. theWindow.showCard(card3);
  20.  
  21. if (card1.getValue() == card2.getValue() || (card1.getValue() == card3.getValue()) || (card2.getValue() == card3.getValue()))
  22. System.out.println("Pair");
  23. else
  24. System.out.println("Not a pair");
  25.  
  26. if (card1.getPointValue() > card2.getPointValue() || (card1.getPointValue() > card3.getPointValue()))
  27. {
  28. System.out.println("The Highest value is " + card1.getPointValue());
  29. }
  30. else
  31. if (card2.getPointValue() > card3.getPointValue() || (card2.getPointValue() > card1.getPointValue()))
  32. {
  33. System.out.println("The Highest value is " + card2.getPointValue());
  34. }
  35. else
  36. if (card3.getPointValue() > card1.getPointValue() || (card3.getPointValue() > card2.getPointValue()))
  37. {
  38. System.out.println("The Highest value is " + card3.getPointValue());
  39. }
  40. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement