Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add SlowTitForTwoTats2 Strategy #926

Merged
merged 3 commits into from
Mar 27, 2017
Merged

Add SlowTitForTwoTats2 Strategy #926

merged 3 commits into from
Mar 27, 2017

Conversation

jtsmith2
Copy link
Member

@jtsmith2 jtsmith2 commented Mar 24, 2017

Strategy from PRISON(1998) that plays C twice for opening. If opponent plays same move twice in a row, the player mimics that move, otherwise just plays it's previous move.

'slow_tft' from PRISON list in #379

Strategy from PRISON(1998) that plays C twice for opening. If opponent plays same move twice in a row, the player mimics that move, otherwise just plays it's previous move.
Copy link
Member

@drvinceknight drvinceknight left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just two minor things as far as I can see: this looks great! 👍

if opponent.history[-2] == opponent.history[-1]:
return opponent.history[-1]

# Otherwise cooperate
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Otherwise play own previous move

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Doh! Fixed in newest push.

@@ -75,7 +75,7 @@
TitForTat, TitFor2Tats, TwoTitsForTat, Bully, SneakyTitForTat,
SuspiciousTitForTat, AntiTitForTat, HardTitForTat, HardTitFor2Tats,
OmegaTFT, Gradual, ContriteTitForTat, SlowTitForTwoTats, AdaptiveTitForTat,
SpitefulTitForTat)
SpitefulTitForTat, SlowTitForTwoTats2)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You also need to add this strategy to the all_strategies list in this file.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should be fixed now.

Copy link
Member

@drvinceknight drvinceknight left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me! Thanks @jtsmith2 :)

@meatballs meatballs merged commit de6d660 into Axelrod-Python:master Mar 27, 2017
@jtsmith2 jtsmith2 deleted the slow_tft branch March 27, 2017 13:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants