Skip to content

Commit

Permalink
Order doctest dict.
Browse files Browse the repository at this point in the history
Ensure compatibility between py3.5 and py3.6
  • Loading branch information
drvinceknight committed Dec 31, 2016
1 parent 7752f37 commit f2c9697
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions docs/tutorials/further_topics/spatial_tournaments.rst
Original file line number Diff line number Diff line change
Expand Up @@ -51,14 +51,14 @@ and obtain the interactions::

>>> spatial_tournament = axl.SpatialTournament(players ,turns=2, repetitions=2, edges=edges)
>>> results = spatial_tournament.play(keep_interactions=True)
>>> for index_pair, interaction in results.interactions.items():
>>> for index_pair, interaction in sorted(results.interactions.items()):
... player1 = spatial_tournament.players[index_pair[0]]
... player2 = spatial_tournament.players[index_pair[1]]
... print('%s vs %s: %s' % (player1, player2, interaction))
Defector vs Tit For Tat: [[('D', 'C'), ('D', 'D')], [('D', 'C'), ('D', 'D')]]
Cooperator vs Tit For Tat: [[('C', 'C'), ('C', 'C')], [('C', 'C'), ('C', 'C')]]
Cooperator vs Grudger: [[('C', 'C'), ('C', 'C')], [('C', 'C'), ('C', 'C')]]
Defector vs Tit For Tat: [[('D', 'C'), ('D', 'D')], [('D', 'C'), ('D', 'D')]]
Defector vs Grudger: [[('D', 'C'), ('D', 'D')], [('D', 'C'), ('D', 'D')]]
Cooperator vs Tit For Tat: [[('C', 'C'), ('C', 'C')], [('C', 'C'), ('C', 'C')]]

As anticipated :code:`Cooperator` does not interact with :code:`Defector` neither
:code:`TitForTat` with :code:`Grudger`.
Expand Down

0 comments on commit f2c9697

Please sign in to comment.