Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.util.*;
- /**
- * Aces High Skeleton. Compiles OK.
- * Sample Output: http://pastebin.com/raw.php?i=RN5UrCXY
- * @author jdalbey
- * @version Sep 2015
- */
- public class AcesHighSkeleton
- {
- private Scanner scanner = new Scanner(System.in);
- private final static int kNumPiles = 4;
- /* The four piles of cards */
- private Stack<Integer>[] cardPiles;
- /* The deck of 52 playing cards */
- private Stack<Integer> deck;
- private final static String rankSymbols = "23456789TJQKA";
- private final static String suitSymbols = "CDSH";
- /** Construct the application */
- public AcesHighSkeleton() {}
- /** Entry point for the application.
- * @param args ignored
- */
- public static void main(String[] args) {}
- /** Play the game until the user quits or the game is over. */
- public void run() {}
- /** Perform a discard.
- * @pile desired pile from which to discard the top card
- */
- public void discard(int pile) {}
- /** Perform move to empty spot.
- * @param desired pile from which to move the top card
- */
- public void move(int pile) {}
- /** Create the empty card piles */
- public void initPiles() {}
- /** Deal one card from the deck onto each pile.
- * @return false if unable to deal all four cards.
- */
- public boolean dealFour()
- {
- return true;
- }
- /** See if the card on top of pileNum can be discarded.
- * @param pileNum the number of the pile selected for discard.
- * @pre 0 <= pileNum < 4
- * @return true if there exists another visible card of the same suit
- * with a higher rank than the top card of selected pile.
- */
- public boolean canDiscard(int pileNum)
- {
- return true;
- }
- /** Remove the top card from selected pile.
- * @param pileNum selected pile
- * @pre cardPiles[pileNum].size() > 0
- */
- public void removeTop(int pileNum) {}
- /** See if the card on top of pileNum can be moved.
- * @param pileNum the number of the pile selected for discard.
- * @pre 0 <= pileNum < 4
- * @return the available pilenumber, if it exists, otherwise -1
- */
- public int canMove(int pileNum)
- {
- return 0;
- }
- /** Move the top card from selected pile to an empty pile.
- * @param pileNum selected pile
- * @param emptyPile the pile number of the empty pile
- * @pre canMove(pileNum) > -1
- */
- public void moveTop(int pileNum) {}
- /** Compute the score; how many cards are left on the table.
- * @return the table score.
- */
- public int getScore()
- {
- return 0;
- }
- /** Print the table. */
- public void printTable() {}
- /** Construct a deck of cards in random order. */
- public void createRandomDeck() {}
- /** Construct a deck of cards in the order specified.
- */
- public void createDeckFromString(String cardInput) {}
- /** Deal (remove and return) the top card from the deck.
- * @return the top card
- */
- public int dealCard()
- {
- return 0;
- }
- /** Determine if the deck has no more cards.
- * @return true if the deck is empty.
- */
- public boolean isEmpty()
- {
- return true;
- }
- /** Accessor to the rank symbol of a card.
- * @param card the card for which the rank is extracted
- */
- public char getRank(int card)
- {
- return ' ';
- }
- /** Accessor to the suit symbol of a card.
- * @param card the card for which the suit is extracted
- */
- public char getSuit(int card)
- {
- return ' ';
- }
- /** Return a printable representation of this card.
- * This implementation returns a 2 letter abbreviation.
- * @return abbrevation of the card, e.g., "2C"
- */
- public String getCard(int card)
- {
- return "";
- }
- /** Does this card have the same suit and a lower rank
- * than Other card.
- * @param other card to be compared to
- * @return true if this card is less than other
- */
- public boolean lessThan(int card1, int card2)
- {
- return true;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement