cs106a – Assignment #4 – Task #2

The complete specification of assignment #4 can be found as part of the stream at iTunes.

Adding graphics

For Part II, your task is simply to extend the program you have already written so that it now keeps track of the Hangman graphical display. Although you might want to spice things up in your extensions, the simple version of the final picture for the unfortunate user who has run out of guesses looks like this:

cs106a – assignment #4 – task #2
Continue reading “cs106a – Assignment #4 – Task #2”

FacebooktwitterredditpinterestlinkedintumblrmailFacebooktwitterredditpinterestlinkedintumblrmail

cs106a – Assignment #4 – Task #1

The complete specification of assignment #4 can be found as part of the stream at iTunes.

Playing a console-based game

In the first part of this assignment, your job is to write a program that handles the user interaction component of the game—everything except the graphical display. To solve the problem, your program must be able to:

  • Choose a random word to use as the secret word. That word is chosen from a word list, as described in the following paragraph.
  • Keep track of the user’s partially guessed word, which begins as a series of dashes and then updated as correct letters are guessed.
  • Implement the basic control structure and manage the details (ask the user to guess a letter, keep track of the number of guesses remaining, print out the various messages, detect the end of the game, and so forth).

Continue reading “cs106a – Assignment #4 – Task #1”

FacebooktwitterredditpinterestlinkedintumblrmailFacebooktwitterredditpinterestlinkedintumblrmail

Assignment #4 Extra Task #1

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

Divide your list of top places into sections (in the table view sense) by country. This will require a little bit different data structure in that MVC.

To sort our places into countries we need two new properties for the data model. placesByCountry will hold the places separated into their countries. countries will just hold the names of the countries sorted alphabetically.

@property (nonatomic, strong) NSDictionary *placesByCountry;
@property (nonatomic, strong) NSArray *countries;
   ...
@synthesize placesByCountry = _placesByCountry;
@synthesize countries = _countries;

Continue reading “Assignment #4 Extra Task #1”

FacebooktwitterredditpinterestlinkedintumblrmailFacebooktwitterredditpinterestlinkedintumblrmail

Assignment #4 Task #9 Addendum

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

Your application must work in both portrait and landscape orientations on the iPhone. Support for the iPad is optional (though it will be required next week, so you can save time later by implementing it now). Use appropriate platform-specific UI idioms (e.g., you must use UINavigationControllers to present the information on the iPhone).

We start by deleting everything in the iPad storyboard and copy everything from the iPhone storyboard into the iPad storyboard. Remove the segues from the table views to the photo view controller.

Drag in a split view controller and remove its master and detail view. Instead wire up the tab bar controller as master and the photo view controller as detail view. Add a bar tool to the photo view controller and create an outlet to its class. Finally setup the split view controller as initial view controller.
Continue reading “Assignment #4 Task #9 Addendum”

FacebooktwitterredditpinterestlinkedintumblrmailFacebooktwitterredditpinterestlinkedintumblrmail

Assignment #4 Task #11

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

The list of recents photos should be saved in NSUserDefaults. The arrays you get back from the FlickrFetcher methods are all property lists.

Inside the photo view controller we set the setter for the photo model to save its data to NSUserDefaults. First we copy the existing list, or create an empty array if there is no entry yet. Using a block enumerator we loop through the array to see if the current photo is already there and remove it. Then we add the current photo data to the beginning of the array. If the array exceeds 20 items we delete the last one.
Continue reading “Assignment #4 Task #11”

FacebooktwitterredditpinterestlinkedintumblrmailFacebooktwitterredditpinterestlinkedintumblrmail