CPSC 170 Post Lab 3
Yukon
Due Before Class on Tuesday, January 8th

For this assignment you will create the card game Yukon, a simplified version of the card game Klondike (more commonly known as solitare). The game begins by dealing cards, from a deck of 52 face-up cards, into seven cascades. A cascade is a pile of cards where each card is shifted down slightly to reveal the rank and suit of the card below it. The leftmost cascade has one card and each of the other cascades has one more card than the cascade to its left. The remainder of the cards are placed into the store, a face-up pile of cards. The goal of the game is to arrange all of the cards into three cascades of descending order of rank with alternating color of suit. To play, a card from the store or a card and all cards above it, in-order, from a cascade can be moved to the top of a cascade, but only if the card is of the next highest rank and the opposite suit color of the top of the cascade it is being added to. If a cascade is emtpy it is possible to move a king of any suit to it. It is also possible to take the top card of the store and move it to the bottom of the store.

Details

The program should display the tableau, the store and the seven cascades, and allow the user to click and drag any card that is visible. When dragging, all cards above the chosen card should also be dragged. However, if the user does not release the dragging cards on a valid card the dragging cards should be returned to where they came from. When the user clicks the store, but doesn't drag, the top card should be moved to the bottom of the store.

Before you begin writing any code you should think about the design of the program. List the classes and methods you think that you will need to complete the program. Some suggestions are:

You will of course need to implement more methods than this; be sure to plan them out before writing any code. Once you have a good understanding of the structure of your program think about what code you are going to implement first. Remember, you will often save time if you write code in small pieces and test each piece before moving on (also remember to test boundary conditions). As usual use good programming practices, appropriate naming of variables, small methods, correct formatting, and thorough documentation.

Submission: Submit your code as a zip file with your name as the zip file name on the course Inquire site.