+ 2
Prisonerâs Dilema
I was wondering how to program the prisoners dilemma in python.
1 Answer
0
I think the key here is to break the scenario down into a process:
1. Define variables for each prisoner's action
2. Assign a value to each variable ("Remain Silent" or "Betray" - Ideally by user input)
3. Evaluate the input using Boolean Logic (IF, AND, OR)
4. Describe the output
Obviously the scenario gets more complex the more prisoners (i.e. variables) are involved.
I hope this helps.