The Prisoner’s Dilemma

Decided to implement a game that I had wanted to do for a long time. I initially wanted to do Mad Libs but decided to start with a switch based game. I decided to combine switch statements with operators to create a prisoner’s dilemma game. There are two versions: one requiring two humans and the other using a computer opponent for a wild card factor.

A more complex game could involve more and more players resulting in factions forming and certain people implicating others while denying their own involvement. The police could also offer incentives that could reduce the severity of punishment, i.e. some gets a good recommendation or immunity for implicating their partner AND confessing. Right now the game only allows someone to do one action at a time. Plenty of people admit their role in a crime and say their partner had something to do with it as well. There is also the possibility of going through more than one cycle. Based on player B’s response, Player A could receive a hint that Player B’s decision will negatively impact them. They could then decide if they want to change their response and perhaps obtain a more favorable outcome.