cs193p – Assignment #3 Extra Task #2

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

Add another tab to track the user’s high scores. You will want to use NSUserDefaults to store the high scores permanently. The tab might want to show information like the time the game was played and the game’s duration. It must also be clear which scores were Playing Card matching games and which scores were Set card matching games. Use attributes to highlight certain information (shortest game, highest score, etc.).

Let’s introduce a new model – which we actually borrow from last years course – which manages game results.

Its public interface needs a class method which returns an array of all available game scores, properties to hold the start time (date), the end time (date), the duration of the game, the score, and type of the game (set or playing cards). Finally it needs two helper methods which we will use to sort the game results by score and duration.
Continue reading “cs193p – Assignment #3 Extra Task #2”

FacebooktwitterredditpinterestlinkedintumblrmailFacebooktwitterredditpinterestlinkedintumblrmail

cs193p – Assignment #3 Extra Task #1

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

Create appropriate icons for your two tabs. The icons are 30×30 and are pure alpha channels (i.e. they are a “cutout”). Search the documentation for more on how to create icons like that and set them.

Create the icons using your favorite graphic program, add them to your image assets and choose them as tab bar icons:

cs193p – assignment #3 extra task #1 – tab bar icons
cs193p – assignment #3 extra task #1 – tab bar icons

The complete code is available on github.

FacebooktwitterredditpinterestlinkedintumblrmailFacebooktwitterredditpinterestlinkedintumblrmail

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