Advertisement
Guest User

me

a guest
Oct 6th, 2015
112
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.27 KB | None | 0 0
  1. public class CardClass
  2. {
  3. private int numbercard;
  4. private String suit;
  5. private String facecard;
  6.  
  7.  
  8. public CardClass()
  9. {
  10. numbercard = 0;
  11. suit = new String("Blank");
  12. facecard = new String ("none");
  13.  
  14. }// end constructor
  15.  
  16. public CardClass(int numbercard, String suit, String facecard)
  17. {
  18. this.numbercard = numbercard;
  19. this.suit = suit;
  20. this.facecard = facecard;
  21.  
  22. } // end of multi-argument
  23.  
  24. public String toString()
  25. {
  26. int randomNum = (int) (Math.random()*52)+1;
  27. String output = new String();
  28. int randomNum1 = (int) (Math.random()*0);
  29. if ( randomNum1 = 0)
  30. {
  31. output= "••••••••••" + "\n" +
  32. "•" + numbercard + " " + "•" + "\n" +
  33. "• •" + "\n" +
  34. "• •" + "\n" +
  35. "• •" + "\n" +
  36. "•" + " "+ numbercard + "•" + "\n" +
  37. "••••••••••";
  38.  
  39.  
  40.  
  41. } // end if
  42. if ( randomNum <= 10 )
  43. {
  44. output= "♥♥♥♥♥♥♥" + "\n" +
  45. "♥" +numbercard+ " " + "♥" + "\n" +
  46. "♥ ♥" + "\n" +
  47. "♥ ♥" + "\n" +
  48. "♥ ♥" + "\n" +
  49. "♥" + " " +numbercard + "♥" + "\n" +
  50. "♥♥♥♥♥♥♥";
  51.  
  52.  
  53.  
  54. } // end if
  55. if (randomNum > 10 )
  56. {
  57. output=
  58. "♦♦♦♦♦♦♦" + "\n" +
  59. "♦" + facecard + " " + "♦" + "\n" +
  60. "♦ ♦" + "\n" +
  61. "♦ ♦" + "\n" +
  62. "♦ ♦" + "\n" +
  63. "♦"+ " " + facecard + "♦" + "\n" +
  64. "♦♦♦♦♦♦♦";
  65.  
  66.  
  67.  
  68. }// end if
  69.  
  70. return output;
  71. } // end toString()
  72. } // end class CardClass
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement