So… As some of you may know, I have been sick. One thing I love to do when I am sick is watch Veritasium, a science and math based YouTube channel. I was watching one about game theory. Specifically the prisoner’s dilemma. I highly advise watching some of this before trying my demo.
I started coding a limited version, played over 15 rounds, against a basic tit for tat bot. Then I realised I was enjoying making it, so I went overboard with code that allowed me to make bots very fast, combining so many functions accepting boolean logic. After completely refactoring my code, to now accept a player to do the logic for, my demo is nearly ready to play bots against each other. Here is a limited version with all of the bots I coded in, explained.
Bots
Tit for Tat: copies your last move, opens with cooperate.
Random: 50/50 chance.
Biased Random: Ima just post a screenshot lol. It basically scales it’s random chances by how you have played in the past.
Friedman, or Grim Trigger: Cooperates until you defect, then defects the whole time out of anger
Generous Tit for Tat: Same as Tit for Tat, but cooperates unless your last two were defect.
Always Defect: Pretty obvious.
Always Cooperate: Also pretty obvious.
Forgetful Grudge: I am pretty proud of this one, Forgetful grudge is like Grim Trigger but occasionally with a 10% chance stops grudging and forgets.
I will add more bots, once I have the game running a full tournament (bots vs bots, each fighting all the rest for 200 rounds.) On that note, I have made it pretty easy to add a new bot, so if anyone wants to, they should! (I really just want someone to see my logic and compliment me
)Then I will rank the bots when I have enough.
Please ignore the bad art with the buttons on screen, they are just there to remind players.
