Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class Game {
- public static void main(String[] args) {
- // Welcome message....
- System.out.println("Welcome to LuckyCard game!");
- Deck games = new Deck();
- }
- }
- public class Card {
- public Card(int theCategory, int theValue){
- //create the cards category and which value.
- int category;
- int value;
- }
- }
- public class Deck {
- Card [] deck = new Card[52];
- public Deck() {
- int cardCounter = 0;
- for(int i=0;i<=3;i++) {
- for (int j=1; j<14;j++) {
- deck[cardCounter] = new Card(i, j);
- cardCounter++;
- System.out.println(deck[i]);
- }
- }
- }
- public void shuffleCards() {
- for ( int i = deck.length-1; i > 0; i-- ) {
- int rand = (int)(Math.random()*(i+1));
- Card temp = deck[i];
- deck[i] = deck[rand];
- deck[rand] = temp;
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement