A simple game to show off Apple's Multipeer Connectivity framework
Objective-C Ruby
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.
Prisoners Dilemma.xcodeproj
Prisoners Dilemma.xcworkspace
Prisoners Dilemma


Prisoner's Dilemma Example

This is a very simple iterated prisoner's dilemma game for two players, each playing on their own iOS device.

It is meant to demonstrate how to use Apple's Multipeer Connectivity framework, and accompanies this blog post.

Try it out!

  1. Clone this repo.
  2. Open the .xcworkspace file.
  3. Run on two physical devices (the simulator often exhibits unexpeced behavior with the multipeer conectivity framework).

Check out the code!

For the sake of making this example easier to follow along with, all game logic and non-boilerplate code is encapsulated in a single view controller. The Main.storyboard file contains the layout of the game's single view, but all other logic lives in that file.


This project uses ReactiveCocoa. It's been set up via CocoaPods, but because the Pods folder is versioned you shouldn't need to worry about that other than needing to open the game's workspace file rather than its project file in Xcode.


MIT License. See the LICENSE file in this repo for details.