Advertisement
jdalbey

CollapseConsole skeleton

Jan 19th, 2014
518
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 1.82 KB | None | 0 0
  1. /**
  2.  * CollapseConsole is the text-based console user interface to the Collapse game.
  3.  * The main() method starts the application running using System.in and System.out.
  4.  * CollapseConsole can also return the top five high scores from the Hall of Fame.
  5.  *
  6.  * @author (your name)
  7.  * @version (a version number or a date)
  8.  */
  9. public class CollapseConsole
  10. {
  11.     /** How many hall of fame entries to return */
  12.     public final static int kHallSize = 5;
  13.  
  14.     /** Entry point for the application.
  15.      *
  16.      *  @param args ignored    
  17.      */
  18.     public static void main(String[] args)
  19.     {  
  20.         CollapseConsole app = new CollapseConsole();
  21.         app.setIOsources(new InputStreamReader(System.in),
  22.                          new OutputStreamWriter(System.out));
  23.         app.run();
  24.     }
  25.  
  26.     /** Construct a new instance of this class.
  27.      * Create the game components and initialize them,
  28.      * create the user interface and connect it to the game.
  29.      */
  30.     public CollapseConsole()
  31.     {
  32.     }
  33.    
  34.     /** Set input/output sources for Stream-based user interfaces.
  35.      * @param rdr A Reader from which user input is obtained.
  36.      * @param wtr A Writer to which program output is displayed.
  37.      */
  38.     public void setIOsources(Reader rdr, Writer wtr)
  39.     {
  40.     }
  41.  
  42.     /** Run the console user interface, using the i/o streams provided by
  43.      *  setIOsources();
  44.      *  @pre setIOsources() has been called.
  45.      */
  46.     public void run()
  47.     {
  48.     }
  49.  
  50.     /** Return a string representation of the top five high scores.
  51.      *  @return string is the top scores, one per line, with the
  52.      *  score and name (in that order), separated by one or more blanks.
  53.      *  Name is twenty characters max.  Leading blanks are allowed.
  54.      */
  55.     public String getHighScores()
  56.     {  
  57.     }      
  58. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement