If one player denies knowledge, but the other defects, the authorities reward the defector with 1.4 points, and punish the other player by giving them no points. If both players defect, the authorities punish both of them with no points. If both players cooperate (with one another) they are both released (the authorities have no evidence), which counts as a one point reward for each.
Each square in the grid here represents a player who always cooperates (green) or always defects (purple). The grid starts out with a random mixture of roughly equal numbers of cooperators and defectors. When the program runs, each player plays a game with each of its neighbors and receives the total of its scores in those games. Then, when all of these games are complete, each player compares its score with those of its neighbors. If one of its neighbors has a higher score, the player changes strategy to copy the strategy of that player.
Before you see what happens, by clicking the "run/stop" button, what do you think will happen? Will the defectors take over? The cooperators? Now, what actually does happen?
When you press "run/stop" when the program is running it will stop and repopulate the grid. Press again to run the program again.
Reference: Ball, P. (1999) The Self-Made Tapestry: Pattern Formation in Nature. Oxford: Oxford University Press, Ch. 9.