Skip to content

Prisoners Dilemma

MicroSim Template

Image Name

Figure caption.

Link to MicroSim

About this MicroSim

Sample Prompt

Create a p5.js sketch that illustrates "The Prisoners Dilemma" in game theory.  

Add two rectangles at height 50 labeled "Prisoner A" and "Prisoner B".
Center 24 point text in each rectangle.
Place two buttons under each prisoner.
Label one button "Remain Silent" and one "Confess".
Show the outcome of each button press below in a 2x2 grid.
Updates to the last choices made by the prisoners when buttons are pressed.
Outcome logic updates based on the combination of choices.
Visual feedback with a red box highlighting the current outcome based on the last choices made.
Organized layout that clearly shows the prisoners' choices and the corresponding outcomes.
GPT Dialog

Wikipedia