Prisoner's Dilemma app for SwiftUI, you play against an AI.
This is a short app I created to learn SwiftUI. It is a classic take on the Prisoner's Dilemma.
Two members of a criminal gang are arrested and imprisoned. Each prisoner is in solitary confinement with no means of communicating with the other. The prosecutors lack sufficient evidence to convict the pair on the principal charge, but they have enough to convict both on a lesser charge. Simultaneously, the prosecutors offer each prisoner a bargain. Each prisoner is given the opportunity either to betray the other by testifying that the other committed the crime, or to cooperate with the other by remaining silent.
Prisoner's Dilemma - Wikipedia
You have the option of staying silent or betraying your opponent, an AI, who makes their decision based off yours as you continue to play. Your goal is to minimize your time in prison.