Skip to content

Commit f2c9697

Browse files
committed
Order doctest dict.
Ensure compatibility between py3.5 and py3.6
1 parent 7752f37 commit f2c9697

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

docs/tutorials/further_topics/spatial_tournaments.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -51,14 +51,14 @@ and obtain the interactions::
5151

5252
>>> spatial_tournament = axl.SpatialTournament(players ,turns=2, repetitions=2, edges=edges)
5353
>>> results = spatial_tournament.play(keep_interactions=True)
54-
>>> for index_pair, interaction in results.interactions.items():
54+
>>> for index_pair, interaction in sorted(results.interactions.items()):
5555
... player1 = spatial_tournament.players[index_pair[0]]
5656
... player2 = spatial_tournament.players[index_pair[1]]
5757
... print('%s vs %s: %s' % (player1, player2, interaction))
58-
Defector vs Tit For Tat: [[('D', 'C'), ('D', 'D')], [('D', 'C'), ('D', 'D')]]
58+
Cooperator vs Tit For Tat: [[('C', 'C'), ('C', 'C')], [('C', 'C'), ('C', 'C')]]
5959
Cooperator vs Grudger: [[('C', 'C'), ('C', 'C')], [('C', 'C'), ('C', 'C')]]
60+
Defector vs Tit For Tat: [[('D', 'C'), ('D', 'D')], [('D', 'C'), ('D', 'D')]]
6061
Defector vs Grudger: [[('D', 'C'), ('D', 'D')], [('D', 'C'), ('D', 'D')]]
61-
Cooperator vs Tit For Tat: [[('C', 'C'), ('C', 'C')], [('C', 'C'), ('C', 'C')]]
6262

6363
As anticipated :code:`Cooperator` does not interact with :code:`Defector` neither
6464
:code:`TitForTat` with :code:`Grudger`.

0 commit comments

Comments
 (0)