Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class CardClass
- {
- private int numbercard;
- private String suit;
- private String facecard;
- public CardClass()
- {
- numbercard = 0;
- suit = new String("Blank");
- facecard = new String ("none");
- }// end constructor
- public CardClass(int numbercard, String suit, String facecard)
- {
- this.numbercard = numbercard;
- this.suit = suit;
- this.facecard = facecard;
- } // end of multi-argument
- public String toString()
- {
- int randomNum = (int) (Math.random()*52)+1;
- String output = new String();
- int randomNum1 = (int) (Math.random()*0);
- if ( randomNum1 = 0)
- {
- output= "••••••••••" + "\n" +
- "•" + numbercard + " " + "•" + "\n" +
- "• •" + "\n" +
- "• •" + "\n" +
- "• •" + "\n" +
- "•" + " "+ numbercard + "•" + "\n" +
- "••••••••••";
- } // end if
- if ( randomNum <= 10 )
- {
- output= "♥♥♥♥♥♥♥" + "\n" +
- "♥" +numbercard+ " " + "♥" + "\n" +
- "♥ ♥" + "\n" +
- "♥ ♥" + "\n" +
- "♥ ♥" + "\n" +
- "♥" + " " +numbercard + "♥" + "\n" +
- "♥♥♥♥♥♥♥";
- } // end if
- if (randomNum > 10 )
- {
- output=
- "♦♦♦♦♦♦♦" + "\n" +
- "♦" + facecard + " " + "♦" + "\n" +
- "♦ ♦" + "\n" +
- "♦ ♦" + "\n" +
- "♦ ♦" + "\n" +
- "♦"+ " " + facecard + "♦" + "\n" +
- "♦♦♦♦♦♦♦";
- }// end if
- return output;
- } // end toString()
- } // end class CardClass
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement