Advertisement
jdalbey

Aces High compiled skeleton

Oct 1st, 2015
139
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.17 KB | None | 0 0
  1. import java.util.*;
  2.  
  3. /**
  4. * Aces High Skeleton. Compiles OK.
  5. * Sample Output: http://pastebin.com/raw.php?i=RN5UrCXY
  6. * @author jdalbey
  7. * @version Sep 2015
  8. */
  9. public class AcesHighSkeleton
  10. {
  11. private Scanner scanner = new Scanner(System.in);
  12. private final static int kNumPiles = 4;
  13. /* The four piles of cards */
  14. private Stack<Integer>[] cardPiles;
  15. /* The deck of 52 playing cards */
  16. private Stack<Integer> deck;
  17.  
  18. private final static String rankSymbols = "23456789TJQKA";
  19. private final static String suitSymbols = "CDSH";
  20.  
  21. /** Construct the application */
  22. public AcesHighSkeleton() {}
  23.  
  24. /** Entry point for the application.
  25. * @param args ignored
  26. */
  27. public static void main(String[] args) {}
  28.  
  29. /** Play the game until the user quits or the game is over. */
  30. public void run() {}
  31.  
  32. /** Perform a discard.
  33. * @pile desired pile from which to discard the top card
  34. */
  35. public void discard(int pile) {}
  36.  
  37. /** Perform move to empty spot.
  38. * @param desired pile from which to move the top card
  39. */
  40. public void move(int pile) {}
  41.  
  42. /** Create the empty card piles */
  43. public void initPiles() {}
  44.  
  45. /** Deal one card from the deck onto each pile.
  46. * @return false if unable to deal all four cards.
  47. */
  48. public boolean dealFour()
  49. {
  50. return true;
  51. }
  52.  
  53. /** See if the card on top of pileNum can be discarded.
  54. * @param pileNum the number of the pile selected for discard.
  55. * @pre 0 <= pileNum < 4
  56. * @return true if there exists another visible card of the same suit
  57. * with a higher rank than the top card of selected pile.
  58. */
  59. public boolean canDiscard(int pileNum)
  60. {
  61. return true;
  62. }
  63.  
  64. /** Remove the top card from selected pile.
  65. * @param pileNum selected pile
  66. * @pre cardPiles[pileNum].size() > 0
  67. */
  68. public void removeTop(int pileNum) {}
  69.  
  70. /** See if the card on top of pileNum can be moved.
  71. * @param pileNum the number of the pile selected for discard.
  72. * @pre 0 <= pileNum < 4
  73. * @return the available pilenumber, if it exists, otherwise -1
  74. */
  75. public int canMove(int pileNum)
  76. {
  77. return 0;
  78. }
  79.  
  80. /** Move the top card from selected pile to an empty pile.
  81. * @param pileNum selected pile
  82. * @param emptyPile the pile number of the empty pile
  83. * @pre canMove(pileNum) > -1
  84. */
  85. public void moveTop(int pileNum) {}
  86.  
  87. /** Compute the score; how many cards are left on the table.
  88. * @return the table score.
  89. */
  90. public int getScore()
  91. {
  92. return 0;
  93. }
  94.  
  95. /** Print the table. */
  96. public void printTable() {}
  97.  
  98. /** Construct a deck of cards in random order. */
  99. public void createRandomDeck() {}
  100.  
  101. /** Construct a deck of cards in the order specified.
  102. */
  103. public void createDeckFromString(String cardInput) {}
  104.  
  105. /** Deal (remove and return) the top card from the deck.
  106. * @return the top card
  107. */
  108. public int dealCard()
  109. {
  110. return 0;
  111. }
  112.  
  113. /** Determine if the deck has no more cards.
  114. * @return true if the deck is empty.
  115. */
  116. public boolean isEmpty()
  117. {
  118. return true;
  119. }
  120.  
  121. /** Accessor to the rank symbol of a card.
  122. * @param card the card for which the rank is extracted
  123. */
  124. public char getRank(int card)
  125. {
  126. return ' ';
  127. }
  128.  
  129. /** Accessor to the suit symbol of a card.
  130. * @param card the card for which the suit is extracted
  131. */
  132. public char getSuit(int card)
  133. {
  134. return ' ';
  135. }
  136.  
  137. /** Return a printable representation of this card.
  138. * This implementation returns a 2 letter abbreviation.
  139. * @return abbrevation of the card, e.g., "2C"
  140. */
  141. public String getCard(int card)
  142. {
  143. return "";
  144. }
  145.  
  146. /** Does this card have the same suit and a lower rank
  147. * than Other card.
  148. * @param other card to be compared to
  149. * @return true if this card is less than other
  150. */
  151. public boolean lessThan(int card1, int card2)
  152. {
  153. return true;
  154. }
  155.  
  156. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement