-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
[WIP] Implement hangaman excercise #905
Conversation
@m-a-ge I don't know much about writing test. Can you please guide me 😅 |
cfe8a1d
to
0754601
Compare
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've left some comments for you to consider
class HangmanTest(unittest.TestCase): | ||
def test(self): | ||
self.assertEqual("hangman", "hangman") | ||
|
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.
More tests should be added
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.
@vaibhavsingh97, I would suggest basing the tests on the ones from the C# track since they have fairly good test coverage.
|
||
|
||
def main(): | ||
while True: |
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 like this infinite loop
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.
@m-a-ge This loop is only if player wan't to play again
@@ -0,0 +1 @@ | |||
# Hangman |
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.
You can adopt README.md
from here - https://github.com/exercism/problem-specifications/blob/master/exercises/hangman/description.md
@vaibhavsingh97, it's a best practice to write tests before working on an actual implementation. It gives an opportunity to analyze the problem better, find edge cases etc. You can also adopt tests from other tracks |
The problem-specifications//description.md suggests that this should be a functional reactive programming (FRP) exercise using an external library. Such libraries seem to exist for Python, but I know nothing about them and I don't really understand what FRP really is. Unless you know what this is and can explain and implement it, I'm going to suggest that we just modify the exercise to use a more traditional paradigm. @m-a-ge, what are your thoughts on this? Your current implementation is going to be really hard to write tests for, because it relies on user interaction, which can't be automated through It would be good to put whatever new description (based loosely on the |
Personally, I'm in favor of adding a new exercise even if it contradicts @N-Parsons what do you think of such approach to the problems likes these? |
@m-a-ge What should I do know? |
@vaibhavsingh97 we need more tests to be added |
@m-a-ge, sounds good to me. |
@vaibhavsingh97 are you still working on this? |
Yes, I forgot now will update PR |
This issue has been automatically marked as |
Fixes: #745