cs193p – Assignment #3 Extra Task #4

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

Add yet another tab for some “settings” in the game (match bonuses, etc.).

Create new model handling the game settings (like we did already for game results). Its public interface consists of our game settings:

@property (nonatomic) int matchBonus;
@property (nonatomic) int mismatchPenalty;
@property (nonatomic) int flipCost;

Continue reading “cs193p – Assignment #3 Extra Task #4”

Facebooktwittergoogle_plusredditpinterestlinkedintumblrmailFacebooktwittergoogle_plusredditpinterestlinkedintumblrmail

cs193p – Assignment #3 Extra Task #3

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

Include the ability to sort the scores shown in the Extra Credit above by last played, score or game duration.

Adjust the layout and add three buttons:

cs193p – assignment #3 extra task #3 – sorting
cs193p – assignment #3 extra task #3 – sorting

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

Facebooktwittergoogle_plusredditpinterestlinkedintumblrmailFacebooktwittergoogle_plusredditpinterestlinkedintumblrmail

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”

Facebooktwittergoogle_plusredditpinterestlinkedintumblrmailFacebooktwittergoogle_plusredditpinterestlinkedintumblrmail

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.

Facebooktwittergoogle_plusredditpinterestlinkedintumblrmailFacebooktwittergoogle_plusredditpinterestlinkedintumblrmail

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”

Facebooktwittergoogle_plusredditpinterestlinkedintumblrmailFacebooktwittergoogle_plusredditpinterestlinkedintumblrmail

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”

Facebooktwittergoogle_plusredditpinterestlinkedintumblrmailFacebooktwittergoogle_plusredditpinterestlinkedintumblrmail