it contains the practical programs in our college

源代码在线查看: deck.java

软件大小: 32796 K
上传用户: NJ_WK
关键词: practical contains programs college
下载地址: 免注册下载 普通下载 VIP

相关代码

				import java.util.*;
				
				public class Deck {
				
				    public static int numSuits = 4;
				    public static int numRanks = 13;
				    public static int numCards = numSuits * numRanks;
				
				    private Card[][] cards;
				
				    public Deck() {
				        cards = new Card[numSuits][numRanks];
				        for (int suit = Card.DIAMONDS; suit 				            for (int rank = Card.ACE; rank 				                cards[suit-1][rank-1] = new Card(rank, suit);
				            }
				        }
				    }
				
				    public Card getCard(int suit, int rank) {
				        return cards[suit-1][rank-1];
				    }
				}
							

相关资源