O'Reilly logo

Get Programming with JavaScript Next: New features of ECMAScript 2015, 2016, and beyond by JD Isaacks

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Lesson 19. Capstone: The prisoner’s dilemma

Let’s pretend you’ve been given the honor of organizing a hack-a-thon—a programming competition where competitors are given a coding challenge they’re expected to solve.

Being the lover of game theory that you are, you decide to use the prisoner’s dilemma as the challenge for the hack-a-thon. How did I know you are a lover of game theory, you ask? Ahem, who isn’t? But on the off chance that you’re not, I’ll explain the prisoner’s dilemma. Two prisoners are interrogated in separate rooms, each asked to snitch on the other prisoner. Exactly what happens when each prisoner snitches on the other changes depending on who tells the story, but the basic idea is this. The best outcome for both prisoners is ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required