This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
user:nbrimme1:portfolio:dataprojectf [2013/10/27 08:42] – [Procedure] nbrimme1 | user:nbrimme1:portfolio:dataprojectf [2013/12/10 04:19] (current) – [References] nbrimme1 | ||
---|---|---|---|
Line 1: | Line 1: | ||
+ | ======Data Structures Project 7: Card Game " | ||
+ | A project for COURSENAME by YOUR NAME OR GROUPMEMBER NAMES during the SEMESTER YEAR. | ||
+ | |||
+ | This project was begun on DATE and is anticipated to take X AMOUNT OF TIME. (Upon completion you can correct this with the actual length). | ||
+ | |||
+ | This project was supposed to be a final project, but Matt changed his mind...not sure if that's good or bad. | ||
+ | =====Objectives===== | ||
+ | State the purpose of this project. What is the point of this project? What do we hope to accomplish by undertaking it? | ||
+ | =====Prerequisites===== | ||
+ | In order to successfully accomplish/ | ||
+ | |||
+ | * resource1 | ||
+ | * resource2 | ||
+ | * resource3 | ||
+ | * experience1 | ||
+ | * experience2 | ||
+ | * etc. | ||
+ | |||
+ | =====Background===== | ||
+ | State the idea or purpose of the project. What are you attempting to pursue? | ||
+ | |||
+ | Upon approval, you'll want to fill this section out with more detailed background information. DO NOT JUST PROVIDE A LINK. | ||
+ | |||
+ | Providing any links to original source material, such as from a project page, is a good idea. | ||
+ | |||
+ | You'll want to give a general overview of what is going to be accomplished (for example, if your project is about installing a web server, do a little write-up on web servers. What is it, why do we need one, how does it work, etc.) | ||
+ | =====Scope===== | ||
+ | Give a general overview of your anticipated implementation of the project. Address any areas where you are making upfront assumptions or curtailing potential detail. State the focus you will be taking in implementation. | ||
+ | |||
+ | =====Attributes===== | ||
+ | State and justify the attributes you'd like to receive upon successful approval and completion of this project. | ||
+ | |||
+ | * attribute1: why you feel your pursuit of this project will gain you this attribute | ||
+ | * attribute2: why you feel your pursuit of this project will gain you this attribute | ||
+ | * etc... | ||
+ | |||
+ | =====Procedure===== | ||
+ | The actual steps taken to accomplish the project. Include images, code snippets, command-line excerpts; whatever is useful for intuitively communicating important information for accomplishing the project. | ||
+ | \\ | ||
+ | \\ | ||
+ | The first step was to become familiar with the rules and vocabulary for the 4 card games. Not only do I need to memorize C vocabulary, now I need to learn some Solitaire vocabulary :-X (A glossary of solitaire terms can be found [[http:// | ||
+ | |||
+ | 1. **[[http:// | ||
+ | * One standard deck of cards is used, **52 total cards, 4 suits (Club, Heart, Diamond, and Spade, each with Ace through King), 2 colors (Black and Red)**. | ||
+ | * **Rules:** | ||
+ | * **Construction and layout:** | ||
+ | * There are 4 open " | ||
+ | * Cards are dealt into 8 " | ||
+ | * **Building during play:** | ||
+ | * The top card of each " | ||
+ | * " | ||
+ | * " | ||
+ | * **Moves:** | ||
+ | * Any " | ||
+ | * Complete or partial " | ||
+ | * **Victory: | ||
+ | * The game is won after all cards are moved to their " | ||
+ | |||
+ | 2. **[[http:// | ||
+ | * Two standard decks of cards are used, **104 total cards, 8 suits (2 Clubs, 2 Hearts, 2 Diamonds, and 2 Spades, each with Ace through King), 4 colors (2 Blacks and 2 Reds)**. | ||
+ | * **Rules:** | ||
+ | * Deal ten " | ||
+ | * Leave space for 8 " | ||
+ | * You may only move the top card from any " | ||
+ | * For every empty " | ||
+ | * The " | ||
+ | * The " | ||
+ | * You may deal one card at a time from the " | ||
+ | * You may use the top card from the " | ||
+ | * You may only go through the " | ||
+ | * The object of the game is to move all the cards to the " | ||
+ | |||
+ | 3. **[[http:// | ||
+ | * One standard deck of cards is used, **52 total cards, 4 suits (Club, Heart, Diamond, and Spade, each with Ace through King), 2 colors (Black and Red)**. | ||
+ | * **Rules:** | ||
+ | * The cards are dealt, face up, into 8 columns (or " | ||
+ | * The remaining 4 cards go into the first 4 " | ||
+ | * These " | ||
+ | * There are also 4 slots that represent the 4 " | ||
+ | * The 8 " | ||
+ | * Technically, | ||
+ | * If a column is emptied, most rules allow for one to place any card in the empty space, regardless of suit or rank (as long as it follows the other restrictions on moving cards). | ||
+ | |||
+ | 4. **[[http:// | ||
+ | * One standard deck of cards is used, **52 total cards, 4 suits (Club, Heart, Diamond, and Spade, each with Ace through King), 2 colors (Black and Red)**. | ||
+ | * **Rules:** | ||
+ | * **Construction and layout:** | ||
+ | * There are four open " | ||
+ | * The entire deck is dealt out left to right into 8 " | ||
+ | * **Building during play:** | ||
+ | * The top card of each cascade begins a " | ||
+ | * " | ||
+ | * " | ||
+ | * **Moves:** | ||
+ | * Any " | ||
+ | * Complete or partial " | ||
+ | * **Victory: | ||
+ | |||
+ | The next step is picking a game to actually code. My initial choice is " | ||
+ | ^Black ♣^ Red ♦ ^ Red ♥ ^Black ♠^ | ||
+ | | | ||
+ | | 02♣ | 02♦ | 02♥ | 02♠ | | ||
+ | | 03♣ | 03♦ | 03♥ | 03♠ | | ||
+ | | 04♣ | 04♦ | 04♥ | 04♠ | | ||
+ | | 05♣ | 05♦ | 05♥ | 05♠ | | ||
+ | | 06♣ | 06♦ | 06♥ | 06♠ | | ||
+ | | 07♣ | 07♦ | 07♥ | 07♠ | | ||
+ | | 08♣ | 08♦ | 08♥ | 08♠ | | ||
+ | | 09♣ | 09♦ | 09♥ | 09♠ | | ||
+ | | 10♣ | 10♦ | 10♥ | 10♠ | | ||
+ | | | ||
+ | | | ||
+ | | | ||
+ | |||
+ | To " | ||
+ | |||
+ | I MIGHT (time permitting) try to implement an " | ||
+ | |||
+ | =====Code===== | ||
+ | <code c> | ||
+ | /* | ||
+ | * hello.c - A sample " | ||
+ | | ||
+ | * written by NAME for COURSE on DATE | ||
+ | * | ||
+ | * compile with: | ||
+ | | ||
+ | * | ||
+ | * execute with: | ||
+ | | ||
+ | */ | ||
+ | |||
+ | #include < | ||
+ | |||
+ | int main() | ||
+ | { | ||
+ | printf(" | ||
+ | return(0); | ||
+ | } | ||
+ | </ | ||
+ | =====Execution===== | ||
+ | Again, if there is associated code with the project, and you haven' | ||
+ | |||
+ | <cli> | ||
+ | lab46:~/$ ./ | ||
+ | Hello, World! | ||
+ | lab46: | ||
+ | </ | ||
+ | =====Reflection===== | ||
+ | Comments/ | ||
+ | |||
+ | One thing I learned was that there are unsolvable games for FreeCell. Another idea that I had was writing a game of chess (or [[http:// | ||
+ | =====References===== | ||
+ | In performing this project, the following resources were referenced: | ||
+ | |||
+ | * **Google** was of course used for this project: | ||
+ | * A way to display the color, suit, and number; to make shiz all pretty:< | ||
+ | /* Set the background and text color to look like a playing card: | ||
+ | Background will be white, cards red and black, and a " | ||
+ | remove the colors. */ | ||
+ | #define RST " | ||
+ | #define WHT " | ||
+ | #define BLK " | ||
+ | #define RED " | ||
+ | |||
+ | /* Display Unicode symbols for suits. ' | ||
+ | required to display Unicode Symbols. */ | ||
+ | wchar_t cardSuits[] = L" | ||
+ | |||
+ | // Change the background to WHT. | ||
+ | // Not sure how I can do this yet. | ||
+ | |||
+ | // Print the BLACK " | ||
+ | printf(BLK "BLK card\n" | ||
+ | printf(RED "RED card.\n" | ||
+ | * [[http:// | ||
+ | * Out of the 32,000 games, all are solvable except for game #11982. | ||
+ | * Out of the 1,000,000 games, 8 are unsolvable: | ||
+ | * #11,982 (from the original 32,000) | ||
+ | * #146,692 | ||
+ | * #186,216 | ||
+ | * #455,889 | ||
+ | * #495,505 | ||
+ | * #512,118 | ||
+ | * #517,776 | ||
+ | * #781,948. | ||
+ | |||
+ | * **Wikipedia**: | ||
+ | * [[http:// | ||
+ | * [[http:// | ||
+ | * [[http:// | ||
+ | * [[http:// | ||
+ | |||
+ | |||
+ | [[http:// | ||
+ | [[http:// |