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

feat: added hangman game #967 #1248

Merged
merged 16 commits into from
Apr 30, 2023
Merged

Conversation

AtlantaEmrys2002
Copy link
Contributor

Description of Change

C implementation of the traditional hangman game (with duck graphic).

References

Issue #967

Checklist

  • Added description of change
  • Added file name matches File name guidelines
  • Added tests and example, test must pass
  • Relevant documentation/comments is changed or added
  • PR title follows semantic commit guidelines
  • Search previous suggestions before making a new one, as yours may be a duplicate.
  • I acknowledge that all my contributions will be made under the project's license.

Notes:
Test cases may need to be improved.

games/hangman.c Show resolved Hide resolved
games/hangman.c Outdated Show resolved Hide resolved
games/hangman.c Outdated Show resolved Hide resolved
games/hangman.c Outdated Show resolved Hide resolved
games/hangman.c Outdated Show resolved Hide resolved
games/hangman.c Outdated Show resolved Hide resolved
games/hangman.c Show resolved Hide resolved
games/hangman.c Show resolved Hide resolved
games/hangman.c Outdated Show resolved Hide resolved
games/hangman.c Outdated Show resolved Hide resolved
@AtlantaEmrys2002
Copy link
Contributor Author

@CascadingCascade Thank you for the code review! It was really helpful. I'll work on improving the initialisation process.

@CascadingCascade
Copy link
Collaborator

@CascadingCascade Thank you for the code review! It was really helpful. I'll work on improving the initialisation process.

Glad to be of help then! I should be online for a few more hours, just ask away if you need help and I'll do my best:)

@Panquesito7 Panquesito7 added the enhancement New feature or request label Apr 16, 2023
games/hangman.c Fixed Show resolved Hide resolved
games/hangman.c Fixed Show resolved Hide resolved
games/hangman.c Fixed Show resolved Hide resolved
games/hangman.c Fixed Show resolved Hide resolved
games/hangman.c Outdated Show resolved Hide resolved
games/hangman.c Outdated Show resolved Hide resolved
games/hangman.c Outdated Show resolved Hide resolved
games/hangman.c Outdated Show resolved Hide resolved
@AtlantaEmrys2002
Copy link
Contributor Author

@Panquesito7 Thank you for the review! I'll definitely work on the struct implementation tomorrow.

Updated so that game instance was held as struct - can include current guess in game_instance too if preferred.
@AtlantaEmrys2002
Copy link
Contributor Author

Added struct implementation - would it be better to change arguments of functions, such as in_word and new_guess, to pointers?

games/hangman.c Fixed Show fixed Hide fixed
games/hangman.c Fixed Show fixed Hide fixed
@Panquesito7 Panquesito7 added the Autochecks are failing Failing CI Auto-checks label Apr 20, 2023
@AtlantaEmrys2002
Copy link
Contributor Author

AtlantaEmrys2002 commented Apr 20, 2023

@Panquesito7 fixed fgets 100.

games/hangman.c Outdated Show resolved Hide resolved
games/hangman.c Outdated Show resolved Hide resolved
games/hangman.c Outdated Show resolved Hide resolved
games/hangman.c Outdated Show resolved Hide resolved
games/hangman.c Outdated Show resolved Hide resolved
games/hangman.c Outdated Show resolved Hide resolved
games/hangman.c Outdated Show resolved Hide resolved
games/hangman.c Outdated Show resolved Hide resolved
@AtlantaEmrys2002
Copy link
Contributor Author

@CascadingCascade Thank you again for the review!

games/hangman.c Outdated Show resolved Hide resolved
Copy link
Member

@Panquesito7 Panquesito7 left a comment

Choose a reason for hiding this comment

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

Almost there! 🙂
I have to say this is a pretty fun game! 👀

games/hangman.c Outdated Show resolved Hide resolved
games/hangman.c Outdated Show resolved Hide resolved
games/hangman.c Outdated Show resolved Hide resolved
@Panquesito7 Panquesito7 removed the Autochecks are failing Failing CI Auto-checks label Apr 21, 2023
Copy link
Member

@Panquesito7 Panquesito7 left a comment

Choose a reason for hiding this comment

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

Awesome work! Thank you. 🚀

Copy link
Collaborator

@CascadingCascade CascadingCascade left a comment

Choose a reason for hiding this comment

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

LGTM. But as a matter of personal preference, I like to ponder about how things could have been, and left some more food for thought in the comments.

games/hangman.c Show resolved Hide resolved
games/hangman.c Show resolved Hide resolved
games/hangman.c Show resolved Hide resolved
games/hangman.c Show resolved Hide resolved
games/hangman.c Show resolved Hide resolved
@Panquesito7 Panquesito7 merged commit 71a7cf3 into TheAlgorithms:master Apr 30, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants