Advertisement
Guest User

Untitled

a guest
Jan 24th, 2019
90
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.88 KB | None | 0 0
  1. public class Game {
  2.  
  3. public static void main(String[] args) {
  4. // Welcome message....
  5. System.out.println("Welcome to LuckyCard game!");
  6.  
  7. Deck games = new Deck();
  8. }
  9.  
  10. }
  11.  
  12.  
  13.  
  14. public class Card {
  15.  
  16. public Card(int theCategory, int theValue){
  17. //create the cards category and which value.
  18. int category;
  19. int value;
  20. }
  21.  
  22. }
  23.  
  24.  
  25. public class Deck {
  26.  
  27. Card [] deck = new Card[52];
  28.  
  29. public Deck() {
  30. int cardCounter = 0;
  31.  
  32. for(int i=0;i<=3;i++) {
  33. for (int j=1; j<14;j++) {
  34. deck[cardCounter] = new Card(i, j);
  35. cardCounter++;
  36. System.out.println(deck[i]);
  37. }
  38. }
  39. }
  40.  
  41. public void shuffleCards() {
  42. for ( int i = deck.length-1; i > 0; i-- ) {
  43. int rand = (int)(Math.random()*(i+1));
  44. Card temp = deck[i];
  45. deck[i] = deck[rand];
  46. deck[rand] = temp;
  47. }
  48. }
  49.  
  50. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement