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!
- Clone this repo.
- Open the
- 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.