Enhancements

It is intended that enhancements will require some discovery and investigation on your part, a situation similar to what you would experience in the “real” world. Sources of information might include the web, JavaDoc for Java classes, and books.

Remember that you should not begin working on enhancements until you have the basic game working.

Finally, you are strongly encouraged to dream up enhancements that you want to implement. Send e-mail to Carrie Howells before you start to make sure your idea is possible and of sufficient complexity to qualify for the extra marks.

You many implement any of the following enhancements. The enhancements are grouped according to the number of marks they are worth. Choose any combination of enhancements which total up to 40% (which includes the potential of a 10% bonus on your project mark).

Enhancements worth 5%

  1. Detect when the player has no legal moves left and announce the end of the game indicating if the player won or lost.
  2. Provide a dialog box to display the rules.
  3. Provide a hint function which hilites all the cards which could move.
  4. Allow the player to undo the most recent move.
  5. When a card is double-clicked it automatically moves to an empty free cell.
  6. Figure out how to display images for various aspects of the game. You may use images in at most two ways for 5% each:
  7. Implement a view which records, either in the user interface or in a file, all the significant events in the game.

Enhancements worth 10% include:

  1. Allow the player to undo an unlimited number of moves (back to the beginning of the game).
  2. Allow the user to move multiple cards at a time from one pile to another if If there aren't enough empty places, display a message such as: “That move requires moving x cards. You have only enough free space to move y cards.” (Where x>y.)
  3. When a card is moved from a layout pile, if the newly exposed card can be placed in the foundation piles, it should move automatically. Be careful: don't move a card to the foundation pile if the opposite-coloured cards of the ranks less than this card have not been moved into the foundation piles. For example: don't move the 5 of clubs on to a foundation pile until the 4 of hearts and 4 of diamonds are already there.
  4. Allow the user to ask the computer to play a single card. Your method must
  5. Use recursion to implement the above enhancement. Horstmann discusses recursion in Section 7.9.
  6. Animate the motion of the cards as they move from pile to pile.
  7. Display a video or play a sound file at some significant point in the game. An extra 5% is available if you develop the video or sound files yourself, rather than using files you find on the net.
  8. Learn how to use menus. Implement several commands such as a new game, saving a game, loading a game, help, about, etc. You must have at least one menu and and at least three menu items. Implementing more will not count for extra marks. (Note: Reading from and writing to files doesn't work with Applets unless you take special measures. If you choose to implement your game as an Applet you will need to address this issue. See Enhancement #1 worth 15%.)
  9. Implement your game as an applet that is playable over the Internet (i.e. your game is playable within a browser). (This enhancement is challenging. Begin by reading the information on making an applet.)

Enhancements worth 15%

  1. Figure out how to use a “cgi script” to save information from a FreeCell applet to your web site. Use it to set-up a world-wide list of players with the highest score. Check out Reading from and Writing to a URLConnection to help you get started.