package deck;

public class Card {
	private int cardNum;
	private boolean visible;
	
	public Card() {
		cardNum = 1;
		visible = false;
	}
	
	public Card(int num) {
		cardNum = num;
		visible = false;
	}
	
	public int getCardNum() {
		return cardNum;
	}
	
	public void makeVisible() {
		visible = true;
	}
	
	public void changeVisible() {
		visible = !visible;
	}
	
	//Gets the value of the card for in-game use
	public int getCardVal(boolean aceIsOne) {
		if(this.getCardNum() >= 49) {
			if(aceIsOne) 
				return 1;
			else 
				return 11;
		}	
		else if(this.getCardNum() >= 33) {
			return 10;
		}	
		else if(this.getCardNum() >= 29) {
			return 9;
		}	
		else if(this.getCardNum() >= 25) {
			return 8;
		}	
		else if(this.getCardNum() >= 21) {
			return 7;
		}	
		else if(this.getCardNum() >= 17) {
			return 6;
		}	
		else if(this.getCardNum() >= 13) {
			return 5;
		}	
		else if(this.getCardNum() >= 9) {
			return 4;
		}	
		else if(this.getCardNum() >= 5) {
			return 3;
		}	
		else {
			return 2;
		}
	}
	
	public String getCardName() {
		if(this.getCardNum() >= 49) {
			return "Ace" + getSuitName();
		}
		else if(this.getCardNum() >= 45) {
			return "King" + getSuitName();
		}
		else if(this.getCardNum() >= 41) {
			return "Queen" + getSuitName();
		}
		else if(this.getCardNum() >= 37) {
			return "Jack" + getSuitName();
		}
		else if(this.getCardNum() >= 33) {
			return "Ten" + getSuitName();
		}
		else if(this.getCardNum() >= 29) {
			return "Nine" + getSuitName();
		}
		else if(this.getCardNum() >= 25) {
			return "Eight" + getSuitName();
		}
		else if(this.getCardNum() >= 21) {
			return "Seven" + getSuitName();
		}
		else if(this.getCardNum() >= 17) {
			return "Six" + getSuitName();
		}
		else if(this.getCardNum() >= 13) {
			return "Five" + getSuitName();
		}
		else if(this.getCardNum() >= 9) {
			return "Four" + getSuitName();
		}
		else if(this.getCardNum() >= 5) {
			return "Three" + getSuitName();
		}
		else {
			return "Two" + getSuitName();
		}
	}
	
	private String getSuitName() {
		if(this.getCardNum()%4 == 0) {
			return " of Spades";
		}
		else if(this.getCardNum()%4 == 1) {
			return " of Hearts";
		}
		else if(this.getCardNum()%4 == 2) {
			return " of Clubs";
		}
		else {
			return " of Diamonds";
		}
	}
}

@@ -455,546 +455,166 @@
 %0A%09%09i
-f(this.getCardNum() %3E= 49) %7B%0A%09%09%09if(aceIsOne) %0A%09%09%09%09return 1;%0A%09%09%09else %0A%09%09%09%09return 11;%0A%09%09%7D%09%0A%09%09else if(this.getCardNum() %3E= 33) %7B%0A%09%09%09return 10;%0A%09%09%7D%09%0A%09%09else if(this.getCardNum() %3E= 29) %7B%0A%09%09%09return 9;%0A%09%09%7D%09%0A%09%09else if(this.getCardNum() %3E= 25) %7B%0A%09%09%09return 8;%0A%09%09%7D%09%0A%09%09else if(this.getCardNum() %3E= 21) %7B%0A%09%09%09return 7;%0A%09%09%7D%09%0A%09%09else if(this.getCardNum() %3E= 17) %7B%0A%09%09%09return 6;%0A%09%09%7D%09%0A%09%09else if(this.getCardNum() %3E= 13) %7B%0A%09%09%09return 5;%0A%09%09%7D%09%0A%09%09else if(this.getCardNum() %3E= 9) %7B%0A%09%09%09return 4;%0A%09%09%7D%09%0A%09%09else if(this.getCardNum() %3E= 5) %7B%0A%09%09%09return 3
+nt val = (this.getCardNum()-1)/4 + 2;%0A%09%09if(val==14 && aceIsOne)%0A%09%09%09val = 1;%0A%09%09else if(val %3E 10 && val %3C 14)%0A%09%09%09val = 10;%0A%09%09else if(val == 14)%0A%09%09%09val = 11
 ;%0A%09%09
-%7D%09
 %0A
-%09%09else %7B%0A%09
 %09%09re
@@ -622,14 +622,12 @@
 urn 
-2;%0A%09%09%7D
+val;
 %0A%09%7D%0A
@@ -1872,8 +1872,276 @@
 %09%7D%0A%09%7D%0A%7D%0A
+%09private String getSuitName() %7B%0A%09%09if(this.getCardNum()%254 == 0) %7B%0A%09%09%09return %22 of Spades%22;%0A%09%09%7D%0A%09%09else if(this.getCardNum()%254 == 1) %7B%0A%09%09%09return %22 of Hearts%22;%0A%09%09%7D%0A%09%09else if(this.getCardNum()%254 == 2) %7B%0A%09%09%09return %22 of Clubs%22;%0A%09%09%7D%0A%09%09else %7B%0A%09%09%09return %22 of Diamonds%22;%0A%09%09%7D%0A%09%7D%0A%7D%0A

Update Card.java