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

cs193p – Assignment #3 Task #3

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

Your Playing Card game must continue to work as required from last week except that it only needs to work as a 2-card matching game (you can remove the switch or segmented control from your UI, but keep your 3-card matching infrastructure because Set is a 3-card matching game).

For convenience (and to confuse you), I will follow the tasks of this assignment slightly out of order. Let’s continue with task #3.

Remove the segmented-control element, adjust the size of the history label and slider, and move the score label and the deal button:

cs193p – assignment #3 task #3 – new layout
cs193p – assignment #3 task #3 – new layout

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

FacebooktwitterredditpinterestlinkedintumblrmailFacebooktwitterredditpinterestlinkedintumblrmail

cs193p – Assignment #3 Task #4

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

Use a UITabBarController to present the two games in your UI in separate tabs.

For convenience (and to confuse you), I will follow the tasks of this assignment slightly out of order. Let’s start with task #4.
Continue reading “cs193p – Assignment #3 Task #4”

FacebooktwitterredditpinterestlinkedintumblrmailFacebooktwitterredditpinterestlinkedintumblrmail

cs193p – Lecture #7 – Animation, Auto Layout

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

Though lecture #7 is called animation and auto layout the title of the last lecture would be better fit, because it discusses mainly views and gestures.

The theory part describes how to draw into views using code and how to use different kind of gestures. The demo at the end of the lecture shows their usage.

The code for this lecture is available at github as well as from Stanford.

The lecture as well as its slides are available via iTunes called “7. Animation, Auto Layout”.

FacebooktwitterredditpinterestlinkedintumblrmailFacebooktwitterredditpinterestlinkedintumblrmail

cs193p – Lecture #6 – Views and Gestures

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

Lecture #6 starts with a short demonstration on how to use abstract view controller classes and their sub classes.

The theory part of the lecture introduces how multiple MVCs work together to be specific navigation controllers and segues, which is shown in another demonstration.

The lecture closes with an explanation of tab-bar controllers.

The code for this lecture is available at github for attributor and for matchismo as well as from Stanford.

The lecture as well as its slides are available via iTunes called “6. Views and Gestures”.

FacebooktwitterredditpinterestlinkedintumblrmailFacebooktwitterredditpinterestlinkedintumblrmail

cs193p – Lecture #5 – View Controller Lifecycle

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

Lecture #5 starts with an introduction to text views and – new to iOS 7 – text storages and TextKit followed by a short demo.

The view-controller life cycle consists of the following steps:

  • the view gets instantiated e.g. from storyboard
  • awakeFromNib is called, which you could compare to init
  • the outlets get set
  • viewDidLoad is called, which can be used for basic setups
  • geometry is determined
  • viewWillLayoutSubviews and viewDidLayoutSubviews are called
  • viewWillAppear and viewDidAppear are called
  • viewWillLayoutSubviews and viewDidLayoutSubviews are called
  • viewWillDisappear and viewDidDisappear are called
  • didReceiveMemoryWarning is called when memory gets low

Continue reading “cs193p – Lecture #5 – View Controller Lifecycle”

FacebooktwitterredditpinterestlinkedintumblrmailFacebooktwitterredditpinterestlinkedintumblrmail