-
Notifications
You must be signed in to change notification settings - Fork 264
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
Human Strategy #732
Human Strategy #732
Conversation
This reverts commit aa8df17.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tiny changes and one question. Looks good to me :)
class Human(Player): | ||
""" | ||
A strategy that prompts for keyboard input rather than deriving its own | ||
action. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Perhaps can we add:
This is to be used interactively and is not expected to be used like the other strategies.
Not sure if that's quite the right wording but I think having something to kind of say: "if you're just poking around and having a look, this strategy is indeed a bit 'weird'"...
name: string | ||
The name of the human player | ||
c_symbol: string | ||
The symbol to denote cooperation |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Perhaps:
The symbol to denote cooperation at the interactive prompt
?
c_symbol: string | ||
The symbol to denote cooperation | ||
d_symbol: string | ||
The symbol to denote defection |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same as above?
@@ -72,6 +72,9 @@ Here are the docstrings of all the strategies in the library. | |||
.. automodule:: axelrod.strategies.handshake | |||
:members: | |||
:undoc-members: | |||
.. automodule:: axelrod.strategies.human |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't know the answer to this question but should this be documented/listed in all_strategies
? I wonder if it would be best left outside of it as that index gives a nice list of 'research' strategies (the cheaters being an immediate counter example to that point of view). No strong feelings from me just think it's worth thinking about.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'll take it out whilst we think further....
>>> match.play() #doctest: +SKIP | ||
|
||
You will be prompted for the action to play at each turn and will be able to | ||
access the results of the match as described in :ref:`creating_matches` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is it worth showing some example of the prompt? It needn't be too extensive and it would not include the >>>
so it wouldn't be picked up by the doctests. So something like (after what you have already written):
This will then prompt the user for inputs of C
or D
:
Starting new match
Turn 1 action [C or D] for me: C
Turn 1: me played C, opponent played C
Turn 2 action [C or D] for me: D
Turn 2: me played D, opponent played C
Turn 3 action [C or D] for me: C
[('C', 'C'), ('C', 'D'), ('D', 'C')]
after this the match
object can be manipulated as described in http://axelrod.readthedocs.io/en/latest/tutorials/getting_started/match.html
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for making those changes. 👍
This is 👍 from me, just the one simple question. |
toolbar = None | ||
print_statement = '{}Starting new match'.format(linesep) | ||
|
||
return { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there a reason to return a dictionary rather than a tuple? Just curious.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I like having the readable keys and I was too lazy to create a NamedTuple!!
A strategy that prompts for keyboard input rather than deriving its own action.
closes #728