cs193p – Assignment #3 Task #9

Please note, this blog entry is from a previous course. You might want to check out the current one.

Last week, there was an Extra Credit task to use a UISlider to show the history of the currently-being-played game. This week we’re going to make showing the history a Required Task, but instead of using a slider, you must invent yet another new MVC which displays the history in a UITextView and which is segued to inside a UINavigationController. It should show the cards involved in every match or mismatch as well as how many points were earned or lost as a result (you are already showing this information in a UILabel for each card choosing, so this should be rather straightforward to implement). Add a bar button item “History” on the right side of the navigation bar which performs the push segue. This feature must work for both the Playing Card game and the Set game.

In storyboard embed both game view controllers into a navigation view controller. Because the usable space decreases remove a row of cards and adjust the layout. Add titles and history buttons. Add a new view controller and click-drag from both history buttons to the new view controller. Set the segue identifier of both of the new segues to “Show History”. Set the title of the new view controller and add a text view. Continue reading “cs193p – Assignment #3 Task #9”

FacebooktwitterredditpinterestlinkedintumblrmailFacebooktwitterredditpinterestlinkedintumblrmail

cs193p – Assignment #3 Task #8

Please note, this blog entry is from a previous course. You might want to check out the current one.

Your Set game should also report (mis)matches like Required Task #5 in the last assignment, but you’ll have to enhance this feature (to use NSAttributedString) to make it capable of working for both the Set and Playing Card games.

We could either change the way how the description string is generated, or adjust it afterwards. The first solution would mean adjusting the card-game-view controller, the second its set-card specific child class. Not wanting to break the existing playing-card code, I go for the second solution. However, it is necessary to access the flip-label property from the subclass, therefore move the property declaration from the class file to its header file:

@property (weak, nonatomic) IBOutlet UILabel *flipDescription;

Continue reading “cs193p – Assignment #3 Task #8”

FacebooktwitterredditpinterestlinkedintumblrmailFacebooktwitterredditpinterestlinkedintumblrmail

cs193p – Assignment #3 Task #6

Please note, this blog entry is from a previous course. You might want to check out the current one.

Instead of drawing the Set cards in the classic form (we’ll do that next week), we’ll use these three characters ▲ ● ■ and use attributes in NSAttributedString to draw them appropriately (i.e. colors and shading).

We need to adjust the title of the card and its background thus we need to make those methods publicly available to be able to change it in the set-card-game-view-controller subclass. The method to generate the title uses normal strings at the moment, we need to change this to attributed strings:
Continue reading “cs193p – Assignment #3 Task #6”

FacebooktwitterredditpinterestlinkedintumblrmailFacebooktwitterredditpinterestlinkedintumblrmail

cs193p – Assignment #3 Task #5

Please note, this blog entry is from a previous course. You might want to check out the current one.

Just to show that you know how to do this, your Set game should have a different number of cards on the table than your Playing Card game (either game can have however many cards of whatever aspect ratio you think is best for your UI).

In the story board change the sizes of the set cards to 40*40, align them, and add two additional rows of cards. Now you need to connect them to the outlet-collection array cardButtons. But because the set-card-game view controller inherits this property from its parent class you need to use that very same parent class to control-drag the buttons to the property. Continue reading “cs193p – Assignment #3 Task #5”

FacebooktwitterredditpinterestlinkedintumblrmailFacebooktwitterredditpinterestlinkedintumblrmail

cs193p – Assignment #3 Task #2

Please note, this blog entry is from a previous course. You might want to check out the current one.

The Set game only needs to allow users to pick sets and get points for doing so (e.g. it does not redeal new cards when sets are found). In other words, it works just like the Playing Card matching game. The only differences are that it is a 3-card matching game and uses different cards (deal your Set cards out of a complete Set deck).

Let’s start with the card model, instead of a suit and a rank, we have colors, symbols, shadings and the count of symbols, for which we create public properties, setters and getters, and therefore need also to synthesize them:
Continue reading “cs193p – Assignment #3 Task #2”

FacebooktwitterredditpinterestlinkedintumblrmailFacebooktwitterredditpinterestlinkedintumblrmail

cs193p – Assignment #3 Task #1

Please note, this blog entry is from a previous course. You might want to check out the current one.

Add a new MVC to your Matchismo solution from last week which plays a simple version of the card matching game Set. A good solution to this assignment will use object-oriented programming techniques to share a lot of code with your Playing Card-based matching game.

For convenience (and to confuse you), I followed the tasks of this assignment slightly out of order. But now, I should be back to the “correct” order.

As model, we need a set card and its deck. Create SetCard as subclass of Card and SetCardDeck as subclass of Deck.

As controller create SetCardGameViewController as subclass from CardGameViewController.
Continue reading “cs193p – Assignment #3 Task #1”

FacebooktwitterredditpinterestlinkedintumblrmailFacebooktwitterredditpinterestlinkedintumblrmail