+ 2

Prisoner’s Dilema

I was wondering how to program the prisoners dilemma in python.

22nd Jan 2019, 7:46 PM
Carlye
Carlye  - avatar
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.
22nd Jan 2019, 8:42 PM
Prometheus1248